Skip to content

Commit c2cbeae

Browse files
cryptobenchclaude
andcommitted
Remove registerEntityEventType calls - events already registered by core
The ECS event types (DamageBlockEvent, BreakBlockEvent, PlaceBlockEvent, UseBlockEvent.Pre) are already registered by the Hytale core game. Attempting to register them again throws IllegalArgumentException. Just register the systems that handle these events. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent e09b60d commit c2cbeae

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

src/main/java/com/landclaims/LandClaims.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919
import com.landclaims.systems.BlockUseProtectionSystem;
2020
import com.hypixel.hytale.server.core.plugin.JavaPlugin;
2121
import com.hypixel.hytale.server.core.plugin.JavaPluginInit;
22-
import com.hypixel.hytale.server.core.event.events.ecs.BreakBlockEvent;
23-
import com.hypixel.hytale.server.core.event.events.ecs.DamageBlockEvent;
24-
import com.hypixel.hytale.server.core.event.events.ecs.PlaceBlockEvent;
25-
import com.hypixel.hytale.server.core.event.events.ecs.UseBlockEvent;
2622

2723
/**
2824
* LandClaims - A chunk-based land claiming plugin with playtime-based limits.
@@ -80,14 +76,7 @@ public void setup() {
8076
// Register ECS block protection systems
8177
getLogger().atInfo().log("Registering ECS block protection systems...");
8278
try {
83-
// Register entity event types first - required before systems can receive these events
84-
getEntityStoreRegistry().registerEntityEventType(DamageBlockEvent.class);
85-
getEntityStoreRegistry().registerEntityEventType(BreakBlockEvent.class);
86-
getEntityStoreRegistry().registerEntityEventType(PlaceBlockEvent.class);
87-
getEntityStoreRegistry().registerEntityEventType(UseBlockEvent.Pre.class);
88-
getLogger().atInfo().log("Registered entity event types");
89-
90-
// Now register the systems that handle these events
79+
// Event types are already registered by the core game, just register our systems
9180
getEntityStoreRegistry().registerSystem(new BlockDamageProtectionSystem(claimManager, getLogger()));
9281
getLogger().atInfo().log("Registered BlockDamageProtectionSystem");
9382
getEntityStoreRegistry().registerSystem(new BlockBreakProtectionSystem(claimManager, getLogger()));

0 commit comments

Comments
 (0)