testserver/Spigot-Server-Patches/0032-Configurable-game-mech...

83 lines
3.1 KiB
Diff
Raw Normal View History

From 66292f7e9fb064cda6d087b23a5569f19a4c3175 Mon Sep 17 00:00:00 2001
From: gsand <gsandowns@gmail.com>
2015-03-08 01:16:09 +00:00
Date: Sun, 8 Mar 2015 04:10:02 -0500
Subject: [PATCH] Configurable game mechanics changes
diff --git a/src/main/java/net/minecraft/server/EntityBoat.java b/src/main/java/net/minecraft/server/EntityBoat.java
2015-03-08 01:16:09 +00:00
index a756192..ce44b25 100644
--- a/src/main/java/net/minecraft/server/EntityBoat.java
+++ b/src/main/java/net/minecraft/server/EntityBoat.java
2014-11-28 01:17:45 +00:00
@@ -340,13 +340,7 @@ public class EntityBoat extends Entity {
if (!destroyEvent.isCancelled()) {
2015-03-08 01:16:09 +00:00
this.die();
if (this.world.getGameRules().getBoolean("doEntityDrops")) {
- for (k = 0; k < 3; ++k) {
2014-11-28 01:17:45 +00:00
- this.a(Item.getItemOf(Blocks.PLANKS), 1, 0.0F);
- }
-
- for (k = 0; k < 2; ++k) {
- this.a(Items.STICK, 1, 0.0F);
- }
2014-11-28 01:17:45 +00:00
+ breakNaturally(); // PaperSpigot
}
2015-03-08 01:16:09 +00:00
} // CraftBukkit end
}
2015-03-08 01:16:09 +00:00
@@ -451,15 +445,7 @@ public class EntityBoat extends Entity {
if (!destroyEvent.isCancelled()) {
2015-03-08 01:16:09 +00:00
this.die();
if (this.world.getGameRules().getBoolean("doEntityDrops")) {
2014-11-28 01:17:45 +00:00
- int i;
-
2014-11-28 01:17:45 +00:00
- for (i = 0; i < 3; ++i) {
- this.a(Item.getItemOf(Blocks.PLANKS), 1, 0.0F);
- }
-
2014-11-28 01:17:45 +00:00
- for (i = 0; i < 2; ++i) {
- this.a(Items.STICK, 1, 0.0F);
- }
2014-11-28 01:17:45 +00:00
+ breakNaturally(); // PaperSpigot
}
2015-03-08 01:16:09 +00:00
} // CraftBukkit end
}
2015-03-08 01:16:09 +00:00
@@ -495,4 +481,21 @@ public class EntityBoat extends Entity {
2014-11-28 01:17:45 +00:00
public int m() {
return this.datawatcher.getInt(18);
}
+
+ /**
+ * PaperSpigot - Handles boat drops depending on the user's config setting
+ */
+ public void breakNaturally() {
+ if (this.world.paperSpigotConfig.boatsDropBoats) {
+ this.a(Items.BOAT, 1, 0.0F);
+ } else {
+ for (int k = 0; k < 3; ++k) {
2014-11-28 01:17:45 +00:00
+ this.a(Item.getItemOf(Blocks.PLANKS), 1, 0.0F);
+ }
+
+ for (int k = 0; k < 2; ++k) {
+ this.a(Items.STICK, 1, 0.0F);
+ }
+ }
+ }
}
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
2015-03-08 01:16:09 +00:00
index ac02b90..f33142a 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
2015-03-08 01:16:09 +00:00
@@ -180,4 +180,10 @@ public class PaperSpigotWorldConfig
removeUnloadedTNTEntities = getBoolean( "remove-unloaded.tnt-entities", true );
removeUnloadedFallingBlocks = getBoolean( "remove-unloaded.falling-blocks", true );
}
+
+ public boolean boatsDropBoats;
+ private void mechanicsChanges()
+ {
+ boatsDropBoats = getBoolean( "game-mechanics.boats-drop-boats", false );
+ }
}
--
2015-03-08 01:16:09 +00:00
1.9.1