Jump to content

ozBillo

Members
  • Posts

    7
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

ozBillo's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Hi Reika, Did you manage to sort out this problem? I'm having similar troubles. It's driving me a little batty!
  2. Awesome! I'm glad, and kinda surprised, that I could help
  3. At the start of my onBlockPlacedBy I had if (!world.isRemote){ onBlockPlacedBy When I removed that it worked. But, I'll probably sort out the packet handling stuff, anyway.
  4. Well, my guess is it's something to do with packets. None of my tileentity variables are being retained. I'm adding packet handling code now. I'll report back with how I go.
  5. Hi KeeganDeathman, Do you solve your problem? I'm having similar difficulties.
  6. If the gate is closed and the player is holding a valid key, the gate opens. If the gate is open and the player is not holding a valid key, the gate closes. I use the playAuxSFXAtEntity method to play the appropriate sound on gate open and close. But, I'm not getting any sound from the gate. Other gates sound okay. Here is the relevant code. Have I missed something? public class MyGate extends BlockFenceGate { ... @Override public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { if(!par1World.isRemote) { if (par5Entity instanceof EntityLivingBase) { EntityLivingBase entityLiving = (EntityLivingBase) par5Entity; if (entityLiving instanceof EntityPlayer) { EntityPlayer entityPlayer = (EntityPlayer) entityLiving; ... int i1 = par1World.getBlockMetadata(par2, par3, par4); boolean MyGateOpen = isFenceGateOpen(i1); if (!MyGateOpen && holdingValidKey) { MyGateOpen = true; par1World.setBlockMetadataWithNotify(par2, par3, par4, i1 | 4, 2); // open the gate par1World.playAuxSFXAtEntity(entityPlayer, 1003, par2, par3, par4, 0); } else if (MyGateOpen && !holdingValidKey) { MyGateOpen = false; par1World.setBlockMetadataWithNotify(par2, par3, par4, i1 & -5, 2); // close the gate par1World.playAuxSFXAtEntity(entityPlayer, 1003, par2, par3, par4, 0); }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.