Update to MC 1.12-pre2

This commit is contained in:
Zach Brown
2017-05-14 13:05:01 -05:00
parent b712d77d72
commit ab4ae72fd5
148 changed files with 724 additions and 1045 deletions

View File

@@ -5,10 +5,31 @@ Subject: [PATCH] Add World Util Methods
Methods that can be used for other patches to help improve logic.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 491278646..c0d6e056d 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@ public class Chunk {
}
+ public final int getLightSubtracted(BlockPosition blockposition, int i) { return this.a(blockposition, i); } // Paper - OBFHELPER
public int a(BlockPosition blockposition, int i) {
int j = blockposition.getX() & 15;
int k = blockposition.getY();
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index cc7369e52..1d2d174e8 100644
index 1fc7ec6f4..20bdf4055 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
public final List<Entity> j = Lists.newArrayList();
protected final IntHashMap<Entity> entitiesById = new IntHashMap();
private final long K = 16777215L;
- private int L;
+ private int L; private int getSkylightSubtracted() { return this.L; } // Paper - OBFHELPER
protected int l = (new Random()).nextInt();
protected final int m = 1013904223;
protected float n;
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
return (CraftServer) Bukkit.getServer();
}
@@ -53,7 +74,7 @@ index cc7369e52..1d2d174e8 100644
+ }
+
+ Chunk chunk = this.getChunkAtWorldCoords(blockposition);
+ return chunk.a(blockposition, this.J) >= level;
+ return chunk.getLightSubtracted(blockposition, this.getSkylightSubtracted()) >= level;
+ }
+ } else {
+ return true;
@@ -64,6 +85,11 @@ index cc7369e52..1d2d174e8 100644
public int getLightLevel(BlockPosition blockposition) {
return this.c(blockposition, true);
}
+ public final int getLight(BlockPosition blockposition, boolean checkNeighbors) { return this.c(blockposition, checkNeighbors); } // Paper - OBFHELPER
public int c(BlockPosition blockposition, boolean flag) {
if (blockposition.getX() >= -30000000 && blockposition.getZ() >= -30000000 && blockposition.getX() < 30000000 && blockposition.getZ() < 30000000) {
if (flag && this.getType(blockposition).f()) {
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
return this.worldProvider.o()[this.getLightLevel(blockposition)];
}