Skip to content

Commit

Permalink
Backport fix for closing SilentChest not dropping cursor item
Browse files Browse the repository at this point in the history
  • Loading branch information
Jikoo committed Jun 9, 2016
1 parent 326ffdb commit 53eadcb
Show file tree
Hide file tree
Showing 18 changed files with 137 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.minecraft.server.v1_4_5.ContainerChest;
import net.minecraft.server.v1_4_5.EntityHuman;
import net.minecraft.server.v1_4_5.IInventory;
import net.minecraft.server.v1_4_5.PlayerInventory;

public class SilentContainerChest extends ContainerChest {
public IInventory inv;
Expand All @@ -32,7 +33,13 @@ public SilentContainerChest(IInventory i1, IInventory i2) {
}

@Override
public void b(EntityHuman paramEntityHuman) {
public void b(EntityHuman entityHuman) {
// Don't send close signal twice, might screw up
PlayerInventory playerinventory = entityHuman.inventory;

if (playerinventory.getCarried() != null) {
entityHuman.drop(playerinventory.getCarried());
playerinventory.setCarried(null);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.minecraft.server.v1_4_6.ContainerChest;
import net.minecraft.server.v1_4_6.EntityHuman;
import net.minecraft.server.v1_4_6.IInventory;
import net.minecraft.server.v1_4_6.PlayerInventory;

public class SilentContainerChest extends ContainerChest {
public IInventory inv;
Expand All @@ -32,7 +33,13 @@ public SilentContainerChest(IInventory i1, IInventory i2) {
}

@Override
public void b(EntityHuman paramEntityHuman) {
public void b(EntityHuman entityHuman) {
// Don't send close signal twice, might screw up
PlayerInventory playerinventory = entityHuman.inventory;

if (playerinventory.getCarried() != null) {
entityHuman.drop(playerinventory.getCarried());
playerinventory.setCarried(null);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.minecraft.server.v1_4_R1.ContainerChest;
import net.minecraft.server.v1_4_R1.EntityHuman;
import net.minecraft.server.v1_4_R1.IInventory;
import net.minecraft.server.v1_4_R1.PlayerInventory;

public class SilentContainerChest extends ContainerChest {
public IInventory inv;
Expand All @@ -32,7 +33,13 @@ public SilentContainerChest(IInventory i1, IInventory i2) {
}

@Override
public void b(EntityHuman paramEntityHuman) {
public void b(EntityHuman entityHuman) {
// Don't send close signal twice, might screw up
PlayerInventory playerinventory = entityHuman.inventory;

if (playerinventory.getCarried() != null) {
entityHuman.drop(playerinventory.getCarried());
playerinventory.setCarried(null);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.minecraft.server.v1_5_R2.ContainerChest;
import net.minecraft.server.v1_5_R2.EntityHuman;
import net.minecraft.server.v1_5_R2.IInventory;
import net.minecraft.server.v1_5_R2.PlayerInventory;

public class SilentContainerChest extends ContainerChest {
public IInventory inv;
Expand All @@ -32,7 +33,13 @@ public SilentContainerChest(IInventory i1, IInventory i2) {
}

@Override
public void b(EntityHuman paramEntityHuman) {
public void b(EntityHuman entityHuman) {
// Don't send close signal twice, might screw up
PlayerInventory playerinventory = entityHuman.inventory;

if (playerinventory.getCarried() != null) {
entityHuman.drop(playerinventory.getCarried());
playerinventory.setCarried(null);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.minecraft.server.v1_5_R3.ContainerChest;
import net.minecraft.server.v1_5_R3.EntityHuman;
import net.minecraft.server.v1_5_R3.IInventory;
import net.minecraft.server.v1_5_R3.PlayerInventory;

public class SilentContainerChest extends ContainerChest {
public IInventory inv;
Expand All @@ -32,7 +33,13 @@ public SilentContainerChest(IInventory i1, IInventory i2) {
}

@Override
public void b(EntityHuman paramEntityHuman) {
public void b(EntityHuman entityHuman) {
// Don't send close signal twice, might screw up
PlayerInventory playerinventory = entityHuman.inventory;

if (playerinventory.getCarried() != null) {
entityHuman.drop(playerinventory.getCarried());
playerinventory.setCarried(null);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.minecraft.server.v1_6_R1.ContainerChest;
import net.minecraft.server.v1_6_R1.EntityHuman;
import net.minecraft.server.v1_6_R1.IInventory;
import net.minecraft.server.v1_6_R1.PlayerInventory;

public class SilentContainerChest extends ContainerChest {
public IInventory inv;
Expand All @@ -32,7 +33,13 @@ public SilentContainerChest(IInventory i1, IInventory i2) {
}

@Override
public void b(EntityHuman paramEntityHuman) {
public void b(EntityHuman entityHuman) {
// Don't send close signal twice, might screw up
PlayerInventory playerinventory = entityHuman.inventory;

if (playerinventory.getCarried() != null) {
entityHuman.drop(playerinventory.getCarried());
playerinventory.setCarried(null);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.minecraft.server.v1_6_R2.ContainerChest;
import net.minecraft.server.v1_6_R2.EntityHuman;
import net.minecraft.server.v1_6_R2.IInventory;
import net.minecraft.server.v1_6_R2.PlayerInventory;

public class SilentContainerChest extends ContainerChest {
public IInventory inv;
Expand All @@ -32,7 +33,13 @@ public SilentContainerChest(IInventory i1, IInventory i2) {
}

@Override
public void b(EntityHuman paramEntityHuman) {
public void b(EntityHuman entityHuman) {
// Don't send close signal twice, might screw up
PlayerInventory playerinventory = entityHuman.inventory;

if (playerinventory.getCarried() != null) {
entityHuman.drop(playerinventory.getCarried());
playerinventory.setCarried(null);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.minecraft.server.v1_6_R3.ContainerChest;
import net.minecraft.server.v1_6_R3.EntityHuman;
import net.minecraft.server.v1_6_R3.IInventory;
import net.minecraft.server.v1_6_R3.PlayerInventory;

public class SilentContainerChest extends ContainerChest {
public IInventory inv;
Expand All @@ -32,7 +33,13 @@ public SilentContainerChest(IInventory i1, IInventory i2) {
}

@Override
public void b(EntityHuman paramEntityHuman) {
public void b(EntityHuman entityHuman) {
// Don't send close signal twice, might screw up
PlayerInventory playerinventory = entityHuman.inventory;

if (playerinventory.getCarried() != null) {
entityHuman.drop(playerinventory.getCarried());
playerinventory.setCarried(null);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.minecraft.server.v1_7_R1.ContainerChest;
import net.minecraft.server.v1_7_R1.EntityHuman;
import net.minecraft.server.v1_7_R1.IInventory;
import net.minecraft.server.v1_7_R1.PlayerInventory;

public class SilentContainerChest extends ContainerChest {
public IInventory inv;
Expand All @@ -32,7 +33,13 @@ public SilentContainerChest(IInventory i1, IInventory i2) {
}

@Override
public void b(EntityHuman paramEntityHuman) {
public void b(EntityHuman entityHuman) {
// Don't send close signal twice, might screw up
PlayerInventory playerinventory = entityHuman.inventory;

if (playerinventory.getCarried() != null) {
entityHuman.drop(playerinventory.getCarried(), false);
playerinventory.setCarried(null);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.minecraft.server.v1_7_R2.ContainerChest;
import net.minecraft.server.v1_7_R2.EntityHuman;
import net.minecraft.server.v1_7_R2.IInventory;
import net.minecraft.server.v1_7_R2.PlayerInventory;

public class SilentContainerChest extends ContainerChest {
public IInventory inv;
Expand All @@ -32,7 +33,13 @@ public SilentContainerChest(IInventory i1, IInventory i2) {
}

@Override
public void b(EntityHuman paramEntityHuman) {
public void b(EntityHuman entityHuman) {
// Don't send close signal twice, might screw up
PlayerInventory playerinventory = entityHuman.inventory;

if (playerinventory.getCarried() != null) {
entityHuman.drop(playerinventory.getCarried(), false);
playerinventory.setCarried(null);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.minecraft.server.v1_7_R3.ContainerChest;
import net.minecraft.server.v1_7_R3.EntityHuman;
import net.minecraft.server.v1_7_R3.IInventory;
import net.minecraft.server.v1_7_R3.PlayerInventory;

public class SilentContainerChest extends ContainerChest {
public IInventory inv;
Expand All @@ -32,7 +33,13 @@ public SilentContainerChest(IInventory i1, IInventory i2) {
}

@Override
public void b(EntityHuman paramEntityHuman) {
public void b(EntityHuman entityHuman) {
// Don't send close signal twice, might screw up
PlayerInventory playerinventory = entityHuman.inventory;

if (playerinventory.getCarried() != null) {
entityHuman.drop(playerinventory.getCarried(), false);
playerinventory.setCarried(null);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.minecraft.server.v1_7_R4.ContainerChest;
import net.minecraft.server.v1_7_R4.EntityHuman;
import net.minecraft.server.v1_7_R4.IInventory;
import net.minecraft.server.v1_7_R4.PlayerInventory;

public class SilentContainerChest extends ContainerChest {
public IInventory inv;
Expand All @@ -32,7 +33,13 @@ public SilentContainerChest(IInventory i1, IInventory i2) {
}

@Override
public void b(EntityHuman paramEntityHuman) {
public void b(EntityHuman entityHuman) {
// Don't send close signal twice, might screw up
PlayerInventory playerinventory = entityHuman.inventory;

if (playerinventory.getCarried() != null) {
entityHuman.drop(playerinventory.getCarried(), false);
playerinventory.setCarried(null);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.minecraft.server.v1_8_R1.ContainerChest;
import net.minecraft.server.v1_8_R1.EntityHuman;
import net.minecraft.server.v1_8_R1.IInventory;
import net.minecraft.server.v1_8_R1.PlayerInventory;

public class SilentContainerChest extends ContainerChest {
public IInventory inv;
Expand All @@ -32,7 +33,13 @@ public SilentContainerChest(IInventory i1, IInventory i2, EntityHuman e1) {
}

@Override
public void b(EntityHuman paramEntityHuman) {
public void b(EntityHuman entityHuman) {
// Don't send close signal twice, might screw up
PlayerInventory playerinventory = entityHuman.inventory;

if (playerinventory.getCarried() != null) {
entityHuman.drop(playerinventory.getCarried(), false);
playerinventory.setCarried(null);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.minecraft.server.v1_8_R2.ContainerChest;
import net.minecraft.server.v1_8_R2.EntityHuman;
import net.minecraft.server.v1_8_R2.IInventory;
import net.minecraft.server.v1_8_R2.PlayerInventory;

public class SilentContainerChest extends ContainerChest {
public IInventory inv;
Expand All @@ -32,7 +33,13 @@ public SilentContainerChest(IInventory i1, IInventory i2, EntityHuman e1) {
}

@Override
public void b(EntityHuman paramEntityHuman) {
public void b(EntityHuman entityHuman) {
// Don't send close signal twice, might screw up
PlayerInventory playerinventory = entityHuman.inventory;

if (playerinventory.getCarried() != null) {
entityHuman.drop(playerinventory.getCarried(), false);
playerinventory.setCarried(null);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.minecraft.server.v1_8_R3.ContainerChest;
import net.minecraft.server.v1_8_R3.EntityHuman;
import net.minecraft.server.v1_8_R3.IInventory;
import net.minecraft.server.v1_8_R3.PlayerInventory;

public class SilentContainerChest extends ContainerChest {
public IInventory inv;
Expand All @@ -32,7 +33,13 @@ public SilentContainerChest(IInventory i1, IInventory i2, EntityHuman e1) {
}

@Override
public void b(EntityHuman paramEntityHuman) {
public void b(EntityHuman entityHuman) {
// Don't send close signal twice, might screw up
PlayerInventory playerinventory = entityHuman.inventory;

if (playerinventory.getCarried() != null) {
entityHuman.drop(playerinventory.getCarried(), false);
playerinventory.setCarried(null);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.minecraft.server.v1_9_R1.ContainerChest;
import net.minecraft.server.v1_9_R1.EntityHuman;
import net.minecraft.server.v1_9_R1.IInventory;
import net.minecraft.server.v1_9_R1.PlayerInventory;

public class SilentContainerChest extends ContainerChest {
public IInventory inv;
Expand All @@ -32,7 +33,13 @@ public SilentContainerChest(IInventory i1, IInventory i2, EntityHuman e1) {
}

@Override
public void b(EntityHuman paramEntityHuman) {
public void b(EntityHuman entityHuman) {
// Don't send close signal twice, might screw up
PlayerInventory playerinventory = entityHuman.inventory;

if (playerinventory.getCarried() != null) {
entityHuman.drop(playerinventory.getCarried(), false);
playerinventory.setCarried(null);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.minecraft.server.v1_9_R2.ContainerChest;
import net.minecraft.server.v1_9_R2.EntityHuman;
import net.minecraft.server.v1_9_R2.IInventory;
import net.minecraft.server.v1_9_R2.PlayerInventory;

public class SilentContainerChest extends ContainerChest {
public IInventory inv;
Expand All @@ -32,7 +33,13 @@ public SilentContainerChest(IInventory i1, IInventory i2, EntityHuman e1) {
}

@Override
public void b(EntityHuman paramEntityHuman) {
public void b(EntityHuman entityHuman) {
// Don't send close signal twice, might screw up
PlayerInventory playerinventory = entityHuman.inventory;

if (playerinventory.getCarried() != null) {
entityHuman.drop(playerinventory.getCarried(), false);
playerinventory.setCarried(null);
}
}
}
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: OpenInv
main: com.lishid.openinv.OpenInv
version: 2.4.6
version: 2.4.7
author: lishid
authors: [Jikoo]
description: >
Expand Down

0 comments on commit 53eadcb

Please sign in to comment.