Under 1300 errors left now, started on packet/network stuffs.

This commit is contained in:
Ben Spiers 2014-04-20 21:15:44 +01:00
parent 86777694e5
commit 31938e8b68
151 changed files with 1796 additions and 1510 deletions

View file

@ -1,29 +1,29 @@
package mekanism.api;
import net.minecraft.item.Item;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
public class ItemInfo
{
public Item item;
public Block block;
public int meta;
public ItemInfo(Item i, int j)
public ItemInfo(Block b, int j)
{
item = i;
block = b;
meta = j;
}
public static ItemInfo get(ItemStack stack)
{
return new ItemInfo(stack.getItem(), stack.getItemDamage());
return new ItemInfo(Block.getBlockFromItem(stack.getItem()), stack.getItemDamage());
}
@Override
public boolean equals(Object obj)
{
return obj instanceof ItemInfo &&
((ItemInfo)obj).item == item &&
((ItemInfo)obj).block == block &&
((ItemInfo)obj).meta == meta;
}
@ -31,7 +31,7 @@ public class ItemInfo
public int hashCode()
{
int code = 1;
code = 31 * code + item.getUnlocalizedName().hashCode();
code = 31 * code + block.getUnlocalizedName().hashCode();
code = 31 * code + meta;
return code;
}

View file

@ -3,6 +3,8 @@ package mekanism.api;
import java.util.HashSet;
import java.util.Set;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import cpw.mods.fml.common.eventhandler.Event;
import net.minecraftforge.oredict.OreDictionary;
@ -11,11 +13,11 @@ public class MekanismAPI
//Add a BlockInfo value here if you don't want a certain block to be picked up by cardboard boxes
private static Set<ItemInfo> cardboardBoxIgnore = new HashSet<ItemInfo>();
public static boolean isBlockCompatible(int id, int meta)
public static boolean isBlockCompatible(Item item, int meta)
{
for(ItemInfo i : cardboardBoxIgnore)
{
if(i.id == id && (i.meta == OreDictionary.WILDCARD_VALUE || i.meta == meta))
if(i.block == item && (i.meta == OreDictionary.WILDCARD_VALUE || i.meta == meta))
{
return false;
}
@ -24,14 +26,14 @@ public class MekanismAPI
return true;
}
public static void addBoxBlacklist(int id, int meta)
public static void addBoxBlacklist(Block block, int meta)
{
cardboardBoxIgnore.add(new ItemInfo(id, meta));
cardboardBoxIgnore.add(new ItemInfo(block, meta));
}
public static void removeBoxBlacklist(int id, int meta)
public static void removeBoxBlacklist(Block block, int meta)
{
cardboardBoxIgnore.remove(new ItemInfo(id, meta));
cardboardBoxIgnore.remove(new ItemInfo(block, meta));
}
public static Set<ItemInfo> getBoxIgnore()

View file

@ -1,37 +1,25 @@
package mekanism.api.transmitters;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.event.world.ChunkEvent;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.ITickHandler;
import cpw.mods.fml.common.TickType;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.common.gameevent.TickEvent.ServerTickEvent;
public class TransmitterNetworkRegistry implements ITickHandler
public class TransmitterNetworkRegistry
{
private static TransmitterNetworkRegistry INSTANCE = new TransmitterNetworkRegistry();
private static boolean loaderRegistered = false;
private HashSet<ITransmitterNetwork> networks = new HashSet<ITransmitterNetwork>();
public TransmitterNetworkRegistry()
{
TickRegistry.registerTickHandler(this, Side.SERVER);
}
public static void initiate()
{
if(!loaderRegistered)
@ -73,11 +61,13 @@ public class TransmitterNetworkRegistry implements ITickHandler
}
}
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {}
@SubscribeEvent
public void onTick(ServerTickEvent event)
{
tickEnd();
}
@Override
public void tickEnd(EnumSet<TickType> type, Object... tickData)
public void tickEnd()
{
Set<ITransmitterNetwork> iterNetworks = (Set<ITransmitterNetwork>)networks.clone();
@ -90,18 +80,6 @@ public class TransmitterNetworkRegistry implements ITickHandler
}
}
@Override
public EnumSet<TickType> ticks()
{
return EnumSet.of(TickType.SERVER);
}
@Override
public String getLabel()
{
return "MekanismNetworks";
}
@Override
public String toString()
{

View file

@ -16,7 +16,6 @@ import mekanism.common.KeySync;
import mekanism.common.Mekanism;
import mekanism.common.ObfuscatedNames;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.item.ItemConfigurator;
import mekanism.common.item.ItemElectricBow;
import mekanism.common.item.ItemFreeRunners;
@ -38,7 +37,7 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatMessageComponent;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.StringUtils;
import org.lwjgl.input.Keyboard;
@ -218,13 +217,13 @@ public class ClientTickHandler implements ITickHandler
{
ItemConfigurator item = (ItemConfigurator)mc.thePlayer.getCurrentEquippedItem().getItem();
if(MekanismKeyHandler.modeSwitchKey.pressed)
if(MekanismKeyHandler.modeSwitchKey.getIsKeyPressed())
{
if(!lastTickUpdate)
{
item.setState(stack, (byte)(item.getState(stack) < 3 ? item.getState(stack)+1 : 0));
PacketHandler.sendPacket(Transmission.SERVER, new PacketConfiguratorState().setParams(item.getState(stack)));
mc.thePlayer.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.GREY + "Configure State: " + item.getColor(item.getState(stack)) + item.getStateDisplay(item.getState(stack))));
Mekanism.packetPipeline.sendToServer(new PacketConfiguratorState(item.getState(stack)));
mc.thePlayer.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.GREY + "Configure State: " + item.getColor(item.getState(stack)) + item.getStateDisplay(item.getState(stack))));
lastTickUpdate = true;
}
}
@ -236,13 +235,13 @@ public class ClientTickHandler implements ITickHandler
{
ItemElectricBow item = (ItemElectricBow)mc.thePlayer.getCurrentEquippedItem().getItem();
if(MekanismKeyHandler.modeSwitchKey.pressed)
if(MekanismKeyHandler.modeSwitchKey.getIsKeyPressed())
{
if(!lastTickUpdate)
{
item.setFireState(stack, !item.getFireState(stack));
PacketHandler.sendPacket(Transmission.SERVER, new PacketElectricBowState().setParams(item.getFireState(stack)));
mc.thePlayer.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.GREY + "Fire Mode: " + (item.getFireState(stack) ? (EnumColor.DARK_GREEN + "ON") : (EnumColor.DARK_RED + "OFF"))));
Mekanism.packetPipeline.sendToServer(new PacketElectricBowState(item.getFireState(stack)));
mc.thePlayer.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.GREY + "Fire Mode: " + (item.getFireState(stack) ? (EnumColor.DARK_GREEN + "ON") : (EnumColor.DARK_RED + "OFF"))));
lastTickUpdate = true;
}
}
@ -254,13 +253,13 @@ public class ClientTickHandler implements ITickHandler
{
ItemWalkieTalkie item = (ItemWalkieTalkie)mc.thePlayer.getCurrentEquippedItem().getItem();
if(MekanismKeyHandler.modeSwitchKey.pressed && item.getOn(stack))
if(MekanismKeyHandler.modeSwitchKey.getIsKeyPressed() && item.getOn(stack))
{
if(!lastTickUpdate)
{
int newChan = item.getChannel(stack) < 9 ? item.getChannel(stack)+1 : 1;
item.setChannel(stack, newChan);
PacketHandler.sendPacket(Transmission.SERVER, new PacketWalkieTalkieState().setParams(newChan));
Mekanism.packetPipeline.sendToServer(new PacketWalkieTalkieState(newChan));
Minecraft.getMinecraft().sndManager.playSoundFX("mekanism:etc.Ding", 1.0F, 1.0F);
lastTickUpdate = true;
}
@ -273,12 +272,12 @@ public class ClientTickHandler implements ITickHandler
{
ItemStack jetpack = mc.thePlayer.getCurrentItemOrArmor(3);
if(MekanismKeyHandler.modeSwitchKey.pressed)
if(MekanismKeyHandler.modeSwitchKey.getIsKeyPressed())
{
if(!lastTickUpdate)
{
((ItemJetpack)jetpack.getItem()).incrementMode(jetpack);
PacketHandler.sendPacket(Transmission.SERVER, new PacketJetpackData().setParams(JetpackPacket.MODE));
Mekanism.packetPipeline.sendToServer(new PacketJetpackData(JetpackPacket.MODE));
Minecraft.getMinecraft().sndManager.playSoundFX("mekanism:etc.Hydraulic", 1.0F, 1.0F);
lastTickUpdate = true;
}
@ -291,12 +290,12 @@ public class ClientTickHandler implements ITickHandler
{
ItemStack scubaTank = mc.thePlayer.getCurrentItemOrArmor(3);
if(MekanismKeyHandler.modeSwitchKey.pressed)
if(MekanismKeyHandler.modeSwitchKey.getIsKeyPressed())
{
if(!lastTickUpdate)
{
((ItemScubaTank)scubaTank.getItem()).toggleFlowing(scubaTank);
PacketHandler.sendPacket(Transmission.SERVER, new PacketScubaTankData().setParams(ScubaTankPacket.MODE));
Mekanism.packetPipeline.sendToServer(new PacketScubaTankData(ScubaTankPacket.MODE));
Minecraft.getMinecraft().sndManager.playSoundFX("mekanism:etc.Hydraulic", 1.0F, 1.0F);
lastTickUpdate = true;
}
@ -331,7 +330,7 @@ public class ClientTickHandler implements ITickHandler
Mekanism.jetpackOn.remove(mc.thePlayer.username);
}
PacketHandler.sendPacket(Transmission.SERVER, new PacketJetpackData().setParams(JetpackPacket.UPDATE, mc.thePlayer.username, isJetpackOn(mc.thePlayer)));
Mekanism.packetPipeline.sendToServer(new PacketJetpackData(JetpackPacket.UPDATE, mc.thePlayer.username, isJetpackOn(mc.thePlayer)));
}
if(Mekanism.gasmaskOn.contains(mc.thePlayer.username) != isGasMaskOn(mc.thePlayer))
@ -344,7 +343,7 @@ public class ClientTickHandler implements ITickHandler
Mekanism.gasmaskOn.remove(mc.thePlayer.username);
}
PacketHandler.sendPacket(Transmission.SERVER, new PacketScubaTankData().setParams(ScubaTankPacket.UPDATE, mc.thePlayer.username, isGasMaskOn(mc.thePlayer)));
Mekanism.packetPipeline.sendToServer(new PacketScubaTankData(ScubaTankPacket.UPDATE, mc.thePlayer.username, isGasMaskOn(mc.thePlayer)));
}
if(MekanismClient.audioHandler != null)
@ -374,8 +373,8 @@ public class ClientTickHandler implements ITickHandler
if(mc.thePlayer.getCurrentItemOrArmor(3) != null && mc.thePlayer.getCurrentItemOrArmor(3).getItem() instanceof ItemJetpack)
{
MekanismClient.updateKey(mc.gameSettings.keyBindJump.keyCode, KeySync.ASCEND);
MekanismClient.updateKey(mc.gameSettings.keyBindSneak.keyCode, KeySync.DESCEND);
MekanismClient.updateKey(mc.gameSettings.keyBindJump.getKeyCode(), KeySync.ASCEND);
MekanismClient.updateKey(mc.gameSettings.keyBindSneak.getKeyCode(), KeySync.DESCEND);
}
if(isJetpackOn(mc.thePlayer))
@ -389,7 +388,7 @@ public class ClientTickHandler implements ITickHandler
}
else if(jetpack.getMode(mc.thePlayer.getCurrentItemOrArmor(3)) == JetpackMode.HOVER)
{
if((!Keyboard.isKeyDown(mc.gameSettings.keyBindJump.keyCode) && !Keyboard.isKeyDown(mc.gameSettings.keyBindSneak.keyCode)) || (Keyboard.isKeyDown(mc.gameSettings.keyBindJump.keyCode) && Keyboard.isKeyDown(mc.gameSettings.keyBindSneak.keyCode)) || mc.currentScreen != null)
if((!Keyboard.isKeyDown(mc.gameSettings.keyBindJump.getKeyCode()) && !Keyboard.isKeyDown(mc.gameSettings.keyBindSneak.keyCode)) || (Keyboard.isKeyDown(mc.gameSettings.keyBindJump.keyCode) && Keyboard.isKeyDown(mc.gameSettings.keyBindSneak.keyCode)) || mc.currentScreen != null)
{
if(mc.thePlayer.motionY > 0)
{
@ -401,11 +400,11 @@ public class ClientTickHandler implements ITickHandler
}
}
else {
if(Keyboard.isKeyDown(mc.gameSettings.keyBindJump.keyCode) && mc.currentScreen == null)
if(Keyboard.isKeyDown(mc.gameSettings.keyBindJump.getKeyCode()) && mc.currentScreen == null)
{
mc.thePlayer.motionY = Math.min(mc.thePlayer.motionY + 0.15D, 0.2D);
}
else if(Keyboard.isKeyDown(mc.gameSettings.keyBindSneak.keyCode) && mc.currentScreen == null)
else if(Keyboard.isKeyDown(mc.gameSettings.keyBindSneak.getKeyCode()) && mc.currentScreen == null)
{
mc.thePlayer.motionY = Math.max(mc.thePlayer.motionY - 0.15D, -0.2D);
}

View file

@ -7,7 +7,7 @@ import java.util.List;
import mekanism.api.EnumColor;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ChatMessageComponent;
import net.minecraft.util.ChatComponentText;
public final class HolidayManager
{
@ -100,13 +100,13 @@ public final class HolidayManager
public void onEvent(EntityPlayer player)
{
String themedLines = getThemedLines(new EnumColor[] {EnumColor.DARK_GREEN, EnumColor.DARK_RED}, 13);
player.sendChatToPlayer(ChatMessageComponent.createFromText(themedLines + EnumColor.DARK_BLUE + "[Mekanism]" + themedLines));
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.RED + "Merry Christmas, " + EnumColor.DARK_BLUE + player.username + EnumColor.RED + "!"));
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.RED + "May you have plenty of Christmas cheer"));
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.RED + "and have a relaxing holiday with your"));
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.RED + "family :)"));
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.DARK_GREY + "-aidancbrady"));
player.sendChatToPlayer(ChatMessageComponent.createFromText(themedLines + EnumColor.DARK_BLUE + "[=======]" + themedLines));
player.addChatMessage(new ChatComponentText(themedLines + EnumColor.DARK_BLUE + "[Mekanism]" + themedLines));
player.addChatMessage(new ChatComponentText(EnumColor.RED + "Merry Christmas, " + EnumColor.DARK_BLUE + player.getCommandSenderName() + EnumColor.RED + "!"));
player.addChatMessage(new ChatComponentText(EnumColor.RED + "May you have plenty of Christmas cheer"));
player.addChatMessage(new ChatComponentText(EnumColor.RED + "and have a relaxing holiday with your"));
player.addChatMessage(new ChatComponentText(EnumColor.RED + "family :)"));
player.addChatMessage(new ChatComponentText(EnumColor.DARK_GREY + "-aidancbrady"));
player.addChatMessage(new ChatComponentText(themedLines + EnumColor.DARK_BLUE + "[=======]" + themedLines));
}
@Override
@ -149,12 +149,12 @@ public final class HolidayManager
public void onEvent(EntityPlayer player)
{
String themedLines = getThemedLines(new EnumColor[] {EnumColor.WHITE, EnumColor.YELLOW}, 13);
player.sendChatToPlayer(ChatMessageComponent.createFromText(themedLines + EnumColor.DARK_BLUE + "[Mekanism]" + themedLines));
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.AQUA + "Happy New Year, " + EnumColor.DARK_BLUE + player.username + EnumColor.RED + "!"));
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.AQUA + "Best wishes to you as we enter this"));
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.AQUA + "new and exciting year of " + calendar.get(Calendar.YEAR) + "! :)"));
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.DARK_GREY + "-aidancbrady"));
player.sendChatToPlayer(ChatMessageComponent.createFromText(themedLines + EnumColor.DARK_BLUE + "[=======]" + themedLines));
player.addChatMessage(new ChatComponentText(themedLines + EnumColor.DARK_BLUE + "[Mekanism]" + themedLines));
player.addChatMessage(new ChatComponentText(EnumColor.AQUA + "Happy New Year, " + EnumColor.DARK_BLUE + player.getCommandSenderName() + EnumColor.RED + "!"));
player.addChatMessage(new ChatComponentText(EnumColor.AQUA + "Best wishes to you as we enter this"));
player.addChatMessage(new ChatComponentText(EnumColor.AQUA + "new and exciting year of " + calendar.get(Calendar.YEAR) + "! :)"));
player.addChatMessage(new ChatComponentText(EnumColor.DARK_GREY + "-aidancbrady"));
player.addChatMessage(new ChatComponentText(themedLines + EnumColor.DARK_BLUE + "[=======]" + themedLines));
}
}

View file

@ -6,7 +6,6 @@ import mekanism.client.sound.SoundHandler;
import mekanism.client.voice.VoiceClient;
import mekanism.common.Mekanism;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.network.PacketKey;
import net.minecraft.client.Minecraft;
import net.minecraftforge.common.MinecraftForge;
@ -38,7 +37,7 @@ public class MekanismClient extends Mekanism
if(down != keyMap.has(Minecraft.getMinecraft().thePlayer, type))
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketKey().setParams(type, down));
Mekanism.packetPipeline.sendToServer(new PacketKey(type, down));
keyMap.update(Minecraft.getMinecraft().thePlayer, type, down);
}
}

View file

@ -17,7 +17,6 @@ import mekanism.client.gui.GuiSlot.SlotOverlay;
import mekanism.client.gui.GuiSlot.SlotType;
import mekanism.client.render.MekanismRenderer;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.inventory.container.ContainerChemicalCrystallizer;
import mekanism.common.network.PacketTileEntity;
import mekanism.common.tile.TileEntityChemicalCrystallizer;
@ -158,7 +157,7 @@ public class GuiChemicalCrystallizer extends GuiMekanism
ArrayList data = new ArrayList();
data.add(0);
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
}
}

View file

@ -15,7 +15,6 @@ import mekanism.client.gui.GuiSlot.SlotOverlay;
import mekanism.client.gui.GuiSlot.SlotType;
import mekanism.client.render.MekanismRenderer;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.inventory.container.ContainerChemicalInfuser;
import mekanism.common.network.PacketTileEntity;
import mekanism.common.tile.TileEntityChemicalInfuser;
@ -132,7 +131,7 @@ public class GuiChemicalInfuser extends GuiMekanism
ArrayList data = new ArrayList();
data.add(0);
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
}
else if(xAxis > 114 && xAxis < 132 && yAxis > 13 && yAxis < 21)
@ -140,7 +139,7 @@ public class GuiChemicalInfuser extends GuiMekanism
ArrayList data = new ArrayList();
data.add(1);
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
}
}

View file

@ -17,7 +17,6 @@ import mekanism.client.gui.GuiSlot.SlotOverlay;
import mekanism.client.gui.GuiSlot.SlotType;
import mekanism.client.render.MekanismRenderer;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.inventory.container.ContainerChemicalWasher;
import mekanism.common.network.PacketTileEntity;
import mekanism.common.tile.TileEntityChemicalWasher;
@ -123,7 +122,7 @@ public class GuiChemicalWasher extends GuiMekanism
ArrayList data = new ArrayList();
data.add(0);
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
}
}

View file

@ -8,7 +8,6 @@ import mekanism.api.EnumColor;
import mekanism.client.render.MekanismRenderer;
import mekanism.common.IInvConfiguration;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.SideData;
import mekanism.common.block.BlockMachine.MachineType;
import mekanism.common.inventory.container.ContainerNull;
@ -256,19 +255,19 @@ public class GuiConfiguration extends GuiMekanism
{
int guiId = MachineType.get(tile.getBlockType(), tile.getBlockMetadata()).guiId;
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketSimpleGui().setParams(Coord4D.get(tile), guiId));
Mekanism.packetPipeline.sendToServer(new PacketSimpleGui(Coord4D.get(tile), guiId));
}
if(xAxis >= 156 && xAxis <= 170 && yAxis >= 6 && yAxis <= 20)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketConfigurationUpdate().setParams(ConfigurationPacket.EJECT, Coord4D.get(tile)));
Mekanism.packetPipeline.sendToServer(new PacketConfigurationUpdate(ConfigurationPacket.EJECT, Coord4D.get(tile)));
}
if(xAxis >= 156 && xAxis <= 170 && yAxis >= 21 && yAxis <= 35)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketConfigurationUpdate().setParams(ConfigurationPacket.STRICT_INPUT, Coord4D.get(tile)));
Mekanism.packetPipeline.sendToServer(new PacketConfigurationUpdate(ConfigurationPacket.STRICT_INPUT, Coord4D.get(tile)));
}
}
@ -280,7 +279,7 @@ public class GuiConfiguration extends GuiMekanism
if(xAxis >= 80 && xAxis <= 96 && yAxis >= 49 && yAxis <= 65)
{
mc.sndManager.playSoundFX("mekanism:etc.Ding", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketConfigurationUpdate().setParams(ConfigurationPacket.EJECT_COLOR, Coord4D.get(tile), button));
Mekanism.packetPipeline.sendToServer(new PacketConfigurationUpdate(ConfigurationPacket.EJECT_COLOR, Coord4D.get(tile), button));
}
for(int i = 0; i < slotPosMap.size(); i++)
@ -291,7 +290,7 @@ public class GuiConfiguration extends GuiMekanism
if(xAxis >= x && xAxis <= x+14 && yAxis >= y && yAxis <= y+14)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketConfigurationUpdate().setParams(ConfigurationPacket.SIDE_DATA, Coord4D.get(tile), button, i));
Mekanism.packetPipeline.sendToServer(new PacketConfigurationUpdate(ConfigurationPacket.SIDE_DATA, Coord4D.get(tile), button, i));
}
}
@ -303,7 +302,7 @@ public class GuiConfiguration extends GuiMekanism
if(xAxis >= x && xAxis <= x+14 && yAxis >= y && yAxis <= y+14)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketConfigurationUpdate().setParams(ConfigurationPacket.INPUT_COLOR, Coord4D.get(tile), button, i));
Mekanism.packetPipeline.sendToServer(new PacketConfigurationUpdate(ConfigurationPacket.INPUT_COLOR, Coord4D.get(tile), button, i));
}
}
}

View file

@ -3,7 +3,6 @@ package mekanism.client.gui;
import mekanism.api.Coord4D;
import mekanism.common.IRedstoneControl;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.network.PacketSimpleGui;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
@ -67,7 +66,7 @@ public class GuiConfigurationTab extends GuiElement
{
if(xAxis >= -21 && xAxis <= -3 && yAxis >= 10 && yAxis <= 28)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketSimpleGui().setParams(Coord4D.get(tileEntity), 9));
Mekanism.packetPipeline.sendToServer(new PacketSimpleGui(Coord4D.get(tileEntity), 9));
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
}
}

View file

@ -9,7 +9,6 @@ import mekanism.client.gui.GuiEnergyInfo.IInfoHandler;
import mekanism.client.gui.GuiSlot.SlotOverlay;
import mekanism.client.gui.GuiSlot.SlotType;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.inventory.container.ContainerDigitalMiner;
import mekanism.common.miner.ThreadMinerSearch.State;
import mekanism.common.network.PacketDigitalMinerGui;
@ -109,18 +108,18 @@ public class GuiDigitalMiner extends GuiMekanism
ArrayList data = new ArrayList();
data.add(3);
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
}
else if(guibutton.id == 1)
{
ArrayList data = new ArrayList();
data.add(4);
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
}
else if(guibutton.id == 2)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketDigitalMinerGui().setParams(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
Mekanism.packetPipeline.sendToServer(new PacketDigitalMinerGui(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
}
}
@ -299,7 +298,7 @@ public class GuiDigitalMiner extends GuiMekanism
ArrayList data = new ArrayList();
data.add(0);
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
}
if(xAxis >= 147 && xAxis <= 161 && yAxis >= 63 && yAxis <= 77)
@ -309,7 +308,7 @@ public class GuiDigitalMiner extends GuiMekanism
ArrayList data = new ArrayList();
data.add(1);
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
}
if(xAxis >= 131 && xAxis <= 145 && yAxis >= 47 && yAxis <= 61)
@ -319,7 +318,7 @@ public class GuiDigitalMiner extends GuiMekanism
ArrayList data = new ArrayList();
data.add(5);
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
}
if(xAxis >= 131 && xAxis <= 145 && yAxis >= 63 && yAxis <= 77)
@ -329,7 +328,7 @@ public class GuiDigitalMiner extends GuiMekanism
ArrayList data = new ArrayList();
data.add(9);
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
}
if(xAxis >= 144 && xAxis <= 160 && yAxis >= 27 && yAxis <= 43)
@ -369,7 +368,7 @@ public class GuiDigitalMiner extends GuiMekanism
data.add(true);
}
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
}
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);

View file

@ -9,7 +9,6 @@ import java.util.Set;
import mekanism.api.Coord4D;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.inventory.container.ContainerNull;
import mekanism.common.miner.MItemStackFilter;
import mekanism.common.miner.MMaterialFilter;
@ -174,17 +173,17 @@ public class GuiDigitalMinerConfig extends GuiMekanism
if(filter instanceof MItemStackFilter)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketDigitalMinerGui().setParams(MinerGuiPacket.SERVER_INDEX, Coord4D.get(tileEntity), 1, getFilterIndex()+i));
Mekanism.packetPipeline.sendToServer(new PacketDigitalMinerGui(MinerGuiPacket.SERVER_INDEX, Coord4D.get(tileEntity), 1, getFilterIndex()+i));
}
else if(filter instanceof MOreDictFilter)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketDigitalMinerGui().setParams(MinerGuiPacket.SERVER_INDEX, Coord4D.get(tileEntity), 2, getFilterIndex()+i));
Mekanism.packetPipeline.sendToServer(new PacketDigitalMinerGui(MinerGuiPacket.SERVER_INDEX, Coord4D.get(tileEntity), 2, getFilterIndex()+i));
}
else if(filter instanceof MMaterialFilter)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketDigitalMinerGui().setParams(MinerGuiPacket.SERVER_INDEX, Coord4D.get(tileEntity), 3, getFilterIndex()+i));
Mekanism.packetPipeline.sendToServer(new PacketDigitalMinerGui(MinerGuiPacket.SERVER_INDEX, Coord4D.get(tileEntity), 3, getFilterIndex()+i));
}
}
}
@ -193,7 +192,7 @@ public class GuiDigitalMinerConfig extends GuiMekanism
if(xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketDigitalMinerGui().setParams(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 4));
Mekanism.packetPipeline.sendToServer(new PacketDigitalMinerGui(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 4));
}
if(xAxis >= 39 && xAxis <= 50 && yAxis >= 67 && yAxis <= 78)
@ -219,7 +218,7 @@ public class GuiDigitalMinerConfig extends GuiMekanism
ArrayList data = new ArrayList();
data.add(10);
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
}
}
@ -286,7 +285,7 @@ public class GuiDigitalMinerConfig extends GuiMekanism
if(guibutton.id == 0)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketDigitalMinerGui().setParams(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 5));
Mekanism.packetPipeline.sendToServer(new PacketDigitalMinerGui(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 5));
}
}
@ -507,7 +506,7 @@ public class GuiDigitalMinerConfig extends GuiMekanism
data.add(6);
data.add(toUse);
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
radiusField.setText("");
}
@ -523,7 +522,7 @@ public class GuiDigitalMinerConfig extends GuiMekanism
data.add(7);
data.add(toUse);
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
minField.setText("");
}
@ -539,7 +538,7 @@ public class GuiDigitalMinerConfig extends GuiMekanism
data.add(8);
data.add(toUse);
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
maxField.setText("");
}

View file

@ -6,7 +6,6 @@ import mekanism.api.energy.IEnergizedItem;
import mekanism.common.IElectricChest;
import mekanism.common.Mekanism;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.inventory.container.ContainerElectricChest;
import mekanism.common.network.PacketElectricChest;
import mekanism.common.network.PacketElectricChest.ElectricChestPacketType;
@ -124,10 +123,10 @@ public class GuiElectricChest extends GuiMekanism
if(isBlock)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketElectricChest().setParams(ElectricChestPacketType.LOCK, !getLocked(), true, Coord4D.get(tileEntity)));
Mekanism.packetPipeline.sendToServer(new PacketElectricChest(ElectricChestPacketType.LOCK, !getLocked(), true, Coord4D.get(tileEntity)));
}
else {
PacketHandler.sendPacket(Transmission.SERVER, new PacketElectricChest().setParams(ElectricChestPacketType.LOCK, !getLocked(), false));
Mekanism.packetPipeline.sendToServer(new PacketElectricChest(ElectricChestPacketType.LOCK, !getLocked(), false));
ItemStack stack = mc.thePlayer.getCurrentEquippedItem();
((IElectricChest)stack.getItem()).setLocked(stack, !getLocked());

View file

@ -15,7 +15,6 @@ import mekanism.client.gui.GuiSlot.SlotOverlay;
import mekanism.client.gui.GuiSlot.SlotType;
import mekanism.common.Mekanism;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.inventory.container.ContainerElectrolyticSeparator;
import mekanism.common.network.PacketTileEntity;
import mekanism.common.tile.TileEntityElectrolyticSeparator;
@ -99,7 +98,7 @@ public class GuiElectrolyticSeparator extends GuiMekanism
ArrayList data = new ArrayList();
data.add((byte)0);
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
}
@ -108,7 +107,7 @@ public class GuiElectrolyticSeparator extends GuiMekanism
ArrayList data = new ArrayList();
data.add((byte)1);
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
}

View file

@ -4,7 +4,6 @@ import java.util.ArrayList;
import mekanism.api.Coord4D;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.inventory.container.ContainerGasTank;
import mekanism.common.network.PacketTileEntity;
import mekanism.common.tile.TileEntityGasTank;
@ -82,7 +81,7 @@ public class GuiGasTank extends GuiMekanism
ArrayList data = new ArrayList();
data.add(0);
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
}

View file

@ -10,7 +10,6 @@ import java.util.Set;
import mekanism.api.Coord4D;
import mekanism.client.render.MekanismRenderer;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.inventory.container.ContainerNull;
import mekanism.common.network.PacketLogisticalSorterGui;
import mekanism.common.network.PacketLogisticalSorterGui.SorterGuiPacket;
@ -163,17 +162,17 @@ public class GuiLogisticalSorter extends GuiMekanism
if(filter instanceof TItemStackFilter)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketLogisticalSorterGui().setParams(SorterGuiPacket.SERVER_INDEX, Coord4D.get(tileEntity), 1, getFilterIndex()+i));
Mekanism.packetPipeline.sendToServer(new PacketLogisticalSorterGui(SorterGuiPacket.SERVER_INDEX, Coord4D.get(tileEntity), 1, getFilterIndex()+i));
}
else if(filter instanceof TOreDictFilter)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketLogisticalSorterGui().setParams(SorterGuiPacket.SERVER_INDEX, Coord4D.get(tileEntity), 2, getFilterIndex()+i));
Mekanism.packetPipeline.sendToServer(new PacketLogisticalSorterGui(SorterGuiPacket.SERVER_INDEX, Coord4D.get(tileEntity), 2, getFilterIndex()+i));
}
else if(filter instanceof TMaterialFilter)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketLogisticalSorterGui().setParams(SorterGuiPacket.SERVER_INDEX, Coord4D.get(tileEntity), 3, getFilterIndex()+i));
Mekanism.packetPipeline.sendToServer(new PacketLogisticalSorterGui(SorterGuiPacket.SERVER_INDEX, Coord4D.get(tileEntity), 3, getFilterIndex()+i));
}
}
}
@ -184,7 +183,7 @@ public class GuiLogisticalSorter extends GuiMekanism
ArrayList data = new ArrayList();
data.add(1);
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
}
@ -193,7 +192,7 @@ public class GuiLogisticalSorter extends GuiMekanism
ArrayList data = new ArrayList();
data.add(2);
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
}
}
@ -209,7 +208,7 @@ public class GuiLogisticalSorter extends GuiMekanism
data.add(0);
data.add(button);
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
mc.sndManager.playSoundFX("mekanism:etc.Ding", 1.0F, 1.0F);
}
}
@ -259,7 +258,7 @@ public class GuiLogisticalSorter extends GuiMekanism
if(guibutton.id == 0)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketLogisticalSorterGui().setParams(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), 4));
Mekanism.packetPipeline.sendToServer(new PacketLogisticalSorterGui(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), 4));
}
}

View file

@ -2,7 +2,6 @@ package mekanism.client.gui;
import mekanism.api.Coord4D;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.inventory.container.ContainerNull;
import mekanism.common.network.PacketDigitalMinerGui;
import mekanism.common.network.PacketDigitalMinerGui.MinerGuiPacket;
@ -50,15 +49,15 @@ public class GuiMFilterSelect extends GuiMekanism
if(guibutton.id == 0)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketDigitalMinerGui().setParams(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 1));
Mekanism.packetPipeline.sendToServer(new PacketDigitalMinerGui(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 1));
}
else if(guibutton.id == 1)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketDigitalMinerGui().setParams(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 2));
Mekanism.packetPipeline.sendToServer(new PacketDigitalMinerGui(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 2));
}
else if(guibutton.id == 2)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketDigitalMinerGui().setParams(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 3));
Mekanism.packetPipeline.sendToServer(new PacketDigitalMinerGui(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 3));
}
}
@ -109,7 +108,7 @@ public class GuiMFilterSelect extends GuiMekanism
if(xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketDigitalMinerGui().setParams(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
Mekanism.packetPipeline.sendToServer(new PacketDigitalMinerGui(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
}
}
}

View file

@ -3,7 +3,6 @@ package mekanism.client.gui;
import mekanism.api.Coord4D;
import mekanism.api.EnumColor;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.inventory.container.ContainerFilter;
import mekanism.common.miner.MItemStackFilter;
import mekanism.common.network.PacketDigitalMinerGui;
@ -87,13 +86,13 @@ public class GuiMItemStackFilter extends GuiMekanism
{
if(isNew)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketNewFilter().setParams(Coord4D.get(tileEntity), filter));
Mekanism.packetPipeline.sendToServer(new PacketNewFilter(Coord4D.get(tileEntity), filter));
}
else {
PacketHandler.sendPacket(Transmission.SERVER, new PacketEditFilter().setParams(Coord4D.get(tileEntity), false, origFilter, filter));
Mekanism.packetPipeline.sendToServer(new PacketEditFilter(Coord4D.get(tileEntity), false, origFilter, filter));
}
PacketHandler.sendPacket(Transmission.SERVER, new PacketDigitalMinerGui().setParams(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
Mekanism.packetPipeline.sendToServer(new PacketDigitalMinerGui(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
}
else if(filter.itemType == null)
{
@ -103,8 +102,8 @@ public class GuiMItemStackFilter extends GuiMekanism
}
else if(guibutton.id == 1)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketEditFilter().setParams(Coord4D.get(tileEntity), true, origFilter));
PacketHandler.sendPacket(Transmission.SERVER, new PacketDigitalMinerGui().setParams(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
Mekanism.packetPipeline.sendToServer(new PacketEditFilter(Coord4D.get(tileEntity), true, origFilter));
Mekanism.packetPipeline.sendToServer(new PacketDigitalMinerGui(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
}
}
@ -200,7 +199,7 @@ public class GuiMItemStackFilter extends GuiMekanism
if(xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketDigitalMinerGui().setParams(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), isNew ? 5 : 0));
Mekanism.packetPipeline.sendToServer(new PacketDigitalMinerGui(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), isNew ? 5 : 0));
}
if(xAxis >= 12 && xAxis <= 28 && yAxis >= 19 && yAxis <= 35)

View file

@ -3,7 +3,6 @@ package mekanism.client.gui;
import mekanism.api.Coord4D;
import mekanism.api.EnumColor;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.inventory.container.ContainerFilter;
import mekanism.common.miner.MMaterialFilter;
import mekanism.common.network.PacketDigitalMinerGui;
@ -87,13 +86,13 @@ public class GuiMMaterialFilter extends GuiMekanism
{
if(isNew)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketNewFilter().setParams(Coord4D.get(tileEntity), filter));
Mekanism.packetPipeline.sendToServer(new PacketNewFilter(Coord4D.get(tileEntity), filter));
}
else {
PacketHandler.sendPacket(Transmission.SERVER, new PacketEditFilter().setParams(Coord4D.get(tileEntity), false, origFilter, filter));
Mekanism.packetPipeline.sendToServer(new PacketEditFilter(Coord4D.get(tileEntity), false, origFilter, filter));
}
PacketHandler.sendPacket(Transmission.SERVER, new PacketDigitalMinerGui().setParams(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
Mekanism.packetPipeline.sendToServer(new PacketDigitalMinerGui(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
}
else if(filter.materialItem == null)
{
@ -103,8 +102,8 @@ public class GuiMMaterialFilter extends GuiMekanism
}
else if(guibutton.id == 1)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketEditFilter().setParams(Coord4D.get(tileEntity), true, origFilter));
PacketHandler.sendPacket(Transmission.SERVER, new PacketDigitalMinerGui().setParams(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
Mekanism.packetPipeline.sendToServer(new PacketEditFilter(Coord4D.get(tileEntity), true, origFilter));
Mekanism.packetPipeline.sendToServer(new PacketDigitalMinerGui(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
}
}
@ -200,7 +199,7 @@ public class GuiMMaterialFilter extends GuiMekanism
if(xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketDigitalMinerGui().setParams(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), isNew ? 5 : 0));
Mekanism.packetPipeline.sendToServer(new PacketDigitalMinerGui(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), isNew ? 5 : 0));
}
if(xAxis >= 12 && xAxis <= 28 && yAxis >= 19 && yAxis <= 35)

View file

@ -6,7 +6,6 @@ import java.util.List;
import mekanism.api.Coord4D;
import mekanism.api.EnumColor;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.inventory.container.ContainerFilter;
import mekanism.common.miner.MOreDictFilter;
import mekanism.common.network.PacketDigitalMinerGui;
@ -131,13 +130,13 @@ public class GuiMOreDictFilter extends GuiMekanism
{
if(isNew)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketNewFilter().setParams(Coord4D.get(tileEntity), filter));
Mekanism.packetPipeline.sendToServer(new PacketNewFilter(Coord4D.get(tileEntity), filter));
}
else {
PacketHandler.sendPacket(Transmission.SERVER, new PacketEditFilter().setParams(Coord4D.get(tileEntity), false, origFilter, filter));
Mekanism.packetPipeline.sendToServer(new PacketEditFilter(Coord4D.get(tileEntity), false, origFilter, filter));
}
PacketHandler.sendPacket(Transmission.SERVER, new PacketDigitalMinerGui().setParams(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
Mekanism.packetPipeline.sendToServer(new PacketDigitalMinerGui(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
}
else {
status = EnumColor.DARK_RED + "No key";
@ -146,8 +145,8 @@ public class GuiMOreDictFilter extends GuiMekanism
}
else if(guibutton.id == 1)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketEditFilter().setParams(Coord4D.get(tileEntity), true, origFilter));
PacketHandler.sendPacket(Transmission.SERVER, new PacketDigitalMinerGui().setParams(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
Mekanism.packetPipeline.sendToServer(new PacketEditFilter(Coord4D.get(tileEntity), true, origFilter));
Mekanism.packetPipeline.sendToServer(new PacketDigitalMinerGui(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
}
}
@ -264,7 +263,7 @@ public class GuiMOreDictFilter extends GuiMekanism
if(xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketDigitalMinerGui().setParams(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), isNew ? 5 : 0));
Mekanism.packetPipeline.sendToServer(new PacketDigitalMinerGui(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), isNew ? 5 : 0));
}
if(xAxis >= 131 && xAxis <= 143 && yAxis >= 47 && yAxis <= 59)

View file

@ -11,7 +11,6 @@ import mekanism.client.gui.GuiProgress.ProgressBar;
import mekanism.client.gui.GuiSlot.SlotOverlay;
import mekanism.client.gui.GuiSlot.SlotType;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.inventory.container.ContainerMetallurgicInfuser;
import mekanism.common.network.PacketTileEntity;
import mekanism.common.tile.TileEntityMetallurgicInfuser;
@ -121,7 +120,7 @@ public class GuiMetallurgicInfuser extends GuiMekanism
ArrayList data = new ArrayList();
data.add(0);
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
}
}

View file

@ -5,7 +5,6 @@ import mekanism.api.Coord4D;
import mekanism.api.energy.IEnergizedItem;
import mekanism.common.IElectricChest;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.network.PacketElectricChest;
import mekanism.common.network.PacketElectricChest.ElectricChestPacketType;
import mekanism.common.tile.TileEntityElectricChest;
@ -136,11 +135,11 @@ public class GuiPasswordEnter extends GuiScreen
if(isBlock)
{
tileEntity.setEnergy(tileEntity.getEnergy() - 100);
PacketHandler.sendPacket(Transmission.SERVER, new PacketElectricChest().setParams(ElectricChestPacketType.SERVER_OPEN, true, true, Coord4D.get(tileEntity)));
Mekanism.packetPipeline.sendToServer(new PacketElectricChest(ElectricChestPacketType.SERVER_OPEN, true, true, Coord4D.get(tileEntity)));
}
else {
((IEnergizedItem)itemStack.getItem()).setEnergy(itemStack, ((IEnergizedItem)itemStack.getItem()).getEnergy(itemStack) - 100);
PacketHandler.sendPacket(Transmission.SERVER, new PacketElectricChest().setParams(ElectricChestPacketType.SERVER_OPEN, true, false));
Mekanism.packetPipeline.sendToServer(new PacketElectricChest(ElectricChestPacketType.SERVER_OPEN, true, false));
}
mc.sndManager.playSoundFX("mekanism:etc.Success", 1.0F, 1.0F);

View file

@ -4,7 +4,6 @@ import mekanism.api.EnumColor;
import mekanism.api.Coord4D;
import mekanism.common.IElectricChest;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.network.PacketElectricChest;
import mekanism.common.network.PacketElectricChest.ElectricChestPacketType;
import mekanism.common.tile.TileEntityElectricChest;
@ -163,13 +162,13 @@ public class GuiPasswordModify extends GuiScreen
else {
if(isBlock)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketElectricChest().setParams(ElectricChestPacketType.PASSWORD, confirmPasswordField.getText(), true, Coord4D.get(tileEntity)));
PacketHandler.sendPacket(Transmission.SERVER, new PacketElectricChest().setParams(ElectricChestPacketType.SERVER_OPEN, false, true, Coord4D.get(tileEntity)));
Mekanism.packetPipeline.sendToServer(new PacketElectricChest(ElectricChestPacketType.PASSWORD, confirmPasswordField.getText(), true, Coord4D.get(tileEntity)));
Mekanism.packetPipeline.sendToServer(new PacketElectricChest(ElectricChestPacketType.SERVER_OPEN, false, true, Coord4D.get(tileEntity)));
}
else {
((IElectricChest)itemStack.getItem()).setPassword(itemStack, confirmPasswordField.getText());
PacketHandler.sendPacket(Transmission.SERVER, new PacketElectricChest().setParams(ElectricChestPacketType.PASSWORD, confirmPasswordField.getText(), false));
PacketHandler.sendPacket(Transmission.SERVER, new PacketElectricChest().setParams(ElectricChestPacketType.SERVER_OPEN, false, false));
Mekanism.packetPipeline.sendToServer(new PacketElectricChest(ElectricChestPacketType.PASSWORD, confirmPasswordField.getText(), false));
Mekanism.packetPipeline.sendToServer(new PacketElectricChest(ElectricChestPacketType.SERVER_OPEN, false, false));
}
}
}

View file

@ -1,7 +1,6 @@
package mekanism.client.gui;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.item.ItemPortableTeleporter;
import mekanism.common.network.PacketDigitUpdate;
import mekanism.common.network.PacketPortableTeleport;
@ -83,7 +82,7 @@ public class GuiPortableTeleporter extends GuiScreen
{
if(guibutton.id == 0)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketPortableTeleport());
Mekanism.packetPipeline.sendToServer(new PacketPortableTeleport());
mc.setIngameFocus();
}
}
@ -98,25 +97,25 @@ public class GuiPortableTeleporter extends GuiScreen
if(xAxis > 23 && xAxis < 37 && yAxis > 44 && yAxis < 58)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketDigitUpdate().setParams(0, getIncrementedNumber(((ItemPortableTeleporter)itemStack.getItem()).getDigit(itemStack, 0))));
Mekanism.packetPipeline.sendToServer(new PacketDigitUpdate(0, getIncrementedNumber(((ItemPortableTeleporter)itemStack.getItem()).getDigit(itemStack, 0))));
((ItemPortableTeleporter)itemStack.getItem()).setDigit(itemStack, 0, getIncrementedNumber(((ItemPortableTeleporter)itemStack.getItem()).getDigit(itemStack, 0)));
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
}
else if(xAxis > 62 && xAxis < 76 && yAxis > 44 && yAxis < 58)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketDigitUpdate().setParams(1, getIncrementedNumber(((ItemPortableTeleporter)itemStack.getItem()).getDigit(itemStack, 1))));
Mekanism.packetPipeline.sendToServer(new PacketDigitUpdate(1, getIncrementedNumber(((ItemPortableTeleporter)itemStack.getItem()).getDigit(itemStack, 1))));
((ItemPortableTeleporter)itemStack.getItem()).setDigit(itemStack, 1, getIncrementedNumber(((ItemPortableTeleporter)itemStack.getItem()).getDigit(itemStack, 1)));
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
}
else if(xAxis > 101 && xAxis < 115 && yAxis > 44 && yAxis < 58)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketDigitUpdate().setParams(2, getIncrementedNumber(((ItemPortableTeleporter)itemStack.getItem()).getDigit(itemStack, 2))));
Mekanism.packetPipeline.sendToServer(new PacketDigitUpdate(2, getIncrementedNumber(((ItemPortableTeleporter)itemStack.getItem()).getDigit(itemStack, 2))));
((ItemPortableTeleporter)itemStack.getItem()).setDigit(itemStack, 2, getIncrementedNumber(((ItemPortableTeleporter)itemStack.getItem()).getDigit(itemStack, 2)));
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
}
else if(xAxis > 140 && xAxis < 154 && yAxis > 44 && yAxis < 58)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketDigitUpdate().setParams(3, getIncrementedNumber(((ItemPortableTeleporter)itemStack.getItem()).getDigit(itemStack, 3))));
Mekanism.packetPipeline.sendToServer(new PacketDigitUpdate(3, getIncrementedNumber(((ItemPortableTeleporter)itemStack.getItem()).getDigit(itemStack, 3))));
((ItemPortableTeleporter)itemStack.getItem()).setDigit(itemStack, 3, getIncrementedNumber(((ItemPortableTeleporter)itemStack.getItem()).getDigit(itemStack, 3)));
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
}

View file

@ -4,7 +4,6 @@ import mekanism.api.Coord4D;
import mekanism.common.IRedstoneControl;
import mekanism.common.IRedstoneControl.RedstoneControl;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.network.PacketRedstoneControl;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
@ -75,7 +74,7 @@ public class GuiRedstoneControl extends GuiElement
int ordinalToSet = current.ordinal() < (RedstoneControl.values().length-1) ? current.ordinal()+1 : 0;
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketRedstoneControl().setParams(Coord4D.get(tileEntity), RedstoneControl.values()[ordinalToSet]));
Mekanism.packetPipeline.sendToServer(new PacketRedstoneControl(Coord4D.get(tileEntity), RedstoneControl.values()[ordinalToSet]));
}
}
}

View file

@ -2,7 +2,6 @@ package mekanism.client.gui;
import mekanism.common.Mekanism;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.inventory.container.ContainerRobitCrafting;
import mekanism.common.network.PacketRobit;
import mekanism.common.network.PacketRobit.RobitPacketType;
@ -105,7 +104,7 @@ public class GuiRobitCrafting extends GuiMekanism
if(xAxis >= 179 && xAxis <= 197 && yAxis >= 10 && yAxis <= 28)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketRobit().setParams(RobitPacketType.GUI, 0, entityId));
Mekanism.packetPipeline.sendToServer(new PacketRobit(RobitPacketType.GUI, 0, entityId));
mc.thePlayer.openGui(Mekanism.instance, 21, mc.theWorld, entityId, 0, 0);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 30 && yAxis <= 48)
@ -115,19 +114,19 @@ public class GuiRobitCrafting extends GuiMekanism
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 50 && yAxis <= 68)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketRobit().setParams(RobitPacketType.GUI, 2, entityId));
Mekanism.packetPipeline.sendToServer(new PacketRobit(RobitPacketType.GUI, 2, entityId));
mc.thePlayer.openGui(Mekanism.instance, 23, mc.theWorld, entityId, 0, 0);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 70 && yAxis <= 88)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketRobit().setParams(RobitPacketType.GUI, 3, entityId));
Mekanism.packetPipeline.sendToServer(new PacketRobit(RobitPacketType.GUI, 3, entityId));
mc.thePlayer.openGui(Mekanism.instance, 24, mc.theWorld, entityId, 0, 0);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 90 && yAxis <= 108)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketRobit().setParams(RobitPacketType.GUI, 4, entityId));
Mekanism.packetPipeline.sendToServer(new PacketRobit(RobitPacketType.GUI, 4, entityId));
mc.thePlayer.openGui(Mekanism.instance, 25, mc.theWorld, entityId, 0, 0);
}
}

View file

@ -2,7 +2,6 @@ package mekanism.client.gui;
import mekanism.common.Mekanism;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.entity.EntityRobit;
import mekanism.common.inventory.container.ContainerRobitInventory;
import mekanism.common.network.PacketRobit;
@ -105,13 +104,13 @@ public class GuiRobitInventory extends GuiMekanism
if(xAxis >= 179 && xAxis <= 197 && yAxis >= 10 && yAxis <= 28)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketRobit().setParams(RobitPacketType.GUI, 0, robit.getEntityId()));
Mekanism.packetPipeline.sendToServer(new PacketRobit(RobitPacketType.GUI, 0, robit.getEntityId()));
mc.thePlayer.openGui(Mekanism.instance, 21, mc.theWorld, robit.getEntityId(), 0, 0);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 30 && yAxis <= 48)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketRobit().setParams(RobitPacketType.GUI, 1, robit.getEntityId()));
Mekanism.packetPipeline.sendToServer(new PacketRobit(RobitPacketType.GUI, 1, robit.getEntityId()));
mc.thePlayer.openGui(Mekanism.instance, 22, mc.theWorld, robit.getEntityId(), 0, 0);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 50 && yAxis <= 68)
@ -121,13 +120,13 @@ public class GuiRobitInventory extends GuiMekanism
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 70 && yAxis <= 88)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketRobit().setParams(RobitPacketType.GUI, 3, robit.getEntityId()));
Mekanism.packetPipeline.sendToServer(new PacketRobit(RobitPacketType.GUI, 3, robit.getEntityId()));
mc.thePlayer.openGui(Mekanism.instance, 24, mc.theWorld, robit.getEntityId(), 0, 0);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 90 && yAxis <= 108)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketRobit().setParams(RobitPacketType.GUI, 4, robit.getEntityId()));
Mekanism.packetPipeline.sendToServer(new PacketRobit(RobitPacketType.GUI, 4, robit.getEntityId()));
mc.thePlayer.openGui(Mekanism.instance, 25, mc.theWorld, robit.getEntityId(), 0, 0);
}
}

View file

@ -2,7 +2,6 @@ package mekanism.client.gui;
import mekanism.common.Mekanism;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.entity.EntityRobit;
import mekanism.common.inventory.container.ContainerRobitMain;
import mekanism.common.network.PacketRobit;
@ -47,7 +46,7 @@ public class GuiRobitMain extends GuiMekanism
{
if(nameChangeField.getText() != null && !nameChangeField.getText().isEmpty())
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketRobit().setParams(RobitPacketType.NAME, nameChangeField.getText(), robit.getEntityId()));
Mekanism.packetPipeline.sendToServer(new PacketRobit(RobitPacketType.NAME, nameChangeField.getText(), robit.getEntityId()));
toggleNameChange();
nameChangeField.setText("");
}
@ -272,31 +271,31 @@ public class GuiRobitMain extends GuiMekanism
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 30 && yAxis <= 48)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketRobit().setParams(RobitPacketType.GUI, 1, robit.getEntityId()));
Mekanism.packetPipeline.sendToServer(new PacketRobit(RobitPacketType.GUI, 1, robit.getEntityId()));
mc.thePlayer.openGui(Mekanism.instance, 22, mc.theWorld, robit.getEntityId(), 0, 0);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 50 && yAxis <= 68)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketRobit().setParams(RobitPacketType.GUI, 2, robit.getEntityId()));
Mekanism.packetPipeline.sendToServer(new PacketRobit(RobitPacketType.GUI, 2, robit.getEntityId()));
mc.thePlayer.openGui(Mekanism.instance, 23, mc.theWorld, robit.getEntityId(), 0, 0);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 70 && yAxis <= 88)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketRobit().setParams(RobitPacketType.GUI, 3, robit.getEntityId()));
Mekanism.packetPipeline.sendToServer(new PacketRobit(RobitPacketType.GUI, 3, robit.getEntityId()));
mc.thePlayer.openGui(Mekanism.instance, 24, mc.theWorld, robit.getEntityId(), 0, 0);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 90 && yAxis <= 108)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketRobit().setParams(RobitPacketType.GUI, 4, robit.getEntityId()));
Mekanism.packetPipeline.sendToServer(new PacketRobit(RobitPacketType.GUI, 4, robit.getEntityId()));
mc.thePlayer.openGui(Mekanism.instance, 25, mc.theWorld, robit.getEntityId(), 0, 0);
}
else if(xAxis >= 152 && xAxis <= 170 && yAxis >= 54 && yAxis <= 72)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketRobit().setParams(RobitPacketType.FOLLOW, robit.getEntityId()));
Mekanism.packetPipeline.sendToServer(new PacketRobit(RobitPacketType.FOLLOW, robit.getEntityId()));
}
else if(xAxis >= 6 && xAxis <= 24 && yAxis >= 54 && yAxis <= 72)
{
@ -306,13 +305,13 @@ public class GuiRobitMain extends GuiMekanism
else if(xAxis >= 6 && xAxis <= 24 && yAxis >= 16 && yAxis <= 34)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketRobit().setParams(RobitPacketType.GO_HOME, robit.getEntityId()));
Mekanism.packetPipeline.sendToServer(new PacketRobit(RobitPacketType.GO_HOME, robit.getEntityId()));
mc.displayGuiScreen(null);
}
else if(xAxis >= 6 && xAxis <= 24 && yAxis >= 35 && yAxis <= 53)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketRobit().setParams(RobitPacketType.DROP_PICKUP, robit.getEntityId()));
Mekanism.packetPipeline.sendToServer(new PacketRobit(RobitPacketType.DROP_PICKUP, robit.getEntityId()));
}
}
}

View file

@ -4,7 +4,6 @@ import java.util.List;
import mekanism.common.Mekanism;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.inventory.container.ContainerRobitRepair;
import mekanism.common.network.PacketRobit;
import mekanism.common.network.PacketRobit.RobitPacketType;
@ -149,25 +148,25 @@ public class GuiRobitRepair extends GuiMekanism implements ICrafting
if(xAxis >= 179 && xAxis <= 197 && yAxis >= 10 && yAxis <= 28)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketRobit().setParams(RobitPacketType.GUI, 0, entityId));
Mekanism.packetPipeline.sendToServer(new PacketRobit(RobitPacketType.GUI, 0, entityId));
mc.thePlayer.openGui(Mekanism.instance, 21, mc.theWorld, entityId, 0, 0);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 30 && yAxis <= 48)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketRobit().setParams(RobitPacketType.GUI, 1, entityId));
Mekanism.packetPipeline.sendToServer(new PacketRobit(RobitPacketType.GUI, 1, entityId));
mc.thePlayer.openGui(Mekanism.instance, 22, mc.theWorld, entityId, 0, 0);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 50 && yAxis <= 68)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketRobit().setParams(RobitPacketType.GUI, 2, entityId));
Mekanism.packetPipeline.sendToServer(new PacketRobit(RobitPacketType.GUI, 2, entityId));
mc.thePlayer.openGui(Mekanism.instance, 23, mc.theWorld, entityId, 0, 0);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 70 && yAxis <= 88)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketRobit().setParams(RobitPacketType.GUI, 3, entityId));
Mekanism.packetPipeline.sendToServer(new PacketRobit(RobitPacketType.GUI, 3, entityId));
mc.thePlayer.openGui(Mekanism.instance, 24, mc.theWorld, entityId, 0, 0);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 90 && yAxis <= 108)

View file

@ -2,7 +2,6 @@ package mekanism.client.gui;
import mekanism.common.Mekanism;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.entity.EntityRobit;
import mekanism.common.inventory.container.ContainerRobitSmelting;
import mekanism.common.network.PacketRobit;
@ -112,19 +111,19 @@ public class GuiRobitSmelting extends GuiMekanism
if(xAxis >= 179 && xAxis <= 197 && yAxis >= 10 && yAxis <= 28)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketRobit().setParams(RobitPacketType.GUI, 0, robit.getEntityId()));
Mekanism.packetPipeline.sendToServer(new PacketRobit(RobitPacketType.GUI, 0, robit.getEntityId()));
mc.thePlayer.openGui(Mekanism.instance, 21, mc.theWorld, robit.getEntityId(), 0, 0);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 30 && yAxis <= 48)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketRobit().setParams(RobitPacketType.GUI, 1, robit.getEntityId()));
Mekanism.packetPipeline.sendToServer(new PacketRobit(RobitPacketType.GUI, 1, robit.getEntityId()));
mc.thePlayer.openGui(Mekanism.instance, 22, mc.theWorld, robit.getEntityId(), 0, 0);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 50 && yAxis <= 68)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketRobit().setParams(RobitPacketType.GUI, 2, robit.getEntityId()));
Mekanism.packetPipeline.sendToServer(new PacketRobit(RobitPacketType.GUI, 2, robit.getEntityId()));
mc.thePlayer.openGui(Mekanism.instance, 23, mc.theWorld, robit.getEntityId(), 0, 0);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 70 && yAxis <= 88)
@ -134,7 +133,7 @@ public class GuiRobitSmelting extends GuiMekanism
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 90 && yAxis <= 108)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketRobit().setParams(RobitPacketType.GUI, 4, robit.getEntityId()));
Mekanism.packetPipeline.sendToServer(new PacketRobit(RobitPacketType.GUI, 4, robit.getEntityId()));
mc.thePlayer.openGui(Mekanism.instance, 25, mc.theWorld, robit.getEntityId(), 0, 0);
}
}

View file

@ -13,7 +13,6 @@ import mekanism.client.gui.GuiSlot.SlotOverlay;
import mekanism.client.gui.GuiSlot.SlotType;
import mekanism.client.render.MekanismRenderer;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.inventory.container.ContainerRotaryCondensentrator;
import mekanism.common.network.PacketTileEntity;
import mekanism.common.tile.TileEntityRotaryCondensentrator;
@ -157,7 +156,7 @@ public class GuiRotaryCondensentrator extends GuiMekanism
ArrayList data = new ArrayList();
data.add(0);
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
}
}

View file

@ -6,7 +6,6 @@ import mekanism.api.Coord4D;
import mekanism.api.gas.GasStack;
import mekanism.client.render.MekanismRenderer;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.inventory.container.ContainerSalinationController;
import mekanism.common.network.PacketTileEntity;
import mekanism.common.tile.TileEntitySalinationController;
@ -156,7 +155,7 @@ public class GuiSalinationController extends GuiMekanism
ArrayList data = new ArrayList();
data.add(0);
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
}
}

View file

@ -4,7 +4,6 @@ import java.util.ArrayList;
import mekanism.api.Coord4D;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.network.PacketTileEntity;
import mekanism.common.tile.TileEntityFactory;
import mekanism.common.util.MekanismUtils;
@ -71,7 +70,7 @@ public class GuiSortingTab extends GuiElement
{
ArrayList data = new ArrayList();
data.add(0);
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
}
}

View file

@ -2,7 +2,6 @@ package mekanism.client.gui;
import mekanism.api.Coord4D;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.inventory.container.ContainerNull;
import mekanism.common.network.PacketLogisticalSorterGui;
import mekanism.common.network.PacketLogisticalSorterGui.SorterGuiPacket;
@ -50,15 +49,15 @@ public class GuiTFilterSelect extends GuiMekanism
if(guibutton.id == 0)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketLogisticalSorterGui().setParams(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), 1));
Mekanism.packetPipeline.sendToServer(new PacketLogisticalSorterGui(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), 1));
}
else if(guibutton.id == 1)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketLogisticalSorterGui().setParams(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), 2));
Mekanism.packetPipeline.sendToServer(new PacketLogisticalSorterGui(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), 2));
}
else if(guibutton.id == 2)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketLogisticalSorterGui().setParams(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), 3));
Mekanism.packetPipeline.sendToServer(new PacketLogisticalSorterGui(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), 3));
}
}
@ -109,7 +108,7 @@ public class GuiTFilterSelect extends GuiMekanism
if(xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketLogisticalSorterGui().setParams(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
Mekanism.packetPipeline.sendToServer(new PacketLogisticalSorterGui(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
}
}
}

View file

@ -4,7 +4,6 @@ import mekanism.api.Coord4D;
import mekanism.api.EnumColor;
import mekanism.client.render.MekanismRenderer;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.inventory.container.ContainerFilter;
import mekanism.common.network.PacketEditFilter;
import mekanism.common.network.PacketLogisticalSorterGui;
@ -107,13 +106,13 @@ public class GuiTItemStackFilter extends GuiMekanism
if(isNew)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketNewFilter().setParams(Coord4D.get(tileEntity), filter));
Mekanism.packetPipeline.sendToServer(new PacketNewFilter(Coord4D.get(tileEntity), filter));
}
else {
PacketHandler.sendPacket(Transmission.SERVER, new PacketEditFilter().setParams(Coord4D.get(tileEntity), false, origFilter, filter));
Mekanism.packetPipeline.sendToServer(new PacketEditFilter(Coord4D.get(tileEntity), false, origFilter, filter));
}
PacketHandler.sendPacket(Transmission.SERVER, new PacketLogisticalSorterGui().setParams(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
Mekanism.packetPipeline.sendToServer(new PacketLogisticalSorterGui(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
}
else if(min > max)
{
@ -139,8 +138,8 @@ public class GuiTItemStackFilter extends GuiMekanism
}
else if(guibutton.id == 1)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketEditFilter().setParams(Coord4D.get(tileEntity), true, origFilter));
PacketHandler.sendPacket(Transmission.SERVER, new PacketLogisticalSorterGui().setParams(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
Mekanism.packetPipeline.sendToServer(new PacketEditFilter(Coord4D.get(tileEntity), true, origFilter));
Mekanism.packetPipeline.sendToServer(new PacketLogisticalSorterGui(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
}
}
@ -297,7 +296,7 @@ public class GuiTItemStackFilter extends GuiMekanism
if(xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketLogisticalSorterGui().setParams(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), isNew ? 4 : 0));
Mekanism.packetPipeline.sendToServer(new PacketLogisticalSorterGui(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), isNew ? 4 : 0));
}
if(xAxis >= 12 && xAxis <= 28 && yAxis >= 19 && yAxis <= 35)

View file

@ -4,7 +4,6 @@ import mekanism.api.Coord4D;
import mekanism.api.EnumColor;
import mekanism.client.render.MekanismRenderer;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.inventory.container.ContainerFilter;
import mekanism.common.network.PacketEditFilter;
import mekanism.common.network.PacketLogisticalSorterGui;
@ -90,13 +89,13 @@ public class GuiTMaterialFilter extends GuiMekanism
{
if(isNew)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketNewFilter().setParams(Coord4D.get(tileEntity), filter));
Mekanism.packetPipeline.sendToServer(new PacketNewFilter(Coord4D.get(tileEntity), filter));
}
else {
PacketHandler.sendPacket(Transmission.SERVER, new PacketEditFilter().setParams(Coord4D.get(tileEntity), false, origFilter, filter));
Mekanism.packetPipeline.sendToServer(new PacketEditFilter(Coord4D.get(tileEntity), false, origFilter, filter));
}
PacketHandler.sendPacket(Transmission.SERVER, new PacketLogisticalSorterGui().setParams(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
Mekanism.packetPipeline.sendToServer(new PacketLogisticalSorterGui(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
}
else if(filter.materialItem == null)
{
@ -106,8 +105,8 @@ public class GuiTMaterialFilter extends GuiMekanism
}
else if(guibutton.id == 1)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketEditFilter().setParams(Coord4D.get(tileEntity), true, origFilter));
PacketHandler.sendPacket(Transmission.SERVER, new PacketLogisticalSorterGui().setParams(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
Mekanism.packetPipeline.sendToServer(new PacketEditFilter(Coord4D.get(tileEntity), true, origFilter));
Mekanism.packetPipeline.sendToServer(new PacketLogisticalSorterGui(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
}
}
@ -228,7 +227,7 @@ public class GuiTMaterialFilter extends GuiMekanism
if(xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketLogisticalSorterGui().setParams(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), isNew ? 4 : 0));
Mekanism.packetPipeline.sendToServer(new PacketLogisticalSorterGui(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), isNew ? 4 : 0));
}
if(xAxis >= 12 && xAxis <= 28 && yAxis >= 19 && yAxis <= 35)

View file

@ -7,7 +7,6 @@ import mekanism.api.Coord4D;
import mekanism.api.EnumColor;
import mekanism.client.render.MekanismRenderer;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.inventory.container.ContainerFilter;
import mekanism.common.network.PacketEditFilter;
import mekanism.common.network.PacketLogisticalSorterGui;
@ -133,13 +132,13 @@ public class GuiTOreDictFilter extends GuiMekanism
{
if(isNew)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketNewFilter().setParams(Coord4D.get(tileEntity), filter));
Mekanism.packetPipeline.sendToServer(new PacketNewFilter(Coord4D.get(tileEntity), filter));
}
else {
PacketHandler.sendPacket(Transmission.SERVER, new PacketEditFilter().setParams(Coord4D.get(tileEntity), false, origFilter, filter));
Mekanism.packetPipeline.sendToServer(new PacketEditFilter(Coord4D.get(tileEntity), false, origFilter, filter));
}
PacketHandler.sendPacket(Transmission.SERVER, new PacketLogisticalSorterGui().setParams(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
Mekanism.packetPipeline.sendToServer(new PacketLogisticalSorterGui(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
}
else {
status = EnumColor.DARK_RED + MekanismUtils.localize("gui.oredictFilter.noKey");
@ -148,8 +147,8 @@ public class GuiTOreDictFilter extends GuiMekanism
}
else if(guibutton.id == 1)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketEditFilter().setParams(Coord4D.get(tileEntity), true, origFilter));
PacketHandler.sendPacket(Transmission.SERVER, new PacketLogisticalSorterGui().setParams(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
Mekanism.packetPipeline.sendToServer(new PacketEditFilter(Coord4D.get(tileEntity), true, origFilter));
Mekanism.packetPipeline.sendToServer(new PacketLogisticalSorterGui(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), 0));
}
}
@ -291,7 +290,7 @@ public class GuiTOreDictFilter extends GuiMekanism
if(xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketLogisticalSorterGui().setParams(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), isNew ? 4 : 0));
Mekanism.packetPipeline.sendToServer(new PacketLogisticalSorterGui(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), isNew ? 4 : 0));
}
if(xAxis >= 131 && xAxis <= 143 && yAxis >= 47 && yAxis <= 59)

View file

@ -6,7 +6,6 @@ import mekanism.api.Coord4D;
import mekanism.client.gui.GuiSlot.SlotOverlay;
import mekanism.client.gui.GuiSlot.SlotType;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.inventory.container.ContainerTeleporter;
import mekanism.common.network.PacketTileEntity;
import mekanism.common.tile.TileEntityTeleporter;
@ -66,7 +65,7 @@ public class GuiTeleporter extends GuiMekanism
data.add(0);
data.add(getIncrementedNumber(tileEntity.code.digitOne));
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
tileEntity.code.digitOne = getIncrementedNumber(tileEntity.code.digitOne);
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
}
@ -75,7 +74,7 @@ public class GuiTeleporter extends GuiMekanism
data.add(1);
data.add(getIncrementedNumber(tileEntity.code.digitTwo));
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
tileEntity.code.digitTwo = getIncrementedNumber(tileEntity.code.digitTwo);
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
}
@ -84,7 +83,7 @@ public class GuiTeleporter extends GuiMekanism
data.add(2);
data.add(getIncrementedNumber(tileEntity.code.digitThree));
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
tileEntity.code.digitThree = getIncrementedNumber(tileEntity.code.digitThree);
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
}
@ -93,7 +92,7 @@ public class GuiTeleporter extends GuiMekanism
data.add(3);
data.add(getIncrementedNumber(tileEntity.code.digitFour));
PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data));
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
tileEntity.code.digitFour = getIncrementedNumber(tileEntity.code.digitFour);
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
}

View file

@ -3,7 +3,6 @@ package mekanism.client.gui;
import mekanism.api.Coord4D;
import mekanism.common.IUpgradeTile;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.network.PacketRemoveUpgrade;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
@ -83,13 +82,13 @@ public class GuiUpgradeManagement extends GuiElement
if(xAxis >= 179 && xAxis <= 198 && yAxis >= 47 && yAxis <= 54)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketRemoveUpgrade().setParams(Coord4D.get(tileEntity), (byte)0));
Mekanism.packetPipeline.sendToServer(new PacketRemoveUpgrade(Coord4D.get(tileEntity), (byte)0));
}
if(xAxis >= 179 && xAxis <= 198 && yAxis >= 57 && yAxis <= 64)
{
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
PacketHandler.sendPacket(Transmission.SERVER, new PacketRemoveUpgrade().setParams(Coord4D.get(tileEntity), (byte)1));
Mekanism.packetPipeline.sendToServer(new PacketRemoveUpgrade(Coord4D.get(tileEntity), (byte)1));
}
if(xAxis >= 180 && xAxis <= 196 && yAxis >= 11 && yAxis <= 27)

View file

@ -51,12 +51,13 @@ import codechicken.lib.lighting.LightModel;
import codechicken.lib.lighting.LightModel.Light;
import codechicken.lib.render.CCModel;
import codechicken.lib.render.CCRenderState;
import codechicken.lib.render.CCRenderState.IVertexOperation;
import codechicken.lib.render.ColourMultiplier;
import codechicken.lib.render.IVertexModifier;
import codechicken.lib.render.IIconTransformation;
import codechicken.lib.render.uv.IVertexModifier;
import codechicken.lib.render.uv.UVTransformation;
import codechicken.lib.render.TextureUtils;
import codechicken.lib.render.TextureUtils.IIconRegister;
import codechicken.lib.render.UV;
import codechicken.lib.render.uv.UV;
import codechicken.lib.vec.Translation;
import codechicken.lib.vec.Vector3;
import cpw.mods.fml.relauncher.Side;
@ -727,12 +728,12 @@ public class RenderPartTransmitter implements IIconRegister
return display;
}
public static class TransmitterTransformation implements IVertexModifier
public static class TransmitterTransformation implements IVertexOperation
{
public ColourMultiplier colour;
public LightMatrix lightMatrix;
public TransmitterTransformation(Colour color, LazyLightMatrix olm)
public TransmitterTransformation(Colour color, LightMatrix olm)
{
if(color != null)
{

View file

@ -8,7 +8,7 @@ import mekanism.common.util.MekanismUtils;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ChatMessageComponent;
import net.minecraft.util.ChatComponentText;
import net.minecraft.server.MinecraftServer;
public class CommandMekanism extends CommandBase
@ -42,26 +42,26 @@ public class CommandMekanism extends CommandBase
{
if(params.length < 1)
{
sender.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " -------------"));
sender.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + " *Version: " + EnumColor.DARK_GREY + Mekanism.versionNumber));
sender.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + " *Latest Version: " + EnumColor.DARK_GREY + Mekanism.latestVersionNumber));
sender.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + " *Developed on Mac OS X 10.8 Mountain Lion"));
sender.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + " *Code, textures, and ideas by aidancbrady"));
sender.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + " *Recent News: " + EnumColor.INDIGO + Mekanism.recentNews));
sender.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[=======]" + EnumColor.GREY + " -------------"));
sender.addChatMessage(new ChatComponentText(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " -------------"));
sender.addChatMessage(new ChatComponentText(EnumColor.GREY + " *Version: " + EnumColor.DARK_GREY + Mekanism.versionNumber));
sender.addChatMessage(new ChatComponentText(EnumColor.GREY + " *Latest Version: " + EnumColor.DARK_GREY + Mekanism.latestVersionNumber));
sender.addChatMessage(new ChatComponentText(EnumColor.GREY + " *Developed on Mac OS X 10.8 Mountain Lion"));
sender.addChatMessage(new ChatComponentText(EnumColor.GREY + " *Code, textures, and ideas by aidancbrady"));
sender.addChatMessage(new ChatComponentText(EnumColor.GREY + " *Recent News: " + EnumColor.INDIGO + Mekanism.recentNews));
sender.addChatMessage(new ChatComponentText(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[=======]" + EnumColor.GREY + " -------------"));
}
else if(params.length == 1)
{
if(params[0].equalsIgnoreCase("help"))
{
sender.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " -------------"));
sender.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.INDIGO + " /mk" + EnumColor.GREY + " -- displays the main page."));
sender.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.INDIGO + " /mk help" + EnumColor.GREY + " -- displays this guide."));
sender.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.INDIGO + " /mk version" + EnumColor.GREY + " -- displays the version number."));
sender.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.INDIGO + " /mk latest" + EnumColor.GREY + " -- displays the latest version number."));
sender.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.INDIGO + " /mk news" + EnumColor.GREY + " -- displays most recent recent news."));
sender.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.INDIGO + " /mk debug" + EnumColor.GREY + " -- toggles Mekanism's debug mode."));
sender.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[=======]" + EnumColor.GREY + " -------------"));
sender.addChatMessage(new ChatComponentText(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " -------------"));
sender.addChatMessage(new ChatComponentText(EnumColor.INDIGO + " /mk" + EnumColor.GREY + " -- displays the main page."));
sender.addChatMessage(new ChatComponentText(EnumColor.INDIGO + " /mk help" + EnumColor.GREY + " -- displays this guide."));
sender.addChatMessage(new ChatComponentText(EnumColor.INDIGO + " /mk version" + EnumColor.GREY + " -- displays the version number."));
sender.addChatMessage(new ChatComponentText(EnumColor.INDIGO + " /mk latest" + EnumColor.GREY + " -- displays the latest version number."));
sender.addChatMessage(new ChatComponentText(EnumColor.INDIGO + " /mk news" + EnumColor.GREY + " -- displays most recent recent news."));
sender.addChatMessage(new ChatComponentText(EnumColor.INDIGO + " /mk debug" + EnumColor.GREY + " -- toggles Mekanism's debug mode."));
sender.addChatMessage(new ChatComponentText(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[=======]" + EnumColor.GREY + " -------------"));
}
else if(params[0].equalsIgnoreCase("version"))
{
@ -69,28 +69,28 @@ public class CommandMekanism extends CommandBase
{
if(Mekanism.updateNotifications || Mekanism.latestVersionNumber == null || Mekanism.recentNews == null || Mekanism.latestVersionNumber.equals("null"))
{
sender.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Minecraft is in offline mode, could not check for updates."));
sender.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Minecraft is in offline mode, could not check for updates."));
}
else {
sender.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Your client is up to date."));
sender.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Your client is up to date."));
}
}
}
else if(params[0].equalsIgnoreCase("news"))
{
sender.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Most recent news: " + EnumColor.INDIGO + Mekanism.recentNews));
sender.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Most recent news: " + EnumColor.INDIGO + Mekanism.recentNews));
}
else if(params[0].equalsIgnoreCase("latest"))
{
sender.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " The latest version for this mod is " + EnumColor.DARK_GREY + Mekanism.latestVersionNumber + EnumColor.GREY + "."));
sender.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " The latest version for this mod is " + EnumColor.DARK_GREY + Mekanism.latestVersionNumber + EnumColor.GREY + "."));
}
else if(params[0].equalsIgnoreCase("debug"))
{
Mekanism.debug = !Mekanism.debug;
sender.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Debug mode set to " + EnumColor.DARK_GREY + Mekanism.debug));
sender.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Debug mode set to " + EnumColor.DARK_GREY + Mekanism.debug));
}
else {
sender.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Unknown command. Type '" + EnumColor.INDIGO + "/mk help" + EnumColor.GREY + "' for help."));
sender.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Unknown command. Type '" + EnumColor.INDIGO + "/mk help" + EnumColor.GREY + "' for help."));
}
}
}

View file

@ -2,7 +2,6 @@ package mekanism.common;
import java.util.EnumSet;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.item.ItemFreeRunners;
import mekanism.common.item.ItemGasMask;
import mekanism.common.item.ItemJetpack;
@ -47,14 +46,14 @@ public class CommonPlayerTickHandler implements ITickHandler
if(item.getStatus(itemstack) != 2)
{
item.setStatus(itemstack, 2);
PacketHandler.sendPacket(Transmission.SINGLE_CLIENT, new PacketStatusUpdate().setParams(2), player);
Mekanism.packetPipeline.sendTo(new PacketStatusUpdate(2), player);
}
}
else {
if(item.getStatus(itemstack) != 1)
{
item.setStatus(itemstack, 1);
PacketHandler.sendPacket(Transmission.SINGLE_CLIENT, new PacketStatusUpdate().setParams(1), player);
Mekanism.packetPipeline.sendTo(new PacketStatusUpdate(1), player);
}
}
return;
@ -64,7 +63,7 @@ public class CommonPlayerTickHandler implements ITickHandler
if(item.getStatus(itemstack) != 3)
{
item.setStatus(itemstack, 3);
PacketHandler.sendPacket(Transmission.SINGLE_CLIENT, new PacketStatusUpdate().setParams(3), player);
Mekanism.packetPipeline.sendTo(new PacketStatusUpdate(3), player);
}
return;
}
@ -72,7 +71,7 @@ public class CommonPlayerTickHandler implements ITickHandler
if(item.getStatus(itemstack) != 4)
{
item.setStatus(itemstack, 4);
PacketHandler.sendPacket(Transmission.SINGLE_CLIENT, new PacketStatusUpdate().setParams(4), player);
Mekanism.packetPipeline.sendTo(new PacketStatusUpdate(4), player);
}
return;
}
@ -81,7 +80,7 @@ public class CommonPlayerTickHandler implements ITickHandler
if(item.getStatus(itemstack) != 4)
{
item.setStatus(itemstack, 4);
PacketHandler.sendPacket(Transmission.SINGLE_CLIENT, new PacketStatusUpdate().setParams(4), player);
Mekanism.packetPipeline.sendTo(new PacketStatusUpdate(4), player);
}
return;
}

View file

@ -1,5 +1,4 @@
package mekanism.common;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.network.PacketBoxBlacklist;
import mekanism.common.network.PacketConfigSync;
import mekanism.common.network.PacketJetpackData;
@ -8,7 +7,9 @@ import mekanism.common.network.PacketScubaTankData;
import mekanism.common.network.PacketScubaTankData.ScubaTankPacket;
import net.minecraft.entity.player.EntityPlayer;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerChangedDimensionEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent;
public class CommonPlayerTracker
{
@ -18,39 +19,46 @@ public class CommonPlayerTracker
onPlayerLogin(event.player);
}
@Override
public void onPlayerLogin(EntityPlayer player)
{
if(!player.getWorldObj().isRemote)
if(!player.worldObj.isRemote)
{
PacketHandler.sendPacket(Transmission.SINGLE_CLIENT, new PacketConfigSync().setParams(), player);
PacketHandler.sendPacket(Transmission.SINGLE_CLIENT, new PacketBoxBlacklist().setParams(), player);
PacketHandler.sendPacket(Transmission.SINGLE_CLIENT, new PacketJetpackData().setParams(JetpackPacket.FULL), player);
PacketHandler.sendPacket(Transmission.SINGLE_CLIENT, new PacketScubaTankData().setParams(ScubaTankPacket.FULL), player);
Mekanism.packetPipeline.sendTo(new PacketConfigSync(), player);
Mekanism.packetPipeline.sendTo(new PacketBoxBlacklist(), player);
Mekanism.packetPipeline.sendTo(new PacketJetpackData(JetpackPacket.FULL), player);
Mekanism.packetPipeline.sendTo(new PacketScubaTankData(ScubaTankPacket.FULL), player);
System.out.println("[Mekanism] Sent config to '" + player.username + ".'");
Mekanism.logger.info((String) "Sent config to '" + player.getDisplayName() + ".'");
}
}
@Override
@SubscribeEvent
public void onPlayerLogoutEvent(PlayerLoggedOutEvent event)
{
onPlayerLogout(event.player);
}
public void onPlayerLogout(EntityPlayer player)
{
Mekanism.jetpackOn.remove(player);
Mekanism.gasmaskOn.remove(player);
}
@SubscribeEvent
public void onPlayerDimChangedEvent(PlayerChangedDimensionEvent event)
{
onPlayerChangedDimension(event.player);
}
@Override
public void onPlayerChangedDimension(EntityPlayer player)
{
Mekanism.jetpackOn.remove(player);
if(!player.getWorldObj().isRemote)
if(!player.worldObj.isRemote)
{
PacketHandler.sendPacket(Transmission.SINGLE_CLIENT, new PacketJetpackData().setParams(JetpackPacket.FULL), player);
PacketHandler.sendPacket(Transmission.SINGLE_CLIENT, new PacketScubaTankData().setParams(ScubaTankPacket.FULL), player);
Mekanism.packetPipeline.sendTo(new PacketJetpackData(JetpackPacket.FULL), player);
Mekanism.packetPipeline.sendTo(new PacketScubaTankData(ScubaTankPacket.FULL), player);
}
}
@Override
public void onPlayerRespawn(EntityPlayer player) {}
}

View file

@ -1,7 +1,6 @@
package mekanism.common;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@ -12,91 +11,81 @@ import mekanism.common.tile.TileEntityDynamicTank;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.common.ITickHandler;
import cpw.mods.fml.common.TickType;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent;
import cpw.mods.fml.relauncher.Side;
public class CommonWorldTickHandler implements ITickHandler
public class CommonWorldTickHandler
{
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {}
@Override
public void tickEnd(EnumSet<TickType> type, Object... tickData)
@SubscribeEvent
public void onTick(WorldTickEvent event)
{
if(tickData[0] instanceof World)
if(event.side == Side.SERVER && event.phase == Phase.END)
{
ArrayList<Integer> idsToKill = new ArrayList<Integer>();
HashMap<Integer, HashSet<Coord4D>> tilesToKill = new HashMap<Integer, HashSet<Coord4D>>();
World world = (World)tickData[0];
if(!world.isRemote)
{
for(Map.Entry<Integer, DynamicTankCache> entry : Mekanism.dynamicInventories.entrySet())
{
int inventoryID = entry.getKey();
for(Coord4D obj : entry.getValue().locations)
{
if(obj.dimensionId == world.provider.dimensionId)
{
TileEntity tileEntity = obj.getTileEntity(world);
if(!(tileEntity instanceof TileEntityDynamicTank) || ((TileEntityDynamicTank)tileEntity).inventoryID != inventoryID)
{
if(!tilesToKill.containsKey(inventoryID))
{
tilesToKill.put(inventoryID, new HashSet<Coord4D>());
}
tilesToKill.get(inventoryID).add(obj);
}
}
}
if(entry.getValue().locations.isEmpty())
{
idsToKill.add(inventoryID);
}
}
for(Map.Entry<Integer, HashSet<Coord4D>> entry : tilesToKill.entrySet())
{
for(Coord4D obj : entry.getValue())
{
Mekanism.dynamicInventories.get(entry.getKey()).locations.remove(obj);
}
}
for(int inventoryID : idsToKill)
{
for(Coord4D obj : Mekanism.dynamicInventories.get(inventoryID).locations)
{
TileEntityDynamicTank dynamicTank = (TileEntityDynamicTank)obj.getTileEntity(world);
if(dynamicTank != null)
{
dynamicTank.cachedFluid = null;
dynamicTank.inventory = new ItemStack[2];
dynamicTank.inventoryID = -1;
}
}
Mekanism.dynamicInventories.remove(inventoryID);
}
}
tickEnd(event.world);
}
}
@Override
public EnumSet<TickType> ticks()
public void tickEnd(World world)
{
return EnumSet.of(TickType.WORLD);
}
ArrayList<Integer> idsToKill = new ArrayList<Integer>();
HashMap<Integer, HashSet<Coord4D>> tilesToKill = new HashMap<Integer, HashSet<Coord4D>>();
@Override
public String getLabel()
{
return "MekanismCommonWorld";
if(!world.isRemote)
{
for(Map.Entry<Integer, DynamicTankCache> entry : Mekanism.dynamicInventories.entrySet())
{
int inventoryID = entry.getKey();
for(Coord4D obj : entry.getValue().locations)
{
if(obj.dimensionId == world.provider.dimensionId)
{
TileEntity tileEntity = obj.getTileEntity(world);
if(!(tileEntity instanceof TileEntityDynamicTank) || ((TileEntityDynamicTank)tileEntity).inventoryID != inventoryID)
{
if(!tilesToKill.containsKey(inventoryID))
{
tilesToKill.put(inventoryID, new HashSet<Coord4D>());
}
tilesToKill.get(inventoryID).add(obj);
}
}
}
if(entry.getValue().locations.isEmpty())
{
idsToKill.add(inventoryID);
}
}
for(Map.Entry<Integer, HashSet<Coord4D>> entry : tilesToKill.entrySet())
{
for(Coord4D obj : entry.getValue())
{
Mekanism.dynamicInventories.get(entry.getKey()).locations.remove(obj);
}
}
for(int inventoryID : idsToKill)
{
for(Coord4D obj : Mekanism.dynamicInventories.get(inventoryID).locations)
{
TileEntityDynamicTank dynamicTank = (TileEntityDynamicTank)obj.getTileEntity(world);
if(dynamicTank != null)
{
dynamicTank.cachedFluid = null;
dynamicTank.inventory = new ItemStack[2];
dynamicTank.inventoryID = -1;
}
}
Mekanism.dynamicInventories.remove(inventoryID);
}
}
}
}

View file

@ -4,6 +4,8 @@ import java.util.HashMap;
import java.util.Map;
import mekanism.api.Coord4D;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
@ -15,17 +17,17 @@ public class ConnectedTextureRenderer
{
public static final byte[][] sideEdges = {{2, 5, 3, 4}, {2, 5, 3, 4}, {1, 4, 0, 5}, {1, 5, 0, 4}, {1, 3, 0, 2}, {1, 2, 0, 3}};
public int blockID;
public Block block;
public int metadata;
public String iconTitle;
public Map<Integer, IIcon> glassMap = new HashMap<Integer, IIcon>();
public ConnectedTextureRenderer(String title, int id, int meta)
public ConnectedTextureRenderer(String title, Block block, int meta)
{
iconTitle = title;
blockID = id;
this.block = block;
metadata = meta;
}
@ -113,13 +115,13 @@ public class ConnectedTextureRenderer
Coord4D block = obj.getFromSide(ForgeDirection.getOrientation(side));
Coord4D blockabove = obj.getFromSide(ForgeDirection.getOrientation(face));
return (block.getBlockId(access) == blockID && block.getMetadata(access) == metadata) && (blockabove.getBlockId(access) != blockID || blockabove.getMetadata(access) != metadata);
return (block.getBlock(access) == this.block && block.getMetadata(access) == metadata) && (blockabove.getBlock(access) != this.block || blockabove.getMetadata(access) != metadata);
}
@SideOnly(Side.CLIENT)
public boolean shouldRenderSide(IBlockAccess world, int x, int y, int z, int side)
{
Coord4D obj = new Coord4D(x, y, z).getFromSide(ForgeDirection.getOrientation(side).getOpposite());
return obj.getBlockId(world) != blockID || obj.getMetadata(world) != metadata;
return obj.getBlock(world) != block || obj.getMetadata(world) != metadata;
}
}

View file

@ -8,7 +8,6 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.logging.Logger;
import mekanism.api.AdvancedInput;
import mekanism.api.ChanceOutput;
@ -37,7 +36,6 @@ import mekanism.common.EnergyDisplay.EnergyType;
import mekanism.common.EnergyNetwork.EnergyTransferEvent;
import mekanism.common.FluidNetwork.FluidTransferEvent;
import mekanism.common.IFactory.RecipeType;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.Tier.EnergyCubeTier;
import mekanism.common.Tier.FactoryTier;
import mekanism.common.block.BlockBasic;
@ -154,6 +152,9 @@ import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import rebelkeithy.mods.metallurgy.api.IOreInfo;
import rebelkeithy.mods.metallurgy.api.MetallurgyAPI;
import codechicken.multipart.handler.MultipartProxy;
@ -169,7 +170,6 @@ import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.event.FMLServerStoppingEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
@ -186,7 +186,7 @@ public class Mekanism
public static final PacketPipeline packetPipeline = new PacketPipeline();
/** Mekanism logger instance */
public static Logger logger = Logger.getLogger("Minecraft");
public static Logger logger = LogManager.getLogger("");
/** Mekanism proxy instance */
@SidedProxy(clientSide = "mekanism.client.ClientProxy", serverSide = "mekanism.common.CommonProxy")
@ -240,24 +240,6 @@ public class Mekanism
public static Set<Coord4D> ic2Registered = new HashSet<Coord4D>();
public static Set<Coord4D> activeVibrators = new HashSet<Coord4D>();
//Block IDs
public static int basicBlockID;
public static int basicBlock2ID;
public static int machineBlockID;
public static int machineBlock2ID;
public static int oreBlockID;
public static int obsidianTNTID;
public static int energyCubeID;
public static int boundingBlockID;
public static int gasTankID;
public static int cardboardBoxID;
public static int plasticID;
public static int slickPlasticID;
public static int glowPlasticID;
public static int reinforcedPlasticID;
public static int roadPlasticID;
public static int plasticFenceID;
//Items
public static ItemElectricBow ElectricBow;
@ -322,9 +304,6 @@ public class Mekanism
public static Item DirtyDust;
public static Item Shard;
public static Item Crystal;
public static int ITEM_ID = 11200;
public static int BLOCK_ID = 3000;
//General Configuration
public static boolean osmiumGenerationEnabled = true;
@ -442,10 +421,10 @@ public class Mekanism
"***", "XXX", "***", Character.valueOf('*'), Blocks.obsidian, Character.valueOf('X'), Blocks.tnt
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(ElectricBow.getUnchargedItem(), new Object[] {
" AB", "E B", " AB", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('B'), Items.silk, Character.valueOf('E'), EnergyTablet.getUnchargedItem()
" AB", "E B", " AB", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('B'), Items.string, Character.valueOf('E'), EnergyTablet.getUnchargedItem()
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(EnergyTablet.getUnchargedItem(), new Object[] {
"RCR", "ECE", "RCR", Character.valueOf('C'), Items.ingotGold, Character.valueOf('R'), Items.redstone, Character.valueOf('E'), EnrichedAlloy
"RCR", "ECE", "RCR", Character.valueOf('C'), Items.gold_ingot, Character.valueOf('R'), Items.redstone, Character.valueOf('E'), EnrichedAlloy
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(MachineBlock, 1, 0), new Object[] {
"ARA", "CIC", "ARA", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('R'), Items.redstone, Character.valueOf('I'), new ItemStack(BasicBlock, 1, 8), Character.valueOf('C'), "circuitBasic"
@ -457,7 +436,7 @@ public class Mekanism
"SCS", "RIR", "SCS", Character.valueOf('S'), Blocks.cobblestone, Character.valueOf('C'), "circuitBasic", Character.valueOf('R'), Items.redstone, Character.valueOf('I'), new ItemStack(BasicBlock, 1, 8)
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(MachineBlock, 1, 3), new Object[] {
"RLR", "CIC", "RLR", Character.valueOf('R'), Items.redstone, Character.valueOf('L'), Items.bucketLava, Character.valueOf('C'), "circuitBasic", Character.valueOf('I'), new ItemStack(BasicBlock, 1, 8)
"RLR", "CIC", "RLR", Character.valueOf('R'), Items.redstone, Character.valueOf('L'), Items.lava_bucket, Character.valueOf('C'), "circuitBasic", Character.valueOf('I'), new ItemStack(BasicBlock, 1, 8)
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(SpeedUpgrade), new Object[] {
" G ", "APA", " G ", Character.valueOf('P'), "dustOsmium", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('G'), Blocks.glass
@ -478,7 +457,7 @@ public class Mekanism
"RLR", "TIT", "RLR", Character.valueOf('R'), Items.redstone, Character.valueOf('L'), new ItemStack(Items.dye, 1, 4), Character.valueOf('T'), EnergyTablet.getUnchargedItem(), Character.valueOf('I'), new ItemStack(BasicBlock, 1, 8)
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(MekanismUtils.getEnergyCube(EnergyCubeTier.ADVANCED), new Object[] {
"EGE", "TBT", "EGE", Character.valueOf('E'), EnrichedAlloy, Character.valueOf('G'), Items.ingotGold, Character.valueOf('T'), EnergyTablet.getUnchargedItem(), Character.valueOf('B'), MekanismUtils.getEnergyCube(EnergyCubeTier.BASIC)
"EGE", "TBT", "EGE", Character.valueOf('E'), EnrichedAlloy, Character.valueOf('G'), Items.gold_ingot, Character.valueOf('T'), EnergyTablet.getUnchargedItem(), Character.valueOf('B'), MekanismUtils.getEnergyCube(EnergyCubeTier.BASIC)
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(MekanismUtils.getEnergyCube(EnergyCubeTier.ELITE), new Object[] {
"CDC", "TAT", "CDC", Character.valueOf('C'), "circuitBasic", Character.valueOf('D'), Items.diamond, Character.valueOf('T'), EnergyTablet.getUnchargedItem(), Character.valueOf('A'), MekanismUtils.getEnergyCube(EnergyCubeTier.ADVANCED)
@ -490,10 +469,10 @@ public class Mekanism
"RER", Character.valueOf('R'), Items.redstone, Character.valueOf('E'), EnrichedAlloy
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(MachineBlock, 1, 8), new Object[] {
"IFI", "ROR", "IFI", Character.valueOf('I'), Items.ingotIron, Character.valueOf('F'), Blocks.furnaceIdle, Character.valueOf('R'), Items.redstone, Character.valueOf('O'), "ingotOsmium"
"IFI", "ROR", "IFI", Character.valueOf('I'), Items.iron_ingot, Character.valueOf('F'), Blocks.furnace, Character.valueOf('R'), Items.redstone, Character.valueOf('O'), "ingotOsmium"
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(TeleportationCore), new Object[] {
"LAL", "GDG", "LAL", Character.valueOf('L'), new ItemStack(Items.dye, 1, 4), Character.valueOf('A'), AtomicCore, Character.valueOf('G'), Items.ingotGold, Character.valueOf('D'), Items.diamond
"LAL", "GDG", "LAL", Character.valueOf('L'), new ItemStack(Items.dye, 1, 4), Character.valueOf('A'), AtomicCore, Character.valueOf('G'), Items.gold_ingot, Character.valueOf('D'), Items.diamond
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(PortableTeleporter), new Object[] {
" E ", "CTC", " E ", Character.valueOf('E'), EnergyTablet.getUnchargedItem(), Character.valueOf('C'), "circuitBasic", Character.valueOf('T'), TeleportationCore
@ -517,7 +496,7 @@ public class Mekanism
"SCS", "GIG", "SCS", Character.valueOf('S'), Blocks.cobblestone, Character.valueOf('C'), "circuitBasic", Character.valueOf('G'), Blocks.glass, Character.valueOf('I'), new ItemStack(BasicBlock, 1, 8)
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(MachineBlock, 1, 12), new Object[] {
" B ", "ECE", "OOO", Character.valueOf('B'), Items.bucketEmpty, Character.valueOf('E'), EnrichedAlloy, Character.valueOf('C'), new ItemStack(BasicBlock, 1, 8), Character.valueOf('O'), "ingotOsmium"
" B ", "ECE", "OOO", Character.valueOf('B'), Items.bucket, Character.valueOf('E'), EnrichedAlloy, Character.valueOf('C'), new ItemStack(BasicBlock, 1, 8), Character.valueOf('O'), "ingotOsmium"
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(MachineBlock, 1, 13), new Object[] {
"SGS", "CcC", "SSS", Character.valueOf('S'), "ingotSteel", Character.valueOf('G'), Blocks.glass, Character.valueOf('C'), Blocks.chest, Character.valueOf('c'), "circuitBasic"
@ -532,7 +511,7 @@ public class Mekanism
" I ", "ICI", " I ", Character.valueOf('I'), "ingotSteel", Character.valueOf('C'), "circuitBasic"
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(MachineBlock, 1, 14), new Object[] {
"PPP", "SES", Character.valueOf('P'), Blocks.pressurePlateStone, Character.valueOf('S'), "ingotSteel", Character.valueOf('E'), EnergyTablet.getUnchargedItem()
"PPP", "SES", Character.valueOf('P'), Blocks.stone_pressure_plate, Character.valueOf('S'), "ingotSteel", Character.valueOf('E'), EnergyTablet.getUnchargedItem()
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(Robit.getUnchargedItem(), new Object[] {
" S ", "ECE", "OIO", Character.valueOf('S'), "ingotSteel", Character.valueOf('E'), EnergyTablet.getUnchargedItem(), Character.valueOf('C'), AtomicCore, Character.valueOf('O'), "ingotRefinedObsidian", Character.valueOf('I'), new ItemStack(MachineBlock, 1, 13)
@ -544,7 +523,7 @@ public class Mekanism
" O", "SCS", " S ", Character.valueOf('O'), "ingotOsmium", Character.valueOf('S'), "ingotSteel", Character.valueOf('C'), "circuitBasic"
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(MachineBlock, 1, 15), new Object[] {
"IPI", "ICI", "III", Character.valueOf('I'), Items.ingotIron, Character.valueOf('P'), Blocks.pistonBase, Character.valueOf('C'), "circuitBasic"
"IPI", "ICI", "III", Character.valueOf('I'), Items.iron_ingot, Character.valueOf('P'), Blocks.piston, Character.valueOf('C'), "circuitBasic"
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(BasicBlock, 1, 6), new Object[] {
"SSS", "SCS", "SSS", Character.valueOf('S'), Blocks.cobblestone, Character.valueOf('C'), "circuitBasic"
@ -579,7 +558,7 @@ public class Mekanism
"ACA", "ERE", "ACA", Character.valueOf('C'), "circuitBasic", Character.valueOf('A'), AtomicCore, Character.valueOf('E'), new ItemStack(BasicBlock, 1, 8), Character.valueOf('R'), new ItemStack(MachineBlock, 1, 9)
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(MachineBlock2, 1, 4), new Object[] {
"IRI", "ECE", "IRI", Character.valueOf('I'), Items.ingotIron, Character.valueOf('R'), Items.redstone, Character.valueOf('E'), Mekanism.EnrichedAlloy, Character.valueOf('C'), ElectrolyticCore
"IRI", "ECE", "IRI", Character.valueOf('I'), Items.iron_ingot, Character.valueOf('R'), Items.redstone, Character.valueOf('E'), Mekanism.EnrichedAlloy, Character.valueOf('C'), ElectrolyticCore
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(ElectrolyticCore), new Object[] {
"EPE", "IEG", "EPE", Character.valueOf('E'), Mekanism.EnrichedAlloy, Character.valueOf('P'), "dustOsmium", Character.valueOf('I'), "dustIron", Character.valueOf('G'), "dustGold"
@ -594,7 +573,7 @@ public class Mekanism
"ICI", "ASA", "ICI", Character.valueOf('I'), "ingotIron", Character.valueOf('C'), "circuitBasic", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('S'), new ItemStack(BasicBlock, 1, 8)
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(BasicBlock, 1, 14), new Object[] {
"CGC", "IBI", "CGC", Character.valueOf('C'), "circuitBasic", Character.valueOf('G'), Blocks.thinGlass, Character.valueOf('I'), new ItemStack(BasicBlock, 1, 8), Character.valueOf('B'), "blockCopper"
"CGC", "IBI", "CGC", Character.valueOf('C'), "circuitBasic", Character.valueOf('G'), Blocks.glass_pane, Character.valueOf('I'), new ItemStack(BasicBlock, 1, 8), Character.valueOf('B'), "blockCopper"
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(BasicBlock, 1, 15), new Object[] {
"ITI", "CBC", "ITI", Character.valueOf('I'), "ingotCopper", Character.valueOf('T'), new ItemStack(BasicBlock, 1, 11), Character.valueOf('C'), "circuitBasic", Character.valueOf('B'), new ItemStack(BasicBlock, 1, 8)
@ -606,7 +585,7 @@ public class Mekanism
"CGC", "EAE", "CGC", Character.valueOf('G'), MekanismUtils.getEmptyGasTank(), Character.valueOf('C'), "circuitBasic", Character.valueOf('A'), AtomicCore, Character.valueOf('E'), EnrichedAlloy
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(MachineBlock2, 1, 7), new Object[] {
"CWC", "EIE", "CGC", Character.valueOf('W'), Items.bucketWater, Character.valueOf('C'), "circuitBasic", Character.valueOf('E'), EnrichedAlloy, Character.valueOf('G'), MekanismUtils.getEmptyGasTank(), Character.valueOf('I'), new ItemStack(BasicBlock, 1, 8)
"CWC", "EIE", "CGC", Character.valueOf('W'), Items.bucket, Character.valueOf('C'), "circuitBasic", Character.valueOf('E'), EnrichedAlloy, Character.valueOf('G'), MekanismUtils.getEmptyGasTank(), Character.valueOf('I'), new ItemStack(BasicBlock, 1, 8)
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(MachineBlock2, 1, 8), new Object[] {
"CGC", "ASA", "CGC", Character.valueOf('G'), MekanismUtils.getEmptyGasTank(), Character.valueOf('C'), "circuitBasic", Character.valueOf('A'), AtomicCore, Character.valueOf('S'), new ItemStack(BasicBlock, 1, 8)
@ -650,7 +629,7 @@ public class Mekanism
"CTC", Character.valueOf('C'), AtomicCore, Character.valueOf('T'), new ItemStack(PartTransmitter, 1, 0)
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(PartTransmitter, 8, 4), new Object[] {
"SBS", Character.valueOf('S'), "ingotSteel", Character.valueOf('B'), Items.bucketEmpty
"SBS", Character.valueOf('S'), "ingotSteel", Character.valueOf('B'), Items.bucket
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(PartTransmitter, 1, 9), new Object[] {
"ETE", Character.valueOf('E'), EnrichedAlloy, Character.valueOf('T'), new ItemStack(PartTransmitter, 1, 4)
@ -668,10 +647,10 @@ public class Mekanism
"SCS", Character.valueOf('S'), "ingotSteel", Character.valueOf('C'), "circuitBasic"
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(PartTransmitter, 2, 7), new Object[] {
"SBS", Character.valueOf('S'), "ingotSteel", Character.valueOf('B'), Blocks.fenceIron
"SBS", Character.valueOf('S'), "ingotSteel", Character.valueOf('B'), Blocks.iron_bars
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(PartTransmitter, 2, 8), new Object[] {
"RRR", "SBS", "RRR", Character.valueOf('R'), Items.redstone, Character.valueOf('S'), "ingotSteel", Character.valueOf('B'), Blocks.fenceIron
"RRR", "SBS", "RRR", Character.valueOf('R'), Items.redstone, Character.valueOf('S'), "ingotSteel", Character.valueOf('B'), Blocks.iron_bars
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(Polyethene, 1, 1), new Object[] {
"PP", "PP", "PP", Character.valueOf('P'), new ItemStack(Polyethene, 1, 0)
@ -686,7 +665,7 @@ public class Mekanism
"SSS", "S S", "SSS", Character.valueOf('S'), new ItemStack(Polyethene, 1, 2)
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(GlowPanel, 2, 15), new Object[] {
"PSP", "S S", "GSG", Character.valueOf('P'), Blocks.thinGlass, Character.valueOf('S'), new ItemStack(Polyethene, 1, 2), Character.valueOf('G'), Items.glowstone
"PSP", "S S", "GSG", Character.valueOf('P'), Blocks.glass_pane, Character.valueOf('S'), new ItemStack(Polyethene, 1, 2), Character.valueOf('G'), Items.glowstone_dust
}));
for(int i = 0; i < EnumColor.DYES.length-1; i++)
@ -695,14 +674,14 @@ public class Mekanism
"SSS", "SDS", "SSS", Character.valueOf('S'), new ItemStack(Polyethene, 1, 2), Character.valueOf('D'), new ItemStack(Items.dye, 1, i)
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(GlowPanel, 2, i), new Object[] {
"PSP", "SDS", "GSG", Character.valueOf('P'), Blocks.thinGlass, Character.valueOf('S'), new ItemStack(Polyethene, 1, 2), Character.valueOf('D'), new ItemStack(Items.dye, 1, i), Character.valueOf('G'), Items.glowstone
"PSP", "SDS", "GSG", Character.valueOf('P'), Blocks.glass_pane, Character.valueOf('S'), new ItemStack(Polyethene, 1, 2), Character.valueOf('D'), new ItemStack(Items.dye, 1, i), Character.valueOf('G'), Items.glowstone_dust
}));
}
for(int i = 0; i < EnumColor.DYES.length; i++)
{
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(Balloon, 2, i), new Object[] {
Items.leather, Items.silk, new ItemStack(Items.dye, 1, i)
Items.leather, Items.string, new ItemStack(Items.dye, 1, i)
}));
for(int j = 0; j < EnumColor.DYES.length; j++)
@ -733,7 +712,7 @@ public class Mekanism
}
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(BlockGlowHDPE, 3, i), new Object[] {
new ItemStack(BlockHDPE, 1, i), new ItemStack(BlockHDPE, 1, i), new ItemStack(BlockHDPE, 1, i), new ItemStack(Items.glowstone)
new ItemStack(BlockHDPE, 1, i), new ItemStack(BlockHDPE, 1, i), new ItemStack(BlockHDPE, 1, i), new ItemStack(Items.glowstone_dust)
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(BlockReinforcedHDPE, 4, i), new Object[] {
@ -746,67 +725,67 @@ public class Mekanism
}
//Furnace Recipes
FurnaceRecipes.smelting().addSmelting(oreBlockID, 0, new ItemStack(Ingot, 1, 1), 1.0F);
FurnaceRecipes.smelting().addSmelting(oreBlockID, 1, new ItemStack(Ingot, 1, 5), 1.0F);
FurnaceRecipes.smelting().addSmelting(oreBlockID, 2, new ItemStack(Ingot, 1, 6), 1.0F);
FurnaceRecipes.smelting().addSmelting(Dust.itemID, 2, new ItemStack(Ingot, 1, 1), 0.0F);
FurnaceRecipes.smelting().addSmelting(Dust.itemID, 0, new ItemStack(Items.ingotIron), 0.0F);
FurnaceRecipes.smelting().addSmelting(Dust.itemID, 1, new ItemStack(Items.ingotGold), 0.0F);
FurnaceRecipes.smelting().addSmelting(Dust.itemID, 5, new ItemStack(Ingot, 1, 4), 0.0F);
FurnaceRecipes.smelting().addSmelting(Dust.itemID, 6, new ItemStack(Ingot, 1, 5), 0.0F);
FurnaceRecipes.smelting().addSmelting(Dust.itemID, 7, new ItemStack(Ingot, 1, 6), 0.0F);
FurnaceRecipes.smelting().func_151394_a(new ItemStack(OreBlock, 1, 0), new ItemStack(Ingot, 1, 1), 1.0F);
FurnaceRecipes.smelting().func_151394_a(new ItemStack(OreBlock, 1, 1), new ItemStack(Ingot, 1, 5), 1.0F);
FurnaceRecipes.smelting().func_151394_a(new ItemStack(OreBlock, 1, 2), new ItemStack(Ingot, 1, 6), 1.0F);
FurnaceRecipes.smelting().func_151394_a(new ItemStack(Dust, 1, 2), new ItemStack(Ingot, 1, 1), 0.0F);
FurnaceRecipes.smelting().func_151394_a(new ItemStack(Dust, 1, 0), new ItemStack(Items.iron_ingot), 0.0F);
FurnaceRecipes.smelting().func_151394_a(new ItemStack(Dust, 1, 1), new ItemStack(Items.gold_ingot), 0.0F);
FurnaceRecipes.smelting().func_151394_a(new ItemStack(Dust, 1, 5), new ItemStack(Ingot, 1, 4), 0.0F);
FurnaceRecipes.smelting().func_151394_a(new ItemStack(Dust, 1, 6), new ItemStack(Ingot, 1, 5), 0.0F);
FurnaceRecipes.smelting().func_151394_a(new ItemStack(Dust, 1, 7), new ItemStack(Ingot, 1, 6), 0.0F);
//Enrichment Chamber Recipes
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Blocks.oreRedstone), new ItemStack(Items.redstone, 12));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Blocks.redstone_ore), new ItemStack(Items.redstone, 12));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Blocks.obsidian), new ItemStack(DirtyDust, 2, 6));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Items.coal, 1, 0), new ItemStack(CompressedCarbon));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Items.coal, 1, 1), new ItemStack(CompressedCarbon));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Items.redstone), new ItemStack(CompressedRedstone));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Blocks.oreLapis), new ItemStack(Items.dye, 12, 4));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Blocks.oreCoal), new ItemStack(Items.coal, 2));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Blocks.oreDiamond), new ItemStack(Items.diamond, 2));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Blocks.cobblestoneMossy), new ItemStack(Blocks.cobblestone));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Blocks.stone), new ItemStack(Blocks.stoneBrick, 1, 2));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Blocks.lapis_ore), new ItemStack(Items.dye, 12, 4));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Blocks.coal_ore), new ItemStack(Items.coal, 2));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Blocks.diamond_ore), new ItemStack(Items.diamond, 2));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Blocks.mossy_cobblestone), new ItemStack(Blocks.cobblestone));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Blocks.stone), new ItemStack(Blocks.stonebrick, 1, 2));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Blocks.sand), new ItemStack(Blocks.gravel));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Blocks.gravel), new ItemStack(Blocks.cobblestone));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Items.gunpowder), new ItemStack(Items.flint));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Blocks.stoneBrick, 1, 2), new ItemStack(Blocks.stoneBrick, 1, 0));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Blocks.stoneBrick, 1, 0), new ItemStack(Blocks.stoneBrick, 1, 3));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Blocks.stoneBrick, 1, 1), new ItemStack(Blocks.stoneBrick, 1, 0));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Blocks.oreNetherQuartz), new ItemStack(Items.netherQuartz, 2));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Blocks.stonebrick, 1, 2), new ItemStack(Blocks.stonebrick, 1, 0));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Blocks.stonebrick, 1, 0), new ItemStack(Blocks.stonebrick, 1, 3));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Blocks.stonebrick, 1, 1), new ItemStack(Blocks.stonebrick, 1, 0));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Blocks.quartz_ore), new ItemStack(Items.quartz, 2));
for(int i = 0; i < EnumColor.DYES.length; i++)
{
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(BlockHDPE, 1, i), new ItemStack(BlockSlickHDPE, 1, i));
}
//Combiner recipes
RecipeHandler.addCombinerRecipe(new ItemStack(Items.redstone, 16), new ItemStack(Blocks.oreRedstone));
RecipeHandler.addCombinerRecipe(new ItemStack(Items.redstone, 16), new ItemStack(Blocks.redstone_ore));
RecipeHandler.addCombinerRecipe(new ItemStack(Items.dye, 16, 4), new ItemStack(Blocks.lapis_ore));
RecipeHandler.addCombinerRecipe(new ItemStack(Items.flint), new ItemStack(Blocks.gravel));
//Osmium Compressor Recipes
RecipeHandler.addOsmiumCompressorRecipe(new ItemStack(Items.glowstone), new ItemStack(Ingot, 1, 3));
RecipeHandler.addOsmiumCompressorRecipe(new ItemStack(Items.glowstone_dust), new ItemStack(Ingot, 1, 3));
//Crusher Recipes
RecipeHandler.addCrusherRecipe(new ItemStack(Items.diamond), new ItemStack(Dust, 1, 4));
RecipeHandler.addCrusherRecipe(new ItemStack(Items.ingotIron), new ItemStack(Dust, 1, 0));
RecipeHandler.addCrusherRecipe(new ItemStack(Items.ingotGold), new ItemStack(Dust, 1, 1));
RecipeHandler.addCrusherRecipe(new ItemStack(Items.iron_ingot), new ItemStack(Dust, 1, 0));
RecipeHandler.addCrusherRecipe(new ItemStack(Items.gold_ingot), new ItemStack(Dust, 1, 1));
RecipeHandler.addCrusherRecipe(new ItemStack(Blocks.gravel), new ItemStack(Blocks.sand));
RecipeHandler.addCrusherRecipe(new ItemStack(Blocks.stone), new ItemStack(Blocks.cobblestone));
RecipeHandler.addCrusherRecipe(new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.gravel));
RecipeHandler.addCrusherRecipe(new ItemStack(Blocks.stoneBrick, 1, 2), new ItemStack(Blocks.stone));
RecipeHandler.addCrusherRecipe(new ItemStack(Blocks.stoneBrick, 1, 0), new ItemStack(Blocks.stoneBrick, 1, 2));
RecipeHandler.addCrusherRecipe(new ItemStack(Blocks.stoneBrick, 1, 3), new ItemStack(Blocks.stoneBrick, 1, 0));
RecipeHandler.addCrusherRecipe(new ItemStack(Blocks.stonebrick, 1, 2), new ItemStack(Blocks.stone));
RecipeHandler.addCrusherRecipe(new ItemStack(Blocks.stonebrick, 1, 0), new ItemStack(Blocks.stonebrick, 1, 2));
RecipeHandler.addCrusherRecipe(new ItemStack(Blocks.stonebrick, 1, 3), new ItemStack(Blocks.stonebrick, 1, 0));
RecipeHandler.addCrusherRecipe(new ItemStack(Items.flint, 4), new ItemStack(Items.gunpowder));
RecipeHandler.addCrusherRecipe(new ItemStack(Blocks.sandStone), new ItemStack(Blocks.sand, 2));
RecipeHandler.addCrusherRecipe(new ItemStack(Blocks.sandstone), new ItemStack(Blocks.sand, 2));
//BioFuel Crusher Recipes
RecipeHandler.addCrusherRecipe(new ItemStack(Blocks.tallGrass), new ItemStack(BioFuel, 4));
RecipeHandler.addCrusherRecipe(new ItemStack(Items.reed), new ItemStack(BioFuel, 2));
RecipeHandler.addCrusherRecipe(new ItemStack(Items.seeds), new ItemStack(BioFuel, 2));
RecipeHandler.addCrusherRecipe(new ItemStack(Blocks.tallgrass), new ItemStack(BioFuel, 4));
RecipeHandler.addCrusherRecipe(new ItemStack(Items.reeds), new ItemStack(BioFuel, 2));
RecipeHandler.addCrusherRecipe(new ItemStack(Items.wheat_seeds), new ItemStack(BioFuel, 2));
RecipeHandler.addCrusherRecipe(new ItemStack(Items.wheat), new ItemStack(BioFuel, 4));
RecipeHandler.addCrusherRecipe(new ItemStack(Items.pumpkinSeeds), new ItemStack(BioFuel, 2));
RecipeHandler.addCrusherRecipe(new ItemStack(Items.melonSeeds), new ItemStack(BioFuel, 2));
RecipeHandler.addCrusherRecipe(new ItemStack(Items.appleRed), new ItemStack(BioFuel, 4));
RecipeHandler.addCrusherRecipe(new ItemStack(Items.pumpkin_seeds), new ItemStack(BioFuel, 2));
RecipeHandler.addCrusherRecipe(new ItemStack(Items.melon_seeds), new ItemStack(BioFuel, 2));
RecipeHandler.addCrusherRecipe(new ItemStack(Items.apple), new ItemStack(BioFuel, 4));
RecipeHandler.addCrusherRecipe(new ItemStack(Items.bread), new ItemStack(BioFuel, 4));
RecipeHandler.addCrusherRecipe(new ItemStack(Items.potato), new ItemStack(BioFuel, 4));
RecipeHandler.addCrusherRecipe(new ItemStack(Items.carrot), new ItemStack(BioFuel, 4));
@ -817,7 +796,7 @@ public class Mekanism
//Chemical Injection Chamber Recipes
RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(new ItemStack(Blocks.obsidian), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Shard, 4, 6));
RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(new ItemStack(Blocks.dirt), GasRegistry.getGas("water")), new ItemStack(Blocks.blockClay));
RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(new ItemStack(Blocks.dirt), GasRegistry.getGas("water")), new ItemStack(Blocks.clay));
RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(new ItemStack(Items.gunpowder), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Dust, 1, 10));
//Precision Sawmill Recipes
@ -825,26 +804,26 @@ public class Mekanism
RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.chest), new ChanceOutput(new ItemStack(Blocks.planks, 8)));
RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.trapdoor), new ChanceOutput(new ItemStack(Blocks.planks, 3)));
RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Items.boat), new ChanceOutput(new ItemStack(Blocks.planks, 5)));
RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Items.bed), new ChanceOutput(new ItemStack(Blocks.planks, 3), new ItemStack(Blocks.cloth, 3), 1));
RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Items.bed), new ChanceOutput(new ItemStack(Blocks.planks, 3), new ItemStack(Blocks.wool, 3), 1));
RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.jukebox), new ChanceOutput(new ItemStack(Blocks.planks, 8), new ItemStack(Items.diamond), 1));
RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.bookShelf), new ChanceOutput(new ItemStack(Blocks.planks, 6), new ItemStack(Items.book, 3), 1));
RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.pressurePlatePlanks), new ChanceOutput(new ItemStack(Blocks.planks, 2)));
RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.bookshelf), new ChanceOutput(new ItemStack(Blocks.planks, 6), new ItemStack(Items.book, 3), 1));
RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.wooden_pressure_plate), new ChanceOutput(new ItemStack(Blocks.planks, 2)));
RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.fence), new ChanceOutput(new ItemStack(Items.stick, 3)));
RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.fenceGate), new ChanceOutput(new ItemStack(Blocks.planks, 2), new ItemStack(Items.stick, 4), 1));
RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.music), new ChanceOutput(new ItemStack(Blocks.planks, 8), new ItemStack(Items.redstone, 1), 1));
RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.torchRedstoneIdle), new ChanceOutput(new ItemStack(Items.stick, 1), new ItemStack(Items.redstone), 1));
RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.workbench), new ChanceOutput(new ItemStack(Blocks.planks, 4)));
RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.fence_gate), new ChanceOutput(new ItemStack(Blocks.planks, 2), new ItemStack(Items.stick, 4), 1));
RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.noteblock), new ChanceOutput(new ItemStack(Blocks.planks, 8), new ItemStack(Items.redstone, 1), 1));
RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.unlit_redstone_torch), new ChanceOutput(new ItemStack(Items.stick, 1), new ItemStack(Items.redstone), 1));
RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.crafting_table), new ChanceOutput(new ItemStack(Blocks.planks, 4)));
//Metallurgic Infuser Recipes
RecipeHandler.addMetallurgicInfuserRecipe(InfusionInput.getInfusion(InfuseRegistry.get("CARBON"), 10, new ItemStack(Items.ingotIron)), new ItemStack(EnrichedIron));
RecipeHandler.addMetallurgicInfuserRecipe(InfusionInput.getInfusion(InfuseRegistry.get("CARBON"), 10, new ItemStack(Items.iron_ingot)), new ItemStack(EnrichedIron));
RecipeHandler.addMetallurgicInfuserRecipe(InfusionInput.getInfusion(InfuseRegistry.get("CARBON"), 10, new ItemStack(EnrichedIron)), new ItemStack(Dust, 1, 5));
RecipeHandler.addMetallurgicInfuserRecipe(InfusionInput.getInfusion(InfuseRegistry.get("REDSTONE"), 10, new ItemStack(Items.ingotIron)), new ItemStack(EnrichedAlloy));
RecipeHandler.addMetallurgicInfuserRecipe(InfusionInput.getInfusion(InfuseRegistry.get("REDSTONE"), 10, new ItemStack(Items.iron_ingot)), new ItemStack(EnrichedAlloy));
RecipeHandler.addMetallurgicInfuserRecipe(InfusionInput.getInfusion(InfuseRegistry.get("FUNGI"), 10, new ItemStack(Blocks.dirt)), new ItemStack(Blocks.mycelium));
if(InfuseRegistry.contains("BIO"))
{
RecipeHandler.addMetallurgicInfuserRecipe(InfusionInput.getInfusion(InfuseRegistry.get("BIO"), 10, new ItemStack(Blocks.cobblestone)), new ItemStack(Blocks.cobblestoneMossy));
RecipeHandler.addMetallurgicInfuserRecipe(InfusionInput.getInfusion(InfuseRegistry.get("BIO"), 10, new ItemStack(Blocks.stoneBrick, 1, 0)), new ItemStack(Blocks.stoneBrick, 1, 1));
RecipeHandler.addMetallurgicInfuserRecipe(InfusionInput.getInfusion(InfuseRegistry.get("BIO"), 10, new ItemStack(Blocks.cobblestone)), new ItemStack(Blocks.mossy_cobblestone));
RecipeHandler.addMetallurgicInfuserRecipe(InfusionInput.getInfusion(InfuseRegistry.get("BIO"), 10, new ItemStack(Blocks.stonebrick, 1, 0)), new ItemStack(Blocks.stonebrick, 1, 1));
}
//Chemical Infuser Recipes
@ -892,10 +871,10 @@ public class Mekanism
InfuseRegistry.registerInfuseObject(new ItemStack(Items.coal, 1, 1), new InfuseObject(InfuseRegistry.get("CARBON"), 20));
InfuseRegistry.registerInfuseObject(new ItemStack(CompressedCarbon), new InfuseObject(InfuseRegistry.get("CARBON"), 100));
InfuseRegistry.registerInfuseObject(new ItemStack(Items.redstone), new InfuseObject(InfuseRegistry.get("REDSTONE"), 10));
InfuseRegistry.registerInfuseObject(new ItemStack(Blocks.blockRedstone), new InfuseObject(InfuseRegistry.get("REDSTONE"), 90));
InfuseRegistry.registerInfuseObject(new ItemStack(Blocks.redstone_block), new InfuseObject(InfuseRegistry.get("REDSTONE"), 90));
InfuseRegistry.registerInfuseObject(new ItemStack(CompressedRedstone), new InfuseObject(InfuseRegistry.get("REDSTONE"), 100));
InfuseRegistry.registerInfuseObject(new ItemStack(Blocks.mushroomRed), new InfuseObject(InfuseRegistry.get("FUNGI"), 10));
InfuseRegistry.registerInfuseObject(new ItemStack(Blocks.mushroomBrown), new InfuseObject(InfuseRegistry.get("FUNGI"), 10));
InfuseRegistry.registerInfuseObject(new ItemStack(Blocks.red_mushroom), new InfuseObject(InfuseRegistry.get("FUNGI"), 10));
InfuseRegistry.registerInfuseObject(new ItemStack(Blocks.brown_mushroom), new InfuseObject(InfuseRegistry.get("FUNGI"), 10));
//Fuels
GameRegistry.registerFuelHandler(new IFuelHandler() {
@ -922,48 +901,48 @@ public class Mekanism
{
//Declarations
configuration.load();
PartTransmitter = new ItemPartTransmitter(configuration.getItem("MultipartTransmitter", ITEM_ID++).getInt()).setUnlocalizedName("MultipartTransmitter");
EnrichedAlloy = new ItemMekanism(configuration.getItem("EnrichedAlloy", ITEM_ID++).getInt()).setUnlocalizedName("EnrichedAlloy");
EnrichedIron = new ItemMekanism(configuration.getItem("EnrichedIron", ITEM_ID++).getInt()).setUnlocalizedName("EnrichedIron");
ControlCircuit = new ItemMekanism(configuration.getItem("ControlCircuit", ITEM_ID++).getInt()).setUnlocalizedName("ControlCircuit");
AtomicCore = new ItemMekanism(configuration.getItem("AtomicCore", ITEM_ID++).getInt()).setUnlocalizedName("AtomicCore");
TeleportationCore = new ItemMekanism(configuration.getItem("TeleportationCore", ITEM_ID++).getInt()).setUnlocalizedName("TeleportationCore");
ElectrolyticCore = new ItemMekanism(configuration.getItem("ElectrolyticCore", ITEM_ID++).getInt()).setUnlocalizedName("ElectrolyticCore");
CompressedCarbon = new ItemMekanism(configuration.getItem("CompressedCarbon", ITEM_ID++).getInt()).setUnlocalizedName("CompressedCarbon");
CompressedRedstone = new ItemMekanism(configuration.getItem("CompressedRedstone", ITEM_ID++).getInt()).setUnlocalizedName("CompressedRedstone");
SpeedUpgrade = new ItemMachineUpgrade(configuration.getItem("SpeedUpgrade", ITEM_ID++).getInt()).setUnlocalizedName("SpeedUpgrade");
EnergyUpgrade = new ItemMachineUpgrade(configuration.getItem("EnergyUpgrade", ITEM_ID++).getInt()).setUnlocalizedName("EnergyUpgrade");
EnergyTablet = (ItemEnergized)new ItemEnergized(configuration.getItem("EnergyTablet", ITEM_ID++).getInt(), 1000000).setUnlocalizedName("EnergyTablet");
Dictionary = new ItemDictionary(configuration.getItem("Dictionary", ITEM_ID++).getInt()).setUnlocalizedName("Dictionary");
FilterCard = new ItemFilterCard(configuration.getItem("FilterCard", ITEM_ID++).getInt()).setUnlocalizedName("FilterCard");
ElectricBow = (ItemElectricBow)new ItemElectricBow(configuration.getItem("ElectricBow", ITEM_ID++).getInt()).setUnlocalizedName("ElectricBow");
PortableTeleporter = new ItemPortableTeleporter(configuration.getItem("PortableTeleporter", ITEM_ID++).getInt()).setUnlocalizedName("PortableTeleporter");
Configurator = new ItemConfigurator(configuration.getItem("Configurator", ITEM_ID++).getInt()).setUnlocalizedName("Configurator");
NetworkReader = new ItemNetworkReader(configuration.getItem("NetworkReader", ITEM_ID++).getInt()).setUnlocalizedName("NetworkReader");
WalkieTalkie = new ItemWalkieTalkie(configuration.getItem("WalkieTalkie", ITEM_ID++).getInt()).setUnlocalizedName("WalkieTalkie");
SeismicReader = (ItemSeismicReader)new ItemSeismicReader(configuration.getItem("SeismicReader", ITEM_ID++).getInt()).setUnlocalizedName("SeismicReader");
AtomicDisassembler = (ItemAtomicDisassembler)new ItemAtomicDisassembler(configuration.getItem("AtomicDisassembler", ITEM_ID++).getInt()).setUnlocalizedName("AtomicDisassembler");
GasMask = (ItemGasMask)new ItemGasMask(configuration.getItem("GasMask", ITEM_ID++).getInt()).setUnlocalizedName("GasMask");
ScubaTank = (ItemScubaTank)new ItemScubaTank(configuration.getItem("ScubaTank", ITEM_ID++).getInt()).setUnlocalizedName("ScubaTank");
Jetpack = (ItemJetpack)new ItemJetpack(configuration.getItem("Jetpack", ITEM_ID++).getInt()).setUnlocalizedName("Jetpack");
ArmoredJetpack = (ItemJetpack)new ItemJetpack(configuration.getItem("ArmoredJetpack", ITEM_ID++).getInt()).setUnlocalizedName("ArmoredJetpack");
FreeRunners = new ItemFreeRunners(configuration.getItem("FreeRunners", ITEM_ID++).getInt()).setUnlocalizedName("FreeRunners");
BrineBucket = new ItemMekanism(configuration.getItem("BrineBucket", ITEM_ID++).getInt()).setMaxStackSize(1).setContainerItem(Items.bucketEmpty).setUnlocalizedName("BrineBucket");
Sawdust = new ItemMekanism(configuration.getItem("Sawdust", ITEM_ID++).getInt()).setUnlocalizedName("Sawdust");
Salt = new ItemMekanism(configuration.getItem("Salt", ITEM_ID++).getInt()).setUnlocalizedName("Salt");
Ingot = new ItemIngot(configuration.getItem("Ingot", ITEM_ID++).getInt());
DirtyDust = new ItemDirtyDust(configuration.getItem("DirtyDust", ITEM_ID++).getInt());
Clump = new ItemClump(configuration.getItem("Clump", ITEM_ID++).getInt());
Shard = new ItemShard(configuration.getItem("Shard", ITEM_ID++).getInt());
Crystal = new ItemCrystal(configuration.getItem("Crystal", ITEM_ID++).getInt());
Dust = new ItemDust(configuration.getItem("Dust", ITEM_ID++).getInt());
Robit = (ItemRobit)new ItemRobit(configuration.getItem("Robit", ITEM_ID++).getInt()).setUnlocalizedName("Robit");
Balloon = new ItemBalloon(configuration.getItem("Balloon", ITEM_ID++).getInt()).setUnlocalizedName("Balloon");
ItemProxy = new ItemProxy(configuration.getItem("ItemProxy", ITEM_ID++).getInt()).setUnlocalizedName("ItemProxy");
Substrate = new ItemMekanism(configuration.getItem("Substrate", ITEM_ID++).getInt()).setUnlocalizedName("Substrate");
Polyethene = new ItemHDPE(configuration.getItem("HDPE", ITEM_ID++).getInt()).setUnlocalizedName("HDPE");
BioFuel = new ItemMekanism(Mekanism.configuration.getItem("BioFuel", ITEM_ID++).getInt()).setUnlocalizedName("BioFuel");
GlowPanel = new ItemGlowPanel(configuration.getItem("GlowPanel", ITEM_ID++).getInt()).setUnlocalizedName("GlowPanel");
PartTransmitter = new ItemPartTransmitter().setUnlocalizedName("MultipartTransmitter");
EnrichedAlloy = new ItemMekanism().setUnlocalizedName("EnrichedAlloy");
EnrichedIron = new ItemMekanism().setUnlocalizedName("EnrichedIron");
ControlCircuit = new ItemMekanism().setUnlocalizedName("ControlCircuit");
AtomicCore = new ItemMekanism().setUnlocalizedName("AtomicCore");
TeleportationCore = new ItemMekanism().setUnlocalizedName("TeleportationCore");
ElectrolyticCore = new ItemMekanism().setUnlocalizedName("ElectrolyticCore");
CompressedCarbon = new ItemMekanism().setUnlocalizedName("CompressedCarbon");
CompressedRedstone = new ItemMekanism().setUnlocalizedName("CompressedRedstone");
SpeedUpgrade = new ItemMachineUpgrade().setUnlocalizedName("SpeedUpgrade");
EnergyUpgrade = new ItemMachineUpgrade().setUnlocalizedName("EnergyUpgrade");
EnergyTablet = (ItemEnergized)new ItemEnergized(1000000).setUnlocalizedName("EnergyTablet");
Dictionary = new ItemDictionary().setUnlocalizedName("Dictionary");
FilterCard = new ItemFilterCard().setUnlocalizedName("FilterCard");
ElectricBow = (ItemElectricBow)new ItemElectricBow().setUnlocalizedName("ElectricBow");
PortableTeleporter = new ItemPortableTeleporter().setUnlocalizedName("PortableTeleporter");
Configurator = new ItemConfigurator().setUnlocalizedName("Configurator");
NetworkReader = new ItemNetworkReader().setUnlocalizedName("NetworkReader");
WalkieTalkie = new ItemWalkieTalkie().setUnlocalizedName("WalkieTalkie");
SeismicReader = (ItemSeismicReader)new ItemSeismicReader().setUnlocalizedName("SeismicReader");
AtomicDisassembler = (ItemAtomicDisassembler)new ItemAtomicDisassembler().setUnlocalizedName("AtomicDisassembler");
GasMask = (ItemGasMask)new ItemGasMask().setUnlocalizedName("GasMask");
ScubaTank = (ItemScubaTank)new ItemScubaTank().setUnlocalizedName("ScubaTank");
Jetpack = (ItemJetpack)new ItemJetpack().setUnlocalizedName("Jetpack");
ArmoredJetpack = (ItemJetpack)new ItemJetpack().setUnlocalizedName("ArmoredJetpack");
FreeRunners = new ItemFreeRunners().setUnlocalizedName("FreeRunners");
BrineBucket = new ItemMekanism().setMaxStackSize(1).setContainerItem(Items.bucket).setUnlocalizedName("BrineBucket");
Sawdust = new ItemMekanism().setUnlocalizedName("Sawdust");
Salt = new ItemMekanism().setUnlocalizedName("Salt");
Ingot = new ItemIngot();
DirtyDust = new ItemDirtyDust();
Clump = new ItemClump();
Shard = new ItemShard();
Crystal = new ItemCrystal();
Dust = new ItemDust();
Robit = (ItemRobit)new ItemRobit().setUnlocalizedName("Robit");
Balloon = new ItemBalloon().setUnlocalizedName("Balloon");
ItemProxy = new ItemProxy().setUnlocalizedName("ItemProxy");
Substrate = new ItemMekanism().setUnlocalizedName("Substrate");
Polyethene = new ItemHDPE().setUnlocalizedName("HDPE");
BioFuel = new ItemMekanism().setUnlocalizedName("BioFuel");
GlowPanel = new ItemGlowPanel().setUnlocalizedName("GlowPanel");
configuration.save();
@ -1019,22 +998,22 @@ public class Mekanism
public void addBlocks()
{
//Declarations
BasicBlock = new BlockBasic(basicBlockID).setUnlocalizedName("BasicBlock");
BasicBlock2 = new BlockBasic(basicBlock2ID).setUnlocalizedName("BasicBlock2");
MachineBlock = new BlockMachine(machineBlockID).setUnlocalizedName("MachineBlock");
MachineBlock2 = new BlockMachine(machineBlock2ID).setUnlocalizedName("MachineBlock2");
OreBlock = new BlockOre(oreBlockID).setUnlocalizedName("OreBlock");
EnergyCube = new BlockEnergyCube(energyCubeID).setUnlocalizedName("EnergyCube");
ObsidianTNT = new BlockObsidianTNT(obsidianTNTID).setUnlocalizedName("ObsidianTNT").setCreativeTab(tabMekanism);
BoundingBlock = (BlockBounding) new BlockBounding(boundingBlockID).setUnlocalizedName("BoundingBlock");
GasTank = new BlockGasTank(gasTankID).setUnlocalizedName("GasTank");
CardboardBox = new BlockCardboardBox(cardboardBoxID).setUnlocalizedName("CardboardBox");
BlockHDPE = new BlockPlastic(plasticID).setUnlocalizedName("PlasticBlock");
BlockSlickHDPE = new BlockPlastic(slickPlasticID).setUnlocalizedName("SlickPlasticBlock");
BlockGlowHDPE = new BlockPlastic(glowPlasticID).setUnlocalizedName("GlowPlasticBlock");
BlockReinforcedHDPE = new BlockPlastic(reinforcedPlasticID).setUnlocalizedName("ReinforcedPlasticBlock");
BlockRoadHDPE = new BlockPlastic(roadPlasticID).setUnlocalizedName("RoadPlasticBlock");
BlockHDPEFence = new BlockPlasticFence(plasticFenceID).setUnlocalizedName("PlasticFence");
BasicBlock = new BlockBasic();
BasicBlock2 = new BlockBasic();
MachineBlock = new BlockMachine();
MachineBlock2 = new BlockMachine();
OreBlock = new BlockOre();
EnergyCube = new BlockEnergyCube();
ObsidianTNT = new BlockObsidianTNT().setCreativeTab(tabMekanism);
BoundingBlock = (BlockBounding) new BlockBounding();
GasTank = new BlockGasTank();
CardboardBox = new BlockCardboardBox();
BlockHDPE = new BlockPlastic();
BlockSlickHDPE = new BlockPlastic();
BlockGlowHDPE = new BlockPlastic();
BlockReinforcedHDPE = new BlockPlastic();
BlockRoadHDPE = new BlockPlastic();
BlockHDPEFence = new BlockPlasticFence();
//Registrations
GameRegistry.registerBlock(BasicBlock, ItemBlockBasic.class, "BasicBlock");
@ -1114,11 +1093,11 @@ public class Mekanism
OreDictionary.registerOre("oreTin", new ItemStack(OreBlock, 1, 2));
//MC stuff
OreDictionary.registerOre("oreCoal", new ItemStack(Blocks.oreCoal));
OreDictionary.registerOre("ingotIron", new ItemStack(Items.ingotIron));
OreDictionary.registerOre("ingotGold", new ItemStack(Items.ingotGold));
OreDictionary.registerOre("oreRedstone", new ItemStack(Blocks.oreRedstone));
OreDictionary.registerOre("oreRedstone", new ItemStack(Blocks.oreRedstoneGlowing));
OreDictionary.registerOre("oreCoal", new ItemStack(Blocks.coal_ore));
OreDictionary.registerOre("ingotIron", new ItemStack(Items.iron_ingot));
OreDictionary.registerOre("ingotGold", new ItemStack(Items.iron_ingot));
OreDictionary.registerOre("oreRedstone", new ItemStack(Blocks.redstone_ore));
OreDictionary.registerOre("oreRedstone", new ItemStack(Blocks.lit_redstone_ore));
if(controlCircuitOreDict || !hooks.BasicComponentsLoaded)
{
@ -1268,7 +1247,7 @@ public class Mekanism
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
logger.setParent(FMLLog.getLogger());
//logger.setParent(FMLLog.getLogger());
File config = event.getSuggestedConfigurationFile();
//Set the mod's configuration
@ -1276,11 +1255,11 @@ public class Mekanism
if(config.getAbsolutePath().contains("voltz"))
{
System.out.println("[Mekanism] Detected Voltz in root directory - hello, fellow user!");
logger.info("Detected Voltz in root directory - hello, fellow user!");
}
else if(config.getAbsolutePath().contains("tekkit"))
{
System.out.println("[Mekanism] Detected Tekkit in root directory - hello, fellow user!");
logger.info("Detected Tekkit in root directory - hello, fellow user!");
}
GasRegistry.register(new Gas("hydrogen")).registerFluid();
@ -1320,16 +1299,16 @@ public class Mekanism
public void init(FMLInitializationEvent event)
{
//Register the mod's ore handler
GameRegistry.registerWorldGenerator(new OreHandler());
GameRegistry.registerWorldGenerator(new OreHandler(), 1);
//Register player tracker
GameRegistry.registerPlayerTracker(new CommonPlayerTracker());
MinecraftForge.EVENT_BUS.register(new CommonPlayerTracker());
//Register the mod's GUI handler
NetworkRegistry.instance().registerGuiHandler(this, new CoreGuiHandler());
NetworkRegistry.INSTANCE.registerGuiHandler(this, new CoreGuiHandler());
//Initialization notification
System.out.println("[Mekanism] Version " + versionNumber + " initializing...");
logger.info("[Mekanism] Version " + versionNumber + " initializing...");
//Get data from server.
new ThreadGetData();
@ -1360,41 +1339,17 @@ public class Mekanism
new MultipartMekanism();
//Packet registrations
PacketHandler.registerPacket(PacketRobit.class);
PacketHandler.registerPacket(PacketTransmitterUpdate.class);
PacketHandler.registerPacket(PacketElectricChest.class);
PacketHandler.registerPacket(PacketElectricBowState.class);
PacketHandler.registerPacket(PacketConfiguratorState.class);
PacketHandler.registerPacket(PacketTileEntity.class);
PacketHandler.registerPacket(PacketPortalFX.class);
PacketHandler.registerPacket(PacketDataRequest.class);
PacketHandler.registerPacket(PacketStatusUpdate.class);
PacketHandler.registerPacket(PacketDigitUpdate.class);
PacketHandler.registerPacket(PacketPortableTeleport.class);
PacketHandler.registerPacket(PacketRemoveUpgrade.class);
PacketHandler.registerPacket(PacketRedstoneControl.class);
PacketHandler.registerPacket(PacketWalkieTalkieState.class);
PacketHandler.registerPacket(PacketLogisticalSorterGui.class);
PacketHandler.registerPacket(PacketNewFilter.class);
PacketHandler.registerPacket(PacketEditFilter.class);
PacketHandler.registerPacket(PacketConfigurationUpdate.class);
PacketHandler.registerPacket(PacketSimpleGui.class);
PacketHandler.registerPacket(PacketDigitalMinerGui.class);
PacketHandler.registerPacket(PacketJetpackData.class);
PacketHandler.registerPacket(PacketKey.class);
PacketHandler.registerPacket(PacketScubaTankData.class);
PacketHandler.registerPacket(PacketConfigSync.class);
PacketHandler.registerPacket(PacketBoxBlacklist.class);
packetPipeline.initalise();
//Load proxy
proxy.registerRenderInformation();
proxy.loadUtilities();
//Completion notification
System.out.println("[Mekanism] Loading complete.");
logger.info("Loading complete.");
//Success message
logger.info("[Mekanism] Mod loaded.");
logger.info("Mod loaded.");
}
@EventHandler
@ -1408,15 +1363,17 @@ public class Mekanism
addIntegratedItems();
OreDictManager.init();
packetPipeline.postInitialise();
System.out.println("[Mekanism] Hooking complete.");
logger.info("Hooking complete.");
}
@SubscribeEvent
public void onEnergyTransferred(EnergyTransferEvent event)
{
try {
PacketHandler.sendPacket(Transmission.ALL_CLIENTS, new PacketTransmitterUpdate().setParams(PacketType.ENERGY, event.energyNetwork.transmitters.iterator().next(), event.power));
packetPipeline.sendToAll(new PacketTransmitterUpdate(PacketType.ENERGY, (TileEntity)event.energyNetwork.transmitters.iterator().next(), event.power));
} catch(Exception e) {}
}
@ -1424,7 +1381,7 @@ public class Mekanism
public void onGasTransferred(GasTransferEvent event)
{
try {
PacketHandler.sendPacket(Transmission.ALL_CLIENTS, new PacketTransmitterUpdate().setParams(PacketType.GAS, event.gasNetwork.transmitters.iterator().next(), event.transferType, event.didTransfer));
packetPipeline.sendToAll(new PacketTransmitterUpdate(PacketType.GAS, (TileEntity)event.gasNetwork.transmitters.iterator().next(), event.transferType, event.didTransfer));
} catch(Exception e) {}
}
@ -1432,7 +1389,7 @@ public class Mekanism
public void onLiquidTransferred(FluidTransferEvent event)
{
try {
PacketHandler.sendPacket(Transmission.ALL_CLIENTS, new PacketTransmitterUpdate().setParams(PacketType.FLUID, event.fluidNetwork.transmitters.iterator().next(), event.fluidType, event.didTransfer));
packetPipeline.sendToAll(new PacketTransmitterUpdate(PacketType.FLUID, (TileEntity)event.fluidNetwork.transmitters.iterator().next(), event.fluidType, event.didTransfer));
} catch(Exception e) {}
}
@ -1440,7 +1397,7 @@ public class Mekanism
public void onNetworkClientRequest(NetworkClientRequest event)
{
try {
PacketHandler.sendPacket(Transmission.SERVER, new PacketDataRequest().setParams(Coord4D.get(event.tileEntity)));
packetPipeline.sendToServer(new PacketDataRequest(Coord4D.get(event.tileEntity)));
} catch(Exception e) {}
}
@ -1461,16 +1418,16 @@ public class Mekanism
@SubscribeEvent
public void onBlacklistUpdate(BoxBlacklistEvent event)
{
MekanismAPI.addBoxBlacklist(CardboardBox.blockID, OreDictionary.WILDCARD_VALUE);
MekanismAPI.addBoxBlacklist(BoundingBlock.blockID, OreDictionary.WILDCARD_VALUE);
MekanismAPI.addBoxBlacklist(Blocks.bedrock.blockID, 0);
MekanismAPI.addBoxBlacklist(Blocks.portal.blockID, OreDictionary.WILDCARD_VALUE);
MekanismAPI.addBoxBlacklist(Blocks.endPortal.blockID, OreDictionary.WILDCARD_VALUE);
MekanismAPI.addBoxBlacklist(Blocks.endPortalFrame.blockID, OreDictionary.WILDCARD_VALUE);
MekanismAPI.addBoxBlacklist(Blocks.bed.blockID, OreDictionary.WILDCARD_VALUE);
MekanismAPI.addBoxBlacklist(Blocks.doorWood.blockID, OreDictionary.WILDCARD_VALUE);
MekanismAPI.addBoxBlacklist(Blocks.doorIron.blockID, OreDictionary.WILDCARD_VALUE);
MekanismAPI.addBoxBlacklist(MultipartProxy.block().blockID, OreDictionary.WILDCARD_VALUE);
MekanismAPI.addBoxBlacklist(CardboardBox, OreDictionary.WILDCARD_VALUE);
MekanismAPI.addBoxBlacklist(BoundingBlock, OreDictionary.WILDCARD_VALUE);
MekanismAPI.addBoxBlacklist(Blocks.bedrock, 0);
MekanismAPI.addBoxBlacklist(Blocks.portal, OreDictionary.WILDCARD_VALUE);
MekanismAPI.addBoxBlacklist(Blocks.end_portal, OreDictionary.WILDCARD_VALUE);
MekanismAPI.addBoxBlacklist(Blocks.end_portal_frame, OreDictionary.WILDCARD_VALUE);
MekanismAPI.addBoxBlacklist(Blocks.bed, OreDictionary.WILDCARD_VALUE);
MekanismAPI.addBoxBlacklist(Blocks.wooden_door, OreDictionary.WILDCARD_VALUE);
MekanismAPI.addBoxBlacklist(Blocks.iron_door, OreDictionary.WILDCARD_VALUE);
MekanismAPI.addBoxBlacklist(MultipartProxy.block(), OreDictionary.WILDCARD_VALUE);
BoxBlacklistParser.load();
}

View file

@ -36,4 +36,10 @@ public class LoadingHook implements IFMLLoadingPlugin
{
}
@Override
public String getAccessTransformerClass()
{
return null;
}
}

View file

@ -12,7 +12,6 @@ import mekanism.common.IBoundingBlock;
import mekanism.common.ItemAttacher;
import mekanism.common.Mekanism;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.inventory.InventoryBin;
import mekanism.common.network.PacketTileEntity;
import mekanism.common.tank.TankUpdateProtocol;
@ -33,6 +32,7 @@ import net.minecraft.entity.EnumCreatureType;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
@ -44,6 +44,7 @@ import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidStack;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -73,40 +74,40 @@ public class BlockBasic extends Block
{
public IIcon[][] icons = new IIcon[256][6];
public ConnectedTextureRenderer glassRenderer = new ConnectedTextureRenderer("glass/DynamicGlass", blockID, 10);
public ConnectedTextureRenderer glassRenderer = new ConnectedTextureRenderer("glass/DynamicGlass", this, 10);
public BlockBasic(int id)
public BlockBasic()
{
super(id, Material.iron);
super(Material.iron);
setHardness(5F);
setResistance(10F);
setCreativeTab(Mekanism.tabMekanism);
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, int id)
public void onNeighborBlockChange(World world, int x, int y, int z, Block block)
{
if(!world.isRemote)
{
TileEntity tileEntity = world.getTileEntity(x, y, z);
if(id == blockID && tileEntity instanceof TileEntityDynamicTank)
if(block == this && tileEntity instanceof TileEntityDynamicTank)
{
((TileEntityDynamicTank)tileEntity).update();
}
if(tileEntity instanceof TileEntityBasicBlock)
{
((TileEntityBasicBlock)tileEntity).onNeighborChange(id);
((TileEntityBasicBlock)tileEntity).onNeighborChange(block);
}
}
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister register)
public void registerBlockIcons(IIconRegister register)
{
if(blockID == Mekanism.basicBlockID)
if(this == Mekanism.BasicBlock)
{
icons[0][0] = register.registerIcon("mekanism:OsmiumBlock");
icons[1][0] = register.registerIcon("mekanism:BronzeBlock");
@ -133,7 +134,7 @@ public class BlockBasic extends Block
glassRenderer.registerIcons(register);
}
else if(blockID == Mekanism.basicBlock2ID)
else if(this == Mekanism.BasicBlock2)
{
icons[0][0] = register.registerIcon("mekanism:SalinationBlock");
}
@ -141,11 +142,11 @@ public class BlockBasic extends Block
@Override
@SideOnly(Side.CLIENT)
public IIcon getBlockTexture(IBlockAccess world, int x, int y, int z, int side)
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side)
{
int metadata = world.getBlockMetadata(x, y, z);
if(blockID == Mekanism.basicBlockID)
if(this == Mekanism.BasicBlock)
{
if(metadata == 6)
{
@ -183,7 +184,7 @@ public class BlockBasic extends Block
return getIcon(side, metadata);
}
}
else if(blockID == Mekanism.basicBlock2ID)
else if(this == Mekanism.BasicBlock2)
{
return getIcon(side, metadata);
}
@ -195,7 +196,7 @@ public class BlockBasic extends Block
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta)
{
if(blockID == Mekanism.basicBlockID)
if(this == Mekanism.BasicBlock)
{
if(meta != 6 && meta != 14)
{
@ -226,7 +227,7 @@ public class BlockBasic extends Block
}
}
}
else if(blockID == Mekanism.basicBlock2ID)
else if(this == Mekanism.BasicBlock2)
{
return icons[meta][0];
}
@ -242,39 +243,39 @@ public class BlockBasic extends Block
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(int i, CreativeTabs creativetabs, List list)
public void getSubBlocks(Item item, CreativeTabs creativetabs, List list)
{
if(blockID == Mekanism.basicBlockID)
if(this == Mekanism.BasicBlock)
{
list.add(new ItemStack(i, 1, 0));
list.add(new ItemStack(i, 1, 1));
list.add(new ItemStack(i, 1, 2));
list.add(new ItemStack(i, 1, 3));
list.add(new ItemStack(i, 1, 4));
list.add(new ItemStack(i, 1, 5));
list.add(new ItemStack(i, 1, 6));
list.add(new ItemStack(i, 1, 7));
list.add(new ItemStack(i, 1, 8));
list.add(new ItemStack(i, 1, 9));
list.add(new ItemStack(i, 1, 10));
list.add(new ItemStack(i, 1, 11));
list.add(new ItemStack(i, 1, 12));
list.add(new ItemStack(i, 1, 13));
list.add(new ItemStack(i, 1, 14));
list.add(new ItemStack(i, 1, 15));
list.add(new ItemStack(item, 1, 0));
list.add(new ItemStack(item, 1, 1));
list.add(new ItemStack(item, 1, 2));
list.add(new ItemStack(item, 1, 3));
list.add(new ItemStack(item, 1, 4));
list.add(new ItemStack(item, 1, 5));
list.add(new ItemStack(item, 1, 6));
list.add(new ItemStack(item, 1, 7));
list.add(new ItemStack(item, 1, 8));
list.add(new ItemStack(item, 1, 9));
list.add(new ItemStack(item, 1, 10));
list.add(new ItemStack(item, 1, 11));
list.add(new ItemStack(item, 1, 12));
list.add(new ItemStack(item, 1, 13));
list.add(new ItemStack(item, 1, 14));
list.add(new ItemStack(item, 1, 15));
}
else if(blockID == Mekanism.basicBlock2ID)
else if(this == Mekanism.BasicBlock2)
{
list.add(new ItemStack(i, 1, 0));
list.add(new ItemStack(item, 1, 0));
}
}
@Override
public boolean canCreatureSpawn(EnumCreatureType type, World world, int x, int y, int z)
public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z)
{
int meta = world.getBlockMetadata(x, y, z);
if(blockID == Mekanism.basicBlockID)
if(this == Mekanism.BasicBlock)
{
if(meta == 9 || meta == 10 || meta == 11)
{
@ -282,7 +283,7 @@ public class BlockBasic extends Block
if(tileEntity != null)
{
if(!world.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER)
{
if(tileEntity.structure != null)
{
@ -298,7 +299,7 @@ public class BlockBasic extends Block
}
}
}
else if(blockID == Mekanism.basicBlock2ID)
else if(this == Mekanism.BasicBlock2)
{
}
@ -311,7 +312,7 @@ public class BlockBasic extends Block
{
int meta = world.getBlockMetadata(x, y, z);
if(blockID == Mekanism.basicBlockID)
if(this == Mekanism.BasicBlock)
{
if(!world.isRemote && meta == 6)
{
@ -340,7 +341,7 @@ public class BlockBasic extends Block
{
int metadata = world.getBlockMetadata(x, y, z);
if(blockID == Mekanism.basicBlockID)
if(this == Mekanism.BasicBlock)
{
if(metadata != 6)
{
@ -419,11 +420,11 @@ public class BlockBasic extends Block
if(!manageInventory(entityplayer, tileEntity))
{
PacketHandler.sendPacket(Transmission.ALL_CLIENTS, new PacketTileEntity().setParams(Coord4D.get(tileEntity), tileEntity.getNetworkedData(new ArrayList())));
Mekanism.packetPipeline.sendToAll(new PacketTileEntity(Coord4D.get(tileEntity), tileEntity.getNetworkedData(new ArrayList())));
entityplayer.openGui(Mekanism.instance, 18, world, x, y, z);
}
else {
entityplayer.inventory.onInventoryChanged();
entityplayer.inventory.markDirty();
tileEntity.sendPacketToRenderer();
}
@ -436,9 +437,9 @@ public class BlockBasic extends Block
}
@Override
public boolean isBlockSolidOnSide(World world, int x, int y, int z, ForgeDirection side)
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side)
{
return !(blockID == Mekanism.basicBlockID && world.getBlockMetadata(x, y, z) == 10);
return !(this == Mekanism.BasicBlock && world.getBlockMetadata(x, y, z) == 10);
}
private boolean manageInventory(EntityPlayer player, TileEntityDynamicTank tileEntity)
@ -539,7 +540,7 @@ public class BlockBasic extends Block
if(!player.capabilities.isCreativeMode)
{
player.setCurrentItemOrArmor(0, new ItemStack(Items.bucketEmpty));
player.setCurrentItemOrArmor(0, new ItemStack(Items.bucket));
}
return true;
@ -605,7 +606,7 @@ public class BlockBasic extends Block
}
}
if(blockID == Mekanism.basicBlockID)
if(this == Mekanism.BasicBlock)
{
switch(metadata)
{
@ -624,11 +625,11 @@ public class BlockBasic extends Block
@Override
public boolean hasTileEntity(int metadata)
{
if(blockID == Mekanism.basicBlockID)
if(this == Mekanism.BasicBlock)
{
return metadata == 6 || metadata == 9 || metadata == 10 || metadata == 11 || metadata == 12 || metadata == 14 || metadata == 15;
}
else if(blockID == Mekanism.basicBlock2ID)
else if(this == Mekanism.BasicBlock2)
{
return metadata == 0;
}
@ -639,7 +640,7 @@ public class BlockBasic extends Block
@Override
public TileEntity createTileEntity(World world, int metadata)
{
if(blockID == Mekanism.basicBlockID)
if(this == Mekanism.BasicBlock)
{
switch(metadata)
{
@ -657,7 +658,7 @@ public class BlockBasic extends Block
return new TileEntitySalinationValve();
}
}
else if(blockID == Mekanism.basicBlock2ID)
else if(this == Mekanism.BasicBlock2)
{
switch(metadata)
{
@ -728,9 +729,9 @@ public class BlockBasic extends Block
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
{
ItemStack ret = new ItemStack(blockID, 1, world.getBlockMetadata(x, y, z));
ItemStack ret = new ItemStack(this, 1, world.getBlockMetadata(x, y, z));
if(blockID == Mekanism.basicBlockID)
if(this == Mekanism.BasicBlock)
{
if(ret.getItemDamage() == 6)
{
@ -750,9 +751,9 @@ public class BlockBasic extends Block
}
@Override
public int idDropped(int i, Random random, int j)
public Item getItemDropped(int i, Random random, int j)
{
return 0;
return null;
}
@Override
@ -800,7 +801,7 @@ public class BlockBasic extends Block
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side)
{
if(blockID == Mekanism.basicBlockID && world.getBlockMetadata(x, y, z) == 10)
if(this == Mekanism.BasicBlock && world.getBlockMetadata(x, y, z) == 10)
{
return glassRenderer.shouldRenderSide(world, x, y, z, side);
}

View file

@ -8,6 +8,7 @@ import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
@ -17,16 +18,16 @@ import cpw.mods.fml.relauncher.SideOnly;
public class BlockBounding extends Block
{
public BlockBounding(int id)
public BlockBounding()
{
super(id, Material.iron);
super(Material.iron);
setHardness(3.5F);
setResistance(8F);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister register) {}
public void registerBlockIcons(IIconRegister register) {}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int facing, float playerX, float playerY, float playerZ)
@ -62,12 +63,12 @@ public class BlockBounding extends Block
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, int id)
public void onNeighborBlockChange(World world, int x, int y, int z, Block block)
{
try {
TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock)world.getTileEntity(x, y, z);
tileEntity.onNeighborChange(id);
Block.blocksList[world.getBlockId(tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ)].onNeighborBlockChange(world, tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ, id);
tileEntity.onNeighborChange(block);
world.getBlock(tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ).onNeighborBlockChange(world, tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ, this);
} catch(Exception e) {}
}
@ -78,9 +79,9 @@ public class BlockBounding extends Block
}
@Override
public int idDropped(int i, Random random, int j)
public Item getItemDropped(int i, Random random, int j)
{
return 0;
return null;
}
@Override

View file

@ -12,6 +12,7 @@ import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
@ -25,9 +26,9 @@ public class BlockCardboardBox extends BlockContainer
{
public IIcon[] icons = new IIcon[6];
public BlockCardboardBox(int id)
public BlockCardboardBox()
{
super(id, Material.cloth);
super(Material.cloth);
setCreativeTab(Mekanism.tabMekanism);
setHardness(0.5F);
setResistance(1F);
@ -35,7 +36,7 @@ public class BlockCardboardBox extends BlockContainer
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister register)
public void registerBlockIcons(IIconRegister register)
{
icons[0] = register.registerIcon("mekanism:CardboardBoxTop");
icons[1] = register.registerIcon("mekanism:CardboardBoxSide");
@ -67,12 +68,12 @@ public class BlockCardboardBox extends BlockContainer
{
BlockData data = tileEntity.storedData;
if(Blocks.blocksList[data.id] != null)
if(data.block != null)
{
data.meta = Blocks.blocksList[data.id].onBlockPlaced(world, x, y, z, facing, hitX, hitY, hitZ, data.meta);
data.meta =data.block.onBlockPlaced(world, x, y, z, facing, hitX, hitY, hitZ, data.meta);
}
world.setBlock(x, y, z, data.id, data.meta, 3);
world.setBlock(x, y, z, data.block, data.meta, 3);
if(data.tileTag != null && world.getTileEntity(x, y, z) != null)
{
@ -80,10 +81,10 @@ public class BlockCardboardBox extends BlockContainer
world.getTileEntity(x, y, z).readFromNBT(data.tileTag);
}
if(Blocks.blocksList[data.id] != null)
if(data.block != null)
{
Blocks.blocksList[data.id].onBlockPlacedBy(world, x, y, z, entityplayer, new ItemStack(data.id, 1, data.meta));
Blocks.blocksList[data.id].onPostBlockPlaced(world, x, y, z, data.meta);
data.block.onBlockPlacedBy(world, x, y, z, entityplayer, new ItemStack(data.block, 1, data.meta));
data.block.onPostBlockPlaced(world, x, y, z, data.meta);
}
float motion = 0.7F;
@ -101,7 +102,7 @@ public class BlockCardboardBox extends BlockContainer
}
@Override
public TileEntity createNewTileEntity(World world)
public TileEntity createNewTileEntity(World world, int meta)
{
return new TileEntityCardboardBox();
}
@ -170,20 +171,20 @@ public class BlockCardboardBox extends BlockContainer
}
@Override
public int idDropped(int i, Random random, int j)
public Item getItemDropped(int i, Random random, int j)
{
return 0;
return null;
}
public static class BlockData
{
public int id;
public Block block;
public int meta;
public NBTTagCompound tileTag;
public BlockData(int i, int j, NBTTagCompound nbtTags)
public BlockData(Block b, int j, NBTTagCompound nbtTags)
{
id = i;
block = b;
meta = j;
tileTag = nbtTags;
}

View file

@ -19,6 +19,8 @@ import mekanism.common.tile.TileEntityBasicBlock;
import mekanism.common.tile.TileEntityDynamicTank;
import mekanism.common.tile.TileEntityElectricBlock;
import mekanism.common.tile.TileEntityEnergyCube;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@ -52,9 +54,9 @@ public class BlockEnergyCube extends BlockContainer
{
public IIcon[][] icons = new IIcon[256][256];
public BlockEnergyCube(int id)
public BlockEnergyCube()
{
super(id, Material.iron);
super(Material.iron);
setHardness(2F);
setResistance(4F);
setCreativeTab(Mekanism.tabMekanism);
@ -62,10 +64,10 @@ public class BlockEnergyCube extends BlockContainer
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister register) {}
public void registerBlockIcons(IIconRegister register) {}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, int id)
public void onNeighborBlockChange(World world, int x, int y, int z, Block block)
{
if(!world.isRemote)
{
@ -73,7 +75,7 @@ public class BlockEnergyCube extends BlockContainer
if(tileEntity instanceof TileEntityBasicBlock)
{
((TileEntityBasicBlock)tileEntity).onNeighborChange(id);
((TileEntityBasicBlock)tileEntity).onNeighborChange(block);
}
}
}
@ -115,14 +117,14 @@ public class BlockEnergyCube extends BlockContainer
}
@Override
public int idDropped(int i, Random random, int j)
public Item getItemDropped(int i, Random random, int j)
{
return 0;
return null;
}
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(int i, CreativeTabs creativetabs, List list)
public void getSubBlocks(Item item, CreativeTabs creativetabs, List list)
{
for(EnergyCubeTier tier : EnergyCubeTier.values())
{
@ -194,7 +196,7 @@ public class BlockEnergyCube extends BlockContainer
}
tileEntity.setFacing((short)change);
world.notifyBlocksOfNeighborChange(x, y, z, blockID);
world.notifyBlocksOfNeighborChange(x, y, z, this);
return true;
}
}
@ -231,7 +233,7 @@ public class BlockEnergyCube extends BlockContainer
}
@Override
public TileEntity createNewTileEntity(World world)
public TileEntity createNewTileEntity(World world, int meta)
{
return new TileEntityEnergyCube();
}
@ -318,7 +320,7 @@ public class BlockEnergyCube extends BlockContainer
}
@Override
public boolean isBlockSolidOnSide(World world, int x, int y, int z, ForgeDirection side)
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side)
{
return true;
}

View file

@ -9,6 +9,8 @@ import mekanism.common.Mekanism;
import mekanism.common.tile.TileEntityBasicBlock;
import mekanism.common.tile.TileEntityElectricBlock;
import mekanism.common.tile.TileEntityGasTank;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@ -29,9 +31,9 @@ public class BlockGasTank extends BlockContainer
{
public Random machineRand = new Random();
public BlockGasTank(int id)
public BlockGasTank()
{
super(id, Material.iron);
super(Material.iron);
setBlockBounds(0.2F, 0.0F, 0.2F, 0.8F, 1.0F, 0.8F);
setHardness(3.5F);
setResistance(8F);
@ -40,7 +42,7 @@ public class BlockGasTank extends BlockContainer
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister register) {}
public void registerBlockIcons(IIconRegister register) {}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityliving, ItemStack itemstack)
@ -63,7 +65,7 @@ public class BlockGasTank extends BlockContainer
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, int id)
public void onNeighborBlockChange(World world, int x, int y, int z, Block block)
{
if(!world.isRemote)
{
@ -71,7 +73,7 @@ public class BlockGasTank extends BlockContainer
if(tileEntity instanceof TileEntityBasicBlock)
{
((TileEntityBasicBlock)tileEntity).onNeighborChange(id);
((TileEntityBasicBlock)tileEntity).onNeighborChange(block);
}
}
}
@ -127,7 +129,7 @@ public class BlockGasTank extends BlockContainer
}
tileEntity.setFacing((short)change);
world.notifyBlocksOfNeighborChange(x, y, z, blockID);
world.notifyBlocksOfNeighborChange(x, y, z, this);
return true;
}
}
@ -190,9 +192,9 @@ public class BlockGasTank extends BlockContainer
}
@Override
public int idDropped(int i, Random random, int j)
public Item getItemDropped(int i, Random random, int j)
{
return 0;
return null;
}
@Override
@ -214,7 +216,7 @@ public class BlockGasTank extends BlockContainer
}
@Override
public TileEntity createNewTileEntity(World world)
public TileEntity createNewTileEntity(World world, int meta)
{
return new TileEntityGasTank();
}

View file

@ -20,7 +20,6 @@ import mekanism.common.IUpgradeManagement;
import mekanism.common.ItemAttacher;
import mekanism.common.Mekanism;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.miner.MinerFilter;
import mekanism.common.network.PacketElectricChest;
import mekanism.common.network.PacketElectricChest.ElectricChestPacketType;
@ -741,10 +740,10 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds
}
else if(!electricChest.authenticated)
{
PacketHandler.sendPacket(Transmission.SINGLE_CLIENT, new PacketElectricChest().setParams(ElectricChestPacketType.CLIENT_OPEN, 2, 0, true, Coord4D.get(electricChest)), entityplayer);
Mekanism.packetPipeline.sendTo(new PacketElectricChest(ElectricChestPacketType.CLIENT_OPEN, 2, 0, true, Coord4D.get(electricChest)), entityplayer);
}
else {
PacketHandler.sendPacket(Transmission.SINGLE_CLIENT, new PacketElectricChest().setParams(ElectricChestPacketType.CLIENT_OPEN, 1, 0, true, Coord4D.get(electricChest)), entityplayer);
Mekanism.packetPipeline.sendTo(new PacketElectricChest(ElectricChestPacketType.CLIENT_OPEN, 1, 0, true, Coord4D.get(electricChest)), entityplayer);
}
return true;

View file

@ -9,6 +9,7 @@ import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
@ -21,15 +22,15 @@ public class BlockObsidianTNT extends Block
{
public IIcon[] icons = new IIcon[256];
public BlockObsidianTNT(int id)
public BlockObsidianTNT()
{
super(id, Material.tnt);
super(Material.tnt);
setCreativeTab(Mekanism.tabMekanism);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister register) {}
public void registerBlockIcons(IIconRegister register) {}
@Override
public void onBlockAdded(World world, int x, int y, int z)
@ -44,7 +45,7 @@ public class BlockObsidianTNT extends Block
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, int blockID)
public void onNeighborBlockChange(World world, int x, int y, int z, Block block)
{
if(world.isBlockIndirectlyGettingPowered(x, y, z))
{
@ -77,7 +78,7 @@ public class BlockObsidianTNT extends Block
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int i1, float f1, float f2, float f3)
{
if(entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID == Items.flintAndSteel.itemID)
if(entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().getItem() == Items.flint_and_steel)
{
explode(world, x, y, z);
world.setBlockToAir(x, y, z);

View file

@ -7,6 +7,7 @@ import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import cpw.mods.fml.relauncher.Side;
@ -24,9 +25,9 @@ public class BlockOre extends Block
{
public IIcon[] icons = new IIcon[256];
public BlockOre(int id)
public BlockOre()
{
super(id, Material.rock);
super(Material.rock);
setHardness(3F);
setResistance(5F);
setCreativeTab(Mekanism.tabMekanism);
@ -34,7 +35,7 @@ public class BlockOre extends Block
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister register)
public void registerBlockIcons(IIconRegister register)
{
icons[0] = register.registerIcon("mekanism:OsmiumOre");
icons[1] = register.registerIcon("mekanism:CopperOre");
@ -56,10 +57,10 @@ public class BlockOre extends Block
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(int i, CreativeTabs creativetabs, List list)
public void getSubBlocks(Item item, CreativeTabs creativetabs, List list)
{
list.add(new ItemStack(i, 1, 0));
list.add(new ItemStack(i, 1, 1));
list.add(new ItemStack(i, 1, 2));
list.add(new ItemStack(item, 1, 0));
list.add(new ItemStack(item, 1, 1));
list.add(new ItemStack(item, 1, 2));
}
}

View file

@ -11,6 +11,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
@ -24,13 +25,13 @@ import cpw.mods.fml.relauncher.SideOnly;
public class BlockPlastic extends Block
{
public BlockPlastic(int id)
public BlockPlastic()
{
super(id, Material.wood);
super(Material.wood);
setHardness(5F);
setResistance(10F);
setCreativeTab(Mekanism.tabMekanism);
if(id == Mekanism.slickPlasticID)
if(this == Mekanism.BlockSlickHDPE)
{
slipperiness = 0.98F;
}
@ -38,25 +39,25 @@ public class BlockPlastic extends Block
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister register)
public void registerBlockIcons(IIconRegister register)
{
if(blockID == Mekanism.plasticID)
if(this == Mekanism.BlockHDPE)
{
blockIcon = register.registerIcon("mekanism:PlasticBlock");
}
else if(blockID == Mekanism.slickPlasticID)
else if(this == Mekanism.BlockSlickHDPE)
{
blockIcon = register.registerIcon("mekanism:SlickPlasticBlock");
}
else if(blockID == Mekanism.glowPlasticID)
else if(this == Mekanism.BlockGlowHDPE)
{
blockIcon = register.registerIcon("mekanism:GlowPlasticBlock");
}
else if(blockID == Mekanism.reinforcedPlasticID)
else if(this == Mekanism.BlockReinforcedHDPE)
{
blockIcon = register.registerIcon("mekanism:ReinforcedPlasticBlock");
}
else if(blockID == Mekanism.roadPlasticID)
else if(this == Mekanism.BlockRoadHDPE)
{
blockIcon = register.registerIcon("mekanism:RoadPlasticBlock");
}
@ -65,7 +66,7 @@ public class BlockPlastic extends Block
@Override
public void onEntityWalking(World world, int x, int y, int z, Entity e)
{
if(blockID == Mekanism.roadPlasticID)
if(this == Mekanism.BlockRoadHDPE)
{
double boost = 1.6;
@ -83,11 +84,11 @@ public class BlockPlastic extends Block
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(int id, CreativeTabs creativetabs, List list)
public void getSubBlocks(Item item, CreativeTabs creativetabs, List list)
{
for(int i = 0; i < EnumColor.DYES.length; i++)
{
list.add(new ItemStack(id, 1, i));
list.add(new ItemStack(item, 1, i));
}
}
@ -108,7 +109,7 @@ public class BlockPlastic extends Block
@Override
public int getLightValue(IBlockAccess world, int x, int y, int z)
{
if(blockID == Mekanism.glowPlasticID)
if(this == Mekanism.BlockGlowHDPE)
{
return 10;
}

View file

@ -7,9 +7,9 @@ import net.minecraft.block.material.Material;
public class BlockPlasticFence extends BlockFence
{
public BlockPlasticFence(int id)
public BlockPlasticFence()
{
super(id, "mekanism:PlasticFence", Material.clay);
super("mekanism:PlasticFence", Material.clay);
setCreativeTab(Mekanism.tabMekanism);
}
}

View file

@ -650,7 +650,7 @@ public class EntityRobit extends EntityCreature implements IInventory, ISustaine
}
@Override
public void onInventoryChanged() {}
public void markDirty() {}
@Override
public boolean isUseableByPlayer(EntityPlayer entityplayer)

View file

@ -32,9 +32,9 @@ public class InventoryElectricChest extends InventoryBasic
}
@Override
public void onInventoryChanged()
public void markDirty()
{
super.onInventoryChanged();
super.markDirty();
if(!reading)
{

View file

@ -17,6 +17,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
@ -29,16 +30,16 @@ public class ItemAtomicDisassembler extends ItemEnergized
public double ENERGY_USAGE = 10;
public double HOE_USAGE = 100;
public ItemAtomicDisassembler(int id)
public ItemAtomicDisassembler()
{
super(id, 1000000);
super(1000000);
}
@Override
public void registerIcons(IIconRegister register) {}
@Override
public boolean canHarvestBlock(Block block)
public boolean canHarvestBlock(Block block, ItemStack stack)
{
return block != Blocks.bedrock;
}
@ -151,7 +152,7 @@ public class ItemAtomicDisassembler extends ItemEnergized
if(!world.isRemote && entityplayer.isSneaking())
{
toggleMode(itemstack);
entityplayer.addChatMessage(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.GREY + "Mode toggled to " + EnumColor.INDIGO + getModeName(itemstack) + EnumColor.AQUA + " (" + getEfficiency(itemstack) + ")");
entityplayer.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.GREY + "Mode toggled to " + EnumColor.INDIGO + getModeName(itemstack) + EnumColor.AQUA + " (" + getEfficiency(itemstack) + ")"));
}
return itemstack;

View file

@ -22,9 +22,9 @@ import cpw.mods.fml.relauncher.SideOnly;
public class ItemBalloon extends ItemMekanism
{
public ItemBalloon(int id)
public ItemBalloon()
{
super(id);
super();
setHasSubtypes(true);
}
@ -88,7 +88,7 @@ public class ItemBalloon extends ItemMekanism
{
AxisAlignedBB bound = AxisAlignedBB.getBoundingBox(x, y, z, x+1, y+3, z+1);
List<EntityBalloon> balloonsNear = player.getWorldObj().getEntitiesWithinAABB(EntityBalloon.class, bound);
List<EntityBalloon> balloonsNear = player.worldObj.getEntitiesWithinAABB(EntityBalloon.class, bound);
if(balloonsNear.size() > 0)
{
@ -125,11 +125,11 @@ public class ItemBalloon extends ItemMekanism
{
if(player.isSneaking())
{
if(!player.getWorldObj().isRemote)
if(!player.worldObj.isRemote)
{
AxisAlignedBB bound = AxisAlignedBB.getBoundingBox(entity.posX - 0.2, entity.posY - 0.5, entity.posZ - 0.2, entity.posX + 0.2, entity.posY + entity.ySize + 4, entity.posZ + 0.2);
List<EntityBalloon> balloonsNear = player.getWorldObj().getEntitiesWithinAABB(EntityBalloon.class, bound);
List<EntityBalloon> balloonsNear = player.worldObj.getEntitiesWithinAABB(EntityBalloon.class, bound);
for(EntityBalloon balloon : balloonsNear)
{
@ -139,7 +139,7 @@ public class ItemBalloon extends ItemMekanism
}
}
player.getWorldObj().spawnEntityInWorld(new EntityBalloon(entity, getColor(stack)));
player.worldObj.spawnEntityInWorld(new EntityBalloon(entity, getColor(stack)));
stack.stackSize--;
}

View file

@ -13,7 +13,6 @@ import mekanism.common.IEnergyCube;
import mekanism.common.ISustainedInventory;
import mekanism.common.Mekanism;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.Tier.EnergyCubeTier;
import mekanism.common.integration.IC2ItemManager;
import mekanism.common.network.PacketTileEntity;
@ -90,7 +89,7 @@ public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IE
if(!world.isRemote)
{
PacketHandler.sendPacket(Transmission.ALL_CLIENTS, new PacketTileEntity().setParams(Coord4D.get(tileEntity), tileEntity.getNetworkedData(new ArrayList())));
Mekanism.packetPipeline.sendToAll(new PacketTileEntity(Coord4D.get(tileEntity), tileEntity.getNetworkedData(new ArrayList())));
}
}

View file

@ -21,7 +21,6 @@ import mekanism.common.ISustainedTank;
import mekanism.common.IUpgradeManagement;
import mekanism.common.Mekanism;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.block.BlockMachine.MachineType;
import mekanism.common.integration.IC2ItemManager;
import mekanism.common.inventory.InventoryElectricChest;
@ -524,11 +523,11 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
{
if(!getAuthenticated(itemstack))
{
PacketHandler.sendPacket(Transmission.SINGLE_CLIENT, new PacketElectricChest().setParams(ElectricChestPacketType.CLIENT_OPEN, 2, 0, false), entityplayer);
Mekanism.packetPipeline.sendTo(new PacketElectricChest(ElectricChestPacketType.CLIENT_OPEN, 2, 0, false), entityplayer);
}
else if(getLocked(itemstack) && getEnergy(itemstack) > 0)
{
PacketHandler.sendPacket(Transmission.SINGLE_CLIENT, new PacketElectricChest().setParams(ElectricChestPacketType.CLIENT_OPEN, 1, 0, false), entityplayer);
Mekanism.packetPipeline.sendTo(new PacketElectricChest(ElectricChestPacketType.CLIENT_OPEN, 1, 0, false), entityplayer);
}
else {
InventoryElectricChest inventory = new InventoryElectricChest(entityplayer);

View file

@ -6,6 +6,7 @@ import mekanism.common.Mekanism;
import mekanism.common.Resource;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
@ -13,9 +14,9 @@ public class ItemClump extends ItemMekanism
{
public IIcon[] icons = new IIcon[256];
public ItemClump(int id)
public ItemClump()
{
super(id);
super();
setHasSubtypes(true);
setCreativeTab(Mekanism.tabMekanism);
}
@ -36,7 +37,7 @@ public class ItemClump extends ItemMekanism
}
@Override
public void getSubItems(int id, CreativeTabs tabs, List itemList)
public void getSubItems(Item item, CreativeTabs tabs, List itemList)
{
for(int counter = 0; counter < Resource.values().length; counter++)
{

View file

@ -9,7 +9,6 @@ import mekanism.api.EnumColor;
import mekanism.common.IConfigurable;
import mekanism.common.IInvConfiguration;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.network.PacketTileEntity;
import mekanism.common.tile.TileEntityBasicBlock;
import mekanism.common.tile.TileEntityElectricChest;
@ -20,7 +19,7 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatMessageComponent;
import net.minecraft.util.ChatComponentText;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import buildcraft.api.tools.IToolWrench;
@ -32,9 +31,9 @@ public class ItemConfigurator extends ItemEnergized implements IToolWrench
private Random random = new Random();
public ItemConfigurator(int id)
public ItemConfigurator()
{
super(id, 60000);
super(60000);
}
@Override
@ -85,7 +84,7 @@ public class ItemConfigurator extends ItemEnergized implements IToolWrench
if(!player.isSneaking())
{
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.configurator.viewColor") + ": " + config.getSideData().get(config.getConfiguration()[MekanismUtils.getBaseOrientation(side, config.getOrientation())]).color.getName()));
player.sendChatToPlayer(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.configurator.viewColor") + ": " + config.getSideData().get(config.getConfiguration()[MekanismUtils.getBaseOrientation(side, config.getOrientation())]).color.getName()));
return true;
}
else {
@ -93,12 +92,12 @@ public class ItemConfigurator extends ItemEnergized implements IToolWrench
{
setEnergy(stack, getEnergy(stack) - ENERGY_PER_CONFIGURE);
MekanismUtils.incrementOutput(config, MekanismUtils.getBaseOrientation(side, config.getOrientation()));
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.configurator.toggleColor") + ": " + config.getSideData().get(config.getConfiguration()[MekanismUtils.getBaseOrientation(side, config.getOrientation())]).color.getName()));
player.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.configurator.toggleColor") + ": " + config.getSideData().get(config.getConfiguration()[MekanismUtils.getBaseOrientation(side, config.getOrientation())]).color.getName()));
if(config instanceof TileEntityBasicBlock)
{
TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)config;
PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(tileEntity), tileEntity.getNetworkedData(new ArrayList())), Coord4D.get(tileEntity), 50D);
Mekanism.packetPipeline.sendToAllAround(new PacketTileEntity(Coord4D.get(tileEntity), tileEntity.getNetworkedData(new ArrayList())), Coord4D.get(tileEntity), 50D);
}
return true;
@ -162,7 +161,7 @@ public class ItemConfigurator extends ItemEnergized implements IToolWrench
return true;
}
else {
player.addChatMessage(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.GREY + MekanismUtils.localize("tooltip.configurator.unauth"));
player.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.GREY + MekanismUtils.localize("tooltip.configurator.unauth")));
return true;
}
}
@ -196,7 +195,7 @@ public class ItemConfigurator extends ItemEnergized implements IToolWrench
if(!world.isRemote && player.isSneaking())
{
Coord4D obj = new Coord4D(x, y, z, world.provider.dimensionId);
player.addChatMessage(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Set link to block " + EnumColor.INDIGO + MekanismUtils.getCoordDisplay(obj) + EnumColor.GREY + ", dimension " + EnumColor.INDIGO + obj.dimensionId);
player.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Set link to block " + EnumColor.INDIGO + MekanismUtils.getCoordDisplay(obj) + EnumColor.GREY + ", dimension " + EnumColor.INDIGO + obj.dimensionId));
setLink(stack, obj);
return true;
@ -307,7 +306,7 @@ public class ItemConfigurator extends ItemEnergized implements IToolWrench
@Override
public boolean canWrench(EntityPlayer player, int x, int y, int z)
{
return !(player.getWorldObj().getTileEntity(x, y, z) instanceof TileEntityBasicBlock);
return !(player.worldObj.getTileEntity(x, y, z) instanceof TileEntityBasicBlock);
}
@Override

View file

@ -6,6 +6,7 @@ import mekanism.common.Mekanism;
import mekanism.common.Resource;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
@ -13,9 +14,9 @@ public class ItemCrystal extends ItemMekanism
{
public IIcon[] icons = new IIcon[256];
public ItemCrystal(int id)
public ItemCrystal()
{
super(id);
super();
setHasSubtypes(true);
setCreativeTab(Mekanism.tabMekanism);
}
@ -36,11 +37,11 @@ public class ItemCrystal extends ItemMekanism
}
@Override
public void getSubItems(int id, CreativeTabs tabs, List itemList)
public void getSubItems(Item item, CreativeTabs tabs, List itemList)
{
for(int counter = 0; counter < Resource.values().length; counter++)
{
itemList.add(new ItemStack(this, 1, counter));
itemList.add(new ItemStack(item, 1, counter));
}
}

View file

@ -8,13 +8,14 @@ import mekanism.common.util.MekanismUtils;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatComponentText;
import net.minecraft.world.World;
public class ItemDictionary extends ItemMekanism
{
public ItemDictionary(int id)
public ItemDictionary()
{
super(id);
super();
setMaxStackSize(1);
}
@ -34,15 +35,15 @@ public class ItemDictionary extends ItemMekanism
if(!names.isEmpty())
{
player.addChatMessage(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Key(s) found:");
player.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Key(s) found:"));
for(String name : names)
{
player.addChatMessage(EnumColor.DARK_GREEN + " - " + name);
player.addChatMessage(new ChatComponentText(EnumColor.DARK_GREEN + " - " + name));
}
}
else {
player.addChatMessage(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " No key.");
player.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " No key."));
}
}

View file

@ -6,6 +6,7 @@ import mekanism.common.Mekanism;
import mekanism.common.Resource;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
@ -13,9 +14,9 @@ public class ItemDirtyDust extends ItemMekanism
{
public IIcon[] icons = new IIcon[256];
public ItemDirtyDust(int id)
public ItemDirtyDust()
{
super(id);
super();
setHasSubtypes(true);
setCreativeTab(Mekanism.tabMekanism);
}
@ -36,11 +37,11 @@ public class ItemDirtyDust extends ItemMekanism
}
@Override
public void getSubItems(int id, CreativeTabs tabs, List itemList)
public void getSubItems(Item item, CreativeTabs tabs, List itemList)
{
for(int counter = 0; counter < Resource.values().length; counter++)
{
itemList.add(new ItemStack(this, 1, counter));
itemList.add(new ItemStack(item, 1, counter));
}
}

View file

@ -5,6 +5,7 @@ import java.util.List;
import mekanism.common.Mekanism;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
@ -17,9 +18,9 @@ public class ItemDust extends ItemMekanism
"Copper", "Tin", "Silver",
"Lead", "Sulfur"};
public ItemDust(int id)
public ItemDust()
{
super(id);
super();
setHasSubtypes(true);
setCreativeTab(Mekanism.tabMekanism);
}
@ -40,11 +41,11 @@ public class ItemDust extends ItemMekanism
}
@Override
public void getSubItems(int id, CreativeTabs tabs, List itemList)
public void getSubItems(Item item, CreativeTabs tabs, List itemList)
{
for(int counter = 0; counter <= 10; ++counter)
{
itemList.add(new ItemStack(this, 1, counter));
itemList.add(new ItemStack(item, 1, counter));
}
}

View file

@ -7,6 +7,7 @@ import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.init.Items;
import net.minecraft.item.EnumAction;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@ -15,9 +16,9 @@ import net.minecraft.world.World;
public class ItemElectricBow extends ItemEnergized
{
public ItemElectricBow(int id)
public ItemElectricBow()
{
super(id, 120000);
super(120000);
}
@Override
@ -34,7 +35,7 @@ public class ItemElectricBow extends ItemEnergized
{
boolean flag = player.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, itemstack) > 0;
if(flag || player.inventory.hasItem(Items.arrow.itemID))
if(flag || player.inventory.hasItem(Items.arrow))
{
int maxItemUse = getMaxItemUseDuration(itemstack) - itemUseCount;
float f = maxItemUse / 20F;
@ -69,7 +70,7 @@ public class ItemElectricBow extends ItemEnergized
entityarrow.canBePickedUp = 2;
}
else {
player.inventory.consumeInventoryItem(Items.arrow.itemID);
player.inventory.consumeInventoryItem(Items.arrow);
}
if(!world.isRemote)
@ -96,7 +97,7 @@ public class ItemElectricBow extends ItemEnergized
@Override
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
{
if(entityplayer.capabilities.isCreativeMode || entityplayer.inventory.hasItem(Items.arrow.itemID))
if(entityplayer.capabilities.isCreativeMode || entityplayer.inventory.hasItem(Items.arrow))
{
entityplayer.setItemInUse(itemstack, getMaxItemUseDuration(itemstack));
}

View file

@ -12,6 +12,7 @@ import mekanism.common.integration.IC2ItemManager;
import mekanism.common.util.MekanismUtils;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
@ -22,9 +23,9 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, ISpec
/** The maximum amount of energy this item can hold. */
public double MAX_ELECTRICITY;
public ItemEnergized(int id, double maxElectricity)
public ItemEnergized(double maxElectricity)
{
super(id);
super();
MAX_ELECTRICITY = maxElectricity;
setMaxStackSize(1);
setMaxDamage(100);
@ -46,7 +47,7 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, ISpec
}
@Override
public void getSubItems(int i, CreativeTabs tabs, List list)
public void getSubItems(Item item, CreativeTabs tabs, List list)
{
ItemStack discharged = new ItemStack(this);
discharged.setItemDamage(100);
@ -63,15 +64,15 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, ISpec
}
@Override
public int getChargedItemId(ItemStack itemStack)
public Item getChargedItem(ItemStack itemStack)
{
return itemID;
return this;
}
@Override
public int getEmptyItemId(ItemStack itemStack)
public Item getEmptyItem(ItemStack itemStack)
{
return itemID;
return this;
}
@Override

View file

@ -9,14 +9,14 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatMessageComponent;
import net.minecraft.util.ChatComponentText;
import net.minecraft.world.World;
public class ItemFilterCard extends ItemMekanism
{
public ItemFilterCard(int id)
public ItemFilterCard()
{
super(id);
super();
setMaxStackSize(1);
}
@ -46,7 +46,7 @@ public class ItemFilterCard extends ItemMekanism
{
data.setString("dataType", ((IFilterAccess)tileEntity).getDataType());
setData(stack, data);
player.addChatMessage(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.GREY + MekanismUtils.localize("tooltip.filterCard.got").replaceAll("%s", EnumColor.INDIGO + MekanismUtils.localize(data.getString("dataType")) + EnumColor.GREY));
player.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.GREY + MekanismUtils.localize("tooltip.filterCard.got").replaceAll("%s", EnumColor.INDIGO + MekanismUtils.localize(data.getString("dataType")) + EnumColor.GREY)));
}
return true;
@ -56,11 +56,11 @@ public class ItemFilterCard extends ItemMekanism
if(((IFilterAccess)tileEntity).getDataType().equals(getDataType(stack)))
{
((IFilterAccess)tileEntity).setFilterData(getData(stack));
player.addChatMessage(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.DARK_GREEN + MekanismUtils.localize("tooltip.filterCard.set").replaceAll("%s", EnumColor.INDIGO + MekanismUtils.localize(getDataType(stack)) + EnumColor.DARK_GREEN));
player.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.DARK_GREEN + MekanismUtils.localize("tooltip.filterCard.set").replaceAll("%s", EnumColor.INDIGO + MekanismUtils.localize(getDataType(stack)) + EnumColor.DARK_GREEN)));
setData(stack, null);
}
else {
player.addChatMessage(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.RED + MekanismUtils.localize("tooltip.filterCard.unequal") + ".");
player.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.RED + MekanismUtils.localize("tooltip.filterCard.unequal") + "."));
}
return true;

View file

@ -19,12 +19,13 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import net.minecraftforge.common.EnumHelper;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.event.entity.living.LivingAttackEvent;
@ -36,9 +37,9 @@ public class ItemFreeRunners extends ItemArmor implements IEnergizedItem, ISpeci
/** The maximum amount of energy this item can hold. */
public double MAX_ELECTRICITY = 64000;
public ItemFreeRunners(int id)
public ItemFreeRunners()
{
super(id, EnumHelper.addArmorMaterial("FRICTIONBOOTS", 0, new int[] {0, 0, 0, 0}, 0), 0, 3);
super(EnumHelper.addArmorMaterial("FRICTIONBOOTS", 0, new int[] {0, 0, 0, 0}, 0), 0, 3);
setMaxStackSize(1);
setMaxDamage(100);
setNoRepair();
@ -85,7 +86,7 @@ public class ItemFreeRunners extends ItemArmor implements IEnergizedItem, ISpeci
}
@Override
public void getSubItems(int i, CreativeTabs tabs, List list)
public void getSubItems(Item item, CreativeTabs tabs, List list)
{
ItemStack discharged = new ItemStack(this);
discharged.setItemDamage(100);
@ -102,15 +103,15 @@ public class ItemFreeRunners extends ItemArmor implements IEnergizedItem, ISpeci
}
@Override
public int getChargedItemId(ItemStack itemStack)
public Item getChargedItem(ItemStack itemStack)
{
return itemID;
return this;
}
@Override
public int getEmptyItemId(ItemStack itemStack)
public Item getEmptyItem(ItemStack itemStack)
{
return itemID;
return this;
}
@Override

View file

@ -10,7 +10,7 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraftforge.common.EnumHelper;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.event.entity.living.LivingAttackEvent;
@ -19,9 +19,9 @@ import cpw.mods.fml.relauncher.SideOnly;
public class ItemGasMask extends ItemArmor
{
public ItemGasMask(int id)
public ItemGasMask()
{
super(id, EnumHelper.addArmorMaterial("GASMASK", 0, new int[] {0, 0, 0, 0}, 0), 0, 0);
super(EnumHelper.addArmorMaterial("GASMASK", 0, new int[] {0, 0, 0, 0}, 0), 0, 0);
setCreativeTab(Mekanism.tabMekanism);
MinecraftForge.EVENT_BUS.register(this);
}

View file

@ -6,6 +6,7 @@ import mekanism.common.Mekanism;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
@ -13,9 +14,9 @@ public class ItemHDPE extends ItemMekanism
{
public IIcon[] icons = new IIcon[256];
public ItemHDPE(int id)
public ItemHDPE()
{
super(id);
super();
setHasSubtypes(true);
setCreativeTab(Mekanism.tabMekanism);
}
@ -36,11 +37,11 @@ public class ItemHDPE extends ItemMekanism
}
@Override
public void getSubItems(int id, CreativeTabs tabs, List itemList)
public void getSubItems(Item item, CreativeTabs tabs, List itemList)
{
for(int counter = 0; counter < PlasticItem.values().length; counter++)
{
itemList.add(new ItemStack(this, 1, counter));
itemList.add(new ItemStack(item, 1, counter));
}
}

View file

@ -5,6 +5,7 @@ import java.util.List;
import mekanism.common.Mekanism;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
@ -14,9 +15,9 @@ public class ItemIngot extends ItemMekanism
public static String[] en_USNames = {"Obsidian", "Osmium", "Bronze", "Glowstone", "Steel", "Copper", "Tin"};
public ItemIngot(int id)
public ItemIngot()
{
super(id);
super();
setHasSubtypes(true);
setCreativeTab(Mekanism.tabMekanism);
}
@ -37,11 +38,11 @@ public class ItemIngot extends ItemMekanism
}
@Override
public void getSubItems(int id, CreativeTabs tabs, List itemList)
public void getSubItems(Item item, CreativeTabs tabs, List itemList)
{
for(int counter = 0; counter <= 6; ++counter)
{
itemList.add(new ItemStack(this, 1, counter));
itemList.add(new ItemStack(item, 1, counter));
}
}

View file

@ -17,11 +17,12 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraftforge.common.EnumHelper;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.common.ISpecialArmor;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -31,9 +32,9 @@ public class ItemJetpack extends ItemArmor implements IGasItem, ISpecialArmor
public int MAX_GAS = 24000;
public int TRANSFER_RATE = 16;
public ItemJetpack(int id)
public ItemJetpack()
{
super(id, EnumHelper.addArmorMaterial("JETPACK", 0, new int[] {0, 0, 0, 0}, 0), 0, 1);
super(EnumHelper.addArmorMaterial("JETPACK", 0, new int[] {0, 0, 0, 0}, 0), 0, 1);
setCreativeTab(Mekanism.tabMekanism);
setMaxDamage(100);
setNoRepair();
@ -235,7 +236,7 @@ public class ItemJetpack extends ItemArmor implements IGasItem, ISpecialArmor
}
@Override
public void getSubItems(int i, CreativeTabs tabs, List list)
public void getSubItems(Item item, CreativeTabs tabs, List list)
{
ItemStack empty = new ItemStack(this);
setGas(empty, null);

View file

@ -4,9 +4,9 @@ import mekanism.common.Mekanism;
public class ItemMachineUpgrade extends ItemMekanism
{
public ItemMachineUpgrade(int id)
public ItemMachineUpgrade()
{
super(id);
super();
setMaxStackSize(8);
setCreativeTab(Mekanism.tabMekanism);
}

View file

@ -7,16 +7,16 @@ import mekanism.common.Mekanism;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatMessageComponent;
import net.minecraft.util.ChatComponentText;
import net.minecraft.world.World;
public class ItemNetworkReader extends ItemEnergized
{
public static double ENERGY_PER_USE = 400;
public ItemNetworkReader(int id)
public ItemNetworkReader()
{
super(id, 60000);
super(60000);
}
@Override
@ -34,28 +34,28 @@ public class ItemNetworkReader extends ItemEnergized
IGridTransmitter<?> transmitter = (IGridTransmitter<?>)tileEntity;
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " -------------"));
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + " *Transmitters: " + EnumColor.DARK_GREY + transmitter.getTransmitterNetwork().getSize()));
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + " *Acceptors: " + EnumColor.DARK_GREY + transmitter.getTransmitterNetwork().getAcceptorSize()));
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + " *Needed: " + EnumColor.DARK_GREY + transmitter.getTransmitterNetwork().getNeeded()));
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + " *Buffer: " + EnumColor.DARK_GREY + transmitter.getTransmitterNetwork().getStored()));
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + " *Throughput: " + EnumColor.DARK_GREY + transmitter.getTransmitterNetwork().getFlow()));
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + " *Capacity: " + EnumColor.DARK_GREY + transmitter.getTransmitterNetwork().getCapacity() + "/tick"));
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[=======]" + EnumColor.GREY + " -------------"));
player.addChatMessage(new ChatComponentText(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " -------------"));
player.addChatMessage(new ChatComponentText(EnumColor.GREY + " *Transmitters: " + EnumColor.DARK_GREY + transmitter.getTransmitterNetwork().getSize()));
player.addChatMessage(new ChatComponentText(EnumColor.GREY + " *Acceptors: " + EnumColor.DARK_GREY + transmitter.getTransmitterNetwork().getAcceptorSize()));
player.addChatMessage(new ChatComponentText(EnumColor.GREY + " *Needed: " + EnumColor.DARK_GREY + transmitter.getTransmitterNetwork().getNeeded()));
player.addChatMessage(new ChatComponentText(EnumColor.GREY + " *Buffer: " + EnumColor.DARK_GREY + transmitter.getTransmitterNetwork().getStored()));
player.addChatMessage(new ChatComponentText(EnumColor.GREY + " *Throughput: " + EnumColor.DARK_GREY + transmitter.getTransmitterNetwork().getFlow()));
player.addChatMessage(new ChatComponentText(EnumColor.GREY + " *Capacity: " + EnumColor.DARK_GREY + transmitter.getTransmitterNetwork().getCapacity() + "/tick"));
player.addChatMessage(new ChatComponentText(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[=======]" + EnumColor.GREY + " -------------"));
}
}
if(player.isSneaking() && Mekanism.debug)
{
String[] strings = TransmitterNetworkRegistry.getInstance().toStrings();
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + "---------- " + EnumColor.DARK_BLUE + "[Mekanism Debug]" + EnumColor.GREY + " ----------"));
player.addChatMessage(new ChatComponentText(EnumColor.GREY + "---------- " + EnumColor.DARK_BLUE + "[Mekanism Debug]" + EnumColor.GREY + " ----------"));
for(String s : strings)
{
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.DARK_GREY + s));
player.addChatMessage(new ChatComponentText(EnumColor.DARK_GREY + s));
}
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[=======]" + EnumColor.GREY + " -------------"));
player.addChatMessage(new ChatComponentText(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[=======]" + EnumColor.GREY + " -------------"));
}
}

View file

@ -12,9 +12,9 @@ import net.minecraft.world.World;
public class ItemPortableTeleporter extends ItemEnergized
{
public ItemPortableTeleporter(int id)
public ItemPortableTeleporter()
{
super(id, 1000000);
super(1000000);
}
@Override
@ -33,7 +33,7 @@ public class ItemPortableTeleporter extends ItemEnergized
int neededEnergy = 1000;
if(entity.getWorldObj().provider.dimensionId != coords.dimensionId)
if(entity.worldObj.provider.dimensionId != coords.dimensionId)
{
neededEnergy+=10000;
}

View file

@ -12,14 +12,14 @@ import net.minecraft.world.World;
public class ItemProxy extends Item
{
public ItemProxy(int id)
public ItemProxy()
{
super(id);
super();
setMaxDamage(1);
}
@Override
public ItemStack getContainerItemStack(ItemStack stack)
public ItemStack getContainerItem(ItemStack stack)
{
return getSavedItem(stack) != null ? getSavedItem(stack) : getDead();
}
@ -31,9 +31,9 @@ public class ItemProxy extends Item
}
@Override
public boolean hasContainerItem()
public boolean hasContainerItem(ItemStack itemStack)
{
return true; //TODO forge PR
return true; //TODO forge PR -- Is this sorted now? -unpairedbracket
}
public void setSavedItem(ItemStack stack, ItemStack save)

View file

@ -19,9 +19,9 @@ import cpw.mods.fml.relauncher.SideOnly;
public class ItemRobit extends ItemEnergized implements ISustainedInventory
{
public ItemRobit(int id)
public ItemRobit()
{
super(id, 100000);
super(100000);
}
@Override
@ -54,7 +54,7 @@ public class ItemRobit extends ItemEnergized implements ISustainedInventory
robit.setHome(Coord4D.get(chargepad));
robit.setEnergy(getEnergy(itemstack));
robit.setOwner(entityplayer.username);
robit.setOwner(entityplayer.getCommandSenderName());
robit.setInventory(getInventory(itemstack));
robit.setName(getName(itemstack));
@ -126,7 +126,7 @@ public class ItemRobit extends ItemEnergized implements ISustainedInventory
return null;
}
return itemStack.stackTagCompound.getTagList("Items");
return itemStack.stackTagCompound.getTagList("Items", 10);
}
return null;

View file

@ -19,7 +19,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.EnumHelper;
import net.minecraftforge.common.util.EnumHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -28,9 +28,9 @@ public class ItemScubaTank extends ItemArmor implements IGasItem
public int MAX_GAS = 24000;
public int TRANSFER_RATE = 16;
public ItemScubaTank(int id)
public ItemScubaTank()
{
super(id, EnumHelper.addArmorMaterial("SCUBATANK", 0, new int[] {0, 0, 0, 0}, 0), 0, 1);
super(EnumHelper.addArmorMaterial("SCUBATANK", 0, new int[] {0, 0, 0, 0}, 0), 0, 1);
setCreativeTab(Mekanism.tabMekanism);
setMaxDamage(100);
setNoRepair();

View file

@ -6,15 +6,16 @@ import mekanism.common.Mekanism;
import mekanism.common.util.MekanismUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatComponentText;
import net.minecraft.world.World;
public class ItemSeismicReader extends ItemEnergized
{
public static final double ENERGY_USAGE = 250;
public ItemSeismicReader(int id)
public ItemSeismicReader()
{
super(id, 12000);
super(12000);
}
@Override
@ -32,7 +33,7 @@ public class ItemSeismicReader extends ItemEnergized
{
if(!world.isRemote)
{
entityplayer.addChatMessage(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.RED + MekanismUtils.localize("tooltip.seismicReader.needsEnergy"));
entityplayer.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.RED + MekanismUtils.localize("tooltip.seismicReader.needsEnergy")));
}
return itemstack;
@ -41,7 +42,7 @@ public class ItemSeismicReader extends ItemEnergized
{
if(!world.isRemote)
{
entityplayer.addChatMessage(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.RED + MekanismUtils.localize("tooltip.seismicReader.noVibrations"));
entityplayer.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.RED + MekanismUtils.localize("tooltip.seismicReader.noVibrations")));
}
return itemstack;

View file

@ -6,6 +6,7 @@ import mekanism.common.Mekanism;
import mekanism.common.Resource;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
@ -13,9 +14,9 @@ public class ItemShard extends ItemMekanism
{
public IIcon[] icons = new IIcon[256];
public ItemShard(int id)
public ItemShard()
{
super(id);
super();
setHasSubtypes(true);
setCreativeTab(Mekanism.tabMekanism);
}
@ -36,11 +37,11 @@ public class ItemShard extends ItemMekanism
}
@Override
public void getSubItems(int id, CreativeTabs tabs, List itemList)
public void getSubItems(Item item, CreativeTabs tabs, List itemList)
{
for(int counter = 0; counter < Resource.values().length; counter++)
{
itemList.add(new ItemStack(this, 1, counter));
itemList.add(new ItemStack(item, 1, counter));
}
}

View file

@ -16,9 +16,9 @@ public class ItemWalkieTalkie extends ItemMekanism
{
public IIcon[] icons = new IIcon[256];
public ItemWalkieTalkie(int id)
public ItemWalkieTalkie()
{
super(id);
super();
setMaxStackSize(1);
}

View file

@ -7,6 +7,7 @@ import mekanism.common.Mekanism;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
@ -19,9 +20,9 @@ import codechicken.multipart.TMultiPart;
public class ItemGlowPanel extends JItemMultiPart
{
public ItemGlowPanel(int id)
public ItemGlowPanel()
{
super(id);
super();
setHasSubtypes(true);
setCreativeTab(Mekanism.tabMekanism);
}
@ -64,16 +65,16 @@ public class ItemGlowPanel extends JItemMultiPart
}
@Override
public void getSubItems(int itemID, CreativeTabs tab, List listToAddTo)
public void getSubItems(Item item, CreativeTabs tab, List listToAddTo)
{
for(EnumColor color : EnumColor.DYES)
{
listToAddTo.add(new ItemStack(itemID, 1, color.getMetaValue()));
listToAddTo.add(new ItemStack(item, 1, color.getMetaValue()));
}
}
@Override
public String getItemDisplayName(ItemStack stack)
public String getItemStackDisplayName(ItemStack stack)
{
EnumColor colour = EnumColor.DYES[stack.getItemDamage()];
String colourName;
@ -85,7 +86,7 @@ public class ItemGlowPanel extends JItemMultiPart
colourName = colour.getDyedName();
}
return colourName + " " + super.getItemDisplayName(stack);
return colourName + " " + super.getItemStackDisplayName(stack);
}
@Override

View file

@ -14,6 +14,7 @@ import mekanism.common.util.MekanismUtils;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
@ -30,9 +31,9 @@ import cpw.mods.fml.relauncher.SideOnly;
public class ItemPartTransmitter extends JItemMultiPart
{
public ItemPartTransmitter(int id)
public ItemPartTransmitter()
{
super(id);
super();
setHasSubtypes(true);
setCreativeTab(Mekanism.tabMekanism);
}
@ -152,11 +153,11 @@ public class ItemPartTransmitter extends JItemMultiPart
}
@Override
public void getSubItems(int itemID, CreativeTabs tab, List listToAddTo)
public void getSubItems(Item item, CreativeTabs tab, List listToAddTo)
{
for(TransmitterType type : TransmitterType.values())
{
listToAddTo.add(new ItemStack(itemID, 1, type.ordinal()));
listToAddTo.add(new ItemStack(item, 1, type.ordinal()));
}
}

View file

@ -5,13 +5,12 @@ import java.util.ArrayList;
import mekanism.api.Coord4D;
import mekanism.api.EnumColor;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.network.PacketTileEntity;
import mekanism.common.transporter.TransporterStack;
import mekanism.common.util.MekanismUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ChatMessageComponent;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.IIcon;
import net.minecraftforge.common.util.ForgeDirection;
@ -121,8 +120,8 @@ public class PartDiversionTransporter extends PartLogisticalTransporter
refreshConnections();
tile().notifyPartChange(this);
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.configurator.toggleDiverter") + ": " + EnumColor.RED + description));
PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(tile()), getNetworkedData(new ArrayList())), Coord4D.get(tile()), 50D);
player.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.configurator.toggleDiverter") + ": " + EnumColor.RED + description));
Mekanism.packetPipeline.sendToAllAround(new PacketTileEntity(Coord4D.get(tile()), getNetworkedData(new ArrayList())), Coord4D.get(tile()), 50D);
return true;
}

View file

@ -11,7 +11,6 @@ import mekanism.client.render.RenderPartTransmitter;
import mekanism.common.HashList;
import mekanism.common.ILogisticalTransporter;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.network.PacketDataRequest;
import mekanism.common.network.PacketTileEntity;
import mekanism.common.tile.TileEntityLogisticalSorter;
@ -31,13 +30,12 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatMessageComponent;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.IIcon;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
import buildcraft.api.transport.IPipe;
import buildcraft.api.transport.IPipeTile;
import codechicken.lib.vec.Vector3;
@ -330,7 +328,7 @@ public class PartLogisticalTransporter extends PartSidedPipe implements ILogisti
for(TransporterStack stack : remove)
{
PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(tile()), getSyncPacket(stack, true)), Coord4D.get(tile()), 50D);
Mekanism.packetPipeline.sendToAllAround(new PacketTileEntity(Coord4D.get(tile()), getSyncPacket(stack, true)), Coord4D.get(tile()), 50D);
transit.remove(stack);
MekanismUtils.saveChunk(tile());
}
@ -339,7 +337,7 @@ public class PartLogisticalTransporter extends PartSidedPipe implements ILogisti
{
if(transit.contains(stack))
{
PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(tile()), getSyncPacket(stack, false)), Coord4D.get(tile()), 50D);
Mekanism.packetPipeline.sendToAllAround(new PacketTileEntity(Coord4D.get(tile()), getSyncPacket(stack, false)), Coord4D.get(tile()), 50D);
}
}
@ -444,7 +442,7 @@ public class PartLogisticalTransporter extends PartSidedPipe implements ILogisti
{
transit.add(stack);
TransporterManager.add(stack);
PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(tile()), getSyncPacket(stack, false)), Coord4D.get(tile()), 50D);
Mekanism.packetPipeline.sendToAllAround(new PacketTileEntity(Coord4D.get(tile()), getSyncPacket(stack, false)), Coord4D.get(tile()), 50D);
MekanismUtils.saveChunk(tile());
}
@ -480,7 +478,7 @@ public class PartLogisticalTransporter extends PartSidedPipe implements ILogisti
{
transit.add(stack);
TransporterManager.add(stack);
PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(tile()), getSyncPacket(stack, false)), Coord4D.get(tile()), 50D);
Mekanism.packetPipeline.sendToAllAround(new PacketTileEntity(Coord4D.get(tile()), getSyncPacket(stack, false)), Coord4D.get(tile()), 50D);
MekanismUtils.saveChunk(tile());
}
@ -495,7 +493,7 @@ public class PartLogisticalTransporter extends PartSidedPipe implements ILogisti
{
stack.progress = 0;
transit.add(stack);
PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(tile()), getSyncPacket(stack, false)), Coord4D.get(tile()), 50D);
Mekanism.packetPipeline.sendToAllAround(new PacketTileEntity(Coord4D.get(tile()), getSyncPacket(stack, false)), Coord4D.get(tile()), 50D);
MekanismUtils.saveChunk(tile());
}
@ -506,7 +504,7 @@ public class PartLogisticalTransporter extends PartSidedPipe implements ILogisti
if(world().isRemote)
{
PacketHandler.sendPacket(Transmission.SERVER, new PacketDataRequest().setParams(Coord4D.get(tile())));
Mekanism.packetPipeline.sendToServer(new PacketDataRequest(Coord4D.get(tile())));
}
}
@ -733,8 +731,8 @@ public class PartLogisticalTransporter extends PartSidedPipe implements ILogisti
TransporterUtils.incrementColor(this);
refreshConnections();
tile().notifyPartChange(this);
PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(tile()), getNetworkedData(new ArrayList())), Coord4D.get(tile()), 50D);
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.configurator.toggleColor") + ": " + (color != null ? color.getName() : EnumColor.BLACK + MekanismUtils.localize("gui.none"))));
Mekanism.packetPipeline.sendToAllAround(new PacketTileEntity(Coord4D.get(tile()), getNetworkedData(new ArrayList())), Coord4D.get(tile()), 50D);
player.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.configurator.toggleColor") + ": " + (color != null ? color.getName() : EnumColor.BLACK + MekanismUtils.localize("gui.none"))));
return true;
}
@ -743,7 +741,7 @@ public class PartLogisticalTransporter extends PartSidedPipe implements ILogisti
public boolean onRightClick(EntityPlayer player, int side)
{
super.onRightClick(player, side);
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.configurator.viewColor") + ": " + (color != null ? color.getName() : "None")));
player.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.configurator.viewColor") + ": " + (color != null ? color.getName() : "None")));
return true;
}

View file

@ -28,7 +28,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatMessageComponent;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.IIcon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraftforge.common.util.ForgeDirection;
@ -600,7 +600,7 @@ public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart,
sendDesc = true;
onModeChange(ForgeDirection.getOrientation(side));
player.sendChatToPlayer(ChatMessageComponent.createFromText("Connection type changed to " + connectionTypes[hit.subHit].toString()));
player.addChatMessage(new ChatComponentText("Connection type changed to " + connectionTypes[hit.subHit].toString()));
return true;
}
@ -626,7 +626,7 @@ public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart,
refreshConnections();
tile().notifyPartChange(this);
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Redstone sensitivity turned " + EnumColor.INDIGO + (redstoneReactive ? "on." : "off.")));
player.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Redstone sensitivity turned " + EnumColor.INDIGO + (redstoneReactive ? "on." : "off.")));
return true;
}

View file

@ -12,7 +12,6 @@ import mekanism.api.transmitters.TransmitterNetworkRegistry;
import mekanism.client.ClientTickHandler;
import mekanism.common.IConfigurable;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.network.PacketTransmitterUpdate;
import mekanism.common.network.PacketTransmitterUpdate.PacketType;
import net.minecraft.entity.player.EntityPlayer;
@ -204,7 +203,7 @@ public abstract class PartTransmitter<N extends DynamicNetwork<?, N>> extends Pa
if(!world().isRemote)
{
PacketHandler.sendPacket(Transmission.CLIENTS_DIM, new PacketTransmitterUpdate().setParams(PacketType.UPDATE, tile()), world().provider.dimensionId);
Mekanism.packetPipeline.sendToDimension(new PacketTransmitterUpdate(PacketType.UPDATE, tile()), world().provider.dimensionId);
}
}
@ -215,7 +214,7 @@ public abstract class PartTransmitter<N extends DynamicNetwork<?, N>> extends Pa
if(!world().isRemote)
{
PacketHandler.sendPacket(Transmission.CLIENTS_DIM, new PacketTransmitterUpdate().setParams(PacketType.UPDATE, tile()), world().provider.dimensionId);
Mekanism.packetPipeline.sendToDimension(new PacketTransmitterUpdate(PacketType.UPDATE, tile()), world().provider.dimensionId);
}
}

View file

@ -1,14 +1,18 @@
package mekanism.common.network;
import java.io.DataOutputStream;
import com.google.common.io.ByteArrayDataInput;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
/**
* AbstractPacket class. Should be the parent of all packets wishing to use the
* PacketPipeline.
*
* @author unpairedbracket based on sirgingalot's work in TiCon
* @author unpairedbracket based on sirgingalot's tutorial
*/
public abstract class MekanismPacket
{

View file

@ -8,22 +8,11 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import com.google.common.io.ByteArrayDataInput;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
public class PacketBoxBlacklist implements IMekanismPacket
public class PacketBoxBlacklist extends MekanismPacket
{
@Override
public String getName()
{
return "BoxBlacklist";
}
@Override
public IMekanismPacket setParams(Object... data)
{
return this;
}
@Override
public void read(ByteArrayDataInput dataStream, EntityPlayer player, World world) throws Exception
{
MekanismAPI.getBoxIgnore().clear();
@ -38,7 +27,6 @@ public class PacketBoxBlacklist implements IMekanismPacket
System.out.println("[Mekanism] Received Cardboard Box blacklist entries from server (" + amount + " total)");
}
@Override
public void write(DataOutputStream dataStream) throws Exception
{
dataStream.writeInt(MekanismAPI.getBoxIgnore().size());
@ -49,4 +37,28 @@ public class PacketBoxBlacklist implements IMekanismPacket
dataStream.writeInt(info.meta);
}
}
@Override
public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer)
{
}
@Override
public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer)
{
}
@Override
public void handleClientSide(EntityPlayer player)
{
}
@Override
public void handleServerSide(EntityPlayer player)
{
}
}

View file

@ -8,22 +8,11 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import com.google.common.io.ByteArrayDataInput;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
public class PacketConfigSync implements IMekanismPacket
public class PacketConfigSync extends MekanismPacket
{
@Override
public String getName()
{
return "ConfigSync";
}
@Override
public IMekanismPacket setParams(Object... data)
{
return this;
}
@Override
public void read(ByteArrayDataInput dataStream, EntityPlayer player, World world) throws Exception
{
Mekanism.osmiumGenerationEnabled = dataStream.readBoolean();
@ -83,7 +72,6 @@ public class PacketConfigSync implements IMekanismPacket
Mekanism.proxy.onConfigSync();
}
@Override
public void write(DataOutputStream dataStream) throws Exception
{
dataStream.writeBoolean(Mekanism.osmiumGenerationEnabled);
@ -137,4 +125,28 @@ public class PacketConfigSync implements IMekanismPacket
module.writeConfig(dataStream);
}
}
@Override
public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer)
{
}
@Override
public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer)
{
}
@Override
public void handleClientSide(EntityPlayer player)
{
}
@Override
public void handleServerSide(EntityPlayer player)
{
}
}

View file

@ -6,8 +6,7 @@ import java.util.ArrayList;
import mekanism.api.Coord4D;
import mekanism.common.IInvConfiguration;
import mekanism.common.ITileNetwork;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.Mekanism;
import mekanism.common.tile.TileEntityBasicBlock;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.TransporterUtils;
@ -17,10 +16,12 @@ import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import com.google.common.io.ByteArrayDataInput;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
public class PacketConfigurationUpdate implements IMekanismPacket
public class PacketConfigurationUpdate extends MekanismPacket
{
public Coord4D object3D;
public Coord4D coord4D;
public int configIndex;
@ -30,47 +31,37 @@ public class PacketConfigurationUpdate implements IMekanismPacket
public ConfigurationPacket packetType;
@Override
public String getName()
public PacketConfigurationUpdate(ConfigurationPacket type, Coord4D coord, int click, int extra)
{
return "ConfigurationUpdate";
}
packetType = type;
@Override
public IMekanismPacket setParams(Object... data)
{
packetType = (ConfigurationPacket)data[0];
object3D = (Coord4D)data[1];
coord4D = coord;
if(packetType == ConfigurationPacket.EJECT_COLOR)
{
clickType = (Integer)data[2];
clickType = click;
}
if(packetType == ConfigurationPacket.SIDE_DATA)
{
clickType = (Integer)data[2];
configIndex = (Integer)data[3];
clickType = click;
configIndex = extra;
}
if(packetType == ConfigurationPacket.INPUT_COLOR)
{
clickType = (Integer)data[2];
inputSide = (Integer)data[3];
clickType = click;
inputSide = extra;
}
return this;
}
@Override
public void read(ByteArrayDataInput dataStream, EntityPlayer player, World world) throws Exception
{
packetType = ConfigurationPacket.values()[dataStream.readInt()];
object3D = new Coord4D(dataStream.readInt(), dataStream.readInt(), dataStream.readInt(), dataStream.readInt());
coord4D = new Coord4D(dataStream.readInt(), dataStream.readInt(), dataStream.readInt(), dataStream.readInt());
TileEntity tile = object3D.getTileEntity(world);
TileEntity tile = coord4D.getTileEntity(world);
if(tile instanceof IInvConfiguration)
{
@ -98,7 +89,7 @@ public class PacketConfigurationUpdate implements IMekanismPacket
((IInvConfiguration)tile).getConfiguration()[configIndex] = 0;
}
PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(object3D, ((ITileNetwork)tile).getNetworkedData(new ArrayList())), object3D, 50D);
Mekanism.packetPipeline.sendToAllAround(new PacketTileEntity(coord4D, ((ITileNetwork) tile).getNetworkedData(new ArrayList())), coord4D, 50D);
}
else if(packetType == ConfigurationPacket.EJECT_COLOR)
{
@ -144,21 +135,20 @@ public class PacketConfigurationUpdate implements IMekanismPacket
for(EntityPlayer p : ((TileEntityBasicBlock)config).playersUsing)
{
PacketHandler.sendPacket(Transmission.SINGLE_CLIENT, new PacketTileEntity().setParams(object3D, ((ITileNetwork)tile).getNetworkedData(new ArrayList())), p);
Mekanism.packetPipeline.sendTo(new PacketTileEntity(coord4D, ((ITileNetwork) tile).getNetworkedData(new ArrayList())), p);
}
}
}
@Override
public void write(DataOutputStream dataStream) throws Exception
{
dataStream.writeInt(packetType.ordinal());
dataStream.writeInt(object3D.xCoord);
dataStream.writeInt(object3D.yCoord);
dataStream.writeInt(object3D.zCoord);
dataStream.writeInt(coord4D.xCoord);
dataStream.writeInt(coord4D.yCoord);
dataStream.writeInt(coord4D.zCoord);
dataStream.writeInt(object3D.dimensionId);
dataStream.writeInt(coord4D.dimensionId);
if(packetType != ConfigurationPacket.EJECT && packetType != ConfigurationPacket.STRICT_INPUT)
{
@ -176,6 +166,29 @@ public class PacketConfigurationUpdate implements IMekanismPacket
}
}
@Override
public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer)
{
}
@Override
public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer)
{
}
@Override
public void handleClientSide(EntityPlayer player)
{
}
@Override
public void handleServerSide(EntityPlayer player)
{
}
public static enum ConfigurationPacket
{
EJECT, SIDE_DATA, EJECT_COLOR, INPUT_COLOR, STRICT_INPUT

View file

@ -8,26 +8,18 @@ import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import com.google.common.io.ByteArrayDataInput;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
public class PacketConfiguratorState implements IMekanismPacket
public class PacketConfiguratorState extends MekanismPacket
{
public byte state;
@Override
public String getName()
public PacketConfiguratorState(byte s)
{
return "ConfiguratorState";
state = s;
}
@Override
public IMekanismPacket setParams(Object... data)
{
state = (Byte)data[0];
return this;
}
@Override
public void read(ByteArrayDataInput dataStream, EntityPlayer player, World world) throws Exception
{
byte state = dataStream.readByte();
@ -40,9 +32,32 @@ public class PacketConfiguratorState implements IMekanismPacket
}
}
@Override
public void write(DataOutputStream dataStream) throws Exception
{
dataStream.writeByte(state);
}
@Override
public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer)
{
}
@Override
public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer)
{
}
@Override
public void handleClientSide(EntityPlayer player)
{
}
@Override
public void handleServerSide(EntityPlayer player)
{
}
}

View file

@ -7,36 +7,27 @@ import mekanism.api.Coord4D;
import mekanism.api.transmitters.DynamicNetwork;
import mekanism.api.transmitters.IGridTransmitter;
import mekanism.common.ITileNetwork;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.Mekanism;
import mekanism.common.tile.TileEntityDynamicTank;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import com.google.common.io.ByteArrayDataInput;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import cpw.mods.fml.common.FMLCommonHandler;
public class PacketDataRequest implements IMekanismPacket
public class PacketDataRequest extends MekanismPacket
{
public Coord4D object3D;
public Coord4D coord4D;
@Override
public String getName()
public PacketDataRequest(Coord4D coord)
{
return "DataRequest";
coord4D = coord;
}
@Override
public IMekanismPacket setParams(Object... data)
{
object3D = (Coord4D)data[0];
return this;
}
@Override
public void read(ByteArrayDataInput dataStream, EntityPlayer player, World world) throws Exception
{
int x = dataStream.readInt();
@ -66,17 +57,40 @@ public class PacketDataRequest implements IMekanismPacket
}
}
PacketHandler.sendPacket(Transmission.ALL_CLIENTS, new PacketTileEntity().setParams(Coord4D.get(worldServer.getTileEntity(x, y, z)), ((ITileNetwork)worldServer.getTileEntity(x, y, z)).getNetworkedData(new ArrayList())));
Mekanism.packetPipeline.sendToAll(new PacketTileEntity(Coord4D.get(worldServer.getTileEntity(x, y, z)), ((ITileNetwork) worldServer.getTileEntity(x, y, z)).getNetworkedData(new ArrayList())));
}
}
@Override
public void write(DataOutputStream dataStream) throws Exception
{
dataStream.writeInt(object3D.xCoord);
dataStream.writeInt(object3D.yCoord);
dataStream.writeInt(object3D.zCoord);
dataStream.writeInt(coord4D.xCoord);
dataStream.writeInt(coord4D.yCoord);
dataStream.writeInt(coord4D.zCoord);
dataStream.writeInt(coord4D.dimensionId);
}
@Override
public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer)
{
}
@Override
public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer)
{
}
@Override
public void handleClientSide(EntityPlayer player)
{
}
@Override
public void handleServerSide(EntityPlayer player)
{
dataStream.writeInt(object3D.dimensionId);
}
}

View file

@ -8,28 +8,20 @@ import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import com.google.common.io.ByteArrayDataInput;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
public class PacketDigitUpdate implements IMekanismPacket
public class PacketDigitUpdate extends MekanismPacket
{
public int index;
public int digit;
@Override
public String getName()
public PacketDigitUpdate(int ind, int dig)
{
return "DigitUpdate";
index = ind;
digit = dig;
}
@Override
public IMekanismPacket setParams(Object... data)
{
index = (Integer)data[0];
digit = (Integer)data[1];
return this;
}
@Override
public void read(ByteArrayDataInput dataStream, EntityPlayer player, World world) throws Exception
{
int index = dataStream.readInt();
@ -44,10 +36,33 @@ public class PacketDigitUpdate implements IMekanismPacket
}
}
@Override
public void write(DataOutputStream dataStream) throws Exception
{
dataStream.writeInt(index);
dataStream.writeInt(digit);
}
@Override
public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer)
{
}
@Override
public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer)
{
}
@Override
public void handleClientSide(EntityPlayer player)
{
}
@Override
public void handleServerSide(EntityPlayer player)
{
}
}

Some files were not shown because too many files have changed in this diff Show more