2016-03-01 04:47:13 +01:00
|
|
|
From 20d67b6173f1cc8238c953b1cf510dbb4255b4a6 Mon Sep 17 00:00:00 2001
|
2014-07-21 22:46:54 +02:00
|
|
|
From: md_5 <git@md-5.net>
|
|
|
|
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
|
2016-03-01 04:47:13 +01:00
|
|
|
index 0596a2e..7698e6d 100644
|
2014-07-21 22:46:54 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2016-03-01 04:47:13 +01:00
|
|
|
@@ -1904,7 +1904,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
2014-11-28 02:17:45 +01:00
|
|
|
|
2016-02-29 22:33:06 +01:00
|
|
|
boolean flag1 = packetplayinsetcreativeslot.a() >= 1 && packetplayinsetcreativeslot.a() <= 45;
|
2014-07-21 22:46:54 +02:00
|
|
|
// CraftBukkit - Add invalidItems check
|
|
|
|
- boolean flag2 = itemstack == null || itemstack.getItem() != null && !invalidItems.contains(Item.getId(itemstack.getItem()));
|
|
|
|
+ boolean flag2 = itemstack == null || itemstack.getItem() != null && (!invalidItems.contains(Item.getId(itemstack.getItem())) || !org.spigotmc.SpigotConfig.filterCreativeItems); // Spigot
|
|
|
|
boolean flag3 = itemstack == null || itemstack.getData() >= 0 && itemstack.count <= 64 && itemstack.count > 0;
|
2015-02-28 12:36:22 +01:00
|
|
|
// CraftBukkit start - Call click event
|
|
|
|
if (flag || (flag1 && !ItemStack.matches(this.player.defaultContainer.getSlot(packetplayinsetcreativeslot.a()).getItem(), packetplayinsetcreativeslot.getItemStack()))) { // Insist on valid slot
|
2014-07-21 22:46:54 +02:00
|
|
|
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
|
2015-05-25 21:09:58 +02:00
|
|
|
index 039777a..686b8bd 100644
|
2014-07-21 22:46:54 +02:00
|
|
|
--- a/src/main/java/org/spigotmc/SpigotConfig.java
|
|
|
|
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
|
2015-05-25 21:09:58 +02:00
|
|
|
@@ -296,4 +296,10 @@ public class SpigotConfig
|
2014-07-21 22:46:54 +02:00
|
|
|
{
|
|
|
|
silentCommandBlocks = getBoolean( "commands.silent-commandblock-console", false );
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public static boolean filterCreativeItems;
|
|
|
|
+ private static void filterCreativeItems()
|
|
|
|
+ {
|
|
|
|
+ filterCreativeItems = getBoolean( "settings.filter-creative-items", true );
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
2016-02-29 22:33:06 +01:00
|
|
|
2.5.0
|
2014-07-21 22:46:54 +02:00
|
|
|
|