mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 04:32:11 -07:00
Paper 1.9
This commit is contained in:
@@ -1,19 +1,34 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Iceee <andrew@opticgaming.tv>
|
||||
Date: Thu, 4 Jun 2015 13:55:02 -0700
|
||||
Date: Wed, 2 Mar 2016 23:00:53 -0600
|
||||
Subject: [PATCH] Configurable TNT cannon fix
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
private void mobSpawnerTickRate() {
|
||||
mobSpawnerTickRate = getInt("mob-spawner-tick-rate", 1);
|
||||
}
|
||||
+
|
||||
+ public boolean fixCannons;
|
||||
+ private void fixCannons() {
|
||||
+ fixCannons = getBoolean("fix-cannons", false);
|
||||
+ log("Fix TNT cannons: " + fixCannons);
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockDiodeAbstract.java b/src/main/java/net/minecraft/server/BlockDiodeAbstract.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockDiodeAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockDiodeAbstract.java
|
||||
@@ -0,0 +0,0 @@ public abstract class BlockDiodeAbstract extends BlockDirectional {
|
||||
@@ -0,0 +0,0 @@ public abstract class BlockDiodeAbstract extends BlockFacingHorizontal {
|
||||
} else {
|
||||
this.b(world, blockposition, iblockdata, 0);
|
||||
world.setAir(blockposition);
|
||||
+ // PaperSpigot start - Fix cannons
|
||||
+ if (world.paperSpigotConfig.fixCannons) {
|
||||
+ // Paper start - Fix cannons
|
||||
+ if (world.paperConfig.fixCannons) {
|
||||
+ world.applyPhysics(blockposition.shift(EnumDirection.EAST), this);
|
||||
+ world.applyPhysics(blockposition.shift(EnumDirection.WEST), this);
|
||||
+ world.applyPhysics(blockposition.shift(EnumDirection.SOUTH), this);
|
||||
@@ -22,16 +37,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ world.applyPhysics(blockposition.shift(EnumDirection.UP), this);
|
||||
+ return;
|
||||
+ }
|
||||
+ // PaperSpigot end
|
||||
+ // Paper end
|
||||
EnumDirection[] aenumdirection = EnumDirection.values();
|
||||
int i = aenumdirection.length;
|
||||
|
||||
@@ -0,0 +0,0 @@ public abstract class BlockDiodeAbstract extends BlockDirectional {
|
||||
@@ -0,0 +0,0 @@ public abstract class BlockDiodeAbstract extends BlockFacingHorizontal {
|
||||
|
||||
public void postBreak(World world, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
if (this.N) {
|
||||
+ // PaperSpigot start - Fix cannons
|
||||
+ if (world.paperSpigotConfig.fixCannons) {
|
||||
if (this.d) {
|
||||
+ // Paper start - Fix cannons
|
||||
+ if (world.paperConfig.fixCannons) {
|
||||
+ world.applyPhysics(blockposition.shift(EnumDirection.EAST), this);
|
||||
+ world.applyPhysics(blockposition.shift(EnumDirection.WEST), this);
|
||||
+ world.applyPhysics(blockposition.shift(EnumDirection.NORTH), this);
|
||||
@@ -40,7 +55,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ world.applyPhysics(blockposition.shift(EnumDirection.UP), this);
|
||||
+ return;
|
||||
+ }
|
||||
+ // PaperSpigot end
|
||||
+ // Paper end
|
||||
EnumDirection[] aenumdirection = EnumDirection.values();
|
||||
int i = aenumdirection.length;
|
||||
|
||||
@@ -52,8 +67,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
public void onPlace(World world, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
if (this.isOn) {
|
||||
+ // PaperSpigot start - Fix cannons
|
||||
+ if (world.paperSpigotConfig.fixCannons) {
|
||||
+ // Paper start - Fix cannons
|
||||
+ if (world.paperConfig.fixCannons) {
|
||||
+ world.applyPhysics(blockposition.shift(EnumDirection.DOWN), this);
|
||||
+ world.applyPhysics(blockposition.shift(EnumDirection.UP), this);
|
||||
+ world.applyPhysics(blockposition.shift(EnumDirection.WEST), this);
|
||||
@@ -62,7 +77,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ world.applyPhysics(blockposition.shift(EnumDirection.NORTH), this);
|
||||
+ return;
|
||||
+ }
|
||||
+ // PaperSpigot end
|
||||
+ // Paper end
|
||||
EnumDirection[] aenumdirection = EnumDirection.values();
|
||||
int i = aenumdirection.length;
|
||||
|
||||
@@ -70,8 +85,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
public void remove(World world, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
if (this.isOn) {
|
||||
+ // PaperSpigot start - Fix cannons
|
||||
+ if (world.paperSpigotConfig.fixCannons) {
|
||||
+ // Paper start - Fix cannons
|
||||
+ if (world.paperConfig.fixCannons) {
|
||||
+ world.applyPhysics(blockposition.shift(EnumDirection.DOWN), this);
|
||||
+ world.applyPhysics(blockposition.shift(EnumDirection.UP), this);
|
||||
+ world.applyPhysics(blockposition.shift(EnumDirection.WEST), this);
|
||||
@@ -80,7 +95,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ world.applyPhysics(blockposition.shift(EnumDirection.NORTH), this);
|
||||
+ return;
|
||||
+ }
|
||||
+ // PaperSpigot end
|
||||
+ // Paper end
|
||||
EnumDirection[] aenumdirection = EnumDirection.values();
|
||||
int i = aenumdirection.length;
|
||||
|
||||
@@ -91,27 +106,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
@@ -0,0 +0,0 @@ public class BlockRedstoneWire extends Block {
|
||||
}
|
||||
|
||||
this.R.add(blockposition);
|
||||
+ // PaperSpigot start - Fix cannons
|
||||
+ if (world.paperSpigotConfig.fixCannons) {
|
||||
+ this.R.add(blockposition.shift(EnumDirection.WEST));
|
||||
+ this.R.add(blockposition.shift(EnumDirection.EAST));
|
||||
+ this.R.add(blockposition.shift(EnumDirection.DOWN));
|
||||
+ this.R.add(blockposition.shift(EnumDirection.UP));
|
||||
+ this.R.add(blockposition.shift(EnumDirection.NORTH));
|
||||
+ this.R.add(blockposition.shift(EnumDirection.SOUTH));
|
||||
this.B.add(blockposition);
|
||||
+ // Paper start - Fix cannons
|
||||
+ if (world.paperConfig.fixCannons) {
|
||||
+ this.B.add(blockposition.shift(EnumDirection.WEST));
|
||||
+ this.B.add(blockposition.shift(EnumDirection.EAST));
|
||||
+ this.B.add(blockposition.shift(EnumDirection.DOWN));
|
||||
+ this.B.add(blockposition.shift(EnumDirection.UP));
|
||||
+ this.B.add(blockposition.shift(EnumDirection.NORTH));
|
||||
+ this.B.add(blockposition.shift(EnumDirection.SOUTH));
|
||||
+ return iblockdata;
|
||||
+ }
|
||||
+ // PaperSpigot end
|
||||
+ // Paper end
|
||||
EnumDirection[] aenumdirection = EnumDirection.values();
|
||||
int i1 = aenumdirection.length;
|
||||
|
||||
@@ -0,0 +0,0 @@ public class BlockRedstoneWire extends Block {
|
||||
private void e(World world, BlockPosition blockposition) {
|
||||
private void b(World world, BlockPosition blockposition) {
|
||||
if (world.getType(blockposition).getBlock() == this) {
|
||||
world.applyPhysics(blockposition, this);
|
||||
+ // PaperSpigot start - Fix cannons
|
||||
+ if (world.paperSpigotConfig.fixCannons) {
|
||||
+ // Paper start - Fix cannons
|
||||
+ if (world.paperConfig.fixCannons) {
|
||||
+ world.applyPhysics(blockposition.shift(EnumDirection.WEST), this);
|
||||
+ world.applyPhysics(blockposition.shift(EnumDirection.EAST), this);
|
||||
+ world.applyPhysics(blockposition.shift(EnumDirection.NORTH), this);
|
||||
@@ -120,7 +135,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ world.applyPhysics(blockposition.shift(EnumDirection.UP), this);
|
||||
+ return;
|
||||
+ }
|
||||
+ // PaperSpigot end
|
||||
+ // Paper end
|
||||
EnumDirection[] aenumdirection = EnumDirection.values();
|
||||
int i = aenumdirection.length;
|
||||
|
||||
@@ -131,29 +146,29 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
@@ -0,0 +0,0 @@ public class BlockTNT extends Block {
|
||||
public void wasExploded(World world, BlockPosition blockposition, Explosion explosion) {
|
||||
if (!world.isClientSide) {
|
||||
org.bukkit.Location loc = explosion.source instanceof EntityTNTPrimed ? ((EntityTNTPrimed) explosion.source).sourceLoc : new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ()); // PaperSpigot
|
||||
- EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(loc, world, (double) ((float) blockposition.getX() + 0.5F), (double) ((float) blockposition.getY() + 0.5F), (double) ((float) blockposition.getZ() + 0.5F), explosion.getSource()); // PaperSpigot - add loc
|
||||
+ // PaperSpigot start - Fix cannons
|
||||
org.bukkit.Location loc = explosion.source instanceof EntityTNTPrimed ? ((EntityTNTPrimed) explosion.source).sourceLoc : new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ()); // Paper
|
||||
- EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(loc, world, (double) ((float) blockposition.getX() + 0.5F), (double) blockposition.getY(), (double) ((float) blockposition.getZ() + 0.5F), explosion.getSource()); // Paper - Add loc
|
||||
+ // Paper start - Fix cannons
|
||||
+ double y = blockposition.getY();
|
||||
+ if (!world.paperSpigotConfig.fixCannons) y += 0.5;
|
||||
+ EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(loc, world, (double) ((float) blockposition.getX() + 0.5F), y, (double) ((float) blockposition.getZ() + 0.5F), explosion.getSource()); // PaperSpigot - add loc
|
||||
+ // PaperSpigot end
|
||||
+ if (!world.paperConfig.fixCannons) y += 0.5;
|
||||
+ EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(loc, world, (double) ((float) blockposition.getX() + 0.5F), y, (double) ((float) blockposition.getZ() + 0.5F), explosion.getSource()); // Paper - Add loc
|
||||
+ // Paper end
|
||||
|
||||
entitytntprimed.fuseTicks = world.random.nextInt(entitytntprimed.fuseTicks / 4) + entitytntprimed.fuseTicks / 8;
|
||||
entitytntprimed.setFuseTicks((short) (world.random.nextInt(entitytntprimed.getFuseTicks() / 4) + entitytntprimed.getFuseTicks() / 8));
|
||||
world.addEntity(entitytntprimed);
|
||||
@@ -0,0 +0,0 @@ public class BlockTNT extends Block {
|
||||
if (!world.isClientSide) {
|
||||
if (((Boolean) iblockdata.get(BlockTNT.EXPLODE)).booleanValue()) {
|
||||
org.bukkit.Location loc = new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ()); // PaperSpigot
|
||||
- EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(loc, world, (double) ((float) blockposition.getX() + 0.5F), (double) ((float) blockposition.getY() + 0.5F), (double) ((float) blockposition.getZ() + 0.5F), entityliving); // PaperSpigot - add loc
|
||||
+ // PaperSpigot start - Fix cannons
|
||||
org.bukkit.Location loc = new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ()); // Paper
|
||||
- EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(loc, world, (double) ((float) blockposition.getX() + 0.5F), (double) blockposition.getY(), (double) ((float) blockposition.getZ() + 0.5F), entityliving); // Paper - Add loc
|
||||
+ // Paper start - Fix cannons
|
||||
+ double y = blockposition.getY();
|
||||
+ if (!world.paperSpigotConfig.fixCannons) y += 0.5;
|
||||
+ EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(loc, world, (double) ((float) blockposition.getX() + 0.5F), y, (double) ((float) blockposition.getZ() + 0.5F), entityliving); // PaperSpigot - add loc
|
||||
+ // PaperSpigot end
|
||||
+ if (!world.paperConfig.fixCannons) y += 0.5;
|
||||
+ EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(loc, world, (double) ((float) blockposition.getX() + 0.5F), y, (double) ((float) blockposition.getZ() + 0.5F), entityliving); // Paper - Add loc
|
||||
+ // Paper end
|
||||
|
||||
world.addEntity(entitytntprimed);
|
||||
world.makeSound(entitytntprimed, "game.tnt.primed", 1.0F, 1.0F);
|
||||
world.a((EntityHuman) null, entitytntprimed.locX, entitytntprimed.locY, entitytntprimed.locZ, SoundEffects.gj, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
diff --git a/src/main/java/net/minecraft/server/DispenserRegistry.java b/src/main/java/net/minecraft/server/DispenserRegistry.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/DispenserRegistry.java
|
||||
@@ -162,12 +177,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
org.bukkit.block.Block block = world.getWorld().getBlockAt(isourceblock.getBlockPosition().getX(), isourceblock.getBlockPosition().getY(), isourceblock.getBlockPosition().getZ());
|
||||
CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1);
|
||||
|
||||
- BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX() + 0.5, blockposition.getY() + 0.5, blockposition.getZ() + 0.5));
|
||||
+ // PaperSpigot start - Fix cannons
|
||||
- BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D));
|
||||
+ // Paper start - Fix cannons
|
||||
+ double y = blockposition.getY();
|
||||
+ if (!world.paperSpigotConfig.fixCannons) y += 0.5;
|
||||
+ BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX() + 0.5, y, blockposition.getZ() + 0.5));
|
||||
+ // PaperSpigot end
|
||||
+ if (!world.paperConfig.fixCannons) y += 0.5;
|
||||
+ BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector((double) blockposition.getX() + 0.5D, y, (double) blockposition.getZ() + 0.5D));
|
||||
+ // Paper end
|
||||
if (!BlockDispenser.eventFired) {
|
||||
world.getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
@@ -176,14 +191,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
|
||||
@@ -0,0 +0,0 @@ public class EntityFallingBlock extends Entity {
|
||||
public IBlockData getBlock() {
|
||||
return this.block;
|
||||
public boolean br() {
|
||||
return true;
|
||||
}
|
||||
+
|
||||
+ // PaperSpigot start - Fix cannons
|
||||
+ // Paper start - Fix cannons
|
||||
+ @Override
|
||||
+ public double f(double d0, double d1, double d2) {
|
||||
+ if (!world.paperSpigotConfig.fixCannons) return super.f(d0, d1, d2);
|
||||
+ if (!world.paperConfig.fixCannons) return super.f(d0, d1, d2);
|
||||
+
|
||||
+ double d3 = this.locX - d0;
|
||||
+ double d4 = this.locY + this.getHeadHeight() - d1;
|
||||
@@ -194,9 +209,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+
|
||||
+ @Override
|
||||
+ public float getHeadHeight() {
|
||||
+ return world.paperSpigotConfig.fixCannons ? this.length / 2 : super.getHeadHeight();
|
||||
+ return world.paperConfig.fixCannons ? this.length / 2 : super.getHeadHeight();
|
||||
+ }
|
||||
+ // PaperSpigot end
|
||||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
@@ -206,18 +221,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
this.lastY = d1;
|
||||
this.lastZ = d2;
|
||||
this.source = entityliving;
|
||||
+ if (world.paperSpigotConfig.fixCannons) this.motX = this.motZ = 0.0F; // PaperSpigot - Fix cannons
|
||||
+ if (world.paperConfig.fixCannons) this.motX = this.motZ = 0.0F; // Paper - Fix cannons
|
||||
}
|
||||
|
||||
protected void h() {}
|
||||
protected void i() {
|
||||
@@ -0,0 +0,0 @@ public class EntityTNTPrimed extends Entity {
|
||||
return this.source;
|
||||
}
|
||||
|
||||
+ // PaperSpigot start - Fix cannons
|
||||
+ // Paper start - Fix cannons
|
||||
+ @Override
|
||||
+ public double f(double d0, double d1, double d2) {
|
||||
+ if (!world.paperSpigotConfig.fixCannons) return super.f(d0, d1, d2);
|
||||
+ if (!world.paperConfig.fixCannons) return super.f(d0, d1, d2);
|
||||
+
|
||||
+ double d3 = this.locX - d0;
|
||||
+ double d4 = this.locY + this.getHeadHeight() - d1;
|
||||
@@ -227,29 +242,29 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean aL() {
|
||||
+ return !world.paperSpigotConfig.fixCannons && super.aL();
|
||||
+ public boolean bd() {
|
||||
+ return !world.paperConfig.fixCannons && super.bd();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
public float getHeadHeight() {
|
||||
- return 0.0F;
|
||||
+ return world.paperSpigotConfig.fixCannons ? this.length / 2 : 0.0F;
|
||||
}
|
||||
+ return world.paperConfig.fixCannons ? this.length / 2 : 0.0F;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Author: Jedediah Smith <jedediah@silencegreys.com>
|
||||
+ */
|
||||
+ @Override
|
||||
+ public boolean W() {
|
||||
+ if (!world.paperSpigotConfig.fixCannons) return super.W();
|
||||
+ public boolean aj() {
|
||||
+ if (!world.paperConfig.fixCannons) return super.aj();
|
||||
+
|
||||
+ // Preserve velocity while calling the super method
|
||||
+ double oldMotX = this.motX;
|
||||
+ double oldMotY = this.motY;
|
||||
+ double oldMotZ = this.motZ;
|
||||
+
|
||||
+ super.W();
|
||||
+ super.aj();
|
||||
+
|
||||
+ this.motX = oldMotX;
|
||||
+ this.motY = oldMotY;
|
||||
@@ -273,18 +288,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+
|
||||
+ return this.inWater;
|
||||
+ }
|
||||
+ // PaperSpigot end
|
||||
}
|
||||
}
|
||||
+ // Paper end
|
||||
|
||||
public void setFuseTicks(int i) {
|
||||
this.datawatcher.set(EntityTNTPrimed.FUSE_TICKS, Integer.valueOf(i));
|
||||
diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/Explosion.java
|
||||
+++ b/src/main/java/net/minecraft/server/Explosion.java
|
||||
@@ -0,0 +0,0 @@ public class Explosion {
|
||||
// CraftBukkit end
|
||||
double d14 = EnchantmentProtection.a(entity, d13);
|
||||
d14 = entity instanceof EntityHuman && world.paperConfig.disableExplosionKnockback ? 0 : EnchantmentProtection.a((EntityLiving) entity, d13); // Paper - Disable explosion knockback
|
||||
}
|
||||
|
||||
+ // PaperSpigot start - Fix cannons
|
||||
+ // Paper start - Fix cannons
|
||||
+ /*
|
||||
entity.motX += d8 * d14;
|
||||
entity.motY += d9 * d14;
|
||||
@@ -292,57 +309,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ */
|
||||
+ // This impulse method sets the dirty flag, so clients will get an immediate velocity update
|
||||
+ entity.g(d8 * d14, d9 * d14, d10 * d14);
|
||||
+ // PaperSpigot end
|
||||
+ // Paper end
|
||||
+
|
||||
if (entity instanceof EntityHuman && !((EntityHuman) entity).abilities.isInvulnerable) {
|
||||
this.k.put((EntityHuman) entity, new Vec3D(d8 * d13, d9 * d13, d10 * d13));
|
||||
}
|
||||
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
|
||||
generateVillage = getBoolean( "generator-settings.village", true );
|
||||
generateFlatBedrock = getBoolean( "generator-settings.flat-bedrock", false );
|
||||
}
|
||||
+
|
||||
+ public boolean fixCannons;
|
||||
+ private void fixCannons()
|
||||
+ {
|
||||
+ // TODO: Remove migrations after most users have upgraded.
|
||||
+ if ( PaperSpigotConfig.version < 9 )
|
||||
+ {
|
||||
+ // Migrate default value
|
||||
+
|
||||
+ boolean value = config.getBoolean( "world-settings.default.fix-cannons", false );
|
||||
+ if ( !value ) value = config.getBoolean( "world-settings.default.tnt-gameplay.fix-directional-bias", false );
|
||||
+ if ( !value ) value = !config.getBoolean( "world-settings.default.tnt-gameplay.moves-in-water", true );
|
||||
+ if ( !value ) value = config.getBoolean( "world-settings.default.tnt-gameplay.legacy-explosion-height", false );
|
||||
+ if ( value ) config.set( "world-settings.default.fix-cannons", true );
|
||||
+
|
||||
+ if ( config.contains( "world-settings.default.tnt-gameplay" ) )
|
||||
+ {
|
||||
+ config.getDefaults().set( "world-settings.default.tnt-gameplay", null);
|
||||
+ config.set( "world-settings.default.tnt-gameplay", null );
|
||||
+ }
|
||||
+
|
||||
+ // Migrate world setting
|
||||
+
|
||||
+ value = config.getBoolean( "world-settings." + worldName + ".fix-cannons", false );
|
||||
+ if ( !value ) value = config.getBoolean( "world-settings." + worldName + ".tnt-gameplay.fix-directional-bias", false );
|
||||
+ if ( !value ) value = !config.getBoolean( "world-settings." + worldName + ".tnt-gameplay.moves-in-water", true );
|
||||
+ if ( !value ) value = config.getBoolean( "world-settings." + worldName + ".tnt-gameplay.legacy-explosion-height", false );
|
||||
+ if ( value ) config.set( "world-settings." + worldName + ".fix-cannons", true );
|
||||
+
|
||||
+ if ( config.contains( "world-settings." + worldName + ".tnt-gameplay" ) )
|
||||
+ {
|
||||
+ config.getDefaults().set( "world-settings." + worldName + ".tnt-gameplay", null);
|
||||
+ config.set( "world-settings." + worldName + ".tnt-gameplay", null );
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ fixCannons = getBoolean( "fix-cannons", false );
|
||||
+ log( "Fix TNT cannons: " + fixCannons );
|
||||
+ }
|
||||
}
|
||||
if (entity instanceof EntityHuman) {
|
||||
EntityHuman entityhuman = (EntityHuman) entity;
|
||||
|
||||
--
|
Reference in New Issue
Block a user