Jump to content
  • 0

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


xyberviri

Question

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

Link to comment
Share on other sites

Recommended Posts

  • 0

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 !!!

Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

  • 0
Guest Ysharma

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.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...