jackmano Posted November 3, 2015 Share Posted November 3, 2015 K, so i have a tile that I want to have different effects, but it wont change the variable that selects which effect! I'm using TileHydroTorch htorch = (TileHydroTorch)icommandsender.getEntityWorld().getTileEntity(x,y,z); if(Integer.parseInt(commands[3]) > 2 || Integer.parseInt(commands[3]) < 0 || Integer.parseInt(commands[3]) != (int)Integer.parseInt(commands[3])) htorch.state = (Integer.parseInt(commands[3])); to grab the tile from the world and set the variable, but it does nothing. I tried some System.out.println("did such and such"); 's and they say that htorch.state was called. But whenever I check the tile, it isnt changed! HELP! tile code package com.rabidfox.syntheticgems; import java.util.Random; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; public class TileHydroTorch extends TileEntity { public int state; public int ticksleft; Random rdm = new Random(); public int getFacing() { return 0; } public TileHydroTorch(){ ticksleft = 10; state = 0; } @Override public void writeToNBT(NBTTagCompound nbt){ super.writeToNBT(nbt); nbt.setInteger("state", state); } @Override public void readFromNBT(NBTTagCompound nbt){ super.readFromNBT(nbt); state = nbt.getInteger("state"); } @Override public void updateEntity(){ ticksleft--; if(state > 2 || state < 0 || state != (int)state){ System.err.println("The Hydrogen Torch at " + this.xCoord + this.yCoord + this.zCoord +" has an invalid state value of " + state + "! Must be 0(off), 1(spraying hydrogen), 2(spraying fire)! Use the setHydroTorchState command to fix it!"); } if(state == 2){ worldObj.spawnParticle("flame", xCoord +(rdm.nextFloat()/5) + (0.25F * 1.5), yCoord +0.5F, zCoord +(rdm.nextFloat()/5) + (0.25F * 1.5), 0.0D, -0.5D, 0.0D); } if(state == 1){ if(ticksleft == 0){ worldObj.spawnParticle("cloud", xCoord +(rdm.nextFloat()/2) + (0.25F * 1.5), yCoord +0.5F, zCoord +(rdm.nextFloat()/2) + (0.25F * 1.5), 0.0D, 0.03D, 0.0D); ticksleft = 10; } } } } Quote http://imageshack.com/a/img907/9908/313wU8.png[/img] Link to comment Share on other sites More sharing options...
jackmano Posted November 3, 2015 Author Share Posted November 3, 2015 Oh, thank you! Divines bless your kind heart! *Gift of Charity added Quote http://imageshack.com/a/img907/9908/313wU8.png[/img] Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.