summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/net/minecraft/server/EntityPlayer.java56
1 files changed, 44 insertions, 12 deletions
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 9b80aef5..b5ebce6b 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -576,7 +576,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public void startCrafting(int i, int j, int k) {
// CraftBukkit start - Inventory open hook
Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerWorkbench(this.inventory, this.world, i, j, k));
- if(container == null) return;
+ if (container == null) {
+ return;
+ }
// CraftBukkit end
this.nextContainerCounter();
@@ -589,7 +591,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public void startEnchanting(int i, int j, int k, String s) {
// CraftBukkit start - Inventory open hook
Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerEnchantTable(this.inventory, this.world, i, j, k));
- if(container == null) return;
+ if (container == null) {
+ return;
+ }
// CraftBukkit end
this.nextContainerCounter();
@@ -602,7 +606,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public void openAnvil(int i, int j, int k) {
// CraftBukkit start - Inventory open hook
Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerAnvil(this.inventory, this.world, i, j, k, this));
- if(container == null) return;
+ if (container == null) {
+ return;
+ }
// CraftBukkit end
this.nextContainerCounter();
@@ -619,7 +625,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
// CraftBukkit start - Inventory open hook
Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerChest(this.inventory, iinventory));
- if(container == null) return;
+ if (container == null) {
+ iinventory.l_(); // Should be closeContainer
+ return;
+ }
// CraftBukkit end
this.nextContainerCounter();
@@ -632,7 +641,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public void openHopper(TileEntityHopper tileentityhopper) {
// CraftBukkit start - Inventory open hook
Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerHopper(this.inventory, tileentityhopper));
- if(container == null) return;
+ if (container == null) {
+ tileentityhopper.l_(); // Should be closeContainer
+ return;
+ }
// CraftBukkit end
this.nextContainerCounter();
@@ -645,7 +657,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public void openMinecartHopper(EntityMinecartHopper entityminecarthopper) {
// CraftBukkit start - Inventory open hook
Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerHopper(this.inventory, entityminecarthopper));
- if(container == null) return;
+ if (container == null) {
+ entityminecarthopper.l_(); // Should be closeContainer
+ return;
+ }
// CraftBukkit end
this.nextContainerCounter();
@@ -658,7 +673,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public void openFurnace(TileEntityFurnace tileentityfurnace) {
// CraftBukkit start - Inventory open hook
Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerFurnace(this.inventory, tileentityfurnace));
- if(container == null) return;
+ if (container == null) {
+ tileentityfurnace.l_(); // Should be closeContainer
+ return;
+ }
// CraftBukkit end
this.nextContainerCounter();
@@ -671,7 +689,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public void openDispenser(TileEntityDispenser tileentitydispenser) {
// CraftBukkit start - Inventory open hook
Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerDispenser(this.inventory, tileentitydispenser));
- if(container == null) return;
+ if (container == null) {
+ tileentitydispenser.l_(); // Should be closeContainer
+ return;
+ }
// CraftBukkit end
this.nextContainerCounter();
@@ -684,7 +705,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public void openBrewingStand(TileEntityBrewingStand tileentitybrewingstand) {
// CraftBukkit start - Inventory open hook
Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerBrewingStand(this.inventory, tileentitybrewingstand));
- if(container == null) return;
+ if (container == null) {
+ tileentitybrewingstand.l_(); // Should be closeContainer
+ return;
+ }
// CraftBukkit end
this.nextContainerCounter();
@@ -697,7 +721,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public void openBeacon(TileEntityBeacon tileentitybeacon) {
// CraftBukkit start - Inventory open hook
Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerBeacon(this.inventory, tileentitybeacon));
- if(container == null) return;
+ if (container == null) {
+ tileentitybeacon.l_(); // Should be closeContainer
+ return;
+ }
// CraftBukkit end
this.nextContainerCounter();
@@ -710,7 +737,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public void openTrade(IMerchant imerchant, String s) {
// CraftBukkit start - Inventory open hook
Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerMerchant(this.inventory, imerchant, this.world));
- if(container == null) return;
+ if (container == null) {
+ return;
+ }
// CraftBukkit end
this.nextContainerCounter();
@@ -740,7 +769,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public void openHorseInventory(EntityHorse entityhorse, IInventory iinventory) {
// CraftBukkit start - Inventory open hook
Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerHorse(this.inventory, iinventory, entityhorse));
- if(container == null) return;
+ if (container == null) {
+ iinventory.l_(); // Should be closeContainer
+ return;
+ }
// CraftBukkit end
if (this.activeContainer != this.defaultContainer) {