Adds in initial registration for a queue

This commit is contained in:
zontreck 2024-04-12 08:55:30 -07:00
parent ecb20540e4
commit a02cd91bcb
3 changed files with 24 additions and 2 deletions

View file

@ -0,0 +1,12 @@
package dev.zontreck.essentials.antiexplode;
import dev.zontreck.libzontreck.memory.world.BlockRestoreQueue;
import dev.zontreck.libzontreck.memory.world.SortedBlockQueue;
public class CreeperHealQueue extends SortedBlockQueue
{
@Override
public String getRestoreQueueName() {
return "creeperheal";
}
}

View file

@ -1,12 +1,16 @@
package dev.zontreck.essentials.imc;
import dev.zontreck.essentials.antiexplode.CreeperHealQueue;
import dev.zontreck.essentials.commands.teleport.TeleportActioner;
import dev.zontreck.essentials.commands.teleport.TeleportContainer;
import dev.zontreck.libzontreck.events.BlockRestoreQueueRegistrationEvent;
import dev.zontreck.libzontreck.events.TeleportEvent;
import net.minecraft.world.phys.Vec2;
import net.minecraftforge.eventbus.api.SubscribeEvent;
public class Events
{
@SubscribeEvent
public static void onTeleportRequest(TeleportEvent ev)
{
ev.setCanceled(true);
@ -18,4 +22,10 @@ public class Events
TeleportActioner.PerformTeleport(container, false);
}
@SubscribeEvent
public static void onRegisterRestoreQueues (BlockRestoreQueueRegistrationEvent event)
{
event.register(new CreeperHealQueue());
}
}