Posted July 27, 201510 yr Hello everybody. This is really strange bug i have discovered: Whenever i destroy my tileentity, it's destrcution should be logged, but it is not. After further testing, i came with fact that shouldRefresh is called on client only. Using following code: @Override public boolean shouldRefresh(Block oldBlock, Block newBlock, int oldMeta, int newMeta, World world, int x, int y, int z) { boolean b = super.shouldRefresh(oldBlock, newBlock, oldMeta, newMeta, world, x, y, z); if(b){ System.out.print("Invalidating on " + (worldObj.isRemote ? "CLIENT" : "SERVER")); TeleplatesManager.invalidate(teleplate); } return b; } I got only this in console ("Invalidating 0" is from TeleplatesManager.invalidate method): Invalidating on CLIENT[12:48:05] [Client thread/INFO] [Teleplates Manager]: Invalidating 0 And this gives me problems, because i want to invalidate tileentity from my mapping whenever it gets destroyed. Does anybody know why this happens? Thanks for help! If you have any questions - just ask! EDIT: Note: my te extends TileEntity, so b is true on server too in this case. Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
July 27, 201510 yr how are you destroying your TE? Maybe you can call a method on your te on server side just before destroying it?
July 27, 201510 yr Author how are you destroying your TE? Maybe you can call a method on your te on server side just before destroying it? In creative. Using left click. And this method description specifies that it's called whenever tes block is being replaced. And destroying is basically replacing with air. Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
July 27, 201510 yr Author This is not what shouldRefresh is for. Use breakBlock in your Block class. Thanks! It works... I knew that i could use breakBlock anyways, but i just was not sure why this is called only on client... This little thing confused me: determines if this tile entity should be re-created when the ID, or Metadata changes. ... Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
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.