Started work on the farm, some changes to the idsu, its still broken

This commit is contained in:
modmuss50 2015-07-13 13:54:44 +01:00
parent be33bdc148
commit c160abf176
26 changed files with 626 additions and 194 deletions

View file

@ -0,0 +1,36 @@
package techreborn.blocks;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import techreborn.Core;
import techreborn.client.GuiHandler;
import techreborn.client.TechRebornCreativeTab;
import techreborn.tiles.TileFarm;
public class BlockFarm extends BlockMachineBase {
public BlockFarm() {
super(Material.iron);
setCreativeTab(TechRebornCreativeTab.instance);
setBlockName("techreborn.farm");
setHardness(2F);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileFarm();
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(!player.isSneaking()){
player.openGui(Core.INSTANCE, GuiHandler.farmID, world, x, y, z);
return true;
}
return false;
}
}

View file

@ -7,6 +7,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
@ -66,7 +67,7 @@ public class BlockIDSU extends BlockMachineBase {
EntityPlayer player, int side, float hitX, float hitY, float hitZ)
{
if(FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
PacketHandler.sendPacketToPlayer(IDSUManager.INSTANCE.getPacket(world, player), player);
Core.packetPipeline.sendTo(IDSUManager.INSTANCE.getPacket(world), (EntityPlayerMP) player);
}
if (!player.isSneaking())
player.openGui(Core.INSTANCE, GuiHandler.idsuID, world, x, y,