From 06000aff4cb3c331c00ab838c426f9fc5d150378 Mon Sep 17 00:00:00 2001 From: Aidan Brady Date: Sat, 3 Aug 2013 03:10:59 -0400 Subject: [PATCH] Screw it, doesn't work :< --- src/resonantinduction/ResonantInduction.java | 4 - .../contractor/EntityContractorItem.java | 62 --------- .../contractor/TileEntityEMContractor.java | 118 +++++++----------- 3 files changed, 46 insertions(+), 138 deletions(-) delete mode 100644 src/resonantinduction/contractor/EntityContractorItem.java diff --git a/src/resonantinduction/ResonantInduction.java b/src/resonantinduction/ResonantInduction.java index d5c87d135..fe79fb195 100644 --- a/src/resonantinduction/ResonantInduction.java +++ b/src/resonantinduction/ResonantInduction.java @@ -10,7 +10,6 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.common.Configuration; import net.minecraftforge.oredict.ShapedOreRecipe; import resonantinduction.contractor.BlockEMContractor; -import resonantinduction.contractor.EntityContractorItem; import resonantinduction.contractor.TileEntityEMContractor; import resonantinduction.entangler.ItemQuantumEntangler; import resonantinduction.tesla.BlockTesla; @@ -26,7 +25,6 @@ import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; -import cpw.mods.fml.common.registry.EntityRegistry; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @@ -134,8 +132,6 @@ public class ResonantInduction // Tiles GameRegistry.registerTileEntity(TileEntityTesla.class, blockTesla.getUnlocalizedName()); GameRegistry.registerTileEntity(TileEntityEMContractor.class, blockEMContractor.getUnlocalizedName()); - - EntityRegistry.registerModEntity(EntityContractorItem.class, "EntityContractorItem", 0, this, 40, 5, true); ResonantInduction.proxy.registerRenderers(); diff --git a/src/resonantinduction/contractor/EntityContractorItem.java b/src/resonantinduction/contractor/EntityContractorItem.java deleted file mode 100644 index 842970f89..000000000 --- a/src/resonantinduction/contractor/EntityContractorItem.java +++ /dev/null @@ -1,62 +0,0 @@ -package resonantinduction.contractor; - -import java.lang.reflect.Method; -import java.util.Iterator; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.item.ItemExpireEvent; - -/** - * Spinoff of EntityItem for Contractors. - * @author AidanBrady - * - */ -public class EntityContractorItem extends EntityItem -{ - public boolean doGravityThisTick = true; - - public EntityContractorItem(World par1World) - { - super(par1World); - } - - @Override - public void onUpdate() - { - super.onUpdate(); - - System.out.println(worldObj.isRemote + " " + motionX + " " + motionY + " " + motionZ); - - if(!doGravityThisTick) - { - motionY = 0; - } - } - - public static EntityContractorItem get(EntityItem entityItem) - { - EntityContractorItem item = new EntityContractorItem(entityItem.worldObj); - - item.posX = entityItem.posX; - item.posY = entityItem.posY; - item.posZ = entityItem.posZ; - - item.setEntityItemStack(entityItem.getEntityItem()); - - item.motionX = entityItem.motionX; - item.motionY = entityItem.motionY; - item.motionZ = entityItem.motionZ; - - item.dataWatcher = entityItem.getDataWatcher(); - - item.delayBeforeCanPickup = entityItem.delayBeforeCanPickup; - - return item; - } -} diff --git a/src/resonantinduction/contractor/TileEntityEMContractor.java b/src/resonantinduction/contractor/TileEntityEMContractor.java index 149402338..b6ed0c26a 100644 --- a/src/resonantinduction/contractor/TileEntityEMContractor.java +++ b/src/resonantinduction/contractor/TileEntityEMContractor.java @@ -38,94 +38,68 @@ public class TileEntityEMContractor extends TileEntity { EntityItem entityItem = (EntityItem)entity; - if(!(entityItem instanceof EntityContractorItem)) + switch(facing) { - entityItem.setDead(); - - if(worldObj.isRemote) - { - continue; - } - - EntityContractorItem newItem = EntityContractorItem.get(entityItem); - worldObj.spawnEntityInWorld(newItem); - - entityItem = newItem; - } - - if(entityItem instanceof EntityContractorItem) - { - switch(facing) - { - case DOWN: - entityItem.setPosition(xCoord+0.5, entityItem.posY, zCoord+0.5); + case DOWN: + entityItem.setPosition(xCoord+0.5, entityItem.posY, zCoord+0.5); - entityItem.motionX = 0; - entityItem.motionZ = 0; + entityItem.motionX = 0; + entityItem.motionZ = 0; - entityItem.motionY = Math.max(-MAX_SPEED, entityItem.motionY-ACCELERATION); + entityItem.motionY = Math.max(-MAX_SPEED, entityItem.motionY-ACCELERATION); - entityItem.isAirBorne = true; - break; - case UP: - entityItem.setPosition(xCoord+0.5, entityItem.posY, zCoord+0.5); + entityItem.isAirBorne = true; + break; + case UP: + entityItem.setPosition(xCoord+0.5, entityItem.posY, zCoord+0.5); - entityItem.motionX = 0; - entityItem.motionZ = 0; + entityItem.motionX = 0; + entityItem.motionZ = 0; - entityItem.motionY = Math.min(MAX_SPEED, entityItem.motionY+ACCELERATION); + entityItem.motionY = Math.min(MAX_SPEED, entityItem.motionY+ACCELERATION); - entityItem.isAirBorne = true; - break; - case NORTH: - ((EntityContractorItem)entityItem).doGravityThisTick = false; + entityItem.isAirBorne = true; + break; + case NORTH: + entityItem.setPosition(entityItem.posX, yCoord+0.5, zCoord+0.5); - entityItem.setPosition(entityItem.posX, yCoord+0.5, zCoord+0.5); + entityItem.motionY = 0; + entityItem.motionZ = 0; - entityItem.motionY = 0; - entityItem.motionZ = 0; - - entityItem.motionX = Math.min(MAX_SPEED, entityItem.motionZ+ACCELERATION); + entityItem.motionX = Math.min(MAX_SPEED, entityItem.motionZ+ACCELERATION); - entityItem.isAirBorne = true; - break; - case SOUTH: - ((EntityContractorItem)entityItem).doGravityThisTick = false; + entityItem.isAirBorne = true; + break; + case SOUTH: + entityItem.setPosition(entityItem.posX, yCoord+0.5, zCoord+0.5); - entityItem.setPosition(entityItem.posX, yCoord+0.5, zCoord+0.5); + entityItem.motionY = 0; + entityItem.motionZ = 0; + + entityItem.motionX = Math.max(-MAX_SPEED, entityItem.motionZ-ACCELERATION); + + entityItem.isAirBorne = true; + break; + case WEST: + entityItem.setPosition(xCoord+0.5, yCoord+0.5, entityItem.posZ); - entityItem.motionY = 0; - entityItem.motionZ = 0; + entityItem.motionX = 0; + entityItem.motionY = 0; - entityItem.motionX = Math.max(-MAX_SPEED, entityItem.motionZ-ACCELERATION); + entityItem.motionZ = Math.min(MAX_SPEED, entityItem.motionX+ACCELERATION); - entityItem.isAirBorne = true; - break; - case WEST: - ((EntityContractorItem)entityItem).doGravityThisTick = false; - - entityItem.setPosition(xCoord+0.5, yCoord+0.5, entityItem.posZ); - - entityItem.motionX = 0; - entityItem.motionY = 0; + entityItem.isAirBorne = true; + break; + case EAST: + entityItem.setPosition(xCoord+0.5, yCoord+0.5, entityItem.posZ); + + entityItem.motionX = 0; + entityItem.motionY = 0; - entityItem.motionZ = Math.min(MAX_SPEED, entityItem.motionX+ACCELERATION); + entityItem.motionZ = Math.max(-MAX_SPEED, entityItem.motionX-ACCELERATION); - entityItem.isAirBorne = true; - break; - case EAST: - ((EntityContractorItem)entityItem).doGravityThisTick = false; - - entityItem.setPosition(xCoord+0.5, yCoord+0.5, entityItem.posZ); - - entityItem.motionX = 0; - entityItem.motionY = 0; - - entityItem.motionZ = Math.max(-MAX_SPEED, entityItem.motionX-ACCELERATION); - - entityItem.isAirBorne = true; - break; - } + entityItem.isAirBorne = true; + break; } } }