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

Your uploaded class file worked perfectly! Thanks for the fix!

For other users, THIS DOES NOT BREAK NEI. You WILL still be able to grab items!

Again to OP, great job and thanks!

  • 0
Posted

This fix broke the ability to place engines. Anytime someone on my server places an engine now it turns into a redstone engine and kicks the player

Seems to work for me.. With this exact fix.

  • 0
Posted

Erhm. I am very confused here.

In my entire server folder, I have no file named "ItemBlock.class" - I don't have folders named "net", "minecraft" or "server" either.

My root folder has (in addition to my world folders):

/buildcraft

/config

/jar

/mods

/plugins

/redpower

To make sure that I didn't screw up while uploading stuff I checked the original Tekkit server pack I downloaded and added to initially - those folders or that file aren't there either. Halp. =(

  • 0
Posted

Erhm. I am very confused here.

In my entire server folder, I have no file named "ItemBlock.class" - I don't have folders named "net", "minecraft" or "server" either.

My root folder has (in addition to my world folders):

/buildcraft

/config

/jar

/mods

/plugins

/redpower

To make sure that I didn't screw up while uploading stuff I checked the original Tekkit server pack I downloaded and added to initially - those folders or that file aren't there either. Halp. =(

ItemBlock.class is within the minecraft.jar. Open it with a program like 7zip.

  • 0
Posted

since i am using a host i don't have access to my minecraft.jar file is there any other way, can i just delete nei will the solve the problem

Use Filezilla and download the .jar, edit it and upload it

  • 0
Posted

The first post fixed it!

I was able to set Residence to work with Legacy Permissions (using the Permissions bridge in PEX) instead of Vault, and using the ItemBlock.class from the first post.

Now I have area protection like it should!

  • 0
Posted

I did all of this, but people can still place in protected areas with worldguard. It says area restricted, or whatever the default Worldguard message is. It gives them back their block but it still has the block they placed? I did the region flag build and all that stuff but no luck. Anyone know how to fix this?

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