Paper/Spigot-Server-Patches/0038-Configurable-game-mechanics-changes.patch

85 Zeilen
3.1 KiB
Diff

2014-11-28 02:17:45 +01:00
From de36e75aad08943806c34e51120a9ce87e0e9b29 Mon Sep 17 00:00:00 2001
From: gsand <gsandowns@gmail.com>
2014-11-28 02:17:45 +01:00
Date: Fri, 28 Nov 2014 13:53:48 -0600
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
2014-11-28 02:17:45 +01:00
index dc4f526..45b5ac5 100644
--- a/src/main/java/net/minecraft/server/EntityBoat.java
+++ b/src/main/java/net/minecraft/server/EntityBoat.java
2014-11-28 02:17:45 +01:00
@@ -340,13 +340,7 @@ public class EntityBoat extends Entity {
if (!destroyEvent.isCancelled()) {
this.die();
- for (k = 0; k < 3; ++k) {
2014-11-28 02:17:45 +01: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 02:17:45 +01:00
+ breakNaturally(); // PaperSpigot
}
// CraftBukkit end
}
@@ -452,15 +446,7 @@ public class EntityBoat extends Entity {
if (!destroyEvent.isCancelled()) {
this.die();
2014-11-28 02:17:45 +01:00
- int i;
-
2014-11-28 02:17:45 +01:00
- for (i = 0; i < 3; ++i) {
- this.a(Item.getItemOf(Blocks.PLANKS), 1, 0.0F);
- }
-
2014-11-28 02:17:45 +01:00
- for (i = 0; i < 2; ++i) {
- this.a(Items.STICK, 1, 0.0F);
- }
2014-11-28 02:17:45 +01:00
+ breakNaturally(); // PaperSpigot
}
// CraftBukkit end
}
2014-11-28 02:17:45 +01:00
@@ -496,4 +482,21 @@ public class EntityBoat extends Entity {
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 02:17:45 +01: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
2014-11-28 02:17:45 +01:00
index 9507ab5..f7a256d 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
2014-11-28 02:17:45 +01:00
@@ -180,4 +180,12 @@ public class PaperSpigotWorldConfig
removeUnloadedTNTEntities = getBoolean( "remove-unloaded.tnt-entities", true );
removeUnloadedFallingBlocks = getBoolean( "remove-unloaded.falling-blocks", true );
}
+
+ public boolean boatsDropBoats;
+ public boolean lessPickyTorches;
+ private void mechanicsChanges()
+ {
+ boatsDropBoats = getBoolean( "game-mechanics.boats-drop-boats", false );
+ lessPickyTorches = getBoolean( "game-mechanics.less-picky-torch-placement", false );
+ }
}
--
1.9.1