Commit 08ee097e authored by mrAppleXZ's avatar mrAppleXZ 💾

Code Storage and Magibench fixes

parent 86b7bbc9
......@@ -47,11 +47,14 @@ public class SPacketUnlock implements IMessage
{
ctx.getServerHandler().player.getServerWorld().addScheduledTask(() ->
{
boolean result = false;
TileEntity te = ctx.getServerHandler().player.world.getTileEntity(message.pos);
if(te instanceof TileCodeStorage)
{
((TileCodeStorage) te).tryUnlock(ctx.getServerHandler().player, message.code);
TileCodeStorage storage = (TileCodeStorage) te;
result = storage.tryUnlock(null, message.code);
}
NetworkManager.sendTo(new CPacketUnlockResponse(result), ctx.getServerHandler().player);
});
return null;
}
......
......@@ -34,6 +34,7 @@ public class TileMagibench extends TileSyncableComposite
{
getSerializers().add(new NBTSerializer.ReaderWriter<>(NBT_TIER, int.class, this::setTier, this::getTier));
getSerializers().add(new NBTSerializer.ReaderWriter<>(NBT_ITEMS, NBTTagCompound.class, (tag) -> handler.deserializeNBT(tag), () -> handler.serializeNBT()));
getSerializers().add(new NBTSerializer.Reader<>(NBT_ITEMS_UPDATE, NBTTagCompound.class, (tag) -> ItemStackUtils.loadSlotUpdate(tag, handler)));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment