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

No [ComputerCraft] Bukkit events

Started by OLEGSHA, 10 June 2016 - 05:28 PM
OLEGSHA #1
Posted 10 June 2016 - 07:28 PM
First off, I am not quite sure I'm posting to the correct forum, since this is not about Lua CC programming but rather CC support in general.

I am having trouble tracking CC turtles' actions on my public Cauldron (Spigot (Bukkit) + Forge) server. On the server, they would move around, dig and place blocks freely, ignoring world editing rules set up by WorldGuard. I am a lower-intermediate modder and an experienced plugin-coder myself, so I know CC does not have to raise Bukkit events, but I found many references to the very opposite porblem, when CC wouldn't be able to do anything exactly because of these events (example). After a considerable amount of research and pluginside debugging (e.g. WorldGuard event logging), I found out that CC does not fire events at all. For example, when a BuildCraft mining well intends to dig a block, a BlockBreakEvent is raised by a so called "fake player" [BuildCraft], and in case it gets cancelled (e.g. the block is protected), no digging happens; with event logging enabled, I also recieve a console notification. However, nothing happens if I make a turtle dig a block or move: the block appears, the turtle moves, even if all server players are forbidden to dig blocks in the area.

I've heard some people talking about 1) CC's fake player [ComputerCraft] and 2) that being a configurable option in some config file "mod_CCTurtle", although I couldn't find one. Since both cases refer to old versions of MC (1.4), I have to suspect config files have been changed. I also found an option in my current config file, B:turtlesObeyBlockProtection, that seems to be what I am looking for, but it was set to "true" during all my previous tests, so that does not solve the problem.

Some technical info:
- MC version: 1.7.10 (UUID problem?)
- Server core: Cauldron (1.7.10-1.1388.1.0)
- ComputerCraft version: 1.74
- Installed server plugins: WorldGuard, PermissionsEX, WorldEdit, AuthMe, Essentials, others (they do not handle block-related events)

Finally, I also have an opposite problem with BuildCraft: said mining well cannot work anywhere, despite all my efforts. I'll try to figure that out on my own, but perhaps the issues could be related.

Thanks in advance.
Bomb Bloke #2
Posted 11 June 2016 - 02:38 AM
ComputerCraft indeed no longer uses a fake player - at least to my understanding, anyway.

Going by this issue report and the one that it links to, it seems Dan expects other coders to use his API for the purpose of restricting turtles, and other coders expect Dan to fire BreakBlock events so that they can restrict turtles.

Beats me what the "proper" way of doing things is. If the events are purely a Bukkit thing, then I wouldn't expect ComputerCraft (a Forge mod) to have anything to do with them.
OLEGSHA #3
Posted 11 June 2016 - 05:05 PM
Thank you, Bomb Bloke.
I hope dan200 had a good reason for removing Bukkit support, but since most plugins do not acknowledge ComputerCraft's new API yet I will code a Bukkit plugin to return old fakeplayer model for now. Since 1.7.10 WorldGuard does not use CC's API I hope my plugin will help preventing turtle griefing on servers without dedicated turtle restriction mods.