generated from tilera/1710mod
feat: implement void interface
This commit is contained in:
parent
e3169b2067
commit
b1fdb881e0
|
@ -6,6 +6,8 @@ import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import net.anvilcraft.thaummach.entities.EntitySingularity;
|
import net.anvilcraft.thaummach.entities.EntitySingularity;
|
||||||
import net.anvilcraft.thaummach.gui.GuiBore;
|
import net.anvilcraft.thaummach.gui.GuiBore;
|
||||||
|
import net.anvilcraft.thaummach.gui.GuiVoidChest;
|
||||||
|
import net.anvilcraft.thaummach.gui.GuiVoidInterface;
|
||||||
import net.anvilcraft.thaummach.render.BlockApparatusRenderer;
|
import net.anvilcraft.thaummach.render.BlockApparatusRenderer;
|
||||||
import net.anvilcraft.thaummach.render.TileSealRenderer;
|
import net.anvilcraft.thaummach.render.TileSealRenderer;
|
||||||
import net.anvilcraft.thaummach.render.entity.EntitySingularityRenderer;
|
import net.anvilcraft.thaummach.render.entity.EntitySingularityRenderer;
|
||||||
|
@ -87,6 +89,12 @@ public class ClientProxy extends CommonProxy {
|
||||||
case BORE:
|
case BORE:
|
||||||
return new GuiBore(player.inventory, (TileBore) te);
|
return new GuiBore(player.inventory, (TileBore) te);
|
||||||
|
|
||||||
|
case VOID_CHEST:
|
||||||
|
return new GuiVoidChest(player.inventory, (TileVoidChest) te);
|
||||||
|
|
||||||
|
case VOID_INTERFACE:
|
||||||
|
return new GuiVoidInterface(player.inventory, (TileVoidInterface) te);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new IllegalArgumentException("ALEC");
|
throw new IllegalArgumentException("ALEC");
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,8 @@ package net.anvilcraft.thaummach;
|
||||||
import cpw.mods.fml.common.network.IGuiHandler;
|
import cpw.mods.fml.common.network.IGuiHandler;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import net.anvilcraft.thaummach.container.ContainerBore;
|
import net.anvilcraft.thaummach.container.ContainerBore;
|
||||||
|
import net.anvilcraft.thaummach.container.ContainerVoidChest;
|
||||||
|
import net.anvilcraft.thaummach.container.ContainerVoidInterface;
|
||||||
import net.anvilcraft.thaummach.tiles.TileBore;
|
import net.anvilcraft.thaummach.tiles.TileBore;
|
||||||
import net.anvilcraft.thaummach.tiles.TileConduit;
|
import net.anvilcraft.thaummach.tiles.TileConduit;
|
||||||
import net.anvilcraft.thaummach.tiles.TileConduitPump;
|
import net.anvilcraft.thaummach.tiles.TileConduitPump;
|
||||||
|
@ -53,6 +55,14 @@ public class CommonProxy implements IGuiHandler {
|
||||||
case BORE:
|
case BORE:
|
||||||
return new ContainerBore(player.inventory, (TileBore) te);
|
return new ContainerBore(player.inventory, (TileBore) te);
|
||||||
|
|
||||||
|
case VOID_CHEST:
|
||||||
|
return new ContainerVoidChest(player.inventory, (TileVoidChest) te);
|
||||||
|
|
||||||
|
case VOID_INTERFACE:
|
||||||
|
return new ContainerVoidInterface(
|
||||||
|
player.inventory, (TileVoidInterface) te
|
||||||
|
);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new IllegalArgumentException("ALEC");
|
throw new IllegalArgumentException("ALEC");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
package net.anvilcraft.thaummach;
|
package net.anvilcraft.thaummach;
|
||||||
|
|
||||||
public enum GuiID {
|
public enum GuiID {
|
||||||
BORE;
|
BORE,
|
||||||
|
VOID_CHEST,
|
||||||
|
VOID_INTERFACE;
|
||||||
|
|
||||||
public static GuiID get(int id) {
|
public static GuiID get(int id) {
|
||||||
if (id >= 0 && id < GuiID.values().length) {
|
if (id >= 0 && id < GuiID.values().length) {
|
||||||
|
|
|
@ -4,6 +4,7 @@ import cpw.mods.fml.common.Mod;
|
||||||
import cpw.mods.fml.common.SidedProxy;
|
import cpw.mods.fml.common.SidedProxy;
|
||||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLServerAboutToStartEvent;
|
||||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||||
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
||||||
|
@ -12,8 +13,12 @@ import cpw.mods.fml.relauncher.Side;
|
||||||
import dev.tilera.auracore.api.HelperLocation;
|
import dev.tilera.auracore.api.HelperLocation;
|
||||||
import net.anvilcraft.thaummach.entities.EntitySingularity;
|
import net.anvilcraft.thaummach.entities.EntitySingularity;
|
||||||
import net.anvilcraft.thaummach.packets.IPacketFX;
|
import net.anvilcraft.thaummach.packets.IPacketFX;
|
||||||
|
import net.anvilcraft.thaummach.packets.PacketChangeVoidInterfaceChannel;
|
||||||
|
import net.anvilcraft.thaummach.packets.PacketChangeVoidInterfaceContainerPage;
|
||||||
import net.anvilcraft.thaummach.packets.PacketFXSparkle;
|
import net.anvilcraft.thaummach.packets.PacketFXSparkle;
|
||||||
import net.anvilcraft.thaummach.packets.PacketFXWisp;
|
import net.anvilcraft.thaummach.packets.PacketFXWisp;
|
||||||
|
import net.anvilcraft.thaummach.tiles.TileSeal;
|
||||||
|
import net.anvilcraft.thaummach.tiles.TileVoidInterface;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
@Mod(modid = "thaummach")
|
@Mod(modid = "thaummach")
|
||||||
|
@ -40,6 +45,18 @@ public class ThaumicMachinery {
|
||||||
channel.registerMessage(
|
channel.registerMessage(
|
||||||
new PacketFXSparkle.Handler(), PacketFXSparkle.class, pktid++, Side.CLIENT
|
new PacketFXSparkle.Handler(), PacketFXSparkle.class, pktid++, Side.CLIENT
|
||||||
);
|
);
|
||||||
|
channel.registerMessage(
|
||||||
|
new PacketChangeVoidInterfaceChannel.Handler(),
|
||||||
|
PacketChangeVoidInterfaceChannel.class,
|
||||||
|
pktid++,
|
||||||
|
Side.SERVER
|
||||||
|
);
|
||||||
|
channel.registerMessage(
|
||||||
|
new PacketChangeVoidInterfaceContainerPage.Handler(),
|
||||||
|
PacketChangeVoidInterfaceContainerPage.class,
|
||||||
|
pktid++,
|
||||||
|
Side.SERVER
|
||||||
|
);
|
||||||
|
|
||||||
NetworkRegistry.INSTANCE.registerGuiHandler(this, proxy);
|
NetworkRegistry.INSTANCE.registerGuiHandler(this, proxy);
|
||||||
|
|
||||||
|
@ -58,6 +75,12 @@ public class ThaumicMachinery {
|
||||||
proxy.init();
|
proxy.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Mod.EventHandler
|
||||||
|
public void onServerAboutToStart(FMLServerAboutToStartEvent ev) {
|
||||||
|
TileVoidInterface.VOID_INTERFACES.clear();
|
||||||
|
TileSeal.SEALS.clear();
|
||||||
|
}
|
||||||
|
|
||||||
public static void sendFXPacket(World worldObj, IPacketFX pkt) {
|
public static void sendFXPacket(World worldObj, IPacketFX pkt) {
|
||||||
HelperLocation loc = pkt.getLocation();
|
HelperLocation loc = pkt.getLocation();
|
||||||
channel.sendToAllAround(
|
channel.sendToAllAround(
|
||||||
|
|
|
@ -696,7 +696,7 @@ public class BlockApparatusMetal extends BlockApparatus {
|
||||||
|
|
||||||
if (meta == MetaVals.VOID_INTERFACE) {
|
if (meta == MetaVals.VOID_INTERFACE) {
|
||||||
TileVoidInterface tvi = (TileVoidInterface) w.getTileEntity(i, j, k);
|
TileVoidInterface tvi = (TileVoidInterface) w.getTileEntity(i, j, k);
|
||||||
if (tvi != null && tvi.linked && w.rand.nextInt(10) == 0) {
|
if (tvi != null && tvi.getLinkedSize() > 1 && w.rand.nextInt(10) == 0) {
|
||||||
FXLightningBolt bolt = new FXLightningBolt(
|
FXLightningBolt bolt = new FXLightningBolt(
|
||||||
w,
|
w,
|
||||||
new WRVector3((double) i + 0.5, (double) j + 0.75, (double) k + 0.5),
|
new WRVector3((double) i + 0.5, (double) j + 0.75, (double) k + 0.5),
|
||||||
|
|
|
@ -0,0 +1,82 @@
|
||||||
|
package net.anvilcraft.thaummach.container;
|
||||||
|
|
||||||
|
import net.anvilcraft.thaummach.tiles.TileVoidChest;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.inventory.Container;
|
||||||
|
import net.minecraft.inventory.Slot;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class ContainerVoidChest extends Container {
|
||||||
|
private TileVoidChest vchest;
|
||||||
|
|
||||||
|
public ContainerVoidChest(InventoryPlayer inventoryplayer, TileVoidChest vc) {
|
||||||
|
this.vchest = vc;
|
||||||
|
|
||||||
|
vc.openInventory();
|
||||||
|
|
||||||
|
int j;
|
||||||
|
int k;
|
||||||
|
for (j = 0; j < 8; ++j) {
|
||||||
|
for (k = 0; k < 9; ++k) {
|
||||||
|
this.addSlotToContainer(new Slot(vc, k + j * 9, 8 + k * 18, 9 + j * 18));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (j = 0; j < 3; ++j) {
|
||||||
|
for (k = 0; k < 9; ++k) {
|
||||||
|
this.addSlotToContainer(
|
||||||
|
new Slot(inventoryplayer, k + j * 9 + 9, 8 + k * 18, 158 + j * 18)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (j = 0; j < 9; ++j) {
|
||||||
|
this.addSlotToContainer(new Slot(inventoryplayer, j, 8 + j * 18, 216));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer entityplayer) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack transferStackInSlot(EntityPlayer player, int i) {
|
||||||
|
ItemStack itemstack = null;
|
||||||
|
Slot slot = (Slot) super.inventorySlots.get(i);
|
||||||
|
if (slot != null && slot.getHasStack()) {
|
||||||
|
ItemStack itemstack1 = slot.getStack();
|
||||||
|
itemstack = itemstack1.copy();
|
||||||
|
if (i < 72) {
|
||||||
|
if (!this.mergeItemStack(itemstack1, 72, 108, true)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} else if (i >= 72 && i <= 108) {
|
||||||
|
if (!this.mergeItemStack(itemstack1, 0, 72, false)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} else if (!this.mergeItemStack(itemstack1, 72, 108, false)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemstack1.stackSize == 0) {
|
||||||
|
slot.putStack((ItemStack) null);
|
||||||
|
} else {
|
||||||
|
slot.onSlotChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemstack1.stackSize == itemstack.stackSize) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return itemstack;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onContainerClosed(EntityPlayer player) {
|
||||||
|
super.onContainerClosed(player);
|
||||||
|
this.vchest.closeInventory();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,135 @@
|
||||||
|
package net.anvilcraft.thaummach.container;
|
||||||
|
|
||||||
|
import net.anvilcraft.thaummach.tiles.TileVoidInterface;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.inventory.Container;
|
||||||
|
import net.minecraft.inventory.IInventory;
|
||||||
|
import net.minecraft.inventory.Slot;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class ContainerVoidInterface extends Container {
|
||||||
|
public TileVoidInterface vinter;
|
||||||
|
|
||||||
|
public ItemStack[] clientItems = new ItemStack[72];
|
||||||
|
|
||||||
|
public ContainerVoidInterface(InventoryPlayer inventoryplayer, TileVoidInterface vc) {
|
||||||
|
this.vinter = vc;
|
||||||
|
|
||||||
|
int j;
|
||||||
|
int k;
|
||||||
|
for (j = 0; j < 8; ++j) {
|
||||||
|
for (k = 0; k < 9; ++k) {
|
||||||
|
this.addSlotToContainer(
|
||||||
|
new SlotVoidInterface(vc, 72 + k + j * 9, 8 + k * 18, 9 + j * 18)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (j = 0; j < 3; ++j) {
|
||||||
|
for (k = 0; k < 9; ++k) {
|
||||||
|
this.addSlotToContainer(
|
||||||
|
new Slot(inventoryplayer, k + j * 9 + 9, 8 + k * 18, 158 + j * 18)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (j = 0; j < 9; ++j) {
|
||||||
|
this.addSlotToContainer(new Slot(inventoryplayer, j, 8 + j * 18, 216));
|
||||||
|
}
|
||||||
|
|
||||||
|
this.vinter.openInventory();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer entityplayer) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack transferStackInSlot(EntityPlayer player, int i) {
|
||||||
|
ItemStack itemstack = null;
|
||||||
|
Slot slot = (Slot) super.inventorySlots.get(i);
|
||||||
|
if (slot != null && slot.getHasStack()) {
|
||||||
|
ItemStack itemstack1 = slot.getStack();
|
||||||
|
itemstack = itemstack1.copy();
|
||||||
|
if (i < 72) {
|
||||||
|
if (!this.mergeItemStack(itemstack1, 72, 108, true)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} else if (i >= 72 && i <= 108) {
|
||||||
|
if (!this.mergeItemStack(itemstack1, 0, 72, false)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} else if (!this.mergeItemStack(itemstack1, 72, 108, false)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemstack1.stackSize == 0) {
|
||||||
|
slot.putStack((ItemStack) null);
|
||||||
|
} else {
|
||||||
|
slot.onSlotChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemstack1.stackSize == itemstack.stackSize) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return itemstack;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onContainerClosed(EntityPlayer player) {
|
||||||
|
super.onContainerClosed(player);
|
||||||
|
this.vinter.closeInventory();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SlotVoidInterface extends Slot {
|
||||||
|
public SlotVoidInterface(
|
||||||
|
IInventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_
|
||||||
|
) {
|
||||||
|
super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack getStack() {
|
||||||
|
if (ContainerVoidInterface.this.vinter.getWorldObj().isRemote)
|
||||||
|
return ContainerVoidInterface.this.clientItems[this.slotNumber];
|
||||||
|
|
||||||
|
return ((TileVoidInterface) this.inventory)
|
||||||
|
.getStackInSlotForCurrentLink(this.slotNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack decrStackSize(int i) {
|
||||||
|
if (ContainerVoidInterface.this.vinter.getWorldObj().isRemote) {
|
||||||
|
ItemStack stack
|
||||||
|
= ContainerVoidInterface.this.clientItems[this.slotNumber];
|
||||||
|
if (stack == null)
|
||||||
|
return null;
|
||||||
|
if (stack.stackSize <= i) {
|
||||||
|
ContainerVoidInterface.this.clientItems[this.slotNumber] = null;
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
|
||||||
|
return stack.splitStack(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ((TileVoidInterface) this.inventory)
|
||||||
|
.decrStackSizeForCurrentLink(this.slotNumber, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void putStack(ItemStack stack) {
|
||||||
|
if (ContainerVoidInterface.this.vinter.getWorldObj().isRemote) {
|
||||||
|
ContainerVoidInterface.this.clientItems[this.slotNumber] = stack;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
((TileVoidInterface) this.inventory)
|
||||||
|
.setInventorySlotContentsForCurrentLink(this.slotNumber, stack);
|
||||||
|
this.onSlotChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
27
src/main/java/net/anvilcraft/thaummach/gui/GuiVoidChest.java
Normal file
27
src/main/java/net/anvilcraft/thaummach/gui/GuiVoidChest.java
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
package net.anvilcraft.thaummach.gui;
|
||||||
|
|
||||||
|
import net.anvilcraft.thaummach.container.ContainerVoidChest;
|
||||||
|
import net.anvilcraft.thaummach.tiles.TileVoidChest;
|
||||||
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
public class GuiVoidChest extends GuiContainer {
|
||||||
|
public GuiVoidChest(InventoryPlayer inventoryplayer, TileVoidChest vc) {
|
||||||
|
super(new ContainerVoidChest(inventoryplayer, vc));
|
||||||
|
super.ySize = 239;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void drawGuiContainerForegroundLayer() {}
|
||||||
|
|
||||||
|
protected void drawGuiContainerBackgroundLayer(float f, int qq, int ww) {
|
||||||
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
super.mc.renderEngine.bindTexture(
|
||||||
|
new ResourceLocation("thaummach", "textures/guis/voidchest.png")
|
||||||
|
);
|
||||||
|
int j = (super.width - super.xSize) / 2;
|
||||||
|
int k = (super.height - super.ySize) / 2;
|
||||||
|
this.drawTexturedModalRect(j, k, 0, 0, super.xSize, super.ySize);
|
||||||
|
}
|
||||||
|
}
|
121
src/main/java/net/anvilcraft/thaummach/gui/GuiVoidInterface.java
Normal file
121
src/main/java/net/anvilcraft/thaummach/gui/GuiVoidInterface.java
Normal file
|
@ -0,0 +1,121 @@
|
||||||
|
package net.anvilcraft.thaummach.gui;
|
||||||
|
|
||||||
|
import net.anvilcraft.thaummach.ThaumicMachinery;
|
||||||
|
import net.anvilcraft.thaummach.container.ContainerVoidInterface;
|
||||||
|
import net.anvilcraft.thaummach.packets.PacketChangeVoidInterfaceChannel;
|
||||||
|
import net.anvilcraft.thaummach.packets.PacketChangeVoidInterfaceContainerPage;
|
||||||
|
import net.anvilcraft.thaummach.tiles.TileVoidInterface;
|
||||||
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
public class GuiVoidInterface extends GuiContainer {
|
||||||
|
TileVoidInterface voidInventory;
|
||||||
|
|
||||||
|
public GuiVoidInterface(InventoryPlayer inventoryplayer, TileVoidInterface vc) {
|
||||||
|
super(new ContainerVoidInterface(inventoryplayer, vc));
|
||||||
|
this.voidInventory = vc;
|
||||||
|
super.ySize = 239;
|
||||||
|
super.xSize = 219;
|
||||||
|
vc.openInventory();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void drawGuiContainerForegroundLayer(int alec1, int alec2) {
|
||||||
|
if (this.voidInventory.getLinkedSize() > 1) {
|
||||||
|
super.fontRendererObj.drawStringWithShadow(
|
||||||
|
this.voidInventory.current + 1 + "/" + this.voidInventory.getLinkedSize(),
|
||||||
|
195,
|
||||||
|
88,
|
||||||
|
0x704070
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void drawGuiContainerBackgroundLayer(float f, int qq, int ww) {
|
||||||
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
super.mc.renderEngine.bindTexture(
|
||||||
|
new ResourceLocation("thaummach", "textures/guis/void_interface.png")
|
||||||
|
);
|
||||||
|
int j = (super.width - super.xSize) / 2;
|
||||||
|
int k = (super.height - super.ySize) / 2;
|
||||||
|
this.drawTexturedModalRect(j, k, 0, 0, super.xSize, super.ySize);
|
||||||
|
this.drawTexturedModalRect(
|
||||||
|
j + 178, k + 24, 224, this.voidInventory.network * 32, 32, 32
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void mouseClicked(int i, int j, int k) {
|
||||||
|
super.mouseClicked(i, j, k);
|
||||||
|
int sx = (super.width - super.xSize) / 2;
|
||||||
|
int sy = (super.height - super.ySize) / 2;
|
||||||
|
int k1 = i - (sx + 178);
|
||||||
|
int l1 = j - (sy + 64);
|
||||||
|
if (k1 >= 0 && l1 >= 0 && k1 < 14 && l1 <= 28) {
|
||||||
|
this.voidInventory.getWorldObj().playSoundEffect(
|
||||||
|
(double) this.voidInventory.xCoord + 0.5,
|
||||||
|
(double) this.voidInventory.yCoord + 0.5,
|
||||||
|
(double) this.voidInventory.zCoord + 0.5,
|
||||||
|
"random.click",
|
||||||
|
0.1F,
|
||||||
|
0.6F
|
||||||
|
);
|
||||||
|
if (this.voidInventory.current > 0) {
|
||||||
|
--this.voidInventory.current;
|
||||||
|
ThaumicMachinery.channel.sendToServer(
|
||||||
|
new PacketChangeVoidInterfaceContainerPage(this.voidInventory.current)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
k1 = i - (sx + 178);
|
||||||
|
l1 = j - (sy + 92);
|
||||||
|
if (k1 >= 0 && l1 >= 0 && k1 < 14 && l1 <= 28) {
|
||||||
|
this.voidInventory.getWorldObj().playSoundEffect(
|
||||||
|
(double) this.voidInventory.xCoord + 0.5,
|
||||||
|
(double) this.voidInventory.yCoord + 0.5,
|
||||||
|
(double) this.voidInventory.zCoord + 0.5,
|
||||||
|
"random.click",
|
||||||
|
0.1F,
|
||||||
|
0.8F
|
||||||
|
);
|
||||||
|
|
||||||
|
if (this.voidInventory.current < this.voidInventory.getLinkedSize() - 1) {
|
||||||
|
++this.voidInventory.current;
|
||||||
|
ThaumicMachinery.channel.sendToServer(
|
||||||
|
new PacketChangeVoidInterfaceContainerPage(this.voidInventory.current)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
k1 = i - (sx + 178);
|
||||||
|
l1 = j - (sy + 24);
|
||||||
|
if (k1 >= 0 && l1 >= 0 && k1 < 32 && l1 <= 32) {
|
||||||
|
this.voidInventory.getWorldObj().playSoundEffect(
|
||||||
|
(double) this.voidInventory.xCoord + 0.5,
|
||||||
|
(double) this.voidInventory.yCoord + 0.5,
|
||||||
|
(double) this.voidInventory.zCoord + 0.5,
|
||||||
|
"random.click",
|
||||||
|
0.1F,
|
||||||
|
0.8F
|
||||||
|
);
|
||||||
|
|
||||||
|
byte newChannel = (byte) (this.voidInventory.network + (k == 0 ? 1 : -1));
|
||||||
|
|
||||||
|
if (newChannel < 0)
|
||||||
|
newChannel = 5;
|
||||||
|
else if (newChannel >= 6)
|
||||||
|
newChannel = 0;
|
||||||
|
|
||||||
|
ThaumicMachinery.channel.sendToServer(new PacketChangeVoidInterfaceChannel(
|
||||||
|
this.voidInventory.xCoord,
|
||||||
|
this.voidInventory.yCoord,
|
||||||
|
this.voidInventory.zCoord,
|
||||||
|
newChannel
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,74 @@
|
||||||
|
package net.anvilcraft.thaummach.packets;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||||
|
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||||
|
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||||
|
import io.netty.buffer.ByteBuf;
|
||||||
|
import net.anvilcraft.thaummach.RuneTileData;
|
||||||
|
import net.anvilcraft.thaummach.tiles.TileVoidInterface;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class PacketChangeVoidInterfaceChannel implements IMessage {
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
int z;
|
||||||
|
byte channel;
|
||||||
|
|
||||||
|
public PacketChangeVoidInterfaceChannel() {}
|
||||||
|
|
||||||
|
public PacketChangeVoidInterfaceChannel(int x, int y, int z, byte channel) {
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
this.z = z;
|
||||||
|
this.channel = channel;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void fromBytes(ByteBuf buf) {
|
||||||
|
this.x = buf.readInt();
|
||||||
|
this.y = buf.readInt();
|
||||||
|
this.z = buf.readInt();
|
||||||
|
this.channel = buf.readByte();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void toBytes(ByteBuf buf) {
|
||||||
|
buf.writeInt(this.x);
|
||||||
|
buf.writeInt(this.y);
|
||||||
|
buf.writeInt(this.z);
|
||||||
|
buf.writeByte(this.channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Handler
|
||||||
|
implements IMessageHandler<PacketChangeVoidInterfaceChannel, IMessage> {
|
||||||
|
@Override
|
||||||
|
public IMessage
|
||||||
|
onMessage(PacketChangeVoidInterfaceChannel msg, MessageContext ctx) {
|
||||||
|
World world = ctx.getServerHandler().playerEntity.worldObj;
|
||||||
|
TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z);
|
||||||
|
|
||||||
|
if (!(te instanceof TileVoidInterface))
|
||||||
|
return null;
|
||||||
|
|
||||||
|
TileVoidInterface vi = (TileVoidInterface) te;
|
||||||
|
|
||||||
|
if (msg.channel >= 0 && msg.channel < 6) {
|
||||||
|
for (RuneTileData rtd : TileVoidInterface.VOID_INTERFACES) {
|
||||||
|
if (rtd.x == vi.xCoord && rtd.y == vi.yCoord && rtd.z == vi.zCoord
|
||||||
|
&& rtd.dim == vi.getWorldObj().provider.dimensionId) {
|
||||||
|
rtd.rune = msg.channel;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
vi.network = msg.channel;
|
||||||
|
vi.invalidateLinks();
|
||||||
|
}
|
||||||
|
|
||||||
|
world.markBlockForUpdate(msg.x, msg.y, msg.z);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,53 @@
|
||||||
|
package net.anvilcraft.thaummach.packets;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||||
|
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||||
|
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||||
|
import io.netty.buffer.ByteBuf;
|
||||||
|
import net.anvilcraft.thaummach.container.ContainerVoidInterface;
|
||||||
|
import net.minecraft.inventory.Container;
|
||||||
|
|
||||||
|
public class PacketChangeVoidInterfaceContainerPage implements IMessage {
|
||||||
|
int page;
|
||||||
|
|
||||||
|
public PacketChangeVoidInterfaceContainerPage() {}
|
||||||
|
|
||||||
|
public PacketChangeVoidInterfaceContainerPage(int page) {
|
||||||
|
this.page = page;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void fromBytes(ByteBuf buf) {
|
||||||
|
this.page = buf.readInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void toBytes(ByteBuf buf) {
|
||||||
|
buf.writeInt(this.page);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Handler
|
||||||
|
implements IMessageHandler<PacketChangeVoidInterfaceContainerPage, IMessage> {
|
||||||
|
@Override
|
||||||
|
public IMessage
|
||||||
|
onMessage(PacketChangeVoidInterfaceContainerPage msg, MessageContext ctx) {
|
||||||
|
Container container = ctx.getServerHandler().playerEntity.openContainer;
|
||||||
|
|
||||||
|
if (!(container instanceof ContainerVoidInterface))
|
||||||
|
return null;
|
||||||
|
|
||||||
|
ContainerVoidInterface cvi = (ContainerVoidInterface) container;
|
||||||
|
|
||||||
|
if (msg.page >= 0 && msg.page < cvi.vinter.getLinkedSize()) {
|
||||||
|
cvi.vinter.current = msg.page;
|
||||||
|
cvi.detectAndSendChanges();
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx.getServerHandler().playerEntity.worldObj.markBlockForUpdate(
|
||||||
|
cvi.vinter.xCoord, cvi.vinter.yCoord, cvi.vinter.zCoord
|
||||||
|
);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -135,7 +135,7 @@ public class TileBore extends TileEntity implements ISidedInventory, ITileGui {
|
||||||
(double) super.xCoord,
|
(double) super.xCoord,
|
||||||
(double) super.yCoord,
|
(double) super.yCoord,
|
||||||
(double) super.zCoord,
|
(double) super.zCoord,
|
||||||
"mob.slimeattack",
|
"mob.slime.attack",
|
||||||
0.3F,
|
0.3F,
|
||||||
0.1F + super.worldObj.rand.nextFloat() * 0.3F
|
0.1F + super.worldObj.rand.nextFloat() * 0.3F
|
||||||
);
|
);
|
||||||
|
|
|
@ -2,22 +2,22 @@ package net.anvilcraft.thaummach.tiles;
|
||||||
|
|
||||||
import java.util.stream.IntStream;
|
import java.util.stream.IntStream;
|
||||||
|
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.anvilcraft.thaummach.GuiID;
|
||||||
|
import net.anvilcraft.thaummach.ITileGui;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.IInventory;
|
|
||||||
import net.minecraft.inventory.ISidedInventory;
|
import net.minecraft.inventory.ISidedInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.nbt.NBTTagList;
|
import net.minecraft.nbt.NBTTagList;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
public class TileVoidChest extends TileEntity implements ISidedInventory {
|
public class TileVoidChest extends TileEntity implements ISidedInventory, ITileGui {
|
||||||
private ItemStack[] vcItemStacks = new ItemStack[72];
|
public ItemStack[] vcItemStacks = new ItemStack[72];
|
||||||
|
|
||||||
// TODO: GUIs
|
@Override
|
||||||
//public GuiScreen getGui(EntityPlayer player) {
|
public GuiID getGuiID() {
|
||||||
// return new GuiVoidChest(player.inventory, this);
|
return GuiID.VOID_CHEST;
|
||||||
//}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void invalidate() {
|
public void invalidate() {
|
||||||
|
@ -129,7 +129,16 @@ public class TileVoidChest extends TileEntity implements ISidedInventory {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void openInventory() {}
|
public void openInventory() {
|
||||||
|
super.worldObj.playSoundEffect(
|
||||||
|
(double) ((float) super.xCoord + 0.5F),
|
||||||
|
(double) ((float) super.yCoord + 0.5F),
|
||||||
|
(double) ((float) super.zCoord + 0.5F),
|
||||||
|
"thaummach:stoneopen",
|
||||||
|
1.0F,
|
||||||
|
1.0F
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasCustomInventoryName() {
|
public boolean hasCustomInventoryName() {
|
||||||
|
|
|
@ -2,29 +2,41 @@ package net.anvilcraft.thaummach.tiles;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.IntStream;
|
import java.util.stream.IntStream;
|
||||||
|
|
||||||
import dev.tilera.auracore.api.HelperLocation;
|
import dev.tilera.auracore.api.HelperLocation;
|
||||||
|
import net.anvilcraft.thaummach.GuiID;
|
||||||
|
import net.anvilcraft.thaummach.ITileGui;
|
||||||
import net.anvilcraft.thaummach.RuneTileData;
|
import net.anvilcraft.thaummach.RuneTileData;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.inventory.ISidedInventory;
|
import net.minecraft.inventory.ISidedInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.network.NetworkManager;
|
||||||
|
import net.minecraft.network.Packet;
|
||||||
|
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
public class TileVoidInterface extends TileEntity implements ISidedInventory {
|
public class TileVoidInterface extends TileEntity implements ISidedInventory, ITileGui {
|
||||||
// TODO: WTF
|
// TODO: WTF
|
||||||
public static Set<RuneTileData> VOID_INTERFACES = new HashSet<>();
|
public static Set<RuneTileData> VOID_INTERFACES = new HashSet<>();
|
||||||
public byte network = 0;
|
public byte network = 0;
|
||||||
public ArrayList<HelperLocation> links = new ArrayList<>();
|
public ArrayList<HelperLocation> links = new ArrayList<>();
|
||||||
public boolean linked = false;
|
|
||||||
public int current = 0;
|
public int current = 0;
|
||||||
public boolean init = false;
|
public boolean init = false;
|
||||||
|
|
||||||
|
private int linkSize;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GuiID getGuiID() {
|
||||||
|
return GuiID.VOID_INTERFACE;
|
||||||
|
}
|
||||||
|
|
||||||
public int getLinkedSize() {
|
public int getLinkedSize() {
|
||||||
return this.links.size();
|
return this.worldObj.isRemote ? this.linkSize : this.links.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -74,34 +86,17 @@ public class TileVoidInterface extends TileEntity implements ISidedInventory {
|
||||||
} catch (Exception var6) {}
|
} catch (Exception var6) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: WTF
|
public ItemStack getStackInSlotForCurrentLink(int i) {
|
||||||
//@Override
|
return this.getStackInSlot(i + this.current * 72);
|
||||||
//public ItemStack getStackInSlotVirtual(int i) {
|
}
|
||||||
// try {
|
|
||||||
// return this.getInventory(this.links.get(this.current)).getStackInSlot(i %
|
|
||||||
// 72);
|
|
||||||
// } catch (Exception var3) {
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
//@Override
|
public ItemStack decrStackSizeForCurrentLink(int i, int j) {
|
||||||
//public ItemStack decrStackSizeVirtual(int i, int j) {
|
return this.decrStackSize(i + this.current * 72, j);
|
||||||
// try {
|
}
|
||||||
// return this.getInventory(this.links.get(this.current))
|
|
||||||
// .decrStackSize(i % 72, j);
|
|
||||||
// } catch (Exception var4) {
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
//@Override
|
public void setInventorySlotContentsForCurrentLink(int i, ItemStack stack) {
|
||||||
//public void setInventorySlotContentsVirtual(int i, ItemStack itemstack) {
|
this.setInventorySlotContents(i + this.current * 72, stack);
|
||||||
// try {
|
}
|
||||||
// this.getInventory(this.links.get(this.current))
|
|
||||||
// .setInventorySlotContents(i % 72, itemstack);
|
|
||||||
// } catch (Exception var4) {}
|
|
||||||
//}
|
|
||||||
|
|
||||||
public void establishLinks() {
|
public void establishLinks() {
|
||||||
this.current = 0;
|
this.current = 0;
|
||||||
|
@ -130,30 +125,50 @@ public class TileVoidInterface extends TileEntity implements ISidedInventory {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.linked = this.links.size() > 1;
|
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void invalidateLinks() {
|
public void invalidateLinks() {
|
||||||
for (RuneTileData rtd : VOID_INTERFACES) {
|
Iterator<RuneTileData> iter = VOID_INTERFACES.iterator();
|
||||||
if (rtd.rune != this.network)
|
while (iter.hasNext()) {
|
||||||
|
RuneTileData rtd = iter.next();
|
||||||
|
if (rtd.dim != this.worldObj.provider.dimensionId)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
TileEntity te = this.worldObj.getTileEntity(rtd.x, rtd.y, rtd.z);
|
TileEntity te = this.worldObj.getTileEntity(rtd.x, rtd.y, rtd.z);
|
||||||
if (!(te instanceof TileVoidInterface)) {
|
if (!(te instanceof TileVoidInterface)) {
|
||||||
VOID_INTERFACES.remove(rtd);
|
iter.remove();
|
||||||
// TODO: WTF WTF WTF WTF
|
} else {
|
||||||
this.invalidateLinks();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (te != null) {
|
|
||||||
TileVoidInterface tvi = (TileVoidInterface) te;
|
TileVoidInterface tvi = (TileVoidInterface) te;
|
||||||
tvi.markDirty();
|
|
||||||
tvi.clearLinks();
|
tvi.clearLinks();
|
||||||
|
this.worldObj.markBlockForUpdate(tvi.xCoord, tvi.yCoord, tvi.zCoord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//public void invalidateLinks() {
|
||||||
|
// for (RuneTileData rtd : VOID_INTERFACES) {
|
||||||
|
// if (rtd.rune != this.network)
|
||||||
|
// continue;
|
||||||
|
|
||||||
|
// TileEntity te = this.worldObj.getTileEntity(rtd.x, rtd.y, rtd.z);
|
||||||
|
// if (!(te instanceof TileVoidInterface)) {
|
||||||
|
// VOID_INTERFACES.remove(rtd);
|
||||||
|
// // TODO: WTF WTF WTF WTF
|
||||||
|
// this.invalidateLinks();
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (te != null) {
|
||||||
|
// TileVoidInterface tvi = (TileVoidInterface) te;
|
||||||
|
// tvi.markDirty();
|
||||||
|
// tvi.clearLinks();
|
||||||
|
// this.worldObj.markBlockForUpdate(tvi.xCoord, tvi.yCoord, tvi.zCoord);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||||
|
//}
|
||||||
|
|
||||||
public void clearLinks() {
|
public void clearLinks() {
|
||||||
this.current = 0;
|
this.current = 0;
|
||||||
this.links.clear();
|
this.links.clear();
|
||||||
|
@ -179,10 +194,14 @@ public class TileVoidInterface extends TileEntity implements ISidedInventory {
|
||||||
@Override
|
@Override
|
||||||
public void updateEntity() {
|
public void updateEntity() {
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
|
if (this.worldObj.isRemote)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!this.init) {
|
if (!this.init) {
|
||||||
this.init = true;
|
this.init = true;
|
||||||
|
|
||||||
VOID_INTERFACES.add(new RuneTileData(this, this.network));
|
VOID_INTERFACES.add(new RuneTileData(this, this.network));
|
||||||
|
this.invalidateLinks();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.links.size() == 0) {
|
if (this.links.size() == 0) {
|
||||||
|
@ -206,7 +225,16 @@ public class TileVoidInterface extends TileEntity implements ISidedInventory {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void openInventory() {}
|
public void openInventory() {
|
||||||
|
this.worldObj.playSoundEffect(
|
||||||
|
(double) ((float) this.xCoord + 0.5F),
|
||||||
|
(double) ((float) this.yCoord + 0.5F),
|
||||||
|
(double) ((float) this.zCoord + 0.5F),
|
||||||
|
"thaummach:heal",
|
||||||
|
1.0F,
|
||||||
|
1.4F
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void closeInventory() {}
|
public void closeInventory() {}
|
||||||
|
@ -237,4 +265,26 @@ public class TileVoidInterface extends TileEntity implements ISidedInventory {
|
||||||
return thisStack != null && thisStack.isItemEqual(otherStack)
|
return thisStack != null && thisStack.isItemEqual(otherStack)
|
||||||
&& thisStack.stackSize >= otherStack.stackSize;
|
&& thisStack.stackSize >= otherStack.stackSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Packet getDescriptionPacket() {
|
||||||
|
NBTTagCompound nbt = new NBTTagCompound();
|
||||||
|
|
||||||
|
nbt.setByte("network", this.network);
|
||||||
|
nbt.setInteger("linkSize", this.getLinkedSize());
|
||||||
|
nbt.setInteger("current", this.current);
|
||||||
|
|
||||||
|
return new S35PacketUpdateTileEntity(
|
||||||
|
this.xCoord, this.yCoord, this.zCoord, this.getBlockMetadata(), nbt
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||||
|
NBTTagCompound nbt = pkt.func_148857_g();
|
||||||
|
|
||||||
|
this.network = nbt.getByte("network");
|
||||||
|
this.linkSize = nbt.getInteger("linkSize");
|
||||||
|
this.current = nbt.getInteger("current");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"popen": {
|
"popen": {
|
||||||
"category": "master",
|
"category": "block",
|
||||||
"sounds": [
|
"sounds": [
|
||||||
{
|
{
|
||||||
"name": "popen",
|
"name": "popen",
|
||||||
|
@ -9,12 +9,39 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"pclose": {
|
"pclose": {
|
||||||
"category": "master",
|
"category": "block",
|
||||||
"sounds": [
|
"sounds": [
|
||||||
{
|
{
|
||||||
"name": "pclose",
|
"name": "pclose",
|
||||||
"stream": false
|
"stream": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"stoneopen": {
|
||||||
|
"category": "block",
|
||||||
|
"sounds": [
|
||||||
|
{
|
||||||
|
"name": "stoneopen",
|
||||||
|
"stream": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"stoneclose": {
|
||||||
|
"category": "block",
|
||||||
|
"sounds": [
|
||||||
|
{
|
||||||
|
"name": "stoneclose",
|
||||||
|
"stream": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"heal": {
|
||||||
|
"category": "master",
|
||||||
|
"sounds": [
|
||||||
|
{
|
||||||
|
"name": "heal",
|
||||||
|
"stream": false
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
BIN
src/main/resources/assets/thaummach/sounds/heal.ogg
Normal file
BIN
src/main/resources/assets/thaummach/sounds/heal.ogg
Normal file
Binary file not shown.
BIN
src/main/resources/assets/thaummach/sounds/stoneclose.ogg
Normal file
BIN
src/main/resources/assets/thaummach/sounds/stoneclose.ogg
Normal file
Binary file not shown.
BIN
src/main/resources/assets/thaummach/sounds/stoneopen.ogg
Normal file
BIN
src/main/resources/assets/thaummach/sounds/stoneopen.ogg
Normal file
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 55 KiB |
BIN
src/main/resources/assets/thaummach/textures/guis/voidchest.png
Normal file
BIN
src/main/resources/assets/thaummach/textures/guis/voidchest.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 45 KiB |
Loading…
Reference in a new issue