Archiviert
13
0

Replace non-picky rails with non-picky torches

Issues with rails colliding with hitboxes on fences
non-picky torches can be placed on stained glass on 1.8+ clients only (client-side limitation)
Dieser Commit ist enthalten in:
Zach Brown 2014-10-24 23:41:49 -05:00
Ursprung b6b3d84943
Commit edf1a20dcd
3 geänderte Dateien mit 194 neuen und 97 gelöschten Zeilen

Datei anzeigen

@ -1,4 +1,4 @@
From 5fad8a996eeca6952e2db084f9ddb41ae4f65fa9 Mon Sep 17 00:00:00 2001
From cbbd2417d3fda9052696daf507161a57a90c8465 Mon Sep 17 00:00:00 2001
From: Zach Brown <Zbob750@live.com>
Date: Tue, 22 Jul 2014 21:05:53 -0500
Subject: [PATCH] mc-dev imports
@ -155,6 +155,179 @@ index 0000000..d36aacb
+ }
+ }
+}
diff --git a/src/main/java/net/minecraft/server/BlockTorch.java b/src/main/java/net/minecraft/server/BlockTorch.java
new file mode 100644
index 0000000..d95aff2
--- /dev/null
+++ b/src/main/java/net/minecraft/server/BlockTorch.java
@@ -0,0 +1,167 @@
+package net.minecraft.server;
+
+import java.util.Random;
+
+public class BlockTorch extends Block {
+
+ protected BlockTorch() {
+ super(Material.ORIENTABLE);
+ this.a(true);
+ this.a(CreativeModeTab.c);
+ }
+
+ public AxisAlignedBB a(World world, int i, int j, int k) {
+ return null;
+ }
+
+ public boolean c() {
+ return false;
+ }
+
+ public boolean d() {
+ return false;
+ }
+
+ public int b() {
+ return 2;
+ }
+
+ private boolean m(World world, int i, int j, int k) {
+ if (World.a((IBlockAccess) world, i, j, k)) {
+ return true;
+ } else {
+ Block block = world.getType(i, j, k);
+
+ return block == Blocks.FENCE || block == Blocks.NETHER_FENCE || block == Blocks.GLASS || block == Blocks.COBBLE_WALL;
+ }
+ }
+
+ public boolean canPlace(World world, int i, int j, int k) {
+ return world.c(i - 1, j, k, true) ? true : (world.c(i + 1, j, k, true) ? true : (world.c(i, j, k - 1, true) ? true : (world.c(i, j, k + 1, true) ? true : this.m(world, i, j - 1, k))));
+ }
+
+ public int getPlacedData(World world, int i, int j, int k, int l, float f, float f1, float f2, int i1) {
+ int j1 = i1;
+
+ if (l == 1 && this.m(world, i, j - 1, k)) {
+ j1 = 5;
+ }
+
+ if (l == 2 && world.c(i, j, k + 1, true)) {
+ j1 = 4;
+ }
+
+ if (l == 3 && world.c(i, j, k - 1, true)) {
+ j1 = 3;
+ }
+
+ if (l == 4 && world.c(i + 1, j, k, true)) {
+ j1 = 2;
+ }
+
+ if (l == 5 && world.c(i - 1, j, k, true)) {
+ j1 = 1;
+ }
+
+ return j1;
+ }
+
+ public void a(World world, int i, int j, int k, Random random) {
+ super.a(world, i, j, k, random);
+ if (world.getData(i, j, k) == 0) {
+ this.onPlace(world, i, j, k);
+ }
+ }
+
+ public void onPlace(World world, int i, int j, int k) {
+ if (world.getData(i, j, k) == 0) {
+ if (world.c(i - 1, j, k, true)) {
+ world.setData(i, j, k, 1, 2);
+ } else if (world.c(i + 1, j, k, true)) {
+ world.setData(i, j, k, 2, 2);
+ } else if (world.c(i, j, k - 1, true)) {
+ world.setData(i, j, k, 3, 2);
+ } else if (world.c(i, j, k + 1, true)) {
+ world.setData(i, j, k, 4, 2);
+ } else if (this.m(world, i, j - 1, k)) {
+ world.setData(i, j, k, 5, 2);
+ }
+ }
+
+ this.e(world, i, j, k);
+ }
+
+ public void doPhysics(World world, int i, int j, int k, Block block) {
+ this.b(world, i, j, k, block);
+ }
+
+ protected boolean b(World world, int i, int j, int k, Block block) {
+ if (this.e(world, i, j, k)) {
+ int l = world.getData(i, j, k);
+ boolean flag = false;
+
+ if (!world.c(i - 1, j, k, true) && l == 1) {
+ flag = true;
+ }
+
+ if (!world.c(i + 1, j, k, true) && l == 2) {
+ flag = true;
+ }
+
+ if (!world.c(i, j, k - 1, true) && l == 3) {
+ flag = true;
+ }
+
+ if (!world.c(i, j, k + 1, true) && l == 4) {
+ flag = true;
+ }
+
+ if (!this.m(world, i, j - 1, k) && l == 5) {
+ flag = true;
+ }
+
+ if (flag) {
+ this.b(world, i, j, k, world.getData(i, j, k), 0);
+ world.setAir(i, j, k);
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return true;
+ }
+ }
+
+ protected boolean e(World world, int i, int j, int k) {
+ if (!this.canPlace(world, i, j, k)) {
+ if (world.getType(i, j, k) == this) {
+ this.b(world, i, j, k, world.getData(i, j, k), 0);
+ world.setAir(i, j, k);
+ }
+
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+ public MovingObjectPosition a(World world, int i, int j, int k, Vec3D vec3d, Vec3D vec3d1) {
+ int l = world.getData(i, j, k) & 7;
+ float f = 0.15F;
+
+ if (l == 1) {
+ this.a(0.0F, 0.2F, 0.5F - f, f * 2.0F, 0.8F, 0.5F + f);
+ } else if (l == 2) {
+ this.a(1.0F - f * 2.0F, 0.2F, 0.5F - f, 1.0F, 0.8F, 0.5F + f);
+ } else if (l == 3) {
+ this.a(0.5F - f, 0.2F, 0.0F, 0.5F + f, 0.8F, f * 2.0F);
+ } else if (l == 4) {
+ this.a(0.5F - f, 0.2F, 1.0F - f * 2.0F, 0.5F + f, 0.8F, 1.0F);
+ } else {
+ f = 0.1F;
+ this.a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.6F, 0.5F + f);
+ }
+
+ return super.a(world, i, j, k, vec3d, vec3d1);
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MobEffectAttackDamage.java b/src/main/java/net/minecraft/server/MobEffectAttackDamage.java
new file mode 100644
index 0000000..3eb029d

Datei anzeigen

@ -1,4 +1,4 @@
From 2d0a853d87d4c3b51d32cb8e1d8ba78da32a1b41 Mon Sep 17 00:00:00 2001
From 6b8e8f9d3a433a7bea59b5d3f77262a383ce3399 Mon Sep 17 00:00:00 2001
From: Iceee <andrew@opticgaming.tv>
Date: Fri, 29 Aug 2014 20:33:52 -0500
Subject: [PATCH] Remove specific entities that fly through an unloaded chunk
@ -94,11 +94,11 @@ index 3bf2af0..1977c6c 100644
entity.tickTimer.startTiming(); // Spigot
// CraftBukkit end
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
index 753bdda..a59fd42 100644
index 7842d69..f80c075 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -178,4 +178,14 @@ public class PaperSpigotWorldConfig
removeInvalidMobSpawnerTEs = getBoolean( "remove-invalid-mob-spawner-tile-entities", true);
removeInvalidMobSpawnerTEs = getBoolean( "remove-invalid-mob-spawner-tile-entities", true );
log( "Remove invalid mob spawner tile entities: " + removeInvalidMobSpawnerTEs );
}
+

Datei anzeigen

@ -1,74 +1,23 @@
From e6ea911ae0a814b801ce8c2b0b011963893686f3 Mon Sep 17 00:00:00 2001
From 87f63a5ecd0f0459f65ccf07aa38b5b47b99a3a8 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/BlockMinecartTrackAbstract.java b/src/main/java/net/minecraft/server/BlockMinecartTrackAbstract.java
index b6b4146..a0b960a 100644
--- a/src/main/java/net/minecraft/server/BlockMinecartTrackAbstract.java
+++ b/src/main/java/net/minecraft/server/BlockMinecartTrackAbstract.java
@@ -61,7 +61,7 @@ public abstract class BlockMinecartTrackAbstract extends Block {
}
diff --git a/src/main/java/net/minecraft/server/BlockTorch.java b/src/main/java/net/minecraft/server/BlockTorch.java
index d95aff2..784d4c0 100644
--- a/src/main/java/net/minecraft/server/BlockTorch.java
+++ b/src/main/java/net/minecraft/server/BlockTorch.java
@@ -32,7 +32,8 @@ public class BlockTorch extends Block {
} else {
Block block = world.getType(i, j, k);
public boolean canPlace(World world, int i, int j, int k) {
- return World.a((IBlockAccess) world, i, j - 1, k);
+ return checkPlace(world, i, j, k); // PaperSpigot - Moved, pass it all along
}
public void onPlace(World world, int i, int j, int k) {
@@ -84,25 +84,27 @@ public abstract class BlockMinecartTrackAbstract extends Block {
boolean flag = false;
- if (!World.a((IBlockAccess) world, i, j - 1, k)) {
+ // PaperSpigot start - Replace !World.a with our own check - Less picky rails
+ if (!checkPlace(world, i, j, k)) {
flag = true;
}
- if (i1 == 2 && !World.a((IBlockAccess) world, i + 1, j, k)) {
+ if (i1 == 2 && !checkPlace(world, i, j, k)) {
flag = true;
}
- if (i1 == 3 && !World.a((IBlockAccess) world, i - 1, j, k)) {
+ if (i1 == 3 && !checkPlace(world, i, j, k)) {
flag = true;
}
- if (i1 == 4 && !World.a((IBlockAccess) world, i, j, k - 1)) {
+ if (i1 == 4 && !checkPlace(world, i, j, k)) {
flag = true;
}
- if (i1 == 5 && !World.a((IBlockAccess) world, i, j, k + 1)) {
+ if (i1 == 5 && !checkPlace(world, i, j, k)) {
flag = true;
}
+ // PaperSpigot end
if (flag) {
// PaperSpigot start - Rails dupe workaround
@@ -146,4 +148,18 @@ public abstract class BlockMinecartTrackAbstract extends Block {
world.applyPhysics(i, j - 1, k, block);
- 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;
}
}
+
+ /**
+ * PaperSpigot - Customizable rail placement on extra blocks
+ */
+ private boolean checkPlace(World world, int i, int j, int k) {
+ Block block = World.getBlock(world, i, j - 1, k);
+ if (world.paperSpigotConfig.lessPickyRails) {
+ if (block instanceof BlockFence) {
+ return true;
+ }
+ }
+
+ return World.canPlace(world, block, i, j - 1, k);
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityBoat.java b/src/main/java/net/minecraft/server/EntityBoat.java
index c9f2b13..7c4c303 100644
--- a/src/main/java/net/minecraft/server/EntityBoat.java
@ -125,48 +74,23 @@ index c9f2b13..7c4c303 100644
+ this.a(Items.STICK, 1, 0.0F);
+ }
+ }
+ }
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 1977c6c..db41b8b 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -3155,4 +3155,20 @@ public abstract class World implements IBlockAccess {
iworldaccess.b();
}
}
+
+ /**
+ * PaperSpigot - Gets block at location
+ */
+ public static Block getBlock(IBlockAccess iblockaccess, int i, int j, int k) {
+ return iblockaccess.getType(i, j, k);
+ }
+
+ /**
+ * PaperSpigot - Checks if block placement is allowed (used in BlockMinecartTrackAbstract and similar)
+ */
+ public static boolean canPlace(IBlockAccess iblockaccess, Block block, int i, int j, int k) {
+ int l = iblockaccess.getData(i, j, k);
+
+ return block.getMaterial().k() && block.d() ? true : (block instanceof BlockStairs ? (l & 4) == 4 : (block instanceof BlockStepAbstract ? (l & 8) == 8 : (block instanceof BlockHopper ? true : (block instanceof BlockSnow ? (l & 7) == 7 : false))));
+ }
}
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
index a59fd42..6b9e127 100644
index f80c075..6b789e4 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -188,4 +188,12 @@ public class PaperSpigotWorldConfig
removeUnloadedTNTEntities = getBoolean("remove-unloaded.tnt-entities", true);
removeUnloadedFallingBlocks = getBoolean("remove-unloaded.falling-blocks", true);
removeUnloadedTNTEntities = getBoolean( "remove-unloaded.tnt-entities", true );
removeUnloadedFallingBlocks = getBoolean( "remove-unloaded.falling-blocks", true );
}
+
+ public boolean boatsDropBoats;
+ public boolean lessPickyRails;
+ public boolean lessPickyTorches;
+ private void mechanicsChanges()
+ {
+ boatsDropBoats = getBoolean( "game-mechanics.boats-drop-boats", false );
+ lessPickyRails = getBoolean( "game-mechanics.less-picky-rail-placement", false );
+ lessPickyTorches = getBoolean ( "game-mechanics.less-picky-torch-placement", false );
+ }
}
--