mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Fix all other areas bgr.I() was supposed to be used
This commit is contained in:
@@ -0,0 +1,160 @@
|
|||||||
|
From 801c2e3e493953a5d51b37d5fb7ff0813884b383 Mon Sep 17 00:00:00 2001
|
||||||
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
|
Date: Sun, 12 May 2019 06:15:25 -0500
|
||||||
|
Subject: [PATCH] Fix mis-mapped getHeight methods for World and IBlockAccess
|
||||||
|
|
||||||
|
---
|
||||||
|
src/main/java/net/minecraft/server/BlockPiston.java | 2 +-
|
||||||
|
src/main/java/net/minecraft/server/ChunkConverter.java | 2 +-
|
||||||
|
src/main/java/net/minecraft/server/IBlockAccess.java | 2 +-
|
||||||
|
src/main/java/net/minecraft/server/ItemScaffolding.java | 2 +-
|
||||||
|
src/main/java/net/minecraft/server/Navigation.java | 4 ++--
|
||||||
|
.../java/net/minecraft/server/RandomPositionGenerator.java | 2 +-
|
||||||
|
src/main/java/net/minecraft/server/TileEntityBeacon.java | 2 +-
|
||||||
|
src/main/java/net/minecraft/server/TileEntityConduit.java | 2 +-
|
||||||
|
src/main/java/net/minecraft/server/World.java | 2 +-
|
||||||
|
src/main/java/net/minecraft/server/WorldServer.java | 2 +-
|
||||||
|
10 files changed, 11 insertions(+), 11 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/BlockPiston.java b/src/main/java/net/minecraft/server/BlockPiston.java
|
||||||
|
index a5573f21f..5000a1243 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/BlockPiston.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/BlockPiston.java
|
||||||
|
@@ -248,7 +248,7 @@ public class BlockPiston extends BlockDirectional {
|
||||||
|
} else if (!world.getWorldBorder().a(blockposition)) {
|
||||||
|
return false;
|
||||||
|
} else if (blockposition.getY() >= 0 && (enumdirection != EnumDirection.DOWN || blockposition.getY() != 0)) {
|
||||||
|
- if (blockposition.getY() <= world.getHeight() - 1 && (enumdirection != EnumDirection.UP || blockposition.getY() != world.getHeight() - 1)) {
|
||||||
|
+ if (blockposition.getY() <= world.getDefHeight() - 1 && (enumdirection != EnumDirection.UP || blockposition.getY() != world.getDefHeight() - 1)) { // Purpur - use bgr.I()
|
||||||
|
if (block != Blocks.PISTON && block != Blocks.STICKY_PISTON) {
|
||||||
|
if (iblockdata.f(world, blockposition) == -1.0F) {
|
||||||
|
return false;
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/ChunkConverter.java b/src/main/java/net/minecraft/server/ChunkConverter.java
|
||||||
|
index 9781b092e..8fb52a72e 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/ChunkConverter.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/ChunkConverter.java
|
||||||
|
@@ -94,7 +94,7 @@ public class ChunkConverter {
|
||||||
|
int l = chunkcoordintpair.e() + (flag6 && (flag2 || flag3) ? 14 : (flag5 ? 0 : 15));
|
||||||
|
EnumDirection[] aenumdirection = EnumDirection.values();
|
||||||
|
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
|
||||||
|
- Iterator iterator = BlockPosition.b(i, 0, k, j, world.getHeight() - 1, l).iterator();
|
||||||
|
+ Iterator iterator = BlockPosition.b(i, 0, k, j, world.getDefHeight() - 1, l).iterator(); // Purpur - use bgr.I()
|
||||||
|
|
||||||
|
while (iterator.hasNext()) {
|
||||||
|
BlockPosition blockposition = (BlockPosition) iterator.next();
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/IBlockAccess.java b/src/main/java/net/minecraft/server/IBlockAccess.java
|
||||||
|
index c44edda65..1f0fd6869 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/IBlockAccess.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/IBlockAccess.java
|
||||||
|
@@ -21,7 +21,7 @@ public interface IBlockAccess {
|
||||||
|
return 15;
|
||||||
|
}
|
||||||
|
|
||||||
|
- default int getHeight() {
|
||||||
|
+ default int getDefHeight() { // Purpur - this is bgr.I()
|
||||||
|
return 256;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/ItemScaffolding.java b/src/main/java/net/minecraft/server/ItemScaffolding.java
|
||||||
|
index 32b74f655..5cd9c5f8b 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/ItemScaffolding.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/ItemScaffolding.java
|
||||||
|
@@ -33,7 +33,7 @@ public class ItemScaffolding extends ItemBlock {
|
||||||
|
while (i < 7) {
|
||||||
|
if (!world.isClientSide && !World.isValidLocation(blockposition_mutableblockposition)) {
|
||||||
|
EntityHuman entityhuman = blockactioncontext.getEntity();
|
||||||
|
- int j = world.getHeight();
|
||||||
|
+ int j = world.getDefHeight(); // Purpur - use bgr.I()
|
||||||
|
|
||||||
|
if (entityhuman instanceof EntityPlayer && blockposition_mutableblockposition.getY() >= j) {
|
||||||
|
PacketPlayOutChat packetplayoutchat = new PacketPlayOutChat((new ChatMessage("build.tooHigh", new Object[] { j})).a(EnumChatFormat.RED), ChatMessageType.GAME_INFO);
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/Navigation.java b/src/main/java/net/minecraft/server/Navigation.java
|
||||||
|
index 79b2d9297..318a70247 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/Navigation.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/Navigation.java
|
||||||
|
@@ -40,7 +40,7 @@ public class Navigation extends NavigationAbstract {
|
||||||
|
return super.b(blockposition1.up());
|
||||||
|
}
|
||||||
|
|
||||||
|
- while (blockposition1.getY() < this.b.getHeight() && this.b.getType(blockposition1).isAir()) {
|
||||||
|
+ while (blockposition1.getY() < this.b.getDefHeight() && this.b.getType(blockposition1).isAir()) { // Purpur - use bgr.I()
|
||||||
|
blockposition1 = blockposition1.up();
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -50,7 +50,7 @@ public class Navigation extends NavigationAbstract {
|
||||||
|
if (!this.b.getType(blockposition).getMaterial().isBuildable()) {
|
||||||
|
return super.b(blockposition);
|
||||||
|
} else {
|
||||||
|
- for (blockposition1 = blockposition.up(); blockposition1.getY() < this.b.getHeight() && this.b.getType(blockposition1).getMaterial().isBuildable(); blockposition1 = blockposition1.up()) {
|
||||||
|
+ for (blockposition1 = blockposition.up(); blockposition1.getY() < this.b.getDefHeight() && this.b.getType(blockposition1).getMaterial().isBuildable(); blockposition1 = blockposition1.up()) { // Purpur - use bgr.I()
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/RandomPositionGenerator.java b/src/main/java/net/minecraft/server/RandomPositionGenerator.java
|
||||||
|
index 78eb1b39c..82e3a0d30 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/RandomPositionGenerator.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/RandomPositionGenerator.java
|
||||||
|
@@ -153,7 +153,7 @@ public class RandomPositionGenerator {
|
||||||
|
} else {
|
||||||
|
BlockPosition blockposition1;
|
||||||
|
|
||||||
|
- for (blockposition1 = blockposition.up(); blockposition1.getY() < entitycreature.world.getHeight() && entitycreature.world.getType(blockposition1).getMaterial().isBuildable(); blockposition1 = blockposition1.up()) {
|
||||||
|
+ for (blockposition1 = blockposition.up(); blockposition1.getY() < entitycreature.world.getDefHeight() && entitycreature.world.getType(blockposition1).getMaterial().isBuildable(); blockposition1 = blockposition1.up()) { // Purpur - use bgr.I()
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/TileEntityBeacon.java b/src/main/java/net/minecraft/server/TileEntityBeacon.java
|
||||||
|
index 87f77bb86..4e0ed4f27 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/TileEntityBeacon.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/TileEntityBeacon.java
|
||||||
|
@@ -232,7 +232,7 @@ public class TileEntityBeacon extends TileEntity implements ITileInventory, ITic
|
||||||
|
{
|
||||||
|
double d0 = (double) (this.levels * 10 + 10);
|
||||||
|
|
||||||
|
- AxisAlignedBB axisalignedbb = (new AxisAlignedBB(this.position)).g(d0).b(0.0D, (double) this.world.getHeight(), 0.0D);
|
||||||
|
+ AxisAlignedBB axisalignedbb = (new AxisAlignedBB(this.position)).g(d0).b(0.0D, (double) this.world.getDefHeight(), 0.0D); // Purpur - use bgr.I()
|
||||||
|
List<EntityHuman> list = this.world.a(EntityHuman.class, axisalignedbb);
|
||||||
|
|
||||||
|
return list;
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/TileEntityConduit.java b/src/main/java/net/minecraft/server/TileEntityConduit.java
|
||||||
|
index b9a0cf4f9..44c363f4d 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/TileEntityConduit.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/TileEntityConduit.java
|
||||||
|
@@ -152,7 +152,7 @@ public class TileEntityConduit extends TileEntity implements ITickable {
|
||||||
|
int k = this.position.getX();
|
||||||
|
int l = this.position.getY();
|
||||||
|
int i1 = this.position.getZ();
|
||||||
|
- AxisAlignedBB axisalignedbb = (new AxisAlignedBB((double) k, (double) l, (double) i1, (double) (k + 1), (double) (l + 1), (double) (i1 + 1))).g((double) j).b(0.0D, (double) this.world.getHeight(), 0.0D);
|
||||||
|
+ AxisAlignedBB axisalignedbb = (new AxisAlignedBB((double) k, (double) l, (double) i1, (double) (k + 1), (double) (l + 1), (double) (i1 + 1))).g((double) j).b(0.0D, (double) this.world.getDefHeight(), 0.0D); // Purpur - use bgr.I()
|
||||||
|
List<EntityHuman> list = this.world.a(EntityHuman.class, axisalignedbb);
|
||||||
|
|
||||||
|
if (!list.isEmpty()) {
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||||
|
index a9a358955..d9cbfbe4a 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/World.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/World.java
|
||||||
|
@@ -1450,7 +1450,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||||
|
|
||||||
|
public void b(int i, BlockPosition blockposition, int j) {}
|
||||||
|
|
||||||
|
- @Override
|
||||||
|
+ //@Override // Purpur - this is bhh.W() not bgr.I() there is a HUGE difference!
|
||||||
|
public int getHeight() {
|
||||||
|
return this.worldProvider.h() ? 128 : 256;
|
||||||
|
}
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||||
|
index f51d8389b..7862c18e7 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||||
|
@@ -469,7 +469,7 @@ public class WorldServer extends World {
|
||||||
|
|
||||||
|
protected BlockPosition a(BlockPosition blockposition) {
|
||||||
|
BlockPosition blockposition1 = this.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING, blockposition);
|
||||||
|
- AxisAlignedBB axisalignedbb = (new AxisAlignedBB(blockposition1, new BlockPosition(blockposition1.getX(), this.getHeight(), blockposition1.getZ()))).g(3.0D);
|
||||||
|
+ AxisAlignedBB axisalignedbb = (new AxisAlignedBB(blockposition1, new BlockPosition(blockposition1.getX(), this.getDefHeight(), blockposition1.getZ()))).g(3.0D); // Purpur - use bgr.I()
|
||||||
|
List<EntityLiving> list = this.a(EntityLiving.class, axisalignedbb, (java.util.function.Predicate<EntityLiving>) (entityliving) -> { // CraftBukkit - decompile error
|
||||||
|
return entityliving != null && entityliving.isAlive() && this.f(entityliving.getChunkCoordinates());
|
||||||
|
});
|
||||||
|
--
|
||||||
|
2.20.1
|
||||||
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
From a8f2de4f00321e36cd8faf16c2f392ef7ed6ddd7 Mon Sep 17 00:00:00 2001
|
|
||||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
||||||
Date: Sun, 12 May 2019 06:15:25 -0500
|
|
||||||
Subject: [PATCH] Fix pistons not working in nether roof
|
|
||||||
|
|
||||||
---
|
|
||||||
src/main/java/net/minecraft/server/BlockPiston.java | 2 +-
|
|
||||||
src/main/java/net/minecraft/server/IBlockAccess.java | 2 +-
|
|
||||||
src/main/java/net/minecraft/server/World.java | 2 +-
|
|
||||||
3 files changed, 3 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/BlockPiston.java b/src/main/java/net/minecraft/server/BlockPiston.java
|
|
||||||
index a5573f21f..61bfa1e78 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/BlockPiston.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/BlockPiston.java
|
|
||||||
@@ -248,7 +248,7 @@ public class BlockPiston extends BlockDirectional {
|
|
||||||
} else if (!world.getWorldBorder().a(blockposition)) {
|
|
||||||
return false;
|
|
||||||
} else if (blockposition.getY() >= 0 && (enumdirection != EnumDirection.DOWN || blockposition.getY() != 0)) {
|
|
||||||
- if (blockposition.getY() <= world.getHeight() - 1 && (enumdirection != EnumDirection.UP || blockposition.getY() != world.getHeight() - 1)) {
|
|
||||||
+ if (blockposition.getY() <= world.getDefHeight() - 1 && (enumdirection != EnumDirection.UP || blockposition.getY() != world.getDefHeight() - 1)) { // Purpur - use bgr.I() not bhh.W()
|
|
||||||
if (block != Blocks.PISTON && block != Blocks.STICKY_PISTON) {
|
|
||||||
if (iblockdata.f(world, blockposition) == -1.0F) {
|
|
||||||
return false;
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/IBlockAccess.java b/src/main/java/net/minecraft/server/IBlockAccess.java
|
|
||||||
index c44edda65..1f0fd6869 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/IBlockAccess.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/IBlockAccess.java
|
|
||||||
@@ -21,7 +21,7 @@ public interface IBlockAccess {
|
|
||||||
return 15;
|
|
||||||
}
|
|
||||||
|
|
||||||
- default int getHeight() {
|
|
||||||
+ default int getDefHeight() { // Purpur - this is bgr.I()
|
|
||||||
return 256;
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
|
||||||
index a9a358955..d9cbfbe4a 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/World.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/World.java
|
|
||||||
@@ -1450,7 +1450,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
|
||||||
|
|
||||||
public void b(int i, BlockPosition blockposition, int j) {}
|
|
||||||
|
|
||||||
- @Override
|
|
||||||
+ //@Override // Purpur - this is bhh.W() not bgr.I() there is a HUGE difference!
|
|
||||||
public int getHeight() {
|
|
||||||
return this.worldProvider.h() ? 128 : 256;
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.20.1
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user