mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 03:34:43 +02:00
Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into tridentsxbows
This commit is contained in:
@ -337,7 +337,7 @@ public class Roll extends AcrobaticsSubSkill {
|
||||
//player.sendMessage(getDescription());
|
||||
//Player stats
|
||||
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.Stats",
|
||||
LocaleLoader.getString("Acrobatics.SubSkill.Roll.Stats", getStats(player)[0], getStats(player)[1])));
|
||||
LocaleLoader.getString("Acrobatics.SubSkill.Roll.Stats", getStats(player))));
|
||||
|
||||
//Mechanics
|
||||
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.Mechanics"));
|
||||
@ -357,6 +357,9 @@ public class Roll extends AcrobaticsSubSkill {
|
||||
//1 = chance to roll with grace at half max level
|
||||
//2 = level where maximum bonus is reached
|
||||
//3 = additive chance to succeed per level
|
||||
//4 = damage threshold when rolling
|
||||
//5 = damage threshold when rolling with grace
|
||||
//6 = half of level where maximum bonus is reached
|
||||
/*
|
||||
Roll:
|
||||
# ChanceMax: Maximum chance of rolling when on <MaxBonusLevel> or higher
|
||||
@ -370,7 +373,7 @@ public class Roll extends AcrobaticsSubSkill {
|
||||
|
||||
//Chance to roll at half max skill
|
||||
RandomChanceSkill rollHalfMaxSkill = new RandomChanceSkill(null, subSkillType);
|
||||
int halfMaxSkillValue = mcMMO.isRetroModeEnabled() ? 500 : 50;
|
||||
int halfMaxSkillValue = AdvancedConfig.getInstance().getMaxBonusLevel(SubSkillType.ACROBATICS_ROLL)/2;
|
||||
rollHalfMaxSkill.setSkillLevel(halfMaxSkillValue);
|
||||
|
||||
//Chance to graceful roll at full skill
|
||||
@ -390,7 +393,7 @@ public class Roll extends AcrobaticsSubSkill {
|
||||
|
||||
double maxLevel = AdvancedConfig.getInstance().getMaxBonusLevel(SubSkillType.ACROBATICS_ROLL);
|
||||
|
||||
return LocaleLoader.getString("Acrobatics.SubSkill.Roll.Mechanics", rollChanceHalfMax, graceChanceHalfMax, maxLevel, chancePerLevel, damageThreshold, damageThreshold * 2);
|
||||
return LocaleLoader.getString("Acrobatics.SubSkill.Roll.Mechanics", rollChanceHalfMax, graceChanceHalfMax, maxLevel, chancePerLevel, damageThreshold, damageThreshold * 2,halfMaxSkillValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -425,4 +428,4 @@ public class Roll extends AcrobaticsSubSkill {
|
||||
{
|
||||
return player.getLocation().getBlock().getLocation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class UUIDUpdateAsyncTask implements Runnable {
|
||||
@ -29,7 +30,7 @@ public class UUIDUpdateAsyncTask implements Runnable {
|
||||
|
||||
private static final int BATCH_SIZE = 100; // 100 at a time
|
||||
|
||||
private final Object awaiter = new Object();
|
||||
private final CountDownLatch awaiter = new CountDownLatch(1);
|
||||
private final mcMMO plugin;
|
||||
private final ImmutableList<String> userNames;
|
||||
private int position = 0;
|
||||
@ -98,12 +99,10 @@ public class UUIDUpdateAsyncTask implements Runnable {
|
||||
position += batch.size();
|
||||
plugin.getLogger().info(String.format("Conversion progress: %d/%d users", position, userNames.size()));
|
||||
|
||||
if (position == userNames.size())
|
||||
{
|
||||
if (position == userNames.size()) {
|
||||
mcMMO.getUpgradeManager().setUpgradeCompleted(UpgradeType.ADD_UUIDS);
|
||||
awaiter.notify();
|
||||
}
|
||||
else
|
||||
awaiter.countDown();
|
||||
} else
|
||||
this.runTaskLaterAsynchronously(plugin, Misc.TICK_CONVERSION_FACTOR * DELAY_PERIOD); // Schedule next batch
|
||||
}
|
||||
|
||||
@ -122,7 +121,7 @@ public class UUIDUpdateAsyncTask implements Runnable {
|
||||
|
||||
public void waitUntilFinished() {
|
||||
try {
|
||||
awaiter.wait();
|
||||
awaiter.await();
|
||||
} catch (InterruptedException e) {
|
||||
// I guess we don't care in this event
|
||||
}
|
||||
|
@ -128,6 +128,9 @@ public class RepairManager extends SkillManager {
|
||||
int baseRepairAmount = repairable.getBaseRepairDurability(item); // Did they send me daughters?
|
||||
short newDurability = repairCalculate(startDurability, baseRepairAmount); // When I asked for sons?
|
||||
|
||||
// toRemove should be refreshed before the event call.
|
||||
toRemove = inventory.getItem(inventory.first(repairMaterial)).clone();
|
||||
|
||||
// Call event
|
||||
if (EventUtils.callRepairCheckEvent(player, (short) (startDurability - newDurability), toRemove, item).isCancelled()) {
|
||||
return;
|
||||
@ -139,7 +142,6 @@ public class RepairManager extends SkillManager {
|
||||
}
|
||||
|
||||
// Remove the item
|
||||
toRemove = inventory.getItem(inventory.first(repairMaterial)).clone();
|
||||
toRemove.setAmount(1);
|
||||
|
||||
inventory.removeItem(toRemove);
|
||||
@ -393,4 +395,4 @@ public class RepairManager extends SkillManager {
|
||||
public void actualizeLastAnvilUse() {
|
||||
lastClick = (int) (System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -100,7 +100,6 @@ public class SalvageManager extends SkillManager {
|
||||
|
||||
potentialSalvageYield = Math.min(potentialSalvageYield, getSalvageLimit()); // Always get at least something back, if you're capable of salvaging it.
|
||||
|
||||
player.getInventory().setItemInMainHand(new ItemStack(Material.AIR));
|
||||
location.add(0.5, 1, 0.5);
|
||||
|
||||
Map<Enchantment, Integer> enchants = item.getEnchantments();
|
||||
@ -140,6 +139,8 @@ public class SalvageManager extends SkillManager {
|
||||
return;
|
||||
}
|
||||
|
||||
player.getInventory().setItemInMainHand(new ItemStack(Material.AIR));
|
||||
|
||||
Location anvilLoc = location.clone();
|
||||
Location playerLoc = player.getLocation().clone();
|
||||
double distance = anvilLoc.distance(playerLoc);
|
||||
|
@ -207,6 +207,8 @@ public class MaterialMapStore {
|
||||
ores.add("redstone_ore");
|
||||
ores.add("emerald_ore");
|
||||
ores.add("ancient_debris");
|
||||
ores.add("nether_gold_ore");
|
||||
ores.add("gilded_blackstone");
|
||||
}
|
||||
|
||||
private void fillArmors() {
|
||||
|
Reference in New Issue
Block a user