Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package portuar.cubicBeyond.client.blocks.decondenseur;
- import net.minecraft.entity.monster.EntityCaveSpider;
- import net.minecraft.entity.monster.EntityCreeper;
- import net.minecraft.entity.monster.EntityEnderman;
- import net.minecraft.entity.passive.EntityBat;
- import net.minecraft.entity.passive.EntityChicken;
- import net.minecraft.entity.passive.EntityCow;
- import net.minecraft.entity.passive.EntityMooshroom;
- import net.minecraft.entity.passive.EntityPig;
- import net.minecraft.entity.passive.EntitySheep;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.network.NetworkManager;
- import net.minecraft.network.Packet;
- import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
- import net.minecraft.tileentity.TileEntity;
- public class TileEntityDecondenseur extends TileEntity
- {
- public float motorAngle, prevMotorAngle;
- public boolean isUse;
- public int itemId, coolDown;
- public void readFromNBT(NBTTagCompound nbtTag)
- {
- super.readFromNBT(nbtTag);
- isUse = nbtTag.getBoolean("isUse");
- itemId = nbtTag.getInteger("itemId");
- coolDown = nbtTag.getInteger("coolDown");
- }
- public void writeToNBT(NBTTagCompound nbtTag)
- {
- super.writeToNBT(nbtTag);
- nbtTag.setBoolean("isUse", isUse);
- nbtTag.setInteger("itemId", itemId);
- nbtTag.setInteger("coolDown", coolDown);
- }
- public void updateEntity()
- {
- System.out.println(this.isUse);
- if(this.isUse == true)
- {
- this.prevMotorAngle = this.motorAngle;
- this.motorAngle += 0.05F;
- this.coolDown--;
- if(this.coolDown < 0)
- {
- if(this.itemId == 1)
- {
- EntityPig entity = new EntityPig(this.worldObj);
- entity.setLocationAndAngles(this.xCoord, this.yCoord + 1, this.zCoord, 0.0F, 0.0F);
- this.worldObj.spawnEntityInWorld(entity);
- this.itemId = 0;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement