mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-11 18:22:08 -07:00
Update to Minecraft 1.13-pre7
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
--- a/net/minecraft/server/TileEntityChest.java
|
||||
+++ b/net/minecraft/server/TileEntityChest.java
|
||||
@@ -3,6 +3,10 @@
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import javax.annotation.Nullable;
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
|
||||
+import org.bukkit.entity.HumanEntity;
|
||||
@@ -11,9 +11,9 @@
|
||||
|
||||
public class TileEntityChest extends TileEntityLootable implements ITickable {
|
||||
|
||||
@@ -18,6 +22,31 @@
|
||||
private int q;
|
||||
private BlockChest.Type r;
|
||||
@@ -11,6 +15,31 @@
|
||||
protected int f;
|
||||
private int k;
|
||||
|
||||
+ // CraftBukkit start - add fields and methods
|
||||
+ public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
|
||||
@@ -40,10 +40,10 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
public TileEntityChest() {
|
||||
protected TileEntityChest(TileEntityTypes<?> tileentitytypes) {
|
||||
super(tileentitytypes);
|
||||
this.items = NonNullList.a(27, ItemStack.a);
|
||||
}
|
||||
@@ -82,7 +111,7 @@
|
||||
@@ -75,7 +104,7 @@
|
||||
}
|
||||
|
||||
public int getMaxStackSize() {
|
||||
@@ -51,54 +51,50 @@
|
||||
+ return maxStack; // CraftBukkit
|
||||
}
|
||||
|
||||
public void invalidateBlockCache() {
|
||||
@@ -258,9 +287,21 @@
|
||||
if (this.l < 0) {
|
||||
this.l = 0;
|
||||
public void X_() {
|
||||
@@ -170,8 +199,20 @@
|
||||
if (this.f < 0) {
|
||||
this.f = 0;
|
||||
}
|
||||
+ int oldPower = Math.max(0, Math.min(15, this.l)); // CraftBukkit - Get power before new viewer is added
|
||||
+ int oldPower = Math.max(0, Math.min(15, this.f)); // CraftBukkit - Get power before new viewer is added
|
||||
|
||||
++this.l;
|
||||
++this.f;
|
||||
+ if (this.world == null) return; // CraftBukkit
|
||||
this.world.playBlockAction(this.position, this.getBlock(), 1, this.l);
|
||||
+
|
||||
+ // CraftBukkit start - Call redstone event
|
||||
+ if (this.getBlock() == Blocks.TRAPPED_CHEST) {
|
||||
+ int newPower = Math.max(0, Math.min(15, this.l));
|
||||
+ int newPower = Math.max(0, Math.min(15, this.f));
|
||||
+
|
||||
+ if (oldPower != newPower) {
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callRedstoneChange(world, position.getX(), position.getY(), position.getZ(), oldPower, newPower);
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callRedstoneChange(world, position, oldPower, newPower);
|
||||
+ }
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
this.world.applyPhysics(this.position, this.getBlock(), false);
|
||||
if (this.p() == BlockChest.Type.TRAP) {
|
||||
this.world.applyPhysics(this.position.down(), this.getBlock(), false);
|
||||
@@ -271,12 +312,21 @@
|
||||
|
||||
public void closeContainer(EntityHuman entityhuman) {
|
||||
if (!entityhuman.isSpectator() && this.getBlock() instanceof BlockChest) {
|
||||
+ int oldPower = Math.max(0, Math.min(15, this.l)); // CraftBukkit - Get power before new viewer is added
|
||||
--this.l;
|
||||
this.world.playBlockAction(this.position, this.getBlock(), 1, this.l);
|
||||
this.world.applyPhysics(this.position, this.getBlock(), false);
|
||||
+
|
||||
+ // CraftBukkit start - Call redstone event
|
||||
if (this.p() == BlockChest.Type.TRAP) {
|
||||
+ int newPower = Math.max(0, Math.min(15, this.l));
|
||||
+
|
||||
+ if (oldPower != newPower) {
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callRedstoneChange(world, position.getX(), position.getY(), position.getZ(), oldPower, newPower);
|
||||
+ }
|
||||
this.world.applyPhysics(this.position.down(), this.getBlock(), false);
|
||||
}
|
||||
+ // CraftBukkit end
|
||||
this.p();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -311,4 +361,11 @@
|
||||
protected NonNullList<ItemStack> q() {
|
||||
return this.items;
|
||||
@@ -179,7 +220,18 @@
|
||||
|
||||
public void closeContainer(EntityHuman entityhuman) {
|
||||
if (!entityhuman.isSpectator()) {
|
||||
+ int oldPower = Math.max(0, Math.min(15, this.f)); // CraftBukkit - Get power before new viewer is added
|
||||
--this.f;
|
||||
+
|
||||
+ // CraftBukkit start - Call redstone event
|
||||
+ if (this.getBlock() == Blocks.TRAPPED_CHEST) {
|
||||
+ int newPower = Math.max(0, Math.min(15, this.f));
|
||||
+
|
||||
+ if (oldPower != newPower) {
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callRedstoneChange(world, position, oldPower, newPower);
|
||||
+ }
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
this.p();
|
||||
}
|
||||
|
||||
@@ -232,4 +284,11 @@
|
||||
tileentitychest.a(tileentitychest1.q());
|
||||
tileentitychest1.a(nonnulllist);
|
||||
}
|
||||
+
|
||||
+ // CraftBukkit start
|
||||
|
Reference in New Issue
Block a user