From 6c4be5d3b8bb4ef259f6603f266d95494cc5c48d Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 12 Feb 2014 18:18:01 +1100 Subject: [PATCH] Allow Disabling Creative Item Filter diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java index 40fb962..f998670 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -1501,7 +1501,7 @@ public class PlayerConnection implements PacketPlayInListener { ItemStack itemstack = packetplayinsetcreativeslot.getItemStack(); boolean flag1 = packetplayinsetcreativeslot.c() >= 1 && packetplayinsetcreativeslot.c() < 36 + PlayerInventory.getHotbarSize(); // CraftBukkit - Add invalidItems check - boolean flag2 = itemstack == null || itemstack.getItem() != null && !invalidItems.contains(Item.b(itemstack.getItem())); + boolean flag2 = itemstack == null || itemstack.getItem() != null && (!invalidItems.contains(Item.b(itemstack.getItem())) || !org.spigotmc.SpigotConfig.filterCreativeItems); // Spigot boolean flag3 = itemstack == null || itemstack.getData() >= 0 && itemstack.count <= 64 && itemstack.count > 0; // CraftBukkit start - Call click event diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java index d749f16..0d0c7b0 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java @@ -278,4 +278,10 @@ public class SpigotConfig { silentCommandBlocks = getBoolean( "commands.silent-commandblock-console", false ); } + + public static boolean filterCreativeItems; + private static void filterCreativeItems() + { + filterCreativeItems = getBoolean( "settings.filter-creative-items", true ); + } } -- 1.8.3.2