mirror of https://github.com/PikaMug/Quests.git
Restore auto-fill block durability
This commit is contained in:
parent
bd1f0b8389
commit
845753ebf4
|
@ -152,7 +152,12 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
|||
// 1 - Initialize variables
|
||||
bukkitVersion = Bukkit.getServer().getBukkitVersion().split("-")[0];
|
||||
settings = new Settings(this);
|
||||
localeManager = new LocaleManager();
|
||||
try {
|
||||
Class.forName("me.pikamug.LocaleLib");
|
||||
localeManager = new LocaleManager();
|
||||
} catch (Exception ignored) {
|
||||
getLogger().info("LocaleLib not present. Is this a debug environment?");
|
||||
}
|
||||
blockListener = new BlockListener(this);
|
||||
itemListener = new ItemListener(this);
|
||||
npcListener = new NpcListener(this);
|
||||
|
|
|
@ -360,19 +360,18 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
} else {
|
||||
two = 0;
|
||||
}
|
||||
if (one == two) {
|
||||
if (one == two) {
|
||||
final int missing;
|
||||
final LinkedList<Short> durability
|
||||
LinkedList<Short> durability
|
||||
= (LinkedList<Short>) context.getSessionData(pref + CK.S_BREAK_DURABILITY);
|
||||
if (durability != null) {
|
||||
missing = one - durability.size();
|
||||
} else {
|
||||
missing = one;
|
||||
durability = new LinkedList<>();
|
||||
}
|
||||
for (int i = 0; i < missing; i++) {
|
||||
if (durability != null) {
|
||||
durability.add((short) 0);
|
||||
}
|
||||
durability.add((short) 0);
|
||||
}
|
||||
context.setSessionData(pref + CK.S_BREAK_DURABILITY, durability);
|
||||
return new BlocksPrompt(stageNum, context);
|
||||
|
@ -733,17 +732,16 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
if (one == two) {
|
||||
final int missing;
|
||||
final LinkedList<Short> durability
|
||||
LinkedList<Short> durability
|
||||
= (LinkedList<Short>) context.getSessionData(pref + CK.S_DAMAGE_DURABILITY);
|
||||
if (durability != null) {
|
||||
missing = one - durability.size();
|
||||
} else {
|
||||
missing = one;
|
||||
durability = new LinkedList<>();
|
||||
}
|
||||
for (int i = 0; i < missing; i++) {
|
||||
if (durability != null) {
|
||||
durability.add((short) 0);
|
||||
}
|
||||
durability.add((short) 0);
|
||||
}
|
||||
context.setSessionData(pref + CK.S_DAMAGE_DURABILITY, durability);
|
||||
return new BlocksPrompt(stageNum, context);
|
||||
|
@ -1102,17 +1100,16 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
if (one == two) {
|
||||
final int missing;
|
||||
final LinkedList<Short> durability
|
||||
LinkedList<Short> durability
|
||||
= (LinkedList<Short>) context.getSessionData(pref + CK.S_PLACE_DURABILITY);
|
||||
if (durability != null) {
|
||||
missing = one - durability.size();
|
||||
} else {
|
||||
missing = one;
|
||||
durability = new LinkedList<>();
|
||||
}
|
||||
for (int i = 0; i < missing; i++) {
|
||||
if (durability != null) {
|
||||
durability.add((short) 0);
|
||||
}
|
||||
durability.add((short) 0);
|
||||
}
|
||||
context.setSessionData(pref + CK.S_PLACE_DURABILITY, durability);
|
||||
return new BlocksPrompt(stageNum, context);
|
||||
|
@ -1469,17 +1466,16 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
|||
}
|
||||
if (one == two) {
|
||||
final int missing;
|
||||
final LinkedList<Short> durability
|
||||
LinkedList<Short> durability
|
||||
= (LinkedList<Short>) context.getSessionData(pref + CK.S_USE_DURABILITY);
|
||||
if (durability != null) {
|
||||
missing = one - durability.size();
|
||||
} else {
|
||||
missing = one;
|
||||
durability = new LinkedList<>();
|
||||
}
|
||||
for (int i = 0; i < missing; i++) {
|
||||
if (durability != null) {
|
||||
durability.add((short) 0);
|
||||
}
|
||||
durability.add((short) 0);
|
||||
}
|
||||
context.setSessionData(pref + CK.S_USE_DURABILITY, durability);
|
||||
return new BlocksPrompt(stageNum, context);
|
||||
|
|
Loading…
Reference in New Issue