This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
0pteron's profile picture

TurtlePlayer (Turtle's FakePlayer) Broken in FTB

Started by 0pteron, 11 April 2013 - 01:39 PM
0pteron #1
Posted 11 April 2013 - 03:39 PM
I am using Feed The Beast Mindcrack v8.2.0 with MCPC+ build L8.

I see MCPC tries to identify turtles with their bukkit.yml :


fake-players:
com/eloraam/redpower/machine/EntityPlayerFake:
username: '[RedPower]'
do-login: true
dan200/turtle/shared/TurtlePlayer:
username: '[ComputerCraft]'
do-login: true

But I believe it not to be working at all. I think the issue lies within Tekkit's CC (modified CC 1.31 I believe) being made for version 1.2.5 and FTB's CC being made for version 1.4.7 that there was a change in how fakeplayer was handled. None of the griefing tools from bukkit (via MCPC) identify the fakeplayer and allow a turtle to bypass all grief protection. Using the same tool on tekkit works fine. (Griefprotection and Factions were used for testing).

This problem could be with MCPC not correctly identiting the turtles fake player, or computercraft changing up how fake players are produced.

I also noticed that in the TurtlePlayer file the name seems to be "ComputerCraft" over tekkit's FakePlayer file it's used as "[ComputerCraft]" - also there are no perturtle options in the FTB config.


——————

It seems in the code for tekkit the blocking of blocks is done as such:

A BlockBreakEvent is triggered and if it is cancelled, it will return false and never issue this.world.setTypeId(j, k, l, 0)


Compared to FTB (CC 1.5)

It checks canBreakBlock() which does not check any events within forge, but then it checks forge's canHarvestBlock via ForgeHooks.canHarvestBlock(block, turtPlayer, meta);

If canHarvestBlock returns false, the turle will not setup to pickup the blocks but it will continue with worldObj.e(newX, newY, newZ, 0);
effectively deleting the block anyways. Either Forge needs a way to detect if a block can be broken along side if a can be harvested or CC needs to not attempt to delete the block if canHarvestBlock returns false.


I believe the block break event is called within the tekkit version compared to the FTB version it only detects if it can be harvested. I cant find where the actual block is being removed but, my guess is that it's not removing the block as if it was a player and as such the grief plugins are not catching it.
immibis #2
Posted 11 April 2013 - 05:17 PM
Mods do not fire BlockBreakEvents automatically. Tekkit used a version specially modified for Bukkit compatibility.
Cloudy #3
Posted 11 April 2013 - 08:03 PM
Uh… bukkit is not supported. You're on your own.
Cranium #4
Posted 12 April 2013 - 03:32 AM
Uh… bukkit is not supported. You're on your own.
Related to what you are saying, but not to the actual topic, what about MCPC+? It doesn't modify the actual mods as far as i can tell. The only thing it wrangles around would probably be the plugins.
Cloudy #5
Posted 12 April 2013 - 04:14 AM
Still not supported.
Cranium #6
Posted 12 April 2013 - 04:23 AM
Righto! Thought I'd ask anyway, since it might come up in the future.
immibis #7
Posted 12 April 2013 - 05:38 PM
MCPC+ tries to adapt vanilla and Forge code so mods can work well with plugins, but this is not always possible without editing the mod.
1.2.5 "bukkit ports" usually didn't just port the code, they also contained the changes required to make mods work well with plugins.
It isn't possible for block break events from turtles to work in MCPC+ unless the CC team or someone else add special code for MCPC+. Same with block breakers, miners, mining lasers, quarries, etc.
0pteron #8
Posted 12 April 2013 - 08:11 PM
It's my understanding that all one would need to do with CC is add a check if bukkit is support (either natively, or a mod that gives it bukkit API such as MCPC+) if bukkit functionality of the server was found then the bukkit libararies would be imported and then the appropriate bukkit "BreakBlockEvent" would be triggered and then checked within bukkit handler to see if it was cancelled. In this instance any bukkit grief protection (Grief Protection, Factions, etc) would be correctly notified that something that isnt approved (turlle in this case) is trying to break a block it shouldnt, and cancel the event in which the turtle would intercept the cancel and return before every firing the world delete block command.

That is a quick albeit hacky way to let grief protection plugins intercept blocks being broken by forge mods.

The better alternative would be for Forge to eventually support a similar BreakBlockEvent that bukkit has (Numerous requests for this but for some reason forge hasnt done it?) and then have MCPC+ translate the forge BreakBlockEvent into a bukkit BreakBlockEvent.

Lastly, Forge can support the BreakBlockEvent as previous but instead of relying on MCPC+ to allow bukkit grief protection, there should be a native forge protection plugin that uses strictly forge code. CC and other mods would have to update to add the blockevent when breaking blocks.

AFAIK there isn't any good anti-grief plugins for forge because forge does not support BreakBlockEvent. This basically means the forge server never even gets notified when a player breaks a block, so how could one detect griefing block breaking if it isn't aware of block breaking at all ?

Some of you may say wait a min, didn't keepcalm release a BreakBlockEvent API , infact an API for a lot of actions. Yes he did, and I havent got it to work for non-player break block events yet. But it does work for player damage and player block and there is no reason you cant just trigger a player block event. The problem then is, as I believe it, forge hasnt added any of keepcalm's event API into official forge, which means CC or any other of the FTB wont add support for it, which means it will never be pushed to the client. I think the clients would also need the updated CC mod and updated forge and or keepcalm mod in order for the breakblockevent to even occur.
0pteron #9
Posted 13 April 2013 - 10:14 AM
To put it simply, Forge has never allowed the server to know when someone has broke a block. Therefore, the forge mod creators (CC and others) have never programmed to let the server know "I am about to break a block, should I continue?" instead it just mindlessly breaks blocks.