Skip to content

Commit 1515f55

Browse files
committed
Compatibility changes for Minecraft 1.9.4.
1 parent dd97aee commit 1515f55

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

java/io/github/d0sboots/enchantmentrevealer/CommandXpSeed.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public void execute(MinecraftServer server, ICommandSender sender, String[] args
115115
player = localPlayer;
116116
isQuery = localQuery;
117117
}
118-
notifyOperators(sender, this, isQuery ? "commands.xpseed.query" : "commands.xpseed.set",
118+
notifyCommandListener(sender, this, isQuery ? "commands.xpseed.query" : "commands.xpseed.set",
119119
player.getName(), String.format("0x%08X", player.getXPSeed()));
120120
}
121121
}

java/io/github/d0sboots/enchantmentrevealer/ContainerEnchantmentWrapper.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ public void updateProgressBar(int id, int data)
9898
// data from the server is inherently racy. We combat this by paying attention to changes
9999
// in the data, with a fallback based on time.
100100
if (id == 9) {
101-
System.arraycopy(field_185001_h, 0, newSeedObservation.enchants, 0, 3);
102-
System.arraycopy(field_185002_i, 0, newSeedObservation.enchantLevels, 0, 3);
101+
System.arraycopy(enchantClue, 0, newSeedObservation.enchants, 0, 3);
102+
System.arraycopy(worldClue, 0, newSeedObservation.enchantLevels, 0, 3);
103103
System.arraycopy(enchantLevels, 0, newSeedObservation.levels, 0, 3);
104104
newSeedObservation.truncatedSeed = (short) (xpSeed & -16);
105105

java/io/github/d0sboots/enchantmentrevealer/EnchantmentWorker.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -296,12 +296,12 @@ private List<EnchantmentData> buildEnchantmentList(int seed, Observation observa
296296
// from, but it happens *after* the addition, meaning it does absolutely nothing.
297297
rand.setSeed(seed + id);
298298
ItemStack item = observation.item;
299-
if (item.getItem() == Items.enchanted_book) {
300-
item = new ItemStack(Items.book);
299+
if (item.getItem() == Items.ENCHANTED_BOOK) {
300+
item = new ItemStack(Items.BOOK);
301301
}
302302
List<EnchantmentData> list = EnchantmentHelper.buildEnchantmentList(rand, item,
303303
observation.levels[id], false);
304-
if (item.getItem() == Items.book && list.size() > 1) {
304+
if (item.getItem() == Items.BOOK && list.size() > 1) {
305305
list.remove(rand.nextInt(list.size()));
306306
}
307307
return list;
@@ -419,13 +419,13 @@ private synchronized void dumpError(String tag) {
419419
GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI();
420420
chat.printChatMessage(new TextComponentTranslation("enchantmentrevealer.error.part1",
421421
new TextComponentTranslation("enchantmentrevealer.error." + tag), "d0sboots",
422-
"gmai", "l.com").setChatStyle(new Style().setColor(TextFormatting.RED)
422+
"gmai", "l.com").setStyle(new Style().setColor(TextFormatting.RED)
423423
.setBold(true)));
424424
chat.printChatMessage(new TextComponentTranslation("enchantmentrevealer.error.part2")
425-
.setChatStyle(new Style().setColor(TextFormatting.YELLOW)));
425+
.setStyle(new Style().setColor(TextFormatting.YELLOW)));
426426
for (Observation observation : observations) {
427427
chat.printChatMessage(new TextComponentString(observation.toString())
428-
.setChatStyle(new Style().setColor(TextFormatting.YELLOW)));
428+
.setStyle(new Style().setColor(TextFormatting.YELLOW)));
429429
}
430430
observations.clear();
431431
candidatesLength = 0;

resources/mcmod.info

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
"version": "1.1",
1111

12-
"mcversion": "1.9",
12+
"mcversion": "1.9.4",
1313

1414
"url": "https://github.com/d0sboots/EnchantmentRevealer",
1515

0 commit comments

Comments
 (0)