PaperMC/Spigot-Server-Patches/Configurable-game-mechanics-changes.patch
2014-10-24 23:44:38 -05:00

96 lines
No EOL
4.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: gsand <gsandowns@gmail.com>
Date: Fri, 24 Oct 2014 22:09:58 -0500
Subject: [PATCH] Configurable game mechanics changes
diff --git a/src/main/java/net/minecraft/server/BlockTorch.java b/src/main/java/net/minecraft/server/BlockTorch.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/BlockTorch.java
+++ b/src/main/java/net/minecraft/server/BlockTorch.java
@@ -0,0 +0,0 @@ public class BlockTorch extends Block {
} else {
Block block = world.getType(i, j, k);
- return block == Blocks.FENCE || block == Blocks.NETHER_FENCE || block == Blocks.GLASS || block == Blocks.COBBLE_WALL;
+ // PaperSpigot - Allow torch placement on stained glass as well
+ return world.paperSpigotConfig.lessPickyTorches ? block == Blocks.FENCE || block == Blocks.NETHER_FENCE || block == Blocks.GLASS || block == Blocks.STAINED_GLASS || block == Blocks.COBBLE_WALL : block == Blocks.FENCE || block == Blocks.NETHER_FENCE || block == Blocks.GLASS || block == Blocks.COBBLE_WALL;
}
}
diff --git a/src/main/java/net/minecraft/server/EntityBoat.java b/src/main/java/net/minecraft/server/EntityBoat.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityBoat.java
+++ b/src/main/java/net/minecraft/server/EntityBoat.java
@@ -0,0 +0,0 @@ public class EntityBoat extends Entity {
if (!destroyEvent.isCancelled()) {
this.die();
- for (k = 0; k < 3; ++k) {
- this.a(Item.getItemOf(Blocks.WOOD), 1, 0.0F);
- }
-
- for (k = 0; k < 2; ++k) {
- this.a(Items.STICK, 1, 0.0F);
- }
+ breakNaturally(); // PaperSpigot - Customizable boat drops
}
// CraftBukkit end
}
@@ -0,0 +0,0 @@ public class EntityBoat extends Entity {
if (!destroyEvent.isCancelled()) {
this.die();
- int l;
-
- for (l = 0; l < 3; ++l) {
- this.a(Item.getItemOf(Blocks.WOOD), 1, 0.0F);
- }
-
- for (l = 0; l < 2; ++l) {
- this.a(Items.STICK, 1, 0.0F);
- }
+ breakNaturally(); // PaperSpigot - Customizable boat drops
}
// CraftBukkit end
}
@@ -0,0 +0,0 @@ public class EntityBoat extends Entity {
public int i() {
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) {
+ this.a(Item.getItemOf(Blocks.WOOD), 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
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -0,0 +0,0 @@ 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 );
+ }
}
--