Cleanup imports. Add dimension exclusions
This commit is contained in:
parent
172c9b51ed
commit
10bd89450c
10 changed files with 18 additions and 16 deletions
|
@ -3,7 +3,7 @@
|
|||
org.gradle.jvmargs=-Xmx8G
|
||||
org.gradle.daemon=false
|
||||
|
||||
my_version=1.3.5.4
|
||||
my_version=1.3.5.5
|
||||
|
||||
mc_version=1.19.2
|
||||
forge_version=43.2.3
|
||||
|
|
|
@ -12,12 +12,8 @@ import dev.zontreck.otemod.OTEMod;
|
|||
import dev.zontreck.otemod.chat.ChatServerOverride;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.network.chat.contents.TranslatableContents;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.network.chat.Style;
|
||||
import net.minecraft.network.chat.TextColor;
|
||||
|
||||
public class DelHomeCommand {
|
||||
public static void register(CommandDispatcher<CommandSourceStack> dispatcher)
|
||||
|
|
|
@ -20,7 +20,6 @@ import dev.zontreck.otemod.database.TeleportDestination;
|
|||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.nbt.NbtUtils;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.phys.Vec2;
|
||||
|
|
|
@ -5,7 +5,6 @@ import com.mojang.brigadier.CommandDispatcher;
|
|||
import dev.zontreck.libzontreck.chat.ChatColor;
|
||||
import dev.zontreck.libzontreck.chat.ChatColor.ColorOptions;
|
||||
import dev.zontreck.otemod.OTEMod;
|
||||
import dev.zontreck.otemod.chat.ChatServerOverride;
|
||||
import dev.zontreck.otemod.configs.Profile;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.Commands;
|
||||
|
|
|
@ -9,7 +9,6 @@ import dev.zontreck.otemod.configs.Profile;
|
|||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraftforge.server.command.EnumArgument;
|
||||
|
||||
public class NickCommand {
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ public class OTEServerConfig {
|
|||
public static final ForgeConfigSpec.BooleanValue DEBUG_HEALER;
|
||||
public static final ForgeConfigSpec.ConfigValue<Integer> TIME_BETWEEN_BLOCKS;
|
||||
public static final ForgeConfigSpec.ConfigValue<Integer> MAX_TRIES_HEAL;
|
||||
public static final ForgeConfigSpec.ConfigValue<List<String>> EXCLUDE_DIMS;
|
||||
|
||||
|
||||
static {
|
||||
|
@ -55,6 +56,11 @@ public class OTEServerConfig {
|
|||
|
||||
MAX_TRIES_HEAL = BUILDER.comment("Maximum amount of retries to restore a block").define("max_tries", 6);
|
||||
|
||||
List<String> defDims = new ArrayList<String>();
|
||||
defDims.add("minecraft:the_end");
|
||||
defDims.add("minecraft:the_nether");
|
||||
defDims.add("otemod:resource");
|
||||
EXCLUDE_DIMS = BUILDER.comment("Dimension names (ex. minecraft:overworld) to exclude from the explosion healing events").define("exclude_dimensions", defDims);
|
||||
|
||||
BUILDER.pop();
|
||||
SPEC=BUILDER.build();
|
||||
|
|
|
@ -8,8 +8,6 @@ import java.util.HashMap;
|
|||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.mariadb.jdbc.export.Prepare;
|
||||
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
|
||||
import dev.zontreck.libzontreck.chat.ChatColor;
|
||||
|
@ -17,16 +15,12 @@ import dev.zontreck.otemod.OTEMod;
|
|||
import dev.zontreck.otemod.chat.ChatServerOverride;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.ListTag;
|
||||
import net.minecraft.nbt.NbtUtils;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.CompoundContainer;
|
||||
import net.minecraft.world.SimpleContainer;
|
||||
import net.minecraft.world.inventory.MenuConstructor;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraftforge.items.ItemStackHandler;
|
||||
|
||||
public class VaultContainer
|
||||
|
|
|
@ -4,7 +4,6 @@ import java.util.Map;
|
|||
import java.util.UUID;
|
||||
|
||||
import dev.zontreck.otemod.OTEMod;
|
||||
import net.minecraft.client.gui.components.events.ContainerEventHandler;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.event.entity.player.PlayerContainerEvent;
|
||||
|
|
|
@ -3,6 +3,9 @@ package dev.zontreck.otemod.zschem;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import dev.zontreck.libzontreck.vectors.Vector3;
|
||||
import dev.zontreck.libzontreck.vectors.WorldPosition;
|
||||
import dev.zontreck.otemod.configs.OTEServerConfig;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraftforge.event.TickEvent;
|
||||
import net.minecraftforge.event.level.ExplosionEvent;
|
||||
|
@ -19,7 +22,14 @@ public class EventHandler {
|
|||
|
||||
//Entity explodes = ev.getExplosion().getSourceMob();
|
||||
// Register blocks to be healed
|
||||
WorldPosition wpos = new WorldPosition(new Vector3(ev.getExplosion().getPosition()), (ServerLevel) ev.getLevel());
|
||||
|
||||
if(OTEServerConfig.EXCLUDE_DIMS.get().contains(wpos.Dimension)){
|
||||
// Dimension is on the exclusion list. Do not process.
|
||||
return;
|
||||
}
|
||||
WorldProp wp = WorldProp.acquire((ServerLevel)ev.getLevel());
|
||||
|
||||
if(wp!=null){
|
||||
wp.onDetonate(ev);
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ modId="otemod" #mandatory
|
|||
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
|
||||
# ${file.jarVersion} will substitute the value of the Implementation-Version as read from the mod's JAR file metadata
|
||||
# see the associated build.gradle script for how to populate this completely automatically during a build
|
||||
version="1.3.5.4" #mandatory
|
||||
version="1.3.5.5" #mandatory
|
||||
# A display name for the mod
|
||||
displayName="OTEMod Resources" #mandatory
|
||||
# A URL to query for updates for this mod. See the JSON update specification https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/
|
||||
|
|
Reference in a new issue