Jump to content
  • 0

FIX:Plugins that use "BlockPlaceEvent", AMChat, Precious Stones


Question

Posted

Hello,

I'm the author of AMChat, i noticed that tekkit was breaking my AMChat Radio tower plugin, namely it was not letting me create radio towers by placing blocks, after further investigation it appears that tekkit has a modifyed version of net\minecraft\server\ItemBlock.class which specifically was missing the call to create the block place event.

I belive this is part of NEI but haven't had time to download all of the bukkit ports and check them for the offending file, also when i replaced it with the version in craft bukkit it started throwing exception errors about the spawners and some nei code.

I made the following changes and it appears to have resolved the issue on my server.

Line 21 ADDED:


			 int clickedX = i; int clickedY = j; int clickedZ = k;





Line 67 & 68 CHANGED:


/* 67 */    Block block = Block.byId[this.id];



			 	CraftBlockState replacedBlockState = CraftBlockState.getBlockState(world, i, j, k);

			 	

			 	world.suppressPhysics = true;

			 	world.setTypeIdAndData(i, j, k, id, filterData(itemstack.getData()));

			 	BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, replacedBlockState, clickedX, clickedY, clickedZ, block);

			 	id = world.getTypeId(i, j, k);

			 	int data = world.getData(i, j, k);

			 	replacedBlockState.update(true);

			 	world.suppressPhysics = false;



			 	

			if ((event.isCancelled()) || (!event.canBuild())) {return true;}

/* 68 */    if (world.setTypeIdAndData(i, j, k, this.id, data))

DISCLAIMER: By downloading the following you Release Xyberviri from any and all responsibility and fully accept any dangers that come with use of modified server code in any environment (Production or Otherwise).

http://www.mediafire.com/?92urahlbrdazq0c

TLDR;

net\minecraft\server\ItemBlock.class needs to be replaced with the above file

Recommended Posts

  • 0
Posted

I did this fix, but people can still place in the Spawn or other protected regions, I have tested this multiple times. I need some help, please message back asap!

  • 0
Posted

Me too , i have this problem when someone places a dirt,netherrack,cobblestone or other block(After a while) it gives the client internal server error , and my Quarry&Deployer doesn't work i have world guard !!!

  • 0
Posted

DISCLAIMER: By downloading the following you Release Xyberviri from any and all responsibility and fully accept any dangers that come with use of modified server code in any environment (Production or Otherwise).

http://www.mediafire.com/?92urahlbrdazq0c

TLDR;

net\minecraft\server\ItemBlock.class needs to be replaced with the above file

I tried the ported version of Bukkit available by the OP twice, it didnt work.

However his fixed class file did!! Soo happy, thanks Xyberviri.

  • 0
Guest Ysharma
Posted

Does this work with Tekkit 3? Or is the block place event bug fixed? Could somebody please respond, because I am trying to set up factions to correctly work on my server.

  • 0
Guest Ysharma
Posted

That means that world protection and rollback plugins should work properly right?

  • 0
Guest Ysharma
Posted

factions protect should work properly though since its a bukkit plugin?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...