mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-20 04:09:43 +00:00
ready to start porting some more stuff.
This commit is contained in:
1 parent
49f412c88c
commit
f0fbfe5844
8 files changed
+137
-310
No files matched your search
@@ -63,7 +63,7 @@ public enum ModObject {
|
||||
itemItemConduit,
|
||||
itemMeConduit,
|
||||
|
||||
blockTravelPlatform,
|
||||
blockTravelAnchor,
|
||||
itemTravelStaff;
|
||||
|
||||
public final String unlocalisedName;
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package crazypants.enderio.enderface;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.Log;
|
||||
|
||||
public abstract class BlockEio extends Block {
|
||||
|
||||
protected final Class<? extends TileEntity> teClass;
|
||||
protected final String name;
|
||||
|
||||
protected BlockEio(String name, Class<? extends TileEntity> teClass) {
|
||||
super(Material.rock);
|
||||
this.teClass = teClass;
|
||||
this.name = name;
|
||||
setHardness(0.5F);
|
||||
setBlockName(name);
|
||||
setStepSound(Block.soundTypeMetal);
|
||||
setCreativeTab(EnderIOTab.tabEnderIO);
|
||||
|
||||
}
|
||||
|
||||
protected void init() {
|
||||
GameRegistry.registerBlock(this, name);
|
||||
if(teClass != null) {
|
||||
GameRegistry.registerTileEntity(teClass, name + "TileEntity");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(int metadata) {
|
||||
return teClass != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, int metadata) {
|
||||
if(teClass != null) {
|
||||
try {
|
||||
return teClass.newInstance();
|
||||
} catch (Exception e) {
|
||||
Log.error("Could not create tile entity for block " + name + " for class " + teClass);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister iIconRegister) {
|
||||
blockIcon = iIconRegister.registerIcon("enderio:" + name);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,8 +1,5 @@
|
||||
package crazypants.enderio.enderface;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -13,11 +10,9 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.GuiHandler;
|
||||
import crazypants.enderio.Log;
|
||||
import crazypants.enderio.ModObject;
|
||||
@@ -25,7 +20,7 @@ import crazypants.enderio.enderface.te.MeProxy;
|
||||
import crazypants.enderio.teleport.ITravelAccessable;
|
||||
import crazypants.util.Lang;
|
||||
|
||||
public class BlockEnderIO extends Block implements ITileEntityProvider {
|
||||
public class BlockEnderIO extends BlockEio {
|
||||
|
||||
public static BlockEnderIO create() {
|
||||
|
||||
@@ -62,16 +57,7 @@ public class BlockEnderIO extends Block implements ITileEntityProvider {
|
||||
static int pass;
|
||||
|
||||
private BlockEnderIO() {
|
||||
super(Material.rock);
|
||||
setHardness(0.5F);
|
||||
setBlockName(ModObject.blockEnderIo.unlocalisedName);
|
||||
setStepSound(Block.soundTypeStone);
|
||||
setCreativeTab(EnderIOTab.tabEnderIO);
|
||||
}
|
||||
|
||||
private void init() {
|
||||
GameRegistry.registerBlock(this, ModObject.blockEnderIo.unlocalisedName);
|
||||
GameRegistry.registerTileEntity(TileEnderIO.class, ModObject.blockEnderIo.unlocalisedName + "TileEntity");
|
||||
super(ModObject.blockEnderIo.unlocalisedName, TileEnderIO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -104,7 +90,6 @@ public class BlockEnderIO extends Block implements ITileEntityProvider {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te instanceof ITravelAccessable) {
|
||||
ITravelAccessable ta = (ITravelAccessable) te;
|
||||
System.out.println("crazypants.enderio.enderface.BlockEnderIO.onBlockActivated: Using as UI: " + entityPlayer.getUniqueID().toString());
|
||||
if(ta.canUiBeAccessed(entityPlayer)) {
|
||||
entityPlayer.openGui(EnderIO.instance, GuiHandler.GUI_ID_TRAVEL_ACCESSABLE, world, x, y, z);
|
||||
} else {
|
||||
@@ -144,15 +129,11 @@ public class BlockEnderIO extends Block implements ITileEntityProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister IIconRegister) {
|
||||
blockIcon = IIconRegister.registerIcon("enderio:enderIO");
|
||||
frameIcon = IIconRegister.registerIcon("enderio:enderIOFrame");
|
||||
highlightOverlayIcon = IIconRegister.registerIcon("enderio:enderIOHighlight");
|
||||
selectedOverlayIcon = IIconRegister.registerIcon("enderio:enderIOSelected");
|
||||
public void registerBlockIcons(IIconRegister iIconRegister) {
|
||||
super.registerBlockIcons(iIconRegister);
|
||||
frameIcon = iIconRegister.registerIcon("enderio:enderIOFrame");
|
||||
highlightOverlayIcon = iIconRegister.registerIcon("enderio:enderIOHighlight");
|
||||
selectedOverlayIcon = iIconRegister.registerIcon("enderio:enderIOSelected");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int var2) {
|
||||
return new TileEnderIO();
|
||||
}
|
||||
}
|
||||
@@ -1,265 +0,0 @@
|
||||
package crazypants.enderio.enderface;
|
||||
|
||||
import crazypants.enderio.IPacketProcessor;
|
||||
import crazypants.enderio.PacketHandler;
|
||||
|
||||
//TODO:1.7
|
||||
public class EnderfacePacketProcessor implements IPacketProcessor {
|
||||
|
||||
@Override
|
||||
public boolean canProcessPacket(int packetID) {
|
||||
return packetID == PacketHandler.ID_ENDERFACE || packetID == PacketHandler.ID_ME_TERMINAL;
|
||||
}
|
||||
|
||||
|
||||
// @Override
|
||||
// public void processPacket(int packetID, INetworkManager manager, DataInputStream data, Player player) throws IOException {
|
||||
// if(packetID == PacketHandler.ID_ENDERFACE) {
|
||||
// handleEnderfacePacket(data, manager, player);
|
||||
// } else if(packetID == PacketHandler.ID_ME_TERMINAL) {
|
||||
// handleMeTerminalPacket(data, manager, player);
|
||||
// } else {
|
||||
// Log.error("EnderfacePacketProcessor.processPacket: Unknown packet with id" + packetID);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private void handleMeTerminalPacket(DataInputStream data, INetworkManager manager, Player p) throws IOException {
|
||||
// if(!(p instanceof EntityPlayerMP)) {
|
||||
// return;
|
||||
// }
|
||||
// EntityPlayerMP player = (EntityPlayerMP) p;
|
||||
// int x = data.readInt();
|
||||
// int y = data.readInt();
|
||||
// int z = data.readInt();
|
||||
//
|
||||
// Container container = null;
|
||||
// try {
|
||||
// container = MeProxy.createMeTerminalContainer(player, x, y, z, false);
|
||||
// } catch (Exception e) {
|
||||
// Log.warn("EnderfacePacketProcessor.openRemoteGui: Could not open remote AE GUI. " + e);
|
||||
// }
|
||||
// openRemoteGui(player, GuiHandler.GUI_ID_ME_ACCESS_TERMINAL, player.worldObj, x, y, z, container);
|
||||
// }
|
||||
//
|
||||
// public static Packet250CustomPayload createMePacket(int x, int y, int z) {
|
||||
// ByteArrayOutputStream bos = new ByteArrayOutputStream(16);
|
||||
// DataOutputStream dos = new DataOutputStream(bos);
|
||||
// try {
|
||||
// dos.writeInt(PacketHandler.ID_ME_TERMINAL);
|
||||
// dos.writeInt(x);
|
||||
// dos.writeInt(y);
|
||||
// dos.writeInt(z);
|
||||
// } catch (IOException e) {
|
||||
// // never thrown
|
||||
// }
|
||||
// Packet250CustomPayload pkt = new Packet250CustomPayload();
|
||||
// pkt.channel = PacketHandler.CHANNEL;
|
||||
// pkt.data = bos.toByteArray();
|
||||
// pkt.length = bos.size();
|
||||
// pkt.isChunkDataPacket = true;
|
||||
// return pkt;
|
||||
// }
|
||||
//
|
||||
// public static Packet250CustomPayload createPacketEnderface(int x, int y, int z) {
|
||||
// ByteArrayOutputStream bos = new ByteArrayOutputStream(16);
|
||||
// DataOutputStream dos = new DataOutputStream(bos);
|
||||
// try {
|
||||
// dos.writeInt(PacketHandler.ID_ENDERFACE);
|
||||
// dos.writeInt(x);
|
||||
// dos.writeInt(y);
|
||||
// dos.writeInt(z);
|
||||
// } catch (IOException e) {
|
||||
// // never thrown
|
||||
// }
|
||||
// Packet250CustomPayload pkt = new Packet250CustomPayload();
|
||||
// pkt.channel = PacketHandler.CHANNEL;
|
||||
// pkt.data = bos.toByteArray();
|
||||
// pkt.length = bos.size();
|
||||
// pkt.isChunkDataPacket = true;
|
||||
// return pkt;
|
||||
// }
|
||||
//
|
||||
// private void handleEnderfacePacket(DataInputStream data, INetworkManager manager, Player p) throws IOException {
|
||||
// if(!(p instanceof EntityPlayerMP)) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// int x = data.readInt();
|
||||
// int y = data.readInt();
|
||||
// int z = data.readInt();
|
||||
//
|
||||
// EntityPlayerMP player = (EntityPlayerMP) p;
|
||||
// net.minecraft.inventory.Container c = player.openContainer;
|
||||
// PlayerProxy pp = new PlayerProxy(player, x, y, z);
|
||||
// EntityPlayerMP proxy = createPlayerProxy(player, pp);
|
||||
// proxy.playerNetServerHandler = player.playerNetServerHandler;
|
||||
// proxy.inventory = player.inventory;
|
||||
// proxy.currentWindowId = player.currentWindowId;
|
||||
// proxy.inventoryContainer = player.inventoryContainer;
|
||||
// proxy.mcServer = player.mcServer;
|
||||
// proxy.openContainer = player.openContainer;
|
||||
// proxy.theItemInWorldManager = player.theItemInWorldManager;
|
||||
// proxy.worldObj = player.worldObj;
|
||||
//
|
||||
// player.theItemInWorldManager.activateBlockOrUseItem(proxy, player.worldObj, null, x, y, z, 0, 0, 0, 0);
|
||||
// player.theItemInWorldManager.thisPlayerMP = player;
|
||||
// if(c != proxy.openContainer) {
|
||||
// player.openContainer = proxy.openContainer;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// void openRemoteGui(EntityPlayerMP player, int modGuiId, World world, int x, int y, int z, Container container) {
|
||||
//
|
||||
// ModContainer mc = FMLCommonHandler.instance().findContainerFor(EnderIO.instance);
|
||||
// NetworkModHandler nmh = FMLNetworkHandler.instance().findNetworkModHandler(mc);
|
||||
//
|
||||
// if(nmh != null) {
|
||||
//
|
||||
// if(container != null) {
|
||||
// player.incrementWindowID();
|
||||
// player.closeContainer();
|
||||
// int windowId = player.currentWindowId;
|
||||
// Packet250CustomPayload pkt = new Packet250CustomPayload();
|
||||
// pkt.channel = "FML";
|
||||
// OpenGuiPacket p = new OpenGuiPacket();
|
||||
// byte[] packetData = p.generatePacket(windowId, nmh.getNetworkId(), modGuiId, x, y, z);
|
||||
// byte[] b = Bytes.concat(new byte[] { UnsignedBytes.checkedCast(4) }, packetData);
|
||||
// pkt.data = b;
|
||||
// pkt.length = pkt.data.length;
|
||||
// player.playerNetServerHandler.sendPacketToPlayer(pkt);
|
||||
// player.openContainer = container;
|
||||
// player.openContainer.windowId = windowId;
|
||||
// player.openContainer.addCraftingToCrafters(player);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public static <T> T createPlayerProxy(EntityPlayerMP player, PlayerProxy proxy) {
|
||||
// Enhancer e = new Enhancer();
|
||||
// e.setCallback(proxy);
|
||||
//
|
||||
// e.setSuperclass(player.getClass());
|
||||
// Class<?>[] argTypes = new Class[] { MinecraftServer.class, World.class, String.class, ItemInWorldManager.class };
|
||||
// Object[] args = new Object[] { player.mcServer, player.worldObj, player.username, player.theItemInWorldManager };
|
||||
//
|
||||
// e.setInterceptDuringConstruction(false);
|
||||
// @SuppressWarnings("unchecked")
|
||||
// T proxifiedObj = (T) e.create(argTypes, args);
|
||||
//
|
||||
// return proxifiedObj;
|
||||
// }
|
||||
//
|
||||
// public static class PlayerProxy implements MethodInterceptor {
|
||||
//
|
||||
// private EntityPlayerMP realObj;
|
||||
//
|
||||
// private Set<String> interceptNames = new HashSet<String>();
|
||||
//
|
||||
// private Set<String> beaconNames = new HashSet<String>();
|
||||
// private Set<String> anvilNames = new HashSet<String>();
|
||||
//
|
||||
// private Set<String> distanceNames = new HashSet<String>();
|
||||
//
|
||||
// int x;
|
||||
// int y;
|
||||
// int z;
|
||||
//
|
||||
// public PlayerProxy(EntityPlayerMP obj, int x, int y, int z) {
|
||||
//
|
||||
// this.x = x;
|
||||
// this.y = y;
|
||||
// this.z = z;
|
||||
//
|
||||
// // TODO: Move to config?
|
||||
// this.realObj = obj;
|
||||
// interceptNames.add("openGui");
|
||||
//
|
||||
// interceptNames.add("displayGUIBrewingStand");
|
||||
// interceptNames.add("func_71017_a");
|
||||
//
|
||||
// interceptNames.add("displayGUIChest");
|
||||
// interceptNames.add("func_71007_a");
|
||||
//
|
||||
// interceptNames.add("displayGUIDispenser");
|
||||
// interceptNames.add("func_71006_a");
|
||||
//
|
||||
// interceptNames.add("displayGUIEnchantment");
|
||||
// interceptNames.add("func_71002_c");
|
||||
//
|
||||
// interceptNames.add("displayGUIFurnace");
|
||||
// interceptNames.add("func_71042_a");
|
||||
//
|
||||
// interceptNames.add("displayGUIWorkbench");
|
||||
// interceptNames.add("func_71058_b");
|
||||
//
|
||||
// interceptNames.add("displayGuiHopper"); // for when its added
|
||||
// interceptNames.add("func_94064_a"); // displayGuiHopper
|
||||
//
|
||||
// interceptNames.add("displayGUIHopper");
|
||||
//
|
||||
// beaconNames.add("displayGUIBeacon");
|
||||
// beaconNames.add("func_82240_a");
|
||||
//
|
||||
// anvilNames.add("displayGUIAnvil");
|
||||
// anvilNames.add("func_82244_d");
|
||||
//
|
||||
// distanceNames.add("getDistanceSq");
|
||||
// distanceNames.add("getDistance");
|
||||
// distanceNames.add("func_70092_e");
|
||||
// distanceNames.add("func_70011_f");
|
||||
// distanceNames.add("func_71569_e");
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
|
||||
//
|
||||
// if(interceptNames.contains(method.getName())) {
|
||||
//
|
||||
// Object res = method.invoke(realObj, objects);
|
||||
// if(realObj.openContainer != null) {
|
||||
// realObj.openContainer = new ContainerWrapper(realObj.openContainer);
|
||||
// }
|
||||
// return res;
|
||||
//
|
||||
// } else if(beaconNames.contains(method.getName())) {
|
||||
//
|
||||
// // Beacon needs to be done manually for some reason to work properly
|
||||
// TileEntityBeacon par1TileEntityBeacon = (TileEntityBeacon) objects[0];
|
||||
// realObj.incrementWindowID();
|
||||
// realObj.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(realObj.currentWindowId, 7, par1TileEntityBeacon.getInvName(),
|
||||
// par1TileEntityBeacon.getSizeInventory(), par1TileEntityBeacon.isInvNameLocalized()));
|
||||
// realObj.openContainer = new ContainerBeacon(realObj.inventory, par1TileEntityBeacon) {
|
||||
// @Override
|
||||
// public boolean canInteractWith(EntityPlayer par1EntityPlayer) {
|
||||
// return true;
|
||||
// }
|
||||
// };
|
||||
// realObj.openContainer.windowId = realObj.currentWindowId;
|
||||
// realObj.openContainer.addCraftingToCrafters(realObj);
|
||||
// return null;
|
||||
//
|
||||
// } else if(anvilNames.contains(method.getName())) {
|
||||
//
|
||||
// realObj.incrementWindowID();
|
||||
// realObj.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(realObj.currentWindowId, 8, "Repairing", 9, true));
|
||||
// realObj.openContainer = new ContainerRepair(realObj.inventory, realObj.worldObj, ((Integer) objects[0]).intValue(), ((Integer) objects[1]).intValue(),
|
||||
// ((Integer) objects[2]).intValue(), realObj) {
|
||||
// @Override
|
||||
// public boolean canInteractWith(EntityPlayer par1EntityPlayer) {
|
||||
// return true;
|
||||
// }
|
||||
// };
|
||||
// realObj.openContainer.windowId = realObj.currentWindowId;
|
||||
// realObj.openContainer.addCraftingToCrafters(realObj);
|
||||
// return null;
|
||||
// } else if(distanceNames.contains(method.getName())) {
|
||||
// return 6;
|
||||
// }
|
||||
// method.setAccessible(true);
|
||||
// return method.invoke(realObj, objects);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package crazypants.enderio.enderface;
|
||||
|
||||
//TODO: Applied Energistics
|
||||
public class PacketOpenMeGui {
|
||||
|
||||
// private void handleMeTerminalPacket(DataInputStream data, INetworkManager manager, Player p) throws IOException {
|
||||
// if(!(p instanceof EntityPlayerMP)) {
|
||||
// return;
|
||||
// }
|
||||
// EntityPlayerMP player = (EntityPlayerMP) p;
|
||||
// int x = data.readInt();
|
||||
// int y = data.readInt();
|
||||
// int z = data.readInt();
|
||||
//
|
||||
// Container container = null;
|
||||
// try {
|
||||
// container = MeProxy.createMeTerminalContainer(player, x, y, z, false);
|
||||
// } catch (Exception e) {
|
||||
// Log.warn("EnderfacePacketProcessor.openRemoteGui: Could not open remote AE GUI. " + e);
|
||||
// }
|
||||
// openRemoteGui(player, GuiHandler.GUI_ID_ME_ACCESS_TERMINAL, player.worldObj, x, y, z, container);
|
||||
// }
|
||||
//
|
||||
// public static Packet250CustomPayload createMePacket(int x, int y, int z) {
|
||||
// ByteArrayOutputStream bos = new ByteArrayOutputStream(16);
|
||||
// DataOutputStream dos = new DataOutputStream(bos);
|
||||
// try {
|
||||
// dos.writeInt(PacketHandler.ID_ME_TERMINAL);
|
||||
// dos.writeInt(x);
|
||||
// dos.writeInt(y);
|
||||
// dos.writeInt(z);
|
||||
// } catch (IOException e) {
|
||||
// // never thrown
|
||||
// }
|
||||
// Packet250CustomPayload pkt = new Packet250CustomPayload();
|
||||
// pkt.channel = PacketHandler.CHANNEL;
|
||||
// pkt.data = bos.toByteArray();
|
||||
// pkt.length = bos.size();
|
||||
// pkt.isChunkDataPacket = true;
|
||||
// return pkt;
|
||||
// }
|
||||
//
|
||||
// public static Packet250CustomPayload createPacketEnderface(int x, int y, int z) {
|
||||
// ByteArrayOutputStream bos = new ByteArrayOutputStream(16);
|
||||
// DataOutputStream dos = new DataOutputStream(bos);
|
||||
// try {
|
||||
// dos.writeInt(PacketHandler.ID_ENDERFACE);
|
||||
// dos.writeInt(x);
|
||||
// dos.writeInt(y);
|
||||
// dos.writeInt(z);
|
||||
// } catch (IOException e) {
|
||||
// // never thrown
|
||||
// }
|
||||
// Packet250CustomPayload pkt = new Packet250CustomPayload();
|
||||
// pkt.channel = PacketHandler.CHANNEL;
|
||||
// pkt.data = bos.toByteArray();
|
||||
// pkt.length = bos.size();
|
||||
// pkt.isChunkDataPacket = true;
|
||||
// return pkt;
|
||||
// }
|
||||
//
|
||||
|
||||
}
|
||||
@@ -1,8 +1,6 @@
|
||||
package crazypants.enderio.teleport;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -16,12 +14,11 @@ import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import crazypants.enderio.Config;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.GuiHandler;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.enderface.BlockEio;
|
||||
import crazypants.enderio.teleport.packet.PacketAccessMode;
|
||||
import crazypants.enderio.teleport.packet.PacketConfigSync;
|
||||
import crazypants.enderio.teleport.packet.PacketDrainStaff;
|
||||
@@ -29,7 +26,7 @@ import crazypants.enderio.teleport.packet.PacketOpenAuthGui;
|
||||
import crazypants.enderio.teleport.packet.PacketTravelEvent;
|
||||
import crazypants.util.Lang;
|
||||
|
||||
public class BlockTravelAnchor extends Block implements IGuiHandler, ITileEntityProvider {
|
||||
public class BlockTravelAnchor extends BlockEio implements IGuiHandler, ITileEntityProvider {
|
||||
|
||||
public static BlockTravelAnchor create() {
|
||||
|
||||
@@ -57,28 +54,22 @@ public class BlockTravelAnchor extends Block implements IGuiHandler, ITileEntity
|
||||
IIcon highlightOverlayIcon;
|
||||
|
||||
private BlockTravelAnchor() {
|
||||
super(Material.rock);
|
||||
setHardness(0.5F);
|
||||
setStepSound(Block.soundTypeStone);
|
||||
setBlockName(ModObject.blockTravelPlatform.unlocalisedName);
|
||||
if(Config.travelAnchorEnabled) {
|
||||
setCreativeTab(EnderIOTab.tabEnderIO);
|
||||
} else {
|
||||
super(ModObject.blockTravelAnchor.unlocalisedName, TileTravelAnchor.class);
|
||||
if(!Config.travelAnchorEnabled) {
|
||||
setCreativeTab(null);
|
||||
}
|
||||
}
|
||||
|
||||
private void init() {
|
||||
|
||||
GameRegistry.registerBlock(this, ModObject.blockTravelPlatform.unlocalisedName);
|
||||
GameRegistry.registerTileEntity(TileTravelAnchor.class, ModObject.blockTravelPlatform.unlocalisedName + "TileEntity");
|
||||
@Override
|
||||
protected void init() {
|
||||
super.init();
|
||||
EnderIO.guiHandler.registerGuiHandler(GuiHandler.GUI_ID_TRAVEL_ACCESSABLE, this);
|
||||
EnderIO.guiHandler.registerGuiHandler(GuiHandler.GUI_ID_TRAVEL_AUTH, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister iIconRegister) {
|
||||
blockIcon = iIconRegister.registerIcon("enderio:blockTravelAnchor");
|
||||
super.registerBlockIcons(iIconRegister);
|
||||
highlightOverlayIcon = iIconRegister.registerIcon("enderio:blockTravelAnchorHighlight");
|
||||
selectedOverlayIcon = iIconRegister.registerIcon("enderio:blockTravelAnchorSelected");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user