Adds in initial registration for a queue
This commit is contained in:
parent
ecb20540e4
commit
a02cd91bcb
3 changed files with 24 additions and 2 deletions
|
@ -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";
|
||||
}
|
||||
}
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue