mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-21 20:42:17 +00:00
More bits of work
This commit is contained in:
1 parent
bd7b8f75e0
commit
fa0c2e6f12
13 files changed
+59
-38
No files matched your search
@@ -480,8 +480,6 @@ public class ClientProxy extends CommonProxy
|
||||
{
|
||||
super.loadUtilities();
|
||||
|
||||
TickRegistry.registerTickHandler(new RenderTickHandler(), Side.CLIENT);
|
||||
|
||||
NetworkRegistry.registerConnectionHandler(new ClientConnectionHandler());
|
||||
|
||||
KeyBindingRegistry.registerKeyBinding(new MekanismKeyHandler());
|
||||
|
||||
@@ -3,7 +3,7 @@ package mekanism.client.gui;
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.client.render.MekanismRenderer;
|
||||
import mekanism.common.PacketHandler;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.inventory.container.ContainerFilter;
|
||||
import mekanism.common.network.PacketEditFilter;
|
||||
import mekanism.common.network.PacketLogisticalSorterGui;
|
||||
|
||||
@@ -239,11 +239,7 @@ public class CommonProxy
|
||||
/**
|
||||
* Set up and load the utilities this mod uses.
|
||||
*/
|
||||
public void loadUtilities()
|
||||
{
|
||||
TickRegistry.registerTickHandler(new CommonPlayerTickHandler(), Side.SERVER);
|
||||
TickRegistry.registerTickHandler(new CommonWorldTickHandler(), Side.SERVER);
|
||||
}
|
||||
public void loadUtilities() {}
|
||||
|
||||
/**
|
||||
* Set up and load the sound handler.
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package mekanism.common.inventory;
|
||||
|
||||
import mekanism.common.item.ItemBlockBasic;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
@@ -139,7 +141,7 @@ public class InventoryBin
|
||||
return null;
|
||||
}
|
||||
|
||||
return new ItemStack(id, 1, meta);
|
||||
return new ItemStack(Item.getItemById(id), 1, meta);
|
||||
}
|
||||
|
||||
public void setItemType(ItemStack stack)
|
||||
@@ -159,7 +161,7 @@ public class InventoryBin
|
||||
ItemStack ret = stack.copy();
|
||||
ret.stackSize = 1;
|
||||
|
||||
bin.stackTagCompound.setInteger("itemID", stack.itemID);
|
||||
bin.stackTagCompound.setInteger("itemID", MekanismUtils.getID(stack));
|
||||
bin.stackTagCompound.setInteger("itemMeta", stack.getItemDamage());
|
||||
}
|
||||
}
|
||||
@@ -41,9 +41,9 @@ public class ItemBlockBasic extends ItemBlock
|
||||
{
|
||||
public Block metaBlock;
|
||||
|
||||
public ItemBlockBasic(int id, Block block)
|
||||
public ItemBlockBasic(Block block)
|
||||
{
|
||||
super(id);
|
||||
super(block);
|
||||
metaBlock = block;
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import mekanism.common.tile.TileEntityCardboardBox;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -28,9 +29,9 @@ public class ItemBlockCardboardBox extends ItemBlock
|
||||
|
||||
public Block metaBlock;
|
||||
|
||||
public ItemBlockCardboardBox(int id, Block block)
|
||||
public ItemBlockCardboardBox(Block block)
|
||||
{
|
||||
super(id);
|
||||
super(block);
|
||||
setMaxStackSize(1);
|
||||
metaBlock = block;
|
||||
|
||||
@@ -45,7 +46,7 @@ public class ItemBlockCardboardBox extends ItemBlock
|
||||
|
||||
if(getBlockData(itemstack) != null)
|
||||
{
|
||||
list.add("Block ID: " + getBlockData(itemstack).id);
|
||||
list.add("Block: " + new ItemStack(getBlockData(itemstack).block, getBlockData(itemstack).meta).getDisplayName());
|
||||
list.add("Metadata: " + getBlockData(itemstack).meta);
|
||||
|
||||
if(getBlockData(itemstack).tileTag != null)
|
||||
@@ -75,7 +76,7 @@ public class ItemBlockCardboardBox extends ItemBlock
|
||||
Block block = world.getBlock(x, y, z);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if(!world.isRemote && MekanismAPI.isBlockCompatible(id, meta))//TODO
|
||||
if(!world.isRemote && MekanismAPI.isBlockCompatible(Item.getItemFromBlock(block), meta))//TODO
|
||||
{
|
||||
BlockData data = new BlockData();
|
||||
data.block = block;
|
||||
|
||||
@@ -12,7 +12,6 @@ import mekanism.api.energy.IEnergizedItem;
|
||||
import mekanism.common.IEnergyCube;
|
||||
import mekanism.common.ISustainedInventory;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.PacketHandler;
|
||||
import mekanism.common.Tier.EnergyCubeTier;
|
||||
import mekanism.common.integration.IC2ItemManager;
|
||||
import mekanism.common.network.PacketTileEntity;
|
||||
@@ -20,11 +19,13 @@ import mekanism.common.tile.TileEntityEnergyCube;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.Constants.NBT;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
@@ -36,9 +37,9 @@ public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IE
|
||||
{
|
||||
public Block metaBlock;
|
||||
|
||||
public ItemBlockEnergyCube(int id, Block block)
|
||||
public ItemBlockEnergyCube(Block block)
|
||||
{
|
||||
super(id);
|
||||
super(block);
|
||||
metaBlock = block;
|
||||
setMaxStackSize(1);
|
||||
setMaxDamage(100);
|
||||
@@ -175,7 +176,7 @@ public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IE
|
||||
return null;
|
||||
}
|
||||
|
||||
return itemStack.stackTagCompound.getTagList("Items");
|
||||
return itemStack.stackTagCompound.getTagList("Items", NBT.TAG_ANY_NUMERIC);
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -293,4 +294,16 @@ public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IE
|
||||
{
|
||||
return IC2ItemManager.getManager(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -32,9 +32,9 @@ public class ItemBlockGasTank extends ItemBlock implements IGasItem, ISustainedI
|
||||
/** How fast this tank can transfer gas. */
|
||||
public static final int TRANSFER_RATE = 16;
|
||||
|
||||
public ItemBlockGasTank(int id, Block block)
|
||||
public ItemBlockGasTank(Block block)
|
||||
{
|
||||
super(id);
|
||||
super(block);
|
||||
metaBlock = block;
|
||||
setHasSubtypes(true);
|
||||
setMaxStackSize(1);
|
||||
|
||||
@@ -873,4 +873,16 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
{
|
||||
return IC2ItemManager.getManager(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -27,9 +27,9 @@ public class ItemBlockOre extends ItemBlock
|
||||
{
|
||||
public Block metaBlock;
|
||||
|
||||
public ItemBlockOre(int id, Block block)
|
||||
public ItemBlockOre(Block block)
|
||||
{
|
||||
super(id);
|
||||
super(block);
|
||||
metaBlock = block;
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@@ -13,9 +13,9 @@ public class ItemBlockPlastic extends ItemBlock
|
||||
{
|
||||
public Block metaBlock;
|
||||
|
||||
public ItemBlockPlastic(int id, Block block)
|
||||
public ItemBlockPlastic(Block block)
|
||||
{
|
||||
super(id);
|
||||
super(block);
|
||||
metaBlock = block;
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@@ -1197,7 +1197,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
||||
}
|
||||
}
|
||||
|
||||
replaceStack = new ItemStack(num, 1, meta);
|
||||
replaceStack = new ItemStack(Item.getItemById(num), 1, meta);
|
||||
}
|
||||
else if(method == 4)
|
||||
{
|
||||
@@ -1215,7 +1215,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
||||
}
|
||||
}
|
||||
|
||||
filters.add(new MItemStackFilter(new ItemStack(num, 1, meta)));
|
||||
filters.add(new MItemStackFilter(new ItemStack(Item.getItemById(num), 1, meta)));
|
||||
}
|
||||
else if(method == 5)
|
||||
{
|
||||
@@ -1227,7 +1227,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
||||
|
||||
if(filter instanceof MItemStackFilter)
|
||||
{
|
||||
if(((MItemStackFilter)filter).itemType.itemID == num)
|
||||
if(MekanismUtils.getID(((MItemStackFilter)filter).itemType) == num)
|
||||
{
|
||||
iter.remove();
|
||||
}
|
||||
@@ -1346,7 +1346,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
||||
|
||||
if(nbtTags.hasKey("filters"))
|
||||
{
|
||||
NBTTagList tagList = nbtTags.getTagList("filters");
|
||||
NBTTagList tagList = nbtTags.getTagList("filters", NBT.TAG_ANY_NUMERIC);
|
||||
|
||||
for(int i = 0; i < tagList.tagCount(); i++)
|
||||
{
|
||||
|
||||
@@ -6,10 +6,9 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.PacketHandler;
|
||||
import mekanism.common.Teleporter;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.network.PacketPortalFX;
|
||||
@@ -20,8 +19,8 @@ import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.packet.Packet41EntityEffect;
|
||||
import net.minecraft.network.packet.Packet9Respawn;
|
||||
import net.minecraft.network.play.server.S07PacketRespawn;
|
||||
import net.minecraft.network.play.server.S1DPacketEntityEffect;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
@@ -34,8 +33,8 @@ import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import dan200.computercraft.api.peripheral.IComputerAccess;
|
||||
import dan200.computercraft.api.lua.ILuaContext;
|
||||
import dan200.computercraft.api.peripheral.IComputerAccess;
|
||||
import dan200.computercraft.api.peripheral.IPeripheral;
|
||||
|
||||
public class TileEntityTeleporter extends TileEntityElectricBlock implements IPeripheral
|
||||
@@ -298,7 +297,7 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements IPe
|
||||
WorldServer oldWorld = server.worldServerForDimension(player.dimension);
|
||||
player.dimension = coord.dimensionId;
|
||||
WorldServer newWorld = server.worldServerForDimension(player.dimension);
|
||||
player.playerNetServerHandler.sendPacketToPlayer(new Packet9Respawn(player.dimension, (byte)player.worldObj.difficultySetting, newWorld.getWorldInfo().getTerrainType(), newWorld.getHeight(), player.theItemInWorldManager.getGameType()));
|
||||
player.playerNetServerHandler.sendPacket(new S07PacketRespawn(player.dimension, player.worldObj.difficultySetting, newWorld.getWorldInfo().getTerrainType(), player.theItemInWorldManager.getGameType()));
|
||||
oldWorld.removePlayerEntityDangerously(player);
|
||||
player.isDead = false;
|
||||
|
||||
@@ -320,10 +319,10 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements IPe
|
||||
while(iterator.hasNext())
|
||||
{
|
||||
PotionEffect potioneffect = (PotionEffect)iterator.next();
|
||||
player.playerNetServerHandler.sendPacketToPlayer(new Packet41EntityEffect(player.getEntityId(), potioneffect));
|
||||
player.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(player.getEntityId(), potioneffect));
|
||||
}
|
||||
|
||||
GameRegistry.onPlayerChangedDimension(player);
|
||||
FMLCommonHandler.instance().firePlayerChangedDimensionEvent(player, id, coord.dimensionId);
|
||||
}
|
||||
else {
|
||||
player.playerNetServerHandler.setPlayerLocation(coord.xCoord+0.5, coord.yCoord+1, coord.zCoord+0.5, player.rotationYaw, player.rotationPitch);
|
||||
|
||||
Reference in new issue
Block a user