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

@ -3,7 +3,7 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
libzontreck=1201.13.041224.0752
libzontreck=1201.13.041224.0832
## Environment Properties
@ -48,7 +48,7 @@ mod_name=Aria's Essentials
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=GPLv3
# The mod version. See https://semver.org/
mod_version=1201.2.041224.0757
mod_version=1201.2.041224.0854
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html

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());
}
}