Backport fix for closing SilentChest not dropping cursor item

This commit is contained in:
Jikoo
2016-06-08 22:38:21 -04:00
parent 326ffdb433
commit 53eadcb821
18 changed files with 137 additions and 18 deletions

View File

@@ -20,6 +20,7 @@ package com.lishid.openinv.internal.v1_4_5;
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;
@@ -32,7 +33,13 @@ public class SilentContainerChest extends ContainerChest {
}
@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);
}
}
}

View File

@@ -20,6 +20,7 @@ package com.lishid.openinv.internal.v1_4_6;
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;
@@ -32,7 +33,13 @@ public class SilentContainerChest extends ContainerChest {
}
@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);
}
}
}

View File

@@ -20,6 +20,7 @@ package com.lishid.openinv.internal.v1_4_R1;
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;
@@ -32,7 +33,13 @@ public class SilentContainerChest extends ContainerChest {
}
@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);
}
}
}

View File

@@ -20,6 +20,7 @@ package com.lishid.openinv.internal.v1_5_R2;
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;
@@ -32,7 +33,13 @@ public class SilentContainerChest extends ContainerChest {
}
@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);
}
}
}

View File

@@ -20,6 +20,7 @@ package com.lishid.openinv.internal.v1_5_R3;
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;
@@ -32,7 +33,13 @@ public class SilentContainerChest extends ContainerChest {
}
@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);
}
}
}

View File

@@ -20,6 +20,7 @@ package com.lishid.openinv.internal.v1_6_R1;
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;
@@ -32,7 +33,13 @@ public class SilentContainerChest extends ContainerChest {
}
@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);
}
}
}

View File

@@ -20,6 +20,7 @@ package com.lishid.openinv.internal.v1_6_R2;
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;
@@ -32,7 +33,13 @@ public class SilentContainerChest extends ContainerChest {
}
@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);
}
}
}

View File

@@ -20,6 +20,7 @@ package com.lishid.openinv.internal.v1_6_R3;
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;
@@ -32,7 +33,13 @@ public class SilentContainerChest extends ContainerChest {
}
@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);
}
}
}

View File

@@ -20,6 +20,7 @@ package com.lishid.openinv.internal.v1_7_R1;
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;
@@ -32,7 +33,13 @@ public class SilentContainerChest extends ContainerChest {
}
@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);
}
}
}

View File

@@ -20,6 +20,7 @@ package com.lishid.openinv.internal.v1_7_R2;
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;
@@ -32,7 +33,13 @@ public class SilentContainerChest extends ContainerChest {
}
@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);
}
}
}

View File

@@ -20,6 +20,7 @@ package com.lishid.openinv.internal.v1_7_R3;
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;
@@ -32,7 +33,13 @@ public class SilentContainerChest extends ContainerChest {
}
@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);
}
}
}

View File

@@ -20,6 +20,7 @@ package com.lishid.openinv.internal.v1_7_R4;
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;
@@ -32,7 +33,13 @@ public class SilentContainerChest extends ContainerChest {
}
@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);
}
}
}

View File

@@ -20,6 +20,7 @@ package com.lishid.openinv.internal.v1_8_R1;
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;
@@ -32,7 +33,13 @@ public class SilentContainerChest extends ContainerChest {
}
@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);
}
}
}

View File

@@ -20,6 +20,7 @@ package com.lishid.openinv.internal.v1_8_R2;
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;
@@ -32,7 +33,13 @@ public class SilentContainerChest extends ContainerChest {
}
@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);
}
}
}

View File

@@ -20,6 +20,7 @@ package com.lishid.openinv.internal.v1_8_R3;
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;
@@ -32,7 +33,13 @@ public class SilentContainerChest extends ContainerChest {
}
@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);
}
}
}

View File

@@ -20,6 +20,7 @@ package com.lishid.openinv.internal.v1_9_R1;
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;
@@ -32,7 +33,13 @@ public class SilentContainerChest extends ContainerChest {
}
@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);
}
}
}

View File

@@ -20,6 +20,7 @@ package com.lishid.openinv.internal.v1_9_R2;
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;
@@ -32,7 +33,13 @@ public class SilentContainerChest extends ContainerChest {
}
@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);
}
}
}