Fix issue caused by module cleanup while backporting awarding achievement

This commit is contained in:
Jikoo 2016-12-05 19:02:43 -05:00
parent f31356b227
commit 802ce28103
7 changed files with 64 additions and 46 deletions

View file

@ -29,6 +29,7 @@ import net.minecraft.server.v1_10_R1.BlockChest;
import net.minecraft.server.v1_10_R1.BlockChest.Type;
import net.minecraft.server.v1_10_R1.BlockEnderChest;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Container;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityOcelot;
import net.minecraft.server.v1_10_R1.EntityPlayer;
@ -145,6 +146,7 @@ public class AnySilentContainer implements IAnySilentContainer {
}
Block block = world.getType(blockPosition).getBlock();
Container container = null;
if (block instanceof BlockChest) {
for (EnumDirection localEnumDirection : EnumDirection.EnumDirectionLimit.HORIZONTAL) {
@ -171,26 +173,27 @@ public class AnySilentContainer implements IAnySilentContainer {
}
if (silentchest) {
tile = new SilentContainerChest(player.inventory, ((IInventory) tile), player);
container = new SilentContainerChest(player.inventory, ((IInventory) tile), player);
}
if (((BlockChest) block).g == Type.BASIC)
if (((BlockChest) block).g == Type.BASIC) {
player.b(StatisticList.ac);
else if (((BlockChest) block).g == Type.TRAP) {
} else if (((BlockChest) block).g == Type.TRAP) {
player.b(StatisticList.W);
}
}
boolean returnValue = false;
if (!silentchest) {
player.openContainer((IInventory) tile);
final IInventory iInventory = (IInventory) tile;
if (!silentchest || container == null) {
player.openContainer(iInventory);
returnValue = true;
} else {
try {
SilentContainerChest silentContainerChest = new SilentContainerChest(player.inventory, ((IInventory) tile), player);
int windowId = player.nextContainerCounter();
player.playerConnection.sendPacket(new PacketPlayOutOpenWindow(windowId, "minecraft:chest", ((IInventory) tile).getScoreboardDisplayName(), ((IInventory) tile).getSize()));
player.activeContainer = silentContainerChest;
player.playerConnection.sendPacket(new PacketPlayOutOpenWindow(windowId, iInventory.getName(), iInventory.getScoreboardDisplayName(), iInventory.getSize()));
player.activeContainer = container;
player.activeContainer.windowId = windowId;
player.activeContainer.addSlotListener(player);
returnValue = true;

View file

@ -211,9 +211,9 @@ public class AnySilentContainer implements IAnySilentContainer {
break;
}
if (blockChest.g == Type.BASIC)
if (blockChest.g == Type.BASIC) {
player.b(StatisticList.ac);
else if (blockChest.g == Type.TRAP) {
} else if (blockChest.g == Type.TRAP) {
player.b(StatisticList.W);
}

View file

@ -28,6 +28,7 @@ import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockChest;
import net.minecraft.server.v1_8_R1.BlockEnderChest;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.Container;
import net.minecraft.server.v1_8_R1.EntityOcelot;
import net.minecraft.server.v1_8_R1.EntityPlayer;
import net.minecraft.server.v1_8_R1.EnumDirection;
@ -145,6 +146,7 @@ public class AnySilentContainer implements IAnySilentContainer {
}
Block block = world.getType(blockPosition).getBlock();
Container container = null;
if (block instanceof BlockChest) {
for (EnumDirection localEnumDirection : EnumDirection.values()) {
@ -176,20 +178,21 @@ public class AnySilentContainer implements IAnySilentContainer {
}
if (silentchest) {
tile = new SilentContainerChest(player.inventory, ((IInventory) tile), player);
container = new SilentContainerChest(player.inventory, ((IInventory) tile), player);
}
}
boolean returnValue = false;
if (!silentchest) {
player.openContainer((IInventory) tile);
final IInventory iInventory = (IInventory) tile;
if (!silentchest || container == null) {
player.openContainer(iInventory);
returnValue = true;
} else {
try {
SilentContainerChest silentContainerChest = new SilentContainerChest(player.inventory, ((IInventory) tile), player);
int windowId = player.nextContainerCounter();
player.playerConnection.sendPacket(new PacketPlayOutOpenWindow(windowId, "minecraft:chest", ((IInventory) tile).getScoreboardDisplayName(), ((IInventory) tile).getSize()));
player.activeContainer = silentContainerChest;
player.playerConnection.sendPacket(new PacketPlayOutOpenWindow(windowId, iInventory.getName(), iInventory.getScoreboardDisplayName(), iInventory.getSize()));
player.activeContainer = container;
player.activeContainer.windowId = windowId;
player.activeContainer.addSlotListener(player);
returnValue = true;

View file

@ -28,6 +28,7 @@ import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockChest;
import net.minecraft.server.v1_8_R2.BlockEnderChest;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.Container;
import net.minecraft.server.v1_8_R2.Entity;
import net.minecraft.server.v1_8_R2.EntityOcelot;
import net.minecraft.server.v1_8_R2.EntityPlayer;
@ -144,6 +145,7 @@ public class AnySilentContainer implements IAnySilentContainer {
}
Block block = world.getType(blockPosition).getBlock();
Container container = null;
if (block instanceof BlockChest) {
for (EnumDirection localEnumDirection : EnumDirection.EnumDirectionLimit.HORIZONTAL) {
@ -170,26 +172,27 @@ public class AnySilentContainer implements IAnySilentContainer {
}
if (silentchest) {
tile = new SilentContainerChest(player.inventory, ((IInventory) tile), player);
container = new SilentContainerChest(player.inventory, ((IInventory) tile), player);
}
if (((BlockChest) block).b == 0)
if (((BlockChest) block).b == 0) {
player.b(StatisticList.aa);
else if (((BlockChest) block).b == 1) {
} else if (((BlockChest) block).b == 1) {
player.b(StatisticList.U);
}
}
boolean returnValue = false;
if (!silentchest) {
player.openContainer((IInventory) tile);
final IInventory iInventory = (IInventory) tile;
if (!silentchest || container == null) {
player.openContainer(iInventory);
returnValue = true;
} else {
try {
SilentContainerChest silentContainerChest = new SilentContainerChest(player.inventory, ((IInventory) tile), player);
int windowId = player.nextContainerCounter();
player.playerConnection.sendPacket(new PacketPlayOutOpenWindow(windowId, "minecraft:chest", ((IInventory) tile).getScoreboardDisplayName(), ((IInventory) tile).getSize()));
player.activeContainer = silentContainerChest;
player.playerConnection.sendPacket(new PacketPlayOutOpenWindow(windowId, iInventory.getName(), iInventory.getScoreboardDisplayName(), iInventory.getSize()));
player.activeContainer = container;
player.activeContainer.windowId = windowId;
player.activeContainer.addSlotListener(player);
returnValue = true;

View file

@ -28,6 +28,7 @@ import net.minecraft.server.v1_8_R3.Block;
import net.minecraft.server.v1_8_R3.BlockChest;
import net.minecraft.server.v1_8_R3.BlockEnderChest;
import net.minecraft.server.v1_8_R3.BlockPosition;
import net.minecraft.server.v1_8_R3.Container;
import net.minecraft.server.v1_8_R3.Entity;
import net.minecraft.server.v1_8_R3.EntityOcelot;
import net.minecraft.server.v1_8_R3.EntityPlayer;
@ -144,6 +145,7 @@ public class AnySilentContainer implements IAnySilentContainer {
}
Block block = world.getType(blockPosition).getBlock();
Container container = null;
if (block instanceof BlockChest) {
for (EnumDirection localEnumDirection : EnumDirection.EnumDirectionLimit.HORIZONTAL) {
@ -170,26 +172,27 @@ public class AnySilentContainer implements IAnySilentContainer {
}
if (silentchest) {
tile = new SilentContainerChest(player.inventory, ((IInventory) tile), player);
container = new SilentContainerChest(player.inventory, ((IInventory) tile), player);
}
if (((BlockChest) block).b == 0)
if (((BlockChest) block).b == 0) {
player.b(StatisticList.aa);
else if (((BlockChest) block).b == 1) {
} else if (((BlockChest) block).b == 1) {
player.b(StatisticList.U);
}
}
boolean returnValue = false;
if (!silentchest) {
player.openContainer((IInventory) tile);
final IInventory iInventory = (IInventory) tile;
if (!silentchest || container == null) {
player.openContainer(iInventory);
returnValue = true;
} else {
try {
SilentContainerChest silentContainerChest = new SilentContainerChest(player.inventory, ((IInventory) tile), player);
int windowId = player.nextContainerCounter();
player.playerConnection.sendPacket(new PacketPlayOutOpenWindow(windowId, "minecraft:chest", ((IInventory) tile).getScoreboardDisplayName(), ((IInventory) tile).getSize()));
player.activeContainer = silentContainerChest;
player.playerConnection.sendPacket(new PacketPlayOutOpenWindow(windowId, iInventory.getName(), iInventory.getScoreboardDisplayName(), iInventory.getSize()));
player.activeContainer = container;
player.activeContainer.windowId = windowId;
player.activeContainer.addSlotListener(player);
returnValue = true;

View file

@ -28,6 +28,7 @@ import net.minecraft.server.v1_9_R1.Block;
import net.minecraft.server.v1_9_R1.BlockChest;
import net.minecraft.server.v1_9_R1.BlockEnderChest;
import net.minecraft.server.v1_9_R1.BlockPosition;
import net.minecraft.server.v1_9_R1.Container;
import net.minecraft.server.v1_9_R1.Entity;
import net.minecraft.server.v1_9_R1.EntityOcelot;
import net.minecraft.server.v1_9_R1.EntityPlayer;
@ -144,6 +145,7 @@ public class AnySilentContainer implements IAnySilentContainer {
}
Block block = world.getType(blockPosition).getBlock();
Container container = null;
if (block instanceof BlockChest) {
for (EnumDirection localEnumDirection : EnumDirection.EnumDirectionLimit.HORIZONTAL) {
@ -170,7 +172,7 @@ public class AnySilentContainer implements IAnySilentContainer {
}
if (silentchest) {
tile = new SilentContainerChest(player.inventory, ((IInventory) tile), player);
container = new SilentContainerChest(player.inventory, ((IInventory) tile), player);
}
if (((BlockChest) block).g == BlockChest.Type.BASIC)
@ -181,15 +183,16 @@ public class AnySilentContainer implements IAnySilentContainer {
}
boolean returnValue = false;
if (!silentchest) {
player.openContainer((IInventory) tile);
final IInventory iInventory = (IInventory) tile;
if (!silentchest || container == null) {
player.openContainer(iInventory);
returnValue = true;
} else {
try {
SilentContainerChest silentContainerChest = new SilentContainerChest(player.inventory, ((IInventory) tile), player);
int windowId = player.nextContainerCounter();
player.playerConnection.sendPacket(new PacketPlayOutOpenWindow(windowId, "minecraft:chest", ((IInventory) tile).getScoreboardDisplayName(), ((IInventory) tile).getSize()));
player.activeContainer = silentContainerChest;
player.playerConnection.sendPacket(new PacketPlayOutOpenWindow(windowId, iInventory.getName(), iInventory.getScoreboardDisplayName(), iInventory.getSize()));
player.activeContainer = container;
player.activeContainer.windowId = windowId;
player.activeContainer.addSlotListener(player);
returnValue = true;

View file

@ -28,6 +28,7 @@ import net.minecraft.server.v1_9_R2.Block;
import net.minecraft.server.v1_9_R2.BlockChest;
import net.minecraft.server.v1_9_R2.BlockEnderChest;
import net.minecraft.server.v1_9_R2.BlockPosition;
import net.minecraft.server.v1_9_R2.Container;
import net.minecraft.server.v1_9_R2.Entity;
import net.minecraft.server.v1_9_R2.EntityOcelot;
import net.minecraft.server.v1_9_R2.EntityPlayer;
@ -144,6 +145,7 @@ public class AnySilentContainer implements IAnySilentContainer {
}
Block block = world.getType(blockPosition).getBlock();
Container container = null;
if (block instanceof BlockChest) {
for (EnumDirection localEnumDirection : EnumDirection.EnumDirectionLimit.HORIZONTAL) {
@ -170,26 +172,27 @@ public class AnySilentContainer implements IAnySilentContainer {
}
if (silentchest) {
tile = new SilentContainerChest(player.inventory, ((IInventory) tile), player);
container = new SilentContainerChest(player.inventory, ((IInventory) tile), player);
}
if (((BlockChest) block).g == BlockChest.Type.BASIC)
if (((BlockChest) block).g == BlockChest.Type.BASIC) {
player.b(StatisticList.ac);
else if (((BlockChest) block).g == BlockChest.Type.TRAP) {
} else if (((BlockChest) block).g == BlockChest.Type.TRAP) {
player.b(StatisticList.W);
}
}
boolean returnValue = false;
if (!silentchest) {
player.openContainer((IInventory) tile);
final IInventory iInventory = (IInventory) tile;
if (!silentchest || container == null) {
player.openContainer(iInventory);
returnValue = true;
} else {
try {
SilentContainerChest silentContainerChest = new SilentContainerChest(player.inventory, ((IInventory) tile), player);
int windowId = player.nextContainerCounter();
player.playerConnection.sendPacket(new PacketPlayOutOpenWindow(windowId, "minecraft:chest", ((IInventory) tile).getScoreboardDisplayName(), ((IInventory) tile).getSize()));
player.activeContainer = silentContainerChest;
player.playerConnection.sendPacket(new PacketPlayOutOpenWindow(windowId, iInventory.getName(), iInventory.getScoreboardDisplayName(), iInventory.getSize()));
player.activeContainer = container;
player.activeContainer.windowId = windowId;
player.activeContainer.addSlotListener(player);
returnValue = true;