summaryrefslogtreecommitdiff
path: root/ihl/tunneling_shield/DriverEntity.java
diff options
context:
space:
mode:
authorFoghrye4 <foghrye4@gmail.com>2016-04-11 19:44:54 +0300
committerFoghrye4 <foghrye4@gmail.com>2016-04-11 19:44:54 +0300
commit05c78126859231a68e199dc34613689bd0978e2f (patch)
tree050bea104a18c72905095d29f31bec2935a27a24 /ihl/tunneling_shield/DriverEntity.java
Initial commit
Diffstat (limited to 'ihl/tunneling_shield/DriverEntity.java')
-rw-r--r--ihl/tunneling_shield/DriverEntity.java69
1 files changed, 69 insertions, 0 deletions
diff --git a/ihl/tunneling_shield/DriverEntity.java b/ihl/tunneling_shield/DriverEntity.java
new file mode 100644
index 0000000..e7e1c90
--- /dev/null
+++ b/ihl/tunneling_shield/DriverEntity.java
@@ -0,0 +1,69 @@
+package ihl.tunneling_shield;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.world.World;
+
+public class DriverEntity extends Entity {
+
+ public DriverTileEntity parent;
+
+ public DriverEntity(World arg0)
+ {
+ super(arg0);
+ this.ignoreFrustumCheck = true;
+ this.motionX = 0.0D;
+ this.motionY = 0.0D;
+ this.motionZ = 0.0D;
+ this.noClip=true;
+ }
+
+ public DriverEntity(World arg0, DriverTileEntity te, int x, int y, int z)
+ {
+ super(arg0);
+ this.parent=te;
+ this.motionX = 0.0D;
+ this.motionY = 0.0D;
+ this.motionZ = 0.0D;
+ this.lastTickPosX = this.prevPosX = this.posX = x;
+ this.lastTickPosY = this.prevPosY = this.posY = y;
+ this.lastTickPosZ = this.prevPosZ = this.posZ = z;
+ this.ignoreFrustumCheck = true;
+ }
+
+ @Override
+ public boolean isInRangeToRenderDist(double par1)
+ {
+ return true;
+ }
+
+
+ @Override
+ public void onUpdate()
+ {
+ super.onUpdate();
+
+ if(this.parent!=null)
+ {
+ this.motionX = 0.0D;
+ this.motionY = 0.0D;
+ this.motionZ = 0.0D;
+ this.lastTickPosX = this.prevPosX = this.posX =this.parent.xCoord+this.parent.getModelShiftAmount()*this.parent.mX();
+ this.lastTickPosY = this.prevPosY = this.posY =(this.parent.yCoord);
+ this.lastTickPosZ = this.prevPosZ = this.posZ =this.parent.zCoord+this.parent.getModelShiftAmount()*this.parent.mZ();
+ }
+ else
+ {
+ this.setDead();
+ }
+ }
+
+ @Override
+ protected void entityInit() {}
+
+ @Override
+ protected void readEntityFromNBT(NBTTagCompound nbt) {}
+
+ @Override
+ protected void writeEntityToNBT(NBTTagCompound nbt) {}
+}