From 9b6e32a7755a158b8d5d4f034713a70bec32e46c Mon Sep 17 00:00:00 2001 From: Jikoo Date: Thu, 29 Dec 2016 03:13:27 -0500 Subject: [PATCH] Fix statistic changes breaking silent/anycontainer in 1.11.1+ C'mon Spigot team, this is why the revision bumps existed in the first place, to allow plugins that deal with NMS to easily and gracefully fail on unsupported versions. 1.11.1 should be R2, 1.11.2 should be R3. I get that NMS isn't officially supported, but honestly, either do away with the versioned packages entirely or keep up with them properly. It's a single string change, it's not like it's prohibitively difficult. --- .../openinv/internal/v1_11_R1/AnySilentContainer.java | 10 +++++----- pom.xml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/v1_11_R1/src/main/java/com/lishid/openinv/internal/v1_11_R1/AnySilentContainer.java b/internal/v1_11_R1/src/main/java/com/lishid/openinv/internal/v1_11_R1/AnySilentContainer.java index 55b1d53..ec541cb 100644 --- a/internal/v1_11_R1/src/main/java/com/lishid/openinv/internal/v1_11_R1/AnySilentContainer.java +++ b/internal/v1_11_R1/src/main/java/com/lishid/openinv/internal/v1_11_R1/AnySilentContainer.java @@ -157,7 +157,7 @@ public class AnySilentContainer implements IAnySilentContainer { // Silent ender chest is pretty much API-only if (silentchest && b.getType() == Material.ENDER_CHEST) { p.openInventory(p.getEnderChest()); - player.b(StatisticList.X); + player.b(StatisticList.getStatistic("stat.enderchestOpened")); return true; } @@ -174,7 +174,7 @@ public class AnySilentContainer implements IAnySilentContainer { InventoryEnderChest enderChest = player.getEnderChest(); enderChest.a((TileEntityEnderChest) tile); player.openContainer(enderChest); - player.b(StatisticList.X); + player.b(StatisticList.getStatistic("stat.enderchestOpened")); return true; } @@ -212,9 +212,9 @@ public class AnySilentContainer implements IAnySilentContainer { } if (blockChest.g == Type.BASIC) { - player.b(StatisticList.ac); + player.b(StatisticList.getStatistic("stat.chestOpened")); } else if (blockChest.g == Type.TRAP) { - player.b(StatisticList.W); + player.b(StatisticList.getStatistic("stat.trappedChestTriggered")); } if (silentchest) { @@ -223,7 +223,7 @@ public class AnySilentContainer implements IAnySilentContainer { } if (block instanceof BlockShulkerBox) { - player.b(StatisticList.ae); + player.b(StatisticList.getStatistic("stat.shulkerBoxOpened")); if (silentchest && tile instanceof TileEntityShulkerBox) { // Set value to current + 1. Ensures consistency later when resetting. diff --git a/pom.xml b/pom.xml index 7dea94c..18262ba 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ UTF-8 - 3.0.4-SNAPSHOT + 3.0.6-SNAPSHOT