Port WorldHandler to NeoForge 21.1.225
All checks were successful
Build / build (push) Successful in 6m56s
All checks were successful
Build / build (push) Successful in 6m56s
This commit is contained in:
57
build.gradle
57
build.gradle
@@ -1,53 +1,57 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id 'java'
|
id 'java'
|
||||||
id 'eclipse'
|
id 'eclipse'
|
||||||
id 'net.minecraftforge.gradle' version '[6.0.16,6.2)'
|
id 'net.neoforged.moddev' version '2.0.141'
|
||||||
id 'me.hypherionmc.cursegradle' version '2.+'
|
id 'me.hypherionmc.cursegradle' version '2.+'
|
||||||
}
|
}
|
||||||
|
|
||||||
archivesBaseName = "${mod_name}-${minecraft_version}"
|
archivesBaseName = "${mod_name}-${minecraft_version}-neoforge"
|
||||||
version = mod_version
|
version = mod_version
|
||||||
|
|
||||||
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
|
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
|
||||||
javadoc.options.addStringOption('Xdoclint:none', '-quiet')
|
javadoc.options.addStringOption('Xdoclint:none', '-quiet')
|
||||||
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + ' (' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
|
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + ' (' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
|
||||||
|
|
||||||
minecraft {
|
neoForge {
|
||||||
mappings channel: 'official', version: minecraft_version
|
version = neo_version
|
||||||
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
|
accessTransformers = project.files('src/main/resources/META-INF/accesstransformer.cfg')
|
||||||
|
|
||||||
runs {
|
runs {
|
||||||
configureEach {
|
|
||||||
workingDirectory project.file('run')
|
|
||||||
}
|
|
||||||
|
|
||||||
client {
|
client {
|
||||||
taskName "${project.name}Client"
|
client()
|
||||||
|
gameDirectory = project.file('run')
|
||||||
|
systemProperty 'neoforge.enabledGameTestNamespaces', mod_id
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
taskName "${project.name}Server"
|
server()
|
||||||
|
gameDirectory = project.file('run')
|
||||||
|
programArgument '--nogui'
|
||||||
|
systemProperty 'neoforge.enabledGameTestNamespaces', mod_id
|
||||||
}
|
}
|
||||||
|
|
||||||
gameTestServer {
|
gameTestServer {
|
||||||
taskName "${project.name}GameTest"
|
type = "gameTestServer"
|
||||||
property 'forge.enabledGameTestNamespaces', mod_id
|
gameDirectory = project.file('run')
|
||||||
|
systemProperty 'neoforge.enabledGameTestNamespaces', mod_id
|
||||||
}
|
}
|
||||||
|
|
||||||
data {
|
data {
|
||||||
workingDirectory project.file('run-data')
|
data()
|
||||||
taskName "${project.name}Data"
|
gameDirectory = project.file('run-data')
|
||||||
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
|
programArguments.addAll '--mod', mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mods {
|
||||||
|
"${mod_id}" {
|
||||||
|
sourceSet(sourceSets.main)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets.main.resources { srcDir 'src/generated/resources' }
|
sourceSets.main.resources { srcDir 'src/generated/resources' }
|
||||||
|
|
||||||
dependencies {
|
|
||||||
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.named('jar', Jar).configure {
|
tasks.named('jar', Jar).configure {
|
||||||
manifest {
|
manifest {
|
||||||
attributes([
|
attributes([
|
||||||
@@ -70,9 +74,9 @@ tasks.named('processResources', ProcessResources).configure {
|
|||||||
|
|
||||||
from sourceSets.main.resources
|
from sourceSets.main.resources
|
||||||
|
|
||||||
filesMatching(['META-INF/mods.toml']) {
|
filesMatching(['META-INF/neoforge.mods.toml']) {
|
||||||
expand project.properties
|
expand project.properties
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(JavaCompile).configureEach {
|
tasks.withType(JavaCompile).configureEach {
|
||||||
@@ -86,16 +90,15 @@ curseforge {
|
|||||||
changelog = file('changelog.txt').canRead() ? file('changelog.txt').text : ''
|
changelog = file('changelog.txt').canRead() ? file('changelog.txt').text : ''
|
||||||
changelogType = 'text'
|
changelogType = 'text'
|
||||||
releaseType = 'release'
|
releaseType = 'release'
|
||||||
addGameVersion 'Forge'
|
addGameVersion 'NeoForge'
|
||||||
forge_compatible_minecraft_versions.split(",").each {
|
neoforge_compatible_minecraft_versions.split(",").each {
|
||||||
addGameVersion(it)
|
addGameVersion(it)
|
||||||
}
|
}
|
||||||
mainArtifact(jar) {
|
mainArtifact(jar) {
|
||||||
displayName = "${minecraft_version}-${mod_version} Universal"
|
displayName = "${minecraft_version}-${mod_version} NeoForge"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
options {
|
options {
|
||||||
javaVersionAutoDetect = false
|
javaVersionAutoDetect = false
|
||||||
forgeGradleIntegration = false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
# WorldHandler
|
# WorldHandler
|
||||||
mod_id = worldhandler
|
mod_id = worldhandler
|
||||||
mod_name = WorldHandler
|
mod_name = WorldHandler
|
||||||
mod_version = 3.5.2
|
mod_version = 3.5.2-neoforge
|
||||||
minecraft_version = 1.21.1
|
minecraft_version = 1.21.1
|
||||||
group = exopandora.worldhandler
|
group = exopandora.worldhandler
|
||||||
main_class = exopandora.worldhandler.Main
|
main_class = exopandora.worldhandler.Main
|
||||||
author = Exopandora
|
author = Exopandora
|
||||||
|
|
||||||
# Forge
|
# NeoForge
|
||||||
forge_version = 52.1.14
|
neo_version = 21.1.225
|
||||||
forge_compatible_minecraft_versions = 1.21.1
|
loader_version_range = [4,)
|
||||||
|
neoforge_compatible_minecraft_versions = 1.21.1
|
||||||
|
|
||||||
# Publishing
|
# Publishing
|
||||||
curse_project_id = 228970
|
curse_project_id = 228970
|
||||||
|
|||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
@@ -2,14 +2,14 @@ pluginManagement {
|
|||||||
repositories {
|
repositories {
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
maven {
|
maven {
|
||||||
name = 'MinecraftForge'
|
name = 'NeoForge'
|
||||||
url = 'https://maven.minecraftforge.net/'
|
url = 'https://maven.neoforged.net/releases'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0'
|
id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
rootProject.name = 'WorldHandler'
|
rootProject.name = 'WorldHandler'
|
||||||
|
|||||||
@@ -10,26 +10,23 @@ import exopandora.worldhandler.event.ClientEventHandler;
|
|||||||
import exopandora.worldhandler.event.KeyHandler;
|
import exopandora.worldhandler.event.KeyHandler;
|
||||||
import exopandora.worldhandler.gui.category.Category;
|
import exopandora.worldhandler.gui.category.Category;
|
||||||
import exopandora.worldhandler.gui.content.Content;
|
import exopandora.worldhandler.gui.content.Content;
|
||||||
import exopandora.worldhandler.usercontent.UsercontentLoader;
|
import exopandora.worldhandler.usercontent.UsercontentLoader;
|
||||||
import exopandora.worldhandler.util.AdvancementHelper;
|
import exopandora.worldhandler.util.AdvancementHelper;
|
||||||
import exopandora.worldhandler.util.CommandHelper;
|
import exopandora.worldhandler.util.CommandHelper;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.neoforged.api.distmarker.Dist;
|
||||||
import net.minecraftforge.client.event.RegisterClientCommandsEvent;
|
import net.neoforged.bus.api.IEventBus;
|
||||||
import net.minecraftforge.client.event.RegisterClientReloadListenersEvent;
|
import net.neoforged.bus.api.SubscribeEvent;
|
||||||
import net.minecraftforge.client.event.RegisterKeyMappingsEvent;
|
import net.neoforged.fml.ModContainer;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.neoforged.fml.common.Mod;
|
||||||
import net.minecraftforge.eventbus.api.IEventBus;
|
import net.neoforged.fml.config.ModConfig.Type;
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.neoforged.neoforge.client.event.RegisterClientCommandsEvent;
|
||||||
import net.minecraftforge.fml.DistExecutor;
|
import net.neoforged.neoforge.client.event.RegisterClientReloadListenersEvent;
|
||||||
import net.minecraftforge.fml.DistExecutor.SafeRunnable;
|
import net.neoforged.neoforge.client.event.RegisterKeyMappingsEvent;
|
||||||
import net.minecraftforge.fml.IExtensionPoint.DisplayTest;
|
import net.neoforged.neoforge.common.NeoForge;
|
||||||
import net.minecraftforge.fml.ModLoadingContext;
|
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
|
||||||
import net.minecraftforge.fml.common.Mod;
|
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||||
import net.minecraftforge.fml.config.ModConfig.Type;
|
import net.neoforged.fml.loading.FMLEnvironment;
|
||||||
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
import net.neoforged.fml.loading.FMLPaths;
|
||||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
|
||||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
|
||||||
import net.minecraftforge.fml.loading.FMLPaths;
|
|
||||||
|
|
||||||
@Mod(Main.MODID)
|
@Mod(Main.MODID)
|
||||||
public class WorldHandler
|
public class WorldHandler
|
||||||
@@ -37,44 +34,37 @@ public class WorldHandler
|
|||||||
public static final Logger LOGGER = LogManager.getLogger();
|
public static final Logger LOGGER = LogManager.getLogger();
|
||||||
public static final Path USERCONTENT_PATH = FMLPaths.CONFIGDIR.get().resolve(Main.MODID).resolve("usercontent");
|
public static final Path USERCONTENT_PATH = FMLPaths.CONFIGDIR.get().resolve(Main.MODID).resolve("usercontent");
|
||||||
|
|
||||||
public WorldHandler()
|
public WorldHandler(IEventBus modEventBus, ModContainer modContainer)
|
||||||
{
|
{
|
||||||
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
|
if(Dist.CLIENT.equals(FMLEnvironment.dist))
|
||||||
ModLoadingContext modLoadingContext = ModLoadingContext.get();
|
{
|
||||||
DistExecutor.safeRunWhenOn(Dist.CLIENT, () -> new SafeRunnable()
|
Config.setupDirectories(WorldHandler.USERCONTENT_PATH);
|
||||||
{
|
modContainer.registerConfig(Type.CLIENT, Config.CLIENT_SPEC, Main.MODID + "/" + Main.MODID + ".toml");
|
||||||
@Override
|
UsercontentLoader.load(WorldHandler.USERCONTENT_PATH);
|
||||||
public void run()
|
modEventBus.addListener(WorldHandler.this::registerKeyMappingsEvent);
|
||||||
{
|
modEventBus.addListener(WorldHandler.this::registerClientReloadListeners);
|
||||||
Config.setupDirectories(WorldHandler.USERCONTENT_PATH);
|
modEventBus.addListener(Content::createRegistry);
|
||||||
modLoadingContext.registerConfig(Type.CLIENT, Config.CLIENT_SPEC, Main.MODID + "/" + Main.MODID + ".toml");
|
modEventBus.addListener(Category::createRegistry);
|
||||||
UsercontentLoader.load(WorldHandler.USERCONTENT_PATH);
|
modEventBus.addListener(Content::register);
|
||||||
modEventBus.addListener(WorldHandler.this::registerKeyMappingsEvent);
|
modEventBus.addListener(Category::register);
|
||||||
modEventBus.addListener(WorldHandler.this::registerClientReloadListeners);
|
}
|
||||||
modEventBus.addListener(Content::createRegistry);
|
modEventBus.addListener(this::clientSetup);
|
||||||
modEventBus.addListener(Category::createRegistry);
|
modEventBus.addListener(this::commonSetup);
|
||||||
modEventBus.addListener(Content::register);
|
}
|
||||||
modEventBus.addListener(Category::register);
|
|
||||||
}
|
@SubscribeEvent
|
||||||
});
|
public void clientSetup(FMLClientSetupEvent event)
|
||||||
modLoadingContext.registerExtensionPoint(DisplayTest.class, () -> new DisplayTest(() -> "ANY", (remote, isServer) -> true));
|
{
|
||||||
modEventBus.addListener(this::clientSetup);
|
NeoForge.EVENT_BUS.addListener(KeyHandler::keyInputEvent);
|
||||||
modEventBus.addListener(this::commonSetup);
|
NeoForge.EVENT_BUS.addListener(ClientEventHandler::renderLevelStageEvent);
|
||||||
}
|
NeoForge.EVENT_BUS.addListener(ClientEventHandler::clientTickEvent);
|
||||||
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void clientSetup(FMLClientSetupEvent event)
|
public void commonSetup(FMLCommonSetupEvent event)
|
||||||
{
|
{
|
||||||
MinecraftForge.EVENT_BUS.addListener(KeyHandler::keyInputEvent);
|
NeoForge.EVENT_BUS.addListener(this::registerCommands);
|
||||||
MinecraftForge.EVENT_BUS.addListener(ClientEventHandler::renderLevelStageEvent);
|
}
|
||||||
MinecraftForge.EVENT_BUS.addListener(ClientEventHandler::clientTickEvent);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public void commonSetup(FMLCommonSetupEvent event)
|
|
||||||
{
|
|
||||||
MinecraftForge.EVENT_BUS.addListener(this::registerCommands);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void registerKeyMappingsEvent(RegisterKeyMappingsEvent event)
|
public void registerKeyMappingsEvent(RegisterKeyMappingsEvent event)
|
||||||
@@ -95,4 +85,4 @@ public class WorldHandler
|
|||||||
{
|
{
|
||||||
event.registerReloadListener(AdvancementHelper.getInstance());
|
event.registerReloadListener(AdvancementHelper.getInstance());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package exopandora.worldhandler.builder.argument;
|
package exopandora.worldhandler.builder.argument;
|
||||||
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
@@ -262,8 +263,8 @@ public class Arguments
|
|||||||
|
|
||||||
public static PrimitiveArgument<Anchor> anchor()
|
public static PrimitiveArgument<Anchor> anchor()
|
||||||
{
|
{
|
||||||
return PrimitiveArgument.builder(string -> EnumHelper.find(string, Anchor.values(), anchor -> anchor.name))
|
return PrimitiveArgument.builder(Anchor::getByName)
|
||||||
.serializer(anchor -> anchor.name)
|
.serializer(anchor -> anchor.name().toLowerCase(Locale.ROOT))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import net.minecraft.nbt.CompoundTag;
|
|||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.block.state.properties.Property;
|
import net.minecraft.world.level.block.state.properties.Property;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
|
||||||
public class BlockPredicateArgument extends TagArgument
|
public class BlockPredicateArgument extends TagArgument
|
||||||
{
|
{
|
||||||
@@ -38,7 +38,7 @@ public class BlockPredicateArgument extends TagArgument
|
|||||||
{
|
{
|
||||||
if(state != null)
|
if(state != null)
|
||||||
{
|
{
|
||||||
this.resource = ForgeRegistries.BLOCKS.getKey(state.getBlock());
|
this.resource = BuiltInRegistries.BLOCK.getKey(state.getBlock());
|
||||||
this.properties = propertiesToString(state.getValues());
|
this.properties = propertiesToString(state.getValues());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import net.minecraft.nbt.CompoundTag;
|
|||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
|
||||||
public class BlockStateArgument extends TagArgument
|
public class BlockStateArgument extends TagArgument
|
||||||
{
|
{
|
||||||
@@ -24,7 +24,7 @@ public class BlockStateArgument extends TagArgument
|
|||||||
{
|
{
|
||||||
if(block != null)
|
if(block != null)
|
||||||
{
|
{
|
||||||
this.set(ForgeRegistries.BLOCKS.getValue(block));
|
this.set(BuiltInRegistries.BLOCK.get(block));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -104,7 +104,7 @@ public class BlockStateArgument extends TagArgument
|
|||||||
|
|
||||||
StringBuilder builder = new StringBuilder(this.state.toString());
|
StringBuilder builder = new StringBuilder(this.state.toString());
|
||||||
String block = this.state.getBlock().toString();
|
String block = this.state.getBlock().toString();
|
||||||
builder.replace(0, block.length(), ForgeRegistries.BLOCKS.getKey(this.state.getBlock()).toString());
|
builder.replace(0, block.length(), BuiltInRegistries.BLOCK.getKey(this.state.getBlock()).toString());
|
||||||
String nbt = super.serialize();
|
String nbt = super.serialize();
|
||||||
|
|
||||||
if(nbt != null && this.state.hasBlockEntity())
|
if(nbt != null && this.state.hasBlockEntity())
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import javax.annotation.Nullable;
|
|||||||
import exopandora.worldhandler.util.ResourceHelper;
|
import exopandora.worldhandler.util.ResourceHelper;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.effect.MobEffect;
|
import net.minecraft.world.effect.MobEffect;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
|
||||||
public class EffectArgument implements IDeserializableArgument
|
public class EffectArgument implements IDeserializableArgument
|
||||||
{
|
{
|
||||||
@@ -25,7 +25,7 @@ public class EffectArgument implements IDeserializableArgument
|
|||||||
{
|
{
|
||||||
if(effect != null)
|
if(effect != null)
|
||||||
{
|
{
|
||||||
this.set(ForgeRegistries.MOB_EFFECTS.getValue(effect));
|
this.set(BuiltInRegistries.MOB_EFFECT.get(effect));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -54,7 +54,7 @@ public class EffectArgument implements IDeserializableArgument
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ForgeRegistries.MOB_EFFECTS.getKey(this.effect).toString();
|
return BuiltInRegistries.MOB_EFFECT.getKey(this.effect).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -10,38 +10,38 @@ import exopandora.worldhandler.util.ResourceHelper;
|
|||||||
import net.minecraft.Util;
|
import net.minecraft.Util;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.entity.EntityType;
|
import net.minecraft.world.entity.EntityType;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
|
||||||
public class EntitySummonArgument implements IDeserializableArgument
|
public class EntitySummonArgument implements IDeserializableArgument
|
||||||
{
|
{
|
||||||
private static final Map<String, ResourceLocation> ALIASES = Util.make(new HashMap<String, ResourceLocation>(), map ->
|
private static final Map<String, ResourceLocation> ALIASES = Util.make(new HashMap<String, ResourceLocation>(), map ->
|
||||||
{
|
{
|
||||||
map.put("RedCow", ForgeRegistries.ENTITY_TYPES.getKey(EntityType.MOOSHROOM));
|
map.put("RedCow", BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.MOOSHROOM));
|
||||||
map.put("ChickenJockey", ForgeRegistries.ENTITY_TYPES.getKey(EntityType.CHICKEN));
|
map.put("ChickenJockey", BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.CHICKEN));
|
||||||
map.put("Pigman", ForgeRegistries.ENTITY_TYPES.getKey(EntityType.PIGLIN));
|
map.put("Pigman", BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.PIGLIN));
|
||||||
map.put("ZombiePig", ForgeRegistries.ENTITY_TYPES.getKey(EntityType.PIGLIN));
|
map.put("ZombiePig", BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.PIGLIN));
|
||||||
map.put("ZombiePigman", ForgeRegistries.ENTITY_TYPES.getKey(EntityType.PIGLIN));
|
map.put("ZombiePigman", BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.PIGLIN));
|
||||||
map.put("Dog", ForgeRegistries.ENTITY_TYPES.getKey(EntityType.WOLF));
|
map.put("Dog", BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.WOLF));
|
||||||
map.put("Dragon", ForgeRegistries.ENTITY_TYPES.getKey(EntityType.ENDER_DRAGON));
|
map.put("Dragon", BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.ENDER_DRAGON));
|
||||||
map.put("SnowMan", ForgeRegistries.ENTITY_TYPES.getKey(EntityType.SNOW_GOLEM));
|
map.put("SnowMan", BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.SNOW_GOLEM));
|
||||||
map.put("LavaCube", ForgeRegistries.ENTITY_TYPES.getKey(EntityType.MAGMA_CUBE));
|
map.put("LavaCube", BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.MAGMA_CUBE));
|
||||||
map.put("MagmaSlime", ForgeRegistries.ENTITY_TYPES.getKey(EntityType.MAGMA_CUBE));
|
map.put("MagmaSlime", BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.MAGMA_CUBE));
|
||||||
map.put("LavaSlime", ForgeRegistries.ENTITY_TYPES.getKey(EntityType.MAGMA_CUBE));
|
map.put("LavaSlime", BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.MAGMA_CUBE));
|
||||||
map.put("SpiderJockey", ForgeRegistries.ENTITY_TYPES.getKey(EntityType.SPIDER));
|
map.put("SpiderJockey", BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.SPIDER));
|
||||||
map.put("VillagerGolem", ForgeRegistries.ENTITY_TYPES.getKey(EntityType.IRON_GOLEM));
|
map.put("VillagerGolem", BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.IRON_GOLEM));
|
||||||
map.put("Ozelot", ForgeRegistries.ENTITY_TYPES.getKey(EntityType.OCELOT));
|
map.put("Ozelot", BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.OCELOT));
|
||||||
map.put("Kitty", ForgeRegistries.ENTITY_TYPES.getKey(EntityType.CAT));
|
map.put("Kitty", BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.CAT));
|
||||||
map.put("Kitten", ForgeRegistries.ENTITY_TYPES.getKey(EntityType.CAT));
|
map.put("Kitten", BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.CAT));
|
||||||
map.put("TESTIFICATE", ForgeRegistries.ENTITY_TYPES.getKey(EntityType.VILLAGER));
|
map.put("TESTIFICATE", BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.VILLAGER));
|
||||||
map.put("Octopus", ForgeRegistries.ENTITY_TYPES.getKey(EntityType.SQUID));
|
map.put("Octopus", BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.SQUID));
|
||||||
map.put("GlowingOctopus", ForgeRegistries.ENTITY_TYPES.getKey(EntityType.SQUID));
|
map.put("GlowingOctopus", BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.SQUID));
|
||||||
map.put("Exwife", ForgeRegistries.ENTITY_TYPES.getKey(EntityType.GHAST));
|
map.put("Exwife", BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.GHAST));
|
||||||
map.put("CommandMinecart", ForgeRegistries.ENTITY_TYPES.getKey(EntityType.COMMAND_BLOCK_MINECART));
|
map.put("CommandMinecart", BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.COMMAND_BLOCK_MINECART));
|
||||||
map.put("Wizard", ForgeRegistries.ENTITY_TYPES.getKey(EntityType.EVOKER));
|
map.put("Wizard", BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.EVOKER));
|
||||||
map.put("Johnny", ForgeRegistries.ENTITY_TYPES.getKey(EntityType.VINDICATOR));
|
map.put("Johnny", BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.VINDICATOR));
|
||||||
map.put("BabyZombie", ForgeRegistries.ENTITY_TYPES.getKey(EntityType.ZOMBIE));
|
map.put("BabyZombie", BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.ZOMBIE));
|
||||||
|
|
||||||
ForgeRegistries.VILLAGER_PROFESSIONS.getEntries().stream().forEach(profession -> map.put(profession.getKey().location().getPath(), profession.getKey().location()));
|
BuiltInRegistries.VILLAGER_PROFESSION.entrySet().stream().forEach(profession -> map.put(profession.getKey().location().getPath(), profession.getKey().location()));
|
||||||
});
|
});
|
||||||
|
|
||||||
private EntityType<?> entity;
|
private EntityType<?> entity;
|
||||||
@@ -67,10 +67,10 @@ public class EntitySummonArgument implements IDeserializableArgument
|
|||||||
{
|
{
|
||||||
if(entity != null)
|
if(entity != null)
|
||||||
{
|
{
|
||||||
EntityType<?> type = ForgeRegistries.ENTITY_TYPES.getValue(entity);
|
EntityType<?> type = BuiltInRegistries.ENTITY_TYPE.get(entity);
|
||||||
ResourceLocation location = ForgeRegistries.ENTITY_TYPES.getKey(type);
|
ResourceLocation location = BuiltInRegistries.ENTITY_TYPE.getKey(type);
|
||||||
|
|
||||||
if(!ForgeRegistries.ENTITY_TYPES.getDefaultKey().equals(location) || location.equals(entity))
|
if(!BuiltInRegistries.ENTITY_TYPE.getDefaultKey().equals(location) || location.equals(entity))
|
||||||
{
|
{
|
||||||
this.set(type);
|
this.set(type);
|
||||||
}
|
}
|
||||||
@@ -124,7 +124,7 @@ public class EntitySummonArgument implements IDeserializableArgument
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ForgeRegistries.ENTITY_TYPES.getKey(this.entity).toString();
|
return BuiltInRegistries.ENTITY_TYPE.getKey(this.entity).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
|||||||
import exopandora.worldhandler.util.ItemPredicateParser;
|
import exopandora.worldhandler.util.ItemPredicateParser;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
|
||||||
public class ItemArgument extends TagArgument
|
public class ItemArgument extends TagArgument
|
||||||
{
|
{
|
||||||
@@ -27,7 +27,7 @@ public class ItemArgument extends TagArgument
|
|||||||
{
|
{
|
||||||
if(item != null)
|
if(item != null)
|
||||||
{
|
{
|
||||||
this.set(ForgeRegistries.ITEMS.getValue(item));
|
this.set(BuiltInRegistries.ITEM.get(item));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -85,10 +85,10 @@ public class ItemArgument extends TagArgument
|
|||||||
|
|
||||||
if(tag != null)
|
if(tag != null)
|
||||||
{
|
{
|
||||||
return ForgeRegistries.ITEMS.getKey(this.item).toString() + tag;
|
return BuiltInRegistries.ITEM.getKey(this.item).toString() + tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ForgeRegistries.ITEMS.getKey(this.item).toString();
|
return BuiltInRegistries.ITEM.getKey(this.item).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
|||||||
import exopandora.worldhandler.util.ItemPredicateParser;
|
import exopandora.worldhandler.util.ItemPredicateParser;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
|
||||||
public class ItemPredicateArgument extends TagArgument
|
public class ItemPredicateArgument extends TagArgument
|
||||||
{
|
{
|
||||||
@@ -28,7 +28,7 @@ public class ItemPredicateArgument extends TagArgument
|
|||||||
{
|
{
|
||||||
if(item != null)
|
if(item != null)
|
||||||
{
|
{
|
||||||
this.resource = ForgeRegistries.ITEMS.getKey(item);
|
this.resource = BuiltInRegistries.ITEM.getKey(item);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
import net.minecraft.client.resources.language.I18n;
|
import net.minecraft.client.resources.language.I18n;
|
||||||
import net.minecraft.world.entity.ai.attributes.Attribute;
|
import net.minecraft.world.entity.ai.attributes.Attribute;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
|
||||||
public abstract class AbstractAttributeTag implements ITagProvider
|
public abstract class AbstractAttributeTag implements ITagProvider
|
||||||
{
|
{
|
||||||
public static final List<Attribute> ATTRIBUTES = ForgeRegistries.ATTRIBUTES.getValues().stream()
|
public static final List<Attribute> ATTRIBUTES = BuiltInRegistries.ATTRIBUTE.stream().toList().stream()
|
||||||
.filter(attribute -> !attribute.getDescriptionId().equals(I18n.get(attribute.getDescriptionId())))
|
.filter(attribute -> !attribute.getDescriptionId().equals(I18n.get(attribute.getDescriptionId())))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import net.minecraft.nbt.CompoundTag;
|
|||||||
import net.minecraft.nbt.ListTag;
|
import net.minecraft.nbt.ListTag;
|
||||||
import net.minecraft.nbt.Tag;
|
import net.minecraft.nbt.Tag;
|
||||||
import net.minecraft.world.effect.MobEffect;
|
import net.minecraft.world.effect.MobEffect;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
|
||||||
public abstract class AbstractEffectTag implements ITagProvider
|
public abstract class AbstractEffectTag implements ITagProvider
|
||||||
{
|
{
|
||||||
@@ -33,7 +33,7 @@ public abstract class AbstractEffectTag implements ITagProvider
|
|||||||
CompoundTag compound = new CompoundTag();
|
CompoundTag compound = new CompoundTag();
|
||||||
int ticks = instance.toTicks();
|
int ticks = instance.toTicks();
|
||||||
|
|
||||||
compound.putString("id", ForgeRegistries.MOB_EFFECTS.getKey(entry.getKey()).toString());
|
compound.putString("id", BuiltInRegistries.MOB_EFFECT.getKey(entry.getKey()).toString());
|
||||||
compound.putByte("amplifier", (byte) (instance.getAmplifier() - 1));
|
compound.putByte("amplifier", (byte) (instance.getAmplifier() - 1));
|
||||||
compound.putInt("duration", ticks > 0 ? ticks : 1000000);
|
compound.putInt("duration", ticks > 0 ? ticks : 1000000);
|
||||||
compound.putBoolean("ambient", instance.isAmbient());
|
compound.putBoolean("ambient", instance.isAmbient());
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import net.minecraft.nbt.CompoundTag;
|
|||||||
import net.minecraft.nbt.ListTag;
|
import net.minecraft.nbt.ListTag;
|
||||||
import net.minecraft.nbt.Tag;
|
import net.minecraft.nbt.Tag;
|
||||||
import net.minecraft.world.entity.ai.attributes.Attribute;
|
import net.minecraft.world.entity.ai.attributes.Attribute;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
|
||||||
public class AttributeModifiersTag extends AbstractAttributeTag
|
public class AttributeModifiersTag extends AbstractAttributeTag
|
||||||
{
|
{
|
||||||
@@ -24,7 +24,7 @@ public class AttributeModifiersTag extends AbstractAttributeTag
|
|||||||
if(entry.getValue() != 0)
|
if(entry.getValue() != 0)
|
||||||
{
|
{
|
||||||
CompoundTag attribute = new CompoundTag();
|
CompoundTag attribute = new CompoundTag();
|
||||||
String id = ForgeRegistries.ATTRIBUTES.getKey(entry.getKey()).toString();
|
String id = BuiltInRegistries.ATTRIBUTE.getKey(entry.getKey()).toString();
|
||||||
|
|
||||||
attribute.putString("AttributeName", id);
|
attribute.putString("AttributeName", id);
|
||||||
attribute.putDouble("Amount", entry.getValue() / 100);
|
attribute.putDouble("Amount", entry.getValue() / 100);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import net.minecraft.nbt.CompoundTag;
|
|||||||
import net.minecraft.nbt.ListTag;
|
import net.minecraft.nbt.ListTag;
|
||||||
import net.minecraft.nbt.Tag;
|
import net.minecraft.nbt.Tag;
|
||||||
import net.minecraft.world.entity.ai.attributes.Attribute;
|
import net.minecraft.world.entity.ai.attributes.Attribute;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
|
||||||
public class AttributesTag extends AbstractAttributeTag
|
public class AttributesTag extends AbstractAttributeTag
|
||||||
{
|
{
|
||||||
@@ -23,7 +23,7 @@ public class AttributesTag extends AbstractAttributeTag
|
|||||||
if(entry.getValue() != 0)
|
if(entry.getValue() != 0)
|
||||||
{
|
{
|
||||||
CompoundTag attribute = new CompoundTag();
|
CompoundTag attribute = new CompoundTag();
|
||||||
String id = ForgeRegistries.ATTRIBUTES.getKey(entry.getKey()).toString();
|
String id = BuiltInRegistries.ATTRIBUTE.getKey(entry.getKey()).toString();
|
||||||
|
|
||||||
attribute.putString("Name", id);
|
attribute.putString("Name", id);
|
||||||
attribute.putDouble("Base", entry.getValue() / 100);
|
attribute.putDouble("Base", entry.getValue() / 100);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import net.minecraft.commands.arguments.blocks.BlockPredicateArgument;
|
|||||||
import net.minecraft.commands.arguments.blocks.BlockStateArgument;
|
import net.minecraft.commands.arguments.blocks.BlockStateArgument;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
|
||||||
public class CommandWH
|
public class CommandWH
|
||||||
{
|
{
|
||||||
@@ -58,7 +58,7 @@ public class CommandWH
|
|||||||
{
|
{
|
||||||
BlockHelper.pos1().set(BlockHelper.getFocusedBlockPos());
|
BlockHelper.pos1().set(BlockHelper.getFocusedBlockPos());
|
||||||
BlockPos pos = BlockHelper.pos1();
|
BlockPos pos = BlockHelper.pos1();
|
||||||
ResourceLocation block = ForgeRegistries.BLOCKS.getKey(BlockHelper.getBlock(pos));
|
ResourceLocation block = BuiltInRegistries.BLOCK.getKey(BlockHelper.getBlock(pos));
|
||||||
CommandHelper.sendFeedback(source, "Set first position to " + pos.getX() + ", " + pos.getY() + ", " + pos.getZ() + " (" + block + ")");
|
CommandHelper.sendFeedback(source, "Set first position to " + pos.getX() + ", " + pos.getY() + ", " + pos.getZ() + " (" + block + ")");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -67,7 +67,7 @@ public class CommandWH
|
|||||||
{
|
{
|
||||||
BlockHelper.pos2().set(BlockHelper.getFocusedBlockPos());
|
BlockHelper.pos2().set(BlockHelper.getFocusedBlockPos());
|
||||||
BlockPos pos = BlockHelper.pos2();
|
BlockPos pos = BlockHelper.pos2();
|
||||||
ResourceLocation block = ForgeRegistries.BLOCKS.getKey(BlockHelper.getBlock(pos));
|
ResourceLocation block = BuiltInRegistries.BLOCK.getKey(BlockHelper.getBlock(pos));
|
||||||
CommandHelper.sendFeedback(source, "Set second position to " + pos.getX() + ", " + pos.getY() + ", " + pos.getZ() + " (" + block + ")");
|
CommandHelper.sendFeedback(source, "Set second position to " + pos.getX() + ", " + pos.getY() + ", " + pos.getZ() + " (" + block + ")");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ import net.minecraft.server.MinecraftServer;
|
|||||||
import net.minecraft.server.level.ServerPlayer;
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
import net.minecraft.world.level.LevelSettings;
|
import net.minecraft.world.level.LevelSettings;
|
||||||
import net.minecraft.world.level.storage.PrimaryLevelData;
|
import net.minecraft.world.level.storage.PrimaryLevelData;
|
||||||
import net.minecraftforge.fml.ModList;
|
import net.neoforged.fml.ModList;
|
||||||
import net.minecraftforge.fml.VersionChecker;
|
import net.neoforged.fml.VersionChecker;
|
||||||
|
|
||||||
public class CommandWorldHandler
|
public class CommandWorldHandler
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,16 +7,16 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
import net.minecraftforge.common.ForgeConfigSpec;
|
import net.neoforged.neoforge.common.ModConfigSpec;
|
||||||
|
|
||||||
public class Config
|
public class Config
|
||||||
{
|
{
|
||||||
public static final ForgeConfigSpec CLIENT_SPEC;
|
public static final ModConfigSpec CLIENT_SPEC;
|
||||||
public static final ClientConfig CLIENT;
|
public static final ClientConfig CLIENT;
|
||||||
|
|
||||||
static
|
static
|
||||||
{
|
{
|
||||||
Pair<ClientConfig, ForgeConfigSpec> pair = new ForgeConfigSpec.Builder().configure(ClientConfig::new);
|
Pair<ClientConfig, ModConfigSpec> pair = new ModConfigSpec.Builder().configure(ClientConfig::new);
|
||||||
CLIENT_SPEC = pair.getRight();
|
CLIENT_SPEC = pair.getRight();
|
||||||
CLIENT = pair.getLeft();
|
CLIENT = pair.getLeft();
|
||||||
}
|
}
|
||||||
@@ -28,7 +28,7 @@ public class Config
|
|||||||
private final ConfigCategorySkin skin;
|
private final ConfigCategorySkin skin;
|
||||||
private final ConfigCategorySliders sliders;
|
private final ConfigCategorySliders sliders;
|
||||||
|
|
||||||
public ClientConfig(ForgeConfigSpec.Builder builder)
|
public ClientConfig(ModConfigSpec.Builder builder)
|
||||||
{
|
{
|
||||||
this.settings = new ConfigCategorySettings(builder);
|
this.settings = new ConfigCategorySettings(builder);
|
||||||
this.butcher = new ConfigCategoryButcher(builder);
|
this.butcher = new ConfigCategoryButcher(builder);
|
||||||
@@ -77,7 +77,7 @@ public class Config
|
|||||||
return Config.CLIENT.getSliders();
|
return Config.CLIENT.getSliders();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static <T> void set(ForgeConfigSpec.ConfigValue<T> configValue, T value)
|
protected static <T> void set(ModConfigSpec.ConfigValue<T> configValue, T value)
|
||||||
{
|
{
|
||||||
if(configValue != null && value != null && (!value.equals(configValue.get()) || configValue.get() instanceof List<?>))
|
if(configValue != null && value != null && (!value.equals(configValue.get()) || configValue.get() instanceof List<?>))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,15 +7,15 @@ import java.util.stream.Collectors;
|
|||||||
import com.google.common.base.Predicates;
|
import com.google.common.base.Predicates;
|
||||||
|
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraftforge.common.ForgeConfigSpec;
|
import net.neoforged.neoforge.common.ModConfigSpec;
|
||||||
import net.minecraftforge.common.ForgeConfigSpec.ConfigValue;
|
import net.neoforged.neoforge.common.ModConfigSpec.ConfigValue;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
|
||||||
public class ConfigCategoryButcher
|
public class ConfigCategoryButcher
|
||||||
{
|
{
|
||||||
private final ConfigValue<List<? extends String>> entities;
|
private final ConfigValue<List<? extends String>> entities;
|
||||||
|
|
||||||
public ConfigCategoryButcher(ForgeConfigSpec.Builder builder)
|
public ConfigCategoryButcher(ModConfigSpec.Builder builder)
|
||||||
{
|
{
|
||||||
builder.push("butcher");
|
builder.push("butcher");
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ public class ConfigCategoryButcher
|
|||||||
{
|
{
|
||||||
if(string != null)
|
if(string != null)
|
||||||
{
|
{
|
||||||
return ForgeRegistries.ENTITY_TYPES.containsKey(ResourceLocation.tryParse(string.toString()));
|
return BuiltInRegistries.ENTITY_TYPE.containsKey(ResourceLocation.tryParse(string.toString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
package exopandora.worldhandler.config;
|
package exopandora.worldhandler.config;
|
||||||
|
|
||||||
import exopandora.worldhandler.util.BlockPlacingMode;
|
import exopandora.worldhandler.util.BlockPlacingMode;
|
||||||
import net.minecraftforge.common.ForgeConfigSpec;
|
import net.neoforged.neoforge.common.ModConfigSpec;
|
||||||
import net.minecraftforge.common.ForgeConfigSpec.BooleanValue;
|
import net.neoforged.neoforge.common.ModConfigSpec.BooleanValue;
|
||||||
import net.minecraftforge.common.ForgeConfigSpec.ConfigValue;
|
import net.neoforged.neoforge.common.ModConfigSpec.ConfigValue;
|
||||||
import net.minecraftforge.common.ForgeConfigSpec.IntValue;
|
import net.neoforged.neoforge.common.ModConfigSpec.IntValue;
|
||||||
|
|
||||||
public class ConfigCategorySettings
|
public class ConfigCategorySettings
|
||||||
{
|
{
|
||||||
@@ -23,7 +23,7 @@ public class ConfigCategorySettings
|
|||||||
private final IntValue midnight;
|
private final IntValue midnight;
|
||||||
private final ConfigValue<BlockPlacingMode> blockPlacingMode;
|
private final ConfigValue<BlockPlacingMode> blockPlacingMode;
|
||||||
|
|
||||||
public ConfigCategorySettings(ForgeConfigSpec.Builder builder)
|
public ConfigCategorySettings(ModConfigSpec.Builder builder)
|
||||||
{
|
{
|
||||||
builder.push("settings");
|
builder.push("settings");
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package exopandora.worldhandler.config;
|
package exopandora.worldhandler.config;
|
||||||
|
|
||||||
import net.minecraftforge.common.ForgeConfigSpec;
|
import net.neoforged.neoforge.common.ModConfigSpec;
|
||||||
import net.minecraftforge.common.ForgeConfigSpec.BooleanValue;
|
import net.neoforged.neoforge.common.ModConfigSpec.BooleanValue;
|
||||||
import net.minecraftforge.common.ForgeConfigSpec.ConfigValue;
|
import net.neoforged.neoforge.common.ModConfigSpec.ConfigValue;
|
||||||
import net.minecraftforge.common.ForgeConfigSpec.IntValue;
|
import net.neoforged.neoforge.common.ModConfigSpec.IntValue;
|
||||||
|
|
||||||
public class ConfigCategorySkin
|
public class ConfigCategorySkin
|
||||||
{
|
{
|
||||||
@@ -21,7 +21,7 @@ public class ConfigCategorySkin
|
|||||||
private final BooleanValue sharpEdges;
|
private final BooleanValue sharpEdges;
|
||||||
private final BooleanValue drawBackground;
|
private final BooleanValue drawBackground;
|
||||||
|
|
||||||
public ConfigCategorySkin(ForgeConfigSpec.Builder builder)
|
public ConfigCategorySkin(ModConfigSpec.Builder builder)
|
||||||
{
|
{
|
||||||
builder.push("skin");
|
builder.push("skin");
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package exopandora.worldhandler.config;
|
package exopandora.worldhandler.config;
|
||||||
|
|
||||||
import net.minecraftforge.common.ForgeConfigSpec;
|
import net.neoforged.neoforge.common.ModConfigSpec;
|
||||||
import net.minecraftforge.common.ForgeConfigSpec.DoubleValue;
|
import net.neoforged.neoforge.common.ModConfigSpec.DoubleValue;
|
||||||
|
|
||||||
public class ConfigCategorySliders
|
public class ConfigCategorySliders
|
||||||
{
|
{
|
||||||
@@ -15,7 +15,7 @@ public class ConfigCategorySliders
|
|||||||
private final DoubleValue maxPlayerPoints;
|
private final DoubleValue maxPlayerPoints;
|
||||||
private final DoubleValue maxTriggerValue;
|
private final DoubleValue maxTriggerValue;
|
||||||
|
|
||||||
public ConfigCategorySliders(ForgeConfigSpec.Builder builder)
|
public ConfigCategorySliders(ModConfigSpec.Builder builder)
|
||||||
{
|
{
|
||||||
builder.push("sliders");
|
builder.push("sliders");
|
||||||
|
|
||||||
|
|||||||
@@ -13,10 +13,9 @@ import net.minecraft.client.renderer.MultiBufferSource.BufferSource;
|
|||||||
import net.minecraft.client.renderer.RenderType;
|
import net.minecraft.client.renderer.RenderType;
|
||||||
import net.minecraft.world.phys.AABB;
|
import net.minecraft.world.phys.AABB;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
import net.minecraftforge.client.event.RenderLevelStageEvent;
|
import net.neoforged.neoforge.client.event.RenderLevelStageEvent;
|
||||||
import net.minecraftforge.event.TickEvent;
|
import net.neoforged.neoforge.client.event.ClientTickEvent;
|
||||||
import net.minecraftforge.event.TickEvent.ClientTickEvent;
|
import net.neoforged.bus.api.SubscribeEvent;
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|
||||||
|
|
||||||
public class ClientEventHandler
|
public class ClientEventHandler
|
||||||
{
|
{
|
||||||
@@ -41,8 +40,7 @@ public class ClientEventHandler
|
|||||||
|
|
||||||
if(aabb.getCenter().distanceTo(projected) < 96)
|
if(aabb.getCenter().distanceTo(projected) < 96)
|
||||||
{
|
{
|
||||||
PoseStack matrix = new PoseStack();
|
PoseStack matrix = event.getPoseStack();
|
||||||
matrix.mulPose(event.getPoseStack());
|
|
||||||
matrix.pushPose();
|
matrix.pushPose();
|
||||||
matrix.translate(-projected.x(), -projected.y(), -projected.z());
|
matrix.translate(-projected.x(), -projected.y(), -projected.z());
|
||||||
|
|
||||||
@@ -60,9 +58,9 @@ public class ClientEventHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public static void clientTickEvent(ClientTickEvent event)
|
public static void clientTickEvent(ClientTickEvent.Pre event)
|
||||||
{
|
{
|
||||||
if(TickEvent.Phase.START.equals(event.phase) && ClientEventHandler.openGui)
|
if(ClientEventHandler.openGui)
|
||||||
{
|
{
|
||||||
ClientEventHandler.openGui = false;
|
ClientEventHandler.openGui = false;
|
||||||
ActionHelper.displayGui();
|
ActionHelper.displayGui();
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import exopandora.worldhandler.util.ActionHelper;
|
|||||||
import exopandora.worldhandler.util.BlockHelper;
|
import exopandora.worldhandler.util.BlockHelper;
|
||||||
import net.minecraft.client.KeyMapping;
|
import net.minecraft.client.KeyMapping;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraftforge.client.event.InputEvent;
|
import net.neoforged.neoforge.client.event.InputEvent;
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.neoforged.bus.api.SubscribeEvent;
|
||||||
|
|
||||||
public class KeyHandler
|
public class KeyHandler
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public class Categories
|
|||||||
|
|
||||||
public static Category getRegisteredCategory(String name)
|
public static Category getRegisteredCategory(String name)
|
||||||
{
|
{
|
||||||
Category category = Category.REGISTRY.getValue(ResourceLocation.fromNamespaceAndPath(Main.MODID, name));
|
Category category = Category.REGISTRY.get(ResourceLocation.fromNamespaceAndPath(Main.MODID, name));
|
||||||
|
|
||||||
if(category == null)
|
if(category == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,20 +15,19 @@ import exopandora.worldhandler.Main;
|
|||||||
import exopandora.worldhandler.gui.content.Content;
|
import exopandora.worldhandler.gui.content.Content;
|
||||||
import exopandora.worldhandler.usercontent.UsercontentConfig;
|
import exopandora.worldhandler.usercontent.UsercontentConfig;
|
||||||
import exopandora.worldhandler.usercontent.UsercontentLoader;
|
import exopandora.worldhandler.usercontent.UsercontentLoader;
|
||||||
import exopandora.worldhandler.usercontent.model.JsonTab;
|
import exopandora.worldhandler.usercontent.model.JsonTab;
|
||||||
import exopandora.worldhandler.util.RegistryHelper;
|
import exopandora.worldhandler.util.RegistryHelper;
|
||||||
import net.minecraft.core.Registry;
|
import net.minecraft.core.Registry;
|
||||||
import net.minecraft.resources.ResourceKey;
|
import net.minecraft.resources.ResourceKey;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.neoforged.bus.api.SubscribeEvent;
|
||||||
import net.minecraftforge.registries.IForgeRegistry;
|
import net.neoforged.neoforge.registries.NewRegistryEvent;
|
||||||
import net.minecraftforge.registries.NewRegistryEvent;
|
import net.neoforged.neoforge.registries.RegisterEvent;
|
||||||
import net.minecraftforge.registries.RegisterEvent;
|
import net.neoforged.neoforge.registries.RegistryBuilder;
|
||||||
import net.minecraftforge.registries.RegistryBuilder;
|
|
||||||
|
|
||||||
public class Category
|
public class Category
|
||||||
{
|
{
|
||||||
public static IForgeRegistry<Category> REGISTRY;
|
public static Registry<Category> REGISTRY;
|
||||||
public static final ResourceKey<Registry<Category>> REGISTRY_KEY = ResourceKey.createRegistryKey(ResourceLocation.fromNamespaceAndPath(Main.MODID, "category"));
|
public static final ResourceKey<Registry<Category>> REGISTRY_KEY = ResourceKey.createRegistryKey(ResourceLocation.fromNamespaceAndPath(Main.MODID, "category"));
|
||||||
public static final Map<String, List<String>> DEFAULT_CATEGORIES = new CategoriesBuilder()
|
public static final Map<String, List<String>> DEFAULT_CATEGORIES = new CategoriesBuilder()
|
||||||
.add("main", "main", "containers", "multiplayer")
|
.add("main", "main", "containers", "multiplayer")
|
||||||
@@ -81,16 +80,13 @@ public class Category
|
|||||||
@Nullable
|
@Nullable
|
||||||
public Content getContent(int index)
|
public Content getContent(int index)
|
||||||
{
|
{
|
||||||
return Content.REGISTRY.getValue(this.contents.get(index));
|
return Content.REGISTRY.get(this.contents.get(index));
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public static void createRegistry(NewRegistryEvent event)
|
public static void createRegistry(NewRegistryEvent event)
|
||||||
{
|
{
|
||||||
event.create(new RegistryBuilder<Category>()
|
REGISTRY = event.create(new RegistryBuilder<Category>(REGISTRY_KEY).sync(false));
|
||||||
.setName(REGISTRY_KEY.location())
|
|
||||||
.disableSaving()
|
|
||||||
.disableSync(), registry -> REGISTRY = registry);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
@@ -102,7 +98,7 @@ public class Category
|
|||||||
{
|
{
|
||||||
RegistryHelper.register(event, REGISTRY_KEY, entry.getKey(), () ->
|
RegistryHelper.register(event, REGISTRY_KEY, entry.getKey(), () ->
|
||||||
{
|
{
|
||||||
var keys = entry.getValue().stream()
|
var keys = entry.getValue().stream()
|
||||||
.map(key -> ResourceLocation.fromNamespaceAndPath(Main.MODID, key))
|
.map(key -> ResourceLocation.fromNamespaceAndPath(Main.MODID, key))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
return new Category(keys);
|
return new Category(keys);
|
||||||
|
|||||||
@@ -35,28 +35,24 @@ import exopandora.worldhandler.gui.content.impl.ContentUsercontent;
|
|||||||
import exopandora.worldhandler.gui.content.impl.ContentWorldInfo;
|
import exopandora.worldhandler.gui.content.impl.ContentWorldInfo;
|
||||||
import exopandora.worldhandler.usercontent.UsercontentLoader;
|
import exopandora.worldhandler.usercontent.UsercontentLoader;
|
||||||
import exopandora.worldhandler.util.RegistryHelper;
|
import exopandora.worldhandler.util.RegistryHelper;
|
||||||
import net.minecraft.core.Registry;
|
import net.minecraft.core.Registry;
|
||||||
import net.minecraft.resources.ResourceKey;
|
import net.minecraft.resources.ResourceKey;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.neoforged.bus.api.SubscribeEvent;
|
||||||
import net.minecraftforge.registries.IForgeRegistry;
|
import net.neoforged.neoforge.registries.NewRegistryEvent;
|
||||||
import net.minecraftforge.registries.NewRegistryEvent;
|
import net.neoforged.neoforge.registries.RegisterEvent;
|
||||||
import net.minecraftforge.registries.RegisterEvent;
|
import net.neoforged.neoforge.registries.RegistryBuilder;
|
||||||
import net.minecraftforge.registries.RegistryBuilder;
|
|
||||||
|
|
||||||
public abstract class Content implements IContent
|
public abstract class Content implements IContent
|
||||||
{
|
{
|
||||||
public static IForgeRegistry<Content> REGISTRY;
|
public static Registry<Content> REGISTRY;
|
||||||
public static final ResourceKey<Registry<Content>> REGISTRY_KEY = ResourceKey.createRegistryKey(ResourceLocation.fromNamespaceAndPath(Main.MODID, "content"));
|
public static final ResourceKey<Registry<Content>> REGISTRY_KEY = ResourceKey.createRegistryKey(ResourceLocation.fromNamespaceAndPath(Main.MODID, "content"));
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public static void createRegistry(NewRegistryEvent event)
|
public static void createRegistry(NewRegistryEvent event)
|
||||||
{
|
{
|
||||||
event.create(new RegistryBuilder<Content>()
|
REGISTRY = event.create(new RegistryBuilder<Content>(REGISTRY_KEY).sync(false));
|
||||||
.setName(REGISTRY_KEY.location())
|
}
|
||||||
.disableSaving()
|
|
||||||
.disableSync(), registry -> REGISTRY = registry);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public static void register(RegisterEvent event)
|
public static void register(RegisterEvent event)
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public class Contents
|
|||||||
|
|
||||||
public static Content getRegisteredContent(String name)
|
public static Content getRegisteredContent(String name)
|
||||||
{
|
{
|
||||||
Content content = Content.REGISTRY.getValue(ResourceLocation.fromNamespaceAndPath(Main.MODID, name));
|
Content content = Content.REGISTRY.get(ResourceLocation.fromNamespaceAndPath(Main.MODID, name));
|
||||||
|
|
||||||
if(content == null)
|
if(content == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import net.minecraft.world.entity.EntityType;
|
|||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.phys.AABB;
|
import net.minecraft.world.phys.AABB;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
|
||||||
public class ContentButcher extends Content
|
public class ContentButcher extends Content
|
||||||
{
|
{
|
||||||
@@ -102,7 +102,7 @@ public class ContentButcher extends Content
|
|||||||
|
|
||||||
container.addRenderableWidget(slaughter = new GuiButtonBase(x + 58, y + 48, 114, 20, Component.translatable("gui.worldhandler.butcher.slaughter"), () ->
|
container.addRenderableWidget(slaughter = new GuiButtonBase(x + 58, y + 48, 114, 20, Component.translatable("gui.worldhandler.butcher.slaughter"), () ->
|
||||||
{
|
{
|
||||||
Collection<EntityType<?>> entities = Config.getButcher().getEntities().stream().map(ForgeRegistries.ENTITY_TYPES::getValue).filter(Predicates.notNull()).collect(Collectors.toList());
|
Collection<EntityType<?>> entities = Config.getButcher().getEntities().stream().map(BuiltInRegistries.ENTITY_TYPE::get).filter(Predicates.notNull()).collect(Collectors.toList());
|
||||||
ContentButcher.slaughter(container.getPlayer(), entities, Integer.parseInt(this.radius));
|
ContentButcher.slaughter(container.getPlayer(), entities, Integer.parseInt(this.radius));
|
||||||
}));
|
}));
|
||||||
slaughter.active = enabled && !Config.getButcher().getEntities().isEmpty();
|
slaughter.active = enabled && !Config.getButcher().getEntities().isEmpty();
|
||||||
@@ -132,7 +132,7 @@ public class ContentButcher extends Content
|
|||||||
{
|
{
|
||||||
KillCommandBuilder kill = new KillCommandBuilder();
|
KillCommandBuilder kill = new KillCommandBuilder();
|
||||||
kill.targets().setSelectorType(SelectorTypes.ALL_ENTITIES);
|
kill.targets().setSelectorType(SelectorTypes.ALL_ENTITIES);
|
||||||
kill.targets().setType(ForgeRegistries.ENTITY_TYPES.getKey(entity));
|
kill.targets().setType(BuiltInRegistries.ENTITY_TYPE.getKey(entity));
|
||||||
kill.targets().setDistanceMax(radius);
|
kill.targets().setDistanceMax(radius);
|
||||||
CommandHelper.sendCommand(username, kill, KillCommandBuilder.Label.KILL_TARGETS);
|
CommandHelper.sendCommand(username, kill, KillCommandBuilder.Label.KILL_TARGETS);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import exopandora.worldhandler.util.ActionHelper;
|
|||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.world.entity.EntityType;
|
import net.minecraft.world.entity.EntityType;
|
||||||
import net.minecraft.world.entity.MobCategory;
|
import net.minecraft.world.entity.MobCategory;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
|
||||||
public class ContentButcherPresets extends ContentChild
|
public class ContentButcherPresets extends ContentChild
|
||||||
{
|
{
|
||||||
@@ -42,22 +42,22 @@ public class ContentButcherPresets extends ContentChild
|
|||||||
|
|
||||||
container.addRenderableWidget(new GuiButtonBase(x + 58, y, 114, 20, Component.translatable("gui.worldhandler.butcher.presets.passive_mobs"), () ->
|
container.addRenderableWidget(new GuiButtonBase(x + 58, y, 114, 20, Component.translatable("gui.worldhandler.butcher.presets.passive_mobs"), () ->
|
||||||
{
|
{
|
||||||
ContentButcher.slaughter(container.getPlayer(), ForgeRegistries.ENTITY_TYPES.getValues().stream().filter(entity -> !MobCategory.MONSTER.equals(entity.getCategory()) && !MobCategory.MISC.equals(entity.getCategory())).collect(Collectors.toList()), this.radius);
|
ContentButcher.slaughter(container.getPlayer(), BuiltInRegistries.ENTITY_TYPE.stream().toList().stream().filter(entity -> !MobCategory.MONSTER.equals(entity.getCategory()) && !MobCategory.MISC.equals(entity.getCategory())).collect(Collectors.toList()), this.radius);
|
||||||
ActionHelper.open(this.getParentContent());
|
ActionHelper.open(this.getParentContent());
|
||||||
}));
|
}));
|
||||||
container.addRenderableWidget(new GuiButtonBase(x + 58, y + 24, 114, 20, Component.translatable("gui.worldhandler.butcher.presets.hostile_mobs"), () ->
|
container.addRenderableWidget(new GuiButtonBase(x + 58, y + 24, 114, 20, Component.translatable("gui.worldhandler.butcher.presets.hostile_mobs"), () ->
|
||||||
{
|
{
|
||||||
ContentButcher.slaughter(container.getPlayer(), ForgeRegistries.ENTITY_TYPES.getValues().stream().filter(entity -> MobCategory.MONSTER.equals(entity.getCategory())).collect(Collectors.toList()), this.radius);
|
ContentButcher.slaughter(container.getPlayer(), BuiltInRegistries.ENTITY_TYPE.stream().toList().stream().filter(entity -> MobCategory.MONSTER.equals(entity.getCategory())).collect(Collectors.toList()), this.radius);
|
||||||
ActionHelper.open(this.getParentContent());
|
ActionHelper.open(this.getParentContent());
|
||||||
}));
|
}));
|
||||||
container.addRenderableWidget(new GuiButtonBase(x + 58, y + 48, 114, 20, Component.translatable("gui.worldhandler.butcher.presets.players"), () ->
|
container.addRenderableWidget(new GuiButtonBase(x + 58, y + 48, 114, 20, Component.translatable("gui.worldhandler.butcher.presets.players"), () ->
|
||||||
{
|
{
|
||||||
ContentButcher.slaughter(container.getPlayer(), ForgeRegistries.ENTITY_TYPES.getValues().stream().filter(entity -> EntityType.PLAYER.equals(entity)).collect(Collectors.toList()), this.radius);
|
ContentButcher.slaughter(container.getPlayer(), BuiltInRegistries.ENTITY_TYPE.stream().toList().stream().filter(entity -> EntityType.PLAYER.equals(entity)).collect(Collectors.toList()), this.radius);
|
||||||
ActionHelper.open(this.getParentContent());
|
ActionHelper.open(this.getParentContent());
|
||||||
}));
|
}));
|
||||||
container.addRenderableWidget(new GuiButtonBase(x + 58, y + 72, 114, 20, Component.translatable("gui.worldhandler.butcher.presets.entities"), () ->
|
container.addRenderableWidget(new GuiButtonBase(x + 58, y + 72, 114, 20, Component.translatable("gui.worldhandler.butcher.presets.entities"), () ->
|
||||||
{
|
{
|
||||||
ContentButcher.slaughter(container.getPlayer(), ForgeRegistries.ENTITY_TYPES.getValues().stream().filter(entity -> MobCategory.MISC.equals(entity.getCategory()) && !EntityType.PLAYER.equals(entity)).collect(Collectors.toList()), this.radius);
|
ContentButcher.slaughter(container.getPlayer(), BuiltInRegistries.ENTITY_TYPE.stream().toList().stream().filter(entity -> MobCategory.MISC.equals(entity.getCategory()) && !EntityType.PLAYER.equals(entity)).collect(Collectors.toList()), this.radius);
|
||||||
ActionHelper.open(this.getParentContent());
|
ActionHelper.open(this.getParentContent());
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import net.minecraft.network.chat.Component;
|
|||||||
import net.minecraft.network.chat.MutableComponent;
|
import net.minecraft.network.chat.MutableComponent;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.entity.EntityType;
|
import net.minecraft.world.entity.EntityType;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
|
||||||
public class ContentButcherSettings extends ContentChild
|
public class ContentButcherSettings extends ContentChild
|
||||||
{
|
{
|
||||||
@@ -24,7 +24,7 @@ public class ContentButcherSettings extends ContentChild
|
|||||||
@Override
|
@Override
|
||||||
public void initGui(Container container, int x, int y)
|
public void initGui(Container container, int x, int y)
|
||||||
{
|
{
|
||||||
List<EntityType<?>> list = ForgeRegistries.ENTITY_TYPES.getValues().stream().filter(EntityType::canSummon).collect(Collectors.toList());
|
List<EntityType<?>> list = BuiltInRegistries.ENTITY_TYPE.stream().toList().stream().filter(EntityType::canSummon).collect(Collectors.toList());
|
||||||
|
|
||||||
MenuPageList<EntityType<?>> entities = new MenuPageList<EntityType<?>>(x, y, list, 114, 20, 3, container, new ILogicPageList<EntityType<?>>()
|
MenuPageList<EntityType<?>> entities = new MenuPageList<EntityType<?>>(x, y, list, 114, 20, 3, container, new ILogicPageList<EntityType<?>>()
|
||||||
{
|
{
|
||||||
@@ -37,13 +37,13 @@ public class ContentButcherSettings extends ContentChild
|
|||||||
@Override
|
@Override
|
||||||
public MutableComponent toTooltip(EntityType<?> item)
|
public MutableComponent toTooltip(EntityType<?> item)
|
||||||
{
|
{
|
||||||
return Component.literal(ForgeRegistries.ENTITY_TYPES.getKey(item).toString());
|
return Component.literal(BuiltInRegistries.ENTITY_TYPE.getKey(item).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(EntityType<?> item)
|
public void onClick(EntityType<?> item)
|
||||||
{
|
{
|
||||||
ContentButcherSettings.this.entity = ForgeRegistries.ENTITY_TYPES.getKey(item);
|
ContentButcherSettings.this.entity = BuiltInRegistries.ENTITY_TYPE.getKey(item);
|
||||||
container.initButtons();
|
container.initButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import net.minecraft.network.chat.Component;
|
|||||||
import net.minecraft.network.chat.MutableComponent;
|
import net.minecraft.network.chat.MutableComponent;
|
||||||
import net.minecraft.world.entity.EntityType;
|
import net.minecraft.world.entity.EntityType;
|
||||||
import net.minecraft.world.level.block.Blocks;
|
import net.minecraft.world.level.block.Blocks;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
|
||||||
public class ContentCommandStack extends ContentChild
|
public class ContentCommandStack extends ContentChild
|
||||||
{
|
{
|
||||||
@@ -59,14 +59,14 @@ public class ContentCommandStack extends ContentChild
|
|||||||
this.activatorRail.setBlockState(Blocks.ACTIVATOR_RAIL.defaultBlockState());
|
this.activatorRail.setBlockState(Blocks.ACTIVATOR_RAIL.defaultBlockState());
|
||||||
this.builderCommandStack.nbt().addTagProvider(this.activatorRail);
|
this.builderCommandStack.nbt().addTagProvider(this.activatorRail);
|
||||||
|
|
||||||
EntityTag redstoneBlock = new EntityTag(ForgeRegistries.ENTITY_TYPES.getKey(EntityType.FALLING_BLOCK));
|
EntityTag redstoneBlock = new EntityTag(BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.FALLING_BLOCK));
|
||||||
redstoneBlock.setTime(1);
|
redstoneBlock.setTime(1);
|
||||||
redstoneBlock.setBlockState(Blocks.REDSTONE_BLOCK.defaultBlockState());
|
redstoneBlock.setBlockState(Blocks.REDSTONE_BLOCK.defaultBlockState());
|
||||||
this.activatorRail.addPassenger(redstoneBlock);
|
this.activatorRail.addPassenger(redstoneBlock);
|
||||||
|
|
||||||
this.addCommand(0);
|
this.addCommand(0);
|
||||||
|
|
||||||
EntityTag blockRemover = new EntityTag(ForgeRegistries.ENTITY_TYPES.getKey(EntityType.COMMAND_BLOCK_MINECART));
|
EntityTag blockRemover = new EntityTag(BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.COMMAND_BLOCK_MINECART));
|
||||||
SetBlockCommandBuilder builder = new SetBlockCommandBuilder();
|
SetBlockCommandBuilder builder = new SetBlockCommandBuilder();
|
||||||
builder.pos().setX(new Coordinate.Ints(Coordinate.Type.RELATIVE));
|
builder.pos().setX(new Coordinate.Ints(Coordinate.Type.RELATIVE));
|
||||||
builder.pos().setY(new Coordinate.Ints(-2, Coordinate.Type.RELATIVE));
|
builder.pos().setY(new Coordinate.Ints(-2, Coordinate.Type.RELATIVE));
|
||||||
@@ -87,10 +87,10 @@ public class ContentCommandStack extends ContentChild
|
|||||||
blockRemover.setCommand(builder.toCommand(SetBlockCommandBuilder.Label.DESTROY, false));
|
blockRemover.setCommand(builder.toCommand(SetBlockCommandBuilder.Label.DESTROY, false));
|
||||||
this.activatorRail.addPassenger(blockRemover);
|
this.activatorRail.addPassenger(blockRemover);
|
||||||
|
|
||||||
EntityTag entityRemover = new EntityTag(ForgeRegistries.ENTITY_TYPES.getKey(EntityType.COMMAND_BLOCK_MINECART));
|
EntityTag entityRemover = new EntityTag(BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.COMMAND_BLOCK_MINECART));
|
||||||
KillCommandBuilder kill = new KillCommandBuilder();
|
KillCommandBuilder kill = new KillCommandBuilder();
|
||||||
kill.targets().setSelectorType(SelectorTypes.ALL_ENTITIES);
|
kill.targets().setSelectorType(SelectorTypes.ALL_ENTITIES);
|
||||||
kill.targets().setType(ForgeRegistries.ENTITY_TYPES.getKey(EntityType.COMMAND_BLOCK_MINECART));
|
kill.targets().setType(BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.COMMAND_BLOCK_MINECART));
|
||||||
kill.targets().setDistanceMax(1.0D);
|
kill.targets().setDistanceMax(1.0D);
|
||||||
entityRemover.setCommand(kill.toCommand(KillCommandBuilder.Label.KILL_TARGETS, false));
|
entityRemover.setCommand(kill.toCommand(KillCommandBuilder.Label.KILL_TARGETS, false));
|
||||||
this.activatorRail.addPassenger(entityRemover);
|
this.activatorRail.addPassenger(entityRemover);
|
||||||
@@ -246,7 +246,7 @@ public class ContentCommandStack extends ContentChild
|
|||||||
|
|
||||||
private void addCommand(int index)
|
private void addCommand(int index)
|
||||||
{
|
{
|
||||||
this.activatorRail.addPassenger(index + HEAD_LENGTH, new EntityTag(ForgeRegistries.ENTITY_TYPES.getKey(EntityType.COMMAND_BLOCK_MINECART)));
|
this.activatorRail.addPassenger(index + HEAD_LENGTH, new EntityTag(BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.COMMAND_BLOCK_MINECART)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeCommand(int index)
|
private void removeCommand(int index)
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import net.minecraft.network.chat.Component;
|
|||||||
import net.minecraft.network.chat.MutableComponent;
|
import net.minecraft.network.chat.MutableComponent;
|
||||||
import net.minecraft.world.entity.ai.attributes.Attribute;
|
import net.minecraft.world.entity.ai.attributes.Attribute;
|
||||||
import net.minecraft.world.item.enchantment.Enchantment;
|
import net.minecraft.world.item.enchantment.Enchantment;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
|
||||||
public class ContentCustomItem extends Content
|
public class ContentCustomItem extends Content
|
||||||
{
|
{
|
||||||
@@ -188,7 +188,7 @@ public class ContentCustomItem extends Content
|
|||||||
@Override
|
@Override
|
||||||
public MutableComponent toTooltip(Attribute attribute)
|
public MutableComponent toTooltip(Attribute attribute)
|
||||||
{
|
{
|
||||||
return Component.literal(ForgeRegistries.ATTRIBUTES.getKey(attribute).toString());
|
return Component.literal(BuiltInRegistries.ATTRIBUTE.getKey(attribute).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import net.minecraft.network.chat.Component;
|
|||||||
import net.minecraft.network.chat.MutableComponent;
|
import net.minecraft.network.chat.MutableComponent;
|
||||||
import net.minecraft.resources.ResourceKey;
|
import net.minecraft.resources.ResourceKey;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
|
||||||
public class ContentLocate extends Content
|
public class ContentLocate extends Content
|
||||||
{
|
{
|
||||||
@@ -158,7 +158,7 @@ public class ContentLocate extends Content
|
|||||||
}
|
}
|
||||||
else if(Page.POI.equals(this.page))
|
else if(Page.POI.equals(this.page))
|
||||||
{
|
{
|
||||||
List<ResourceLocation> pois = new ArrayList<ResourceLocation>(ForgeRegistries.POI_TYPES.getKeys());
|
List<ResourceLocation> pois = new ArrayList<ResourceLocation>(BuiltInRegistries.POINT_OF_INTEREST_TYPE.keySet());
|
||||||
MenuPageList<ResourceLocation> list = new MenuPageList<ResourceLocation>(x + 118, y, pois, 114, 20, 3, container, new ILogicPageList<ResourceLocation>()
|
MenuPageList<ResourceLocation> list = new MenuPageList<ResourceLocation>(x + 118, y, pois, 114, 20, 3, container, new ILogicPageList<ResourceLocation>()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class ContentNoteEditor extends Content
|
|||||||
if(this.isActive)
|
if(this.isActive)
|
||||||
{
|
{
|
||||||
BlockPos pos = this.builderNoteEditor.pos().getBlockPos();
|
BlockPos pos = this.builderNoteEditor.pos().getBlockPos();
|
||||||
SoundEvent sound = getSoundEvent(pos).getSoundEvent().get();
|
SoundEvent sound = getSoundEvent(pos).getSoundEvent().value();
|
||||||
|
|
||||||
container.addRenderableWidget(new GuiButtonPiano(x - 3 + 15, y, 14, 92, Component.translatable("gui.worldhandler.blocks.note_block_editor.g"), sound, 0.53F, Type.NORMAL, () -> this.setNote(container.getPlayer(), 1)));
|
container.addRenderableWidget(new GuiButtonPiano(x - 3 + 15, y, 14, 92, Component.translatable("gui.worldhandler.blocks.note_block_editor.g"), sound, 0.53F, Type.NORMAL, () -> this.setNote(container.getPlayer(), 1)));
|
||||||
container.addRenderableWidget(new GuiButtonPiano(x - 3 + 15 * 2, y, 14, 92, Component.translatable("gui.worldhandler.blocks.note_block_editor.a"), sound, 0.6F, Type.NORMAL, () -> this.setNote(container.getPlayer(), 3)));
|
container.addRenderableWidget(new GuiButtonPiano(x - 3 + 15 * 2, y, 14, 92, Component.translatable("gui.worldhandler.blocks.note_block_editor.a"), sound, 0.6F, Type.NORMAL, () -> this.setNote(container.getPlayer(), 3)));
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import net.minecraft.network.chat.MutableComponent;
|
|||||||
import net.minecraft.world.effect.MobEffect;
|
import net.minecraft.world.effect.MobEffect;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
import net.minecraft.world.item.Items;
|
import net.minecraft.world.item.Items;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
|
||||||
public class ContentPotions extends ContentChild
|
public class ContentPotions extends ContentChild
|
||||||
{
|
{
|
||||||
@@ -72,7 +72,7 @@ public class ContentPotions extends ContentChild
|
|||||||
@Override
|
@Override
|
||||||
public void initGui(Container container, int x, int y)
|
public void initGui(Container container, int x, int y)
|
||||||
{
|
{
|
||||||
MenuPageList<MobEffect> potions = new MenuPageList<MobEffect>(x, y, new ArrayList<MobEffect>(ForgeRegistries.MOB_EFFECTS.getValues()), 114, 20, 3, container, new ILogicPageList<MobEffect>()
|
MenuPageList<MobEffect> potions = new MenuPageList<MobEffect>(x, y, new ArrayList<MobEffect>(BuiltInRegistries.MOB_EFFECT.stream().toList()), 114, 20, 3, container, new ILogicPageList<MobEffect>()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public MutableComponent translate(MobEffect effect)
|
public MutableComponent translate(MobEffect effect)
|
||||||
@@ -83,7 +83,7 @@ public class ContentPotions extends ContentChild
|
|||||||
@Override
|
@Override
|
||||||
public MutableComponent toTooltip(MobEffect effect)
|
public MutableComponent toTooltip(MobEffect effect)
|
||||||
{
|
{
|
||||||
return Component.literal(ForgeRegistries.MOB_EFFECTS.getKey(effect).toString());
|
return Component.literal(BuiltInRegistries.MOB_EFFECT.getKey(effect).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -163,7 +163,7 @@ public class ContentPotions extends ContentChild
|
|||||||
tag.setShowParticles(!tag.doShowParticles());
|
tag.setShowParticles(!tag.doShowParticles());
|
||||||
container.init();
|
container.init();
|
||||||
}));
|
}));
|
||||||
container.addRenderableWidget(new GuiSlider(x + 118, y, 114, 20, 1, Config.getSliders().getMaxPotionAmplifier(), 1, container, new LogicSliderSimple("amplifier" + ForgeRegistries.MOB_EFFECTS.getKey(effect), Component.translatable("gui.worldhandler.potions.effect.amplifier"), value ->
|
container.addRenderableWidget(new GuiSlider(x + 118, y, 114, 20, 1, Config.getSliders().getMaxPotionAmplifier(), 1, container, new LogicSliderSimple("amplifier" + BuiltInRegistries.MOB_EFFECT.getKey(effect), Component.translatable("gui.worldhandler.potions.effect.amplifier"), value ->
|
||||||
{
|
{
|
||||||
this.builderPotion.amplifier().set((byte) (value.byteValue() - 1));
|
this.builderPotion.amplifier().set((byte) (value.byteValue() - 1));
|
||||||
tag.setAmplifier(value.byteValue());
|
tag.setAmplifier(value.byteValue());
|
||||||
@@ -174,17 +174,17 @@ public class ContentPotions extends ContentChild
|
|||||||
MobEffect effect = this.builderPotion.effect().getEffect();
|
MobEffect effect = this.builderPotion.effect().getEffect();
|
||||||
EffectInstance tag = this.effects.getOrCreate(effect);
|
EffectInstance tag = this.effects.getOrCreate(effect);
|
||||||
|
|
||||||
container.addRenderableWidget(new GuiSlider(x + 118, y, 114, 20, 0, 59, 0, container, new LogicSliderSimple("s" + ForgeRegistries.MOB_EFFECTS.getKey(effect), Component.translatable("gui.worldhandler.potion.time.seconds"), value ->
|
container.addRenderableWidget(new GuiSlider(x + 118, y, 114, 20, 0, 59, 0, container, new LogicSliderSimple("s" + BuiltInRegistries.MOB_EFFECT.getKey(effect), Component.translatable("gui.worldhandler.potion.time.seconds"), value ->
|
||||||
{
|
{
|
||||||
tag.setSeconds(value.intValue());
|
tag.setSeconds(value.intValue());
|
||||||
this.builderPotion.seconds().set(tag.toSeconds());
|
this.builderPotion.seconds().set(tag.toSeconds());
|
||||||
})));
|
})));
|
||||||
container.addRenderableWidget(new GuiSlider(x + 118, y + 24, 114, 20, 0, 59, 0, container, new LogicSliderSimple("m" + ForgeRegistries.MOB_EFFECTS.getKey(effect), Component.translatable("gui.worldhandler.potion.time.minutes"), value ->
|
container.addRenderableWidget(new GuiSlider(x + 118, y + 24, 114, 20, 0, 59, 0, container, new LogicSliderSimple("m" + BuiltInRegistries.MOB_EFFECT.getKey(effect), Component.translatable("gui.worldhandler.potion.time.minutes"), value ->
|
||||||
{
|
{
|
||||||
tag.setMinutes(value.intValue());
|
tag.setMinutes(value.intValue());
|
||||||
this.builderPotion.seconds().set(tag.toSeconds());
|
this.builderPotion.seconds().set(tag.toSeconds());
|
||||||
})));
|
})));
|
||||||
container.addRenderableWidget(new GuiSlider(x + 118, y + 48, 114, 20, 0, 99, 0, container, new LogicSliderSimple("h" + ForgeRegistries.MOB_EFFECTS.getKey(effect), Component.translatable("gui.worldhandler.potion.time.hours"), value ->
|
container.addRenderableWidget(new GuiSlider(x + 118, y + 48, 114, 20, 0, 99, 0, container, new LogicSliderSimple("h" + BuiltInRegistries.MOB_EFFECT.getKey(effect), Component.translatable("gui.worldhandler.potion.time.hours"), value ->
|
||||||
{
|
{
|
||||||
tag.setHours(value.intValue());
|
tag.setHours(value.intValue());
|
||||||
this.builderPotion.seconds().set(tag.toSeconds());
|
this.builderPotion.seconds().set(tag.toSeconds());
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ import net.minecraft.network.chat.MutableComponent;
|
|||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.stats.StatType;
|
import net.minecraft.stats.StatType;
|
||||||
import net.minecraft.stats.Stats;
|
import net.minecraft.stats.Stats;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
import net.minecraftforge.registries.IForgeRegistry;
|
import net.minecraft.core.Registry;
|
||||||
|
|
||||||
public class ContentScoreboardObjectives extends ContentScoreboard
|
public class ContentScoreboardObjectives extends ContentScoreboard
|
||||||
{
|
{
|
||||||
@@ -63,7 +63,7 @@ public class ContentScoreboardObjectives extends ContentScoreboard
|
|||||||
|
|
||||||
if(resource != null)
|
if(resource != null)
|
||||||
{
|
{
|
||||||
StatType<?> type = ForgeRegistries.STAT_TYPES.getValue(resource);
|
StatType<?> type = BuiltInRegistries.STAT_TYPE.get(resource);
|
||||||
|
|
||||||
if(type != null)
|
if(type != null)
|
||||||
{
|
{
|
||||||
@@ -144,9 +144,9 @@ public class ContentScoreboardObjectives extends ContentScoreboard
|
|||||||
@Nullable
|
@Nullable
|
||||||
private boolean isRegistryItem(ResourceLocation resource)
|
private boolean isRegistryItem(ResourceLocation resource)
|
||||||
{
|
{
|
||||||
IForgeRegistry<?>[] registries = new IForgeRegistry<?>[] {ForgeRegistries.BLOCKS, ForgeRegistries.ITEMS, ForgeRegistries.ENTITY_TYPES};
|
Registry<?>[] registries = new Registry<?>[] {BuiltInRegistries.BLOCK, BuiltInRegistries.ITEM, BuiltInRegistries.ENTITY_TYPE};
|
||||||
|
|
||||||
for(IForgeRegistry<?> registry : registries)
|
for(Registry<?> registry : registries)
|
||||||
{
|
{
|
||||||
if(registry.containsKey(resource))
|
if(registry.containsKey(resource))
|
||||||
{
|
{
|
||||||
@@ -154,7 +154,7 @@ public class ContentScoreboardObjectives extends ContentScoreboard
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ForgeRegistries.STAT_TYPES.containsKey(resource);
|
return BuiltInRegistries.STAT_TYPE.containsKey(resource);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ import net.minecraft.world.entity.ai.attributes.Attribute;
|
|||||||
import net.minecraft.world.entity.npc.VillagerProfession;
|
import net.minecraft.world.entity.npc.VillagerProfession;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
import net.minecraft.world.item.Items;
|
import net.minecraft.world.item.Items;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
|
||||||
public class ContentSummon extends Content
|
public class ContentSummon extends Content
|
||||||
{
|
{
|
||||||
@@ -246,7 +246,7 @@ public class ContentSummon extends Content
|
|||||||
@Override
|
@Override
|
||||||
public MutableComponent toTooltip(Attribute attribute)
|
public MutableComponent toTooltip(Attribute attribute)
|
||||||
{
|
{
|
||||||
return Component.literal(ForgeRegistries.ATTRIBUTES.getKey(attribute).toString());
|
return Component.literal(BuiltInRegistries.ATTRIBUTE.getKey(attribute).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -345,7 +345,7 @@ public class ContentSummon extends Content
|
|||||||
|
|
||||||
for(ResourceLocation location : this.sortedEffects())
|
for(ResourceLocation location : this.sortedEffects())
|
||||||
{
|
{
|
||||||
MobEffect effect = ForgeRegistries.MOB_EFFECTS.getValue(location);
|
MobEffect effect = BuiltInRegistries.MOB_EFFECT.get(location);
|
||||||
|
|
||||||
if(effect.equals(MobEffects.HARM) || effect.equals(MobEffects.HEAL))
|
if(effect.equals(MobEffects.HARM) || effect.equals(MobEffects.HEAL))
|
||||||
{
|
{
|
||||||
@@ -357,7 +357,7 @@ public class ContentSummon extends Content
|
|||||||
button1.active = false;
|
button1.active = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.potionPage == ForgeRegistries.MOB_EFFECTS.getKeys().size() - 3)
|
if(this.potionPage == BuiltInRegistries.MOB_EFFECT.keySet().size() - 3)
|
||||||
{
|
{
|
||||||
button2.active = false;
|
button2.active = false;
|
||||||
}
|
}
|
||||||
@@ -366,11 +366,11 @@ public class ContentSummon extends Content
|
|||||||
{
|
{
|
||||||
EffectInstance tag = this.effects.getOrCreate(effect);
|
EffectInstance tag = this.effects.getOrCreate(effect);
|
||||||
|
|
||||||
container.addRenderableWidget(new GuiSlider(x + 118, y, 114, 20, 0, Config.getSliders().getMaxSummonPotionAmplifier(), 0, container, new LogicSliderSimple("amplifier" + ForgeRegistries.MOB_EFFECTS.getKey(effect), Component.translatable(effect.getDescriptionId()), value ->
|
container.addRenderableWidget(new GuiSlider(x + 118, y, 114, 20, 0, Config.getSliders().getMaxSummonPotionAmplifier(), 0, container, new LogicSliderSimple("amplifier" + BuiltInRegistries.MOB_EFFECT.getKey(effect), Component.translatable(effect.getDescriptionId()), value ->
|
||||||
{
|
{
|
||||||
tag.setAmplifier(value.byteValue());
|
tag.setAmplifier(value.byteValue());
|
||||||
})));
|
})));
|
||||||
container.addRenderableWidget(new GuiSlider(x + 118, y + 24, 114, 20, 0, Config.getSliders().getMaxSummonPotionMinutes(), 0, container, new LogicSliderSimple("duration" + ForgeRegistries.MOB_EFFECTS.getKey(effect), Component.translatable("gui.worldhandler.potion.time.minutes"), value ->
|
container.addRenderableWidget(new GuiSlider(x + 118, y + 24, 114, 20, 0, Config.getSliders().getMaxSummonPotionMinutes(), 0, container, new LogicSliderSimple("duration" + BuiltInRegistries.MOB_EFFECT.getKey(effect), Component.translatable("gui.worldhandler.potion.time.minutes"), value ->
|
||||||
{
|
{
|
||||||
tag.setMinutes(value.intValue());
|
tag.setMinutes(value.intValue());
|
||||||
})));
|
})));
|
||||||
@@ -449,12 +449,12 @@ public class ContentSummon extends Content
|
|||||||
}
|
}
|
||||||
else if(EntityType.VILLAGER.equals(entity))
|
else if(EntityType.VILLAGER.equals(entity))
|
||||||
{
|
{
|
||||||
for(VillagerProfession profession : ForgeRegistries.VILLAGER_PROFESSIONS)
|
for(VillagerProfession profession : BuiltInRegistries.VILLAGER_PROFESSION)
|
||||||
{
|
{
|
||||||
if(StringUtils.equalsIgnoreCase(this.mob, profession.toString()))
|
if(StringUtils.equalsIgnoreCase(this.mob, profession.toString()))
|
||||||
{
|
{
|
||||||
CompoundTag villagerData = new CompoundTag();
|
CompoundTag villagerData = new CompoundTag();
|
||||||
villagerData.putString("profession", ForgeRegistries.VILLAGER_PROFESSIONS.getKey(profession).toString());
|
villagerData.putString("profession", BuiltInRegistries.VILLAGER_PROFESSION.getKey(profession).toString());
|
||||||
|
|
||||||
this.mutable.setKey("VillagerData");
|
this.mutable.setKey("VillagerData");
|
||||||
this.mutable.setTag(villagerData);
|
this.mutable.setTag(villagerData);
|
||||||
@@ -473,7 +473,7 @@ public class ContentSummon extends Content
|
|||||||
else if(EntityType.CHICKEN.equals(entity) && StringUtils.containsIgnoreCase(this.mob, "Jockey") && !this.entity.hasPassengers())
|
else if(EntityType.CHICKEN.equals(entity) && StringUtils.containsIgnoreCase(this.mob, "Jockey") && !this.entity.hasPassengers())
|
||||||
{
|
{
|
||||||
ListTag list = new ListTag();
|
ListTag list = new ListTag();
|
||||||
EntityTag zombie = new EntityTag(ForgeRegistries.ENTITY_TYPES.getKey(EntityType.ZOMBIE));
|
EntityTag zombie = new EntityTag(BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.ZOMBIE));
|
||||||
|
|
||||||
zombie.setIsBaby(true);
|
zombie.setIsBaby(true);
|
||||||
list.add(zombie.value());
|
list.add(zombie.value());
|
||||||
@@ -484,7 +484,7 @@ public class ContentSummon extends Content
|
|||||||
else if(EntityType.SPIDER.equals(entity) && StringUtils.containsIgnoreCase(this.mob, "Jockey") && !this.entity.hasPassengers())
|
else if(EntityType.SPIDER.equals(entity) && StringUtils.containsIgnoreCase(this.mob, "Jockey") && !this.entity.hasPassengers())
|
||||||
{
|
{
|
||||||
ListTag list = new ListTag();
|
ListTag list = new ListTag();
|
||||||
EntityTag skeleton = new EntityTag(ForgeRegistries.ENTITY_TYPES.getKey(EntityType.SKELETON));
|
EntityTag skeleton = new EntityTag(BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.SKELETON));
|
||||||
|
|
||||||
skeleton.setHandItem(0, Items.BOW);
|
skeleton.setHandItem(0, Items.BOW);
|
||||||
list.add(skeleton.value());
|
list.add(skeleton.value());
|
||||||
@@ -503,7 +503,7 @@ public class ContentSummon extends Content
|
|||||||
{
|
{
|
||||||
if(Page.POTIONS.equals(this.page))
|
if(Page.POTIONS.equals(this.page))
|
||||||
{
|
{
|
||||||
guiGraphics.drawString(Minecraft.getInstance().font, (this.potionPage + 1) + "/" + (ForgeRegistries.MOB_EFFECTS.getKeys().size() - 2), x + 118, y - 11, Config.getSkin().getHeadlineColor(), false);
|
guiGraphics.drawString(Minecraft.getInstance().font, (this.potionPage + 1) + "/" + (BuiltInRegistries.MOB_EFFECT.keySet().size() - 2), x + 118, y - 11, Config.getSkin().getHeadlineColor(), false);
|
||||||
}
|
}
|
||||||
else if(Page.EQUIPMENT.equals(this.page))
|
else if(Page.EQUIPMENT.equals(this.page))
|
||||||
{
|
{
|
||||||
@@ -529,8 +529,8 @@ public class ContentSummon extends Content
|
|||||||
|
|
||||||
private List<ResourceLocation> sortedEffects()
|
private List<ResourceLocation> sortedEffects()
|
||||||
{
|
{
|
||||||
return ForgeRegistries.MOB_EFFECTS.getKeys().stream()
|
return BuiltInRegistries.MOB_EFFECT.keySet().stream()
|
||||||
.sorted((a, b) -> I18n.get(ForgeRegistries.MOB_EFFECTS.getValue(a).getDescriptionId()).compareTo(I18n.get(ForgeRegistries.MOB_EFFECTS.getValue(b).getDescriptionId())))
|
.sorted((a, b) -> I18n.get(BuiltInRegistries.MOB_EFFECT.get(a).getDescriptionId()).compareTo(I18n.get(BuiltInRegistries.MOB_EFFECT.get(b).getDescriptionId())))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ import java.util.function.Consumer;
|
|||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.network.chat.MutableComponent;
|
import net.minecraft.network.chat.MutableComponent;
|
||||||
import net.minecraft.world.entity.ai.attributes.Attribute;
|
import net.minecraft.world.entity.ai.attributes.Attribute;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
|
||||||
public class LogicSliderAttribute extends LogicSliderSimple
|
public class LogicSliderAttribute extends LogicSliderSimple
|
||||||
{
|
{
|
||||||
public LogicSliderAttribute(Attribute attribute, MutableComponent text, Consumer<Integer> listener)
|
public LogicSliderAttribute(Attribute attribute, MutableComponent text, Consumer<Integer> listener)
|
||||||
{
|
{
|
||||||
super(ForgeRegistries.ATTRIBUTES.getKey(attribute).toString(), text, listener);
|
super(BuiltInRegistries.ATTRIBUTE.getKey(attribute).toString(), text, listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import exopandora.worldhandler.usercontent.model.JsonWidget;
|
|||||||
import exopandora.worldhandler.util.TextUtils;
|
import exopandora.worldhandler.util.TextUtils;
|
||||||
import net.minecraft.client.gui.components.AbstractWidget;
|
import net.minecraft.client.gui.components.AbstractWidget;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
|
||||||
public class WidgetFactory extends AbstractWidgetFactory
|
public class WidgetFactory extends AbstractWidgetFactory
|
||||||
{
|
{
|
||||||
@@ -54,7 +54,7 @@ public class WidgetFactory extends AbstractWidgetFactory
|
|||||||
widget.getLayout().getY() + y,
|
widget.getLayout().getY() + y,
|
||||||
widget.getLayout().getWidth(),
|
widget.getLayout().getWidth(),
|
||||||
widget.getLayout().getHeight(),
|
widget.getLayout().getHeight(),
|
||||||
ForgeRegistries.ITEMS.getValue(ResourceLocation.parse(widget.getAttributes().getItem())),
|
BuiltInRegistries.ITEM.get(ResourceLocation.parse(widget.getAttributes().getItem())),
|
||||||
this.getActionHandlerFactory().createActionHandler(content, widget.getAction(), container::getPlayer)
|
this.getActionHandlerFactory().createActionHandler(content, widget.getAction(), container::getPlayer)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,12 +17,11 @@ import net.minecraft.server.packs.resources.ReloadableResourceManager;
|
|||||||
import net.minecraft.server.packs.resources.ResourceManager;
|
import net.minecraft.server.packs.resources.ResourceManager;
|
||||||
import net.minecraft.util.Unit;
|
import net.minecraft.util.Unit;
|
||||||
import net.minecraft.util.profiling.ProfilerFiller;
|
import net.minecraft.util.profiling.ProfilerFiller;
|
||||||
import net.minecraftforge.common.crafting.conditions.ICondition.IContext;
|
|
||||||
|
|
||||||
public class AdvancementHelper implements PreparableReloadListener
|
public class AdvancementHelper implements PreparableReloadListener
|
||||||
{
|
{
|
||||||
private static final AdvancementHelper INSTANCE = new AdvancementHelper();
|
private static final AdvancementHelper INSTANCE = new AdvancementHelper();
|
||||||
private final ServerAdvancementManager manager = new ServerAdvancementManager(RegistryHelper.registryAccess(), IContext.EMPTY);
|
private final ServerAdvancementManager manager = new ServerAdvancementManager(RegistryHelper.registryAccess());
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CompletableFuture<Void> reload(PreparationBarrier stage, ResourceManager resourceManager, ProfilerFiller preparationsProfiler, ProfilerFiller reloadProfiler, Executor backgroundExecutor, Executor gameExecutor)
|
public CompletableFuture<Void> reload(PreparationBarrier stage, ResourceManager resourceManager, ProfilerFiller preparationsProfiler, ProfilerFiller reloadProfiler, Executor backgroundExecutor, Executor gameExecutor)
|
||||||
|
|||||||
@@ -15,11 +15,11 @@ import net.minecraft.nbt.TagParser;
|
|||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.Blocks;
|
import net.minecraft.world.level.block.Blocks;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
|
||||||
public class BlockPredicateParser
|
public class BlockPredicateParser
|
||||||
{
|
{
|
||||||
private static final ResourceLocation AIR_RESOURCE_LOCATION = ForgeRegistries.BLOCKS.getKey(Blocks.AIR);
|
private static final ResourceLocation AIR_RESOURCE_LOCATION = BuiltInRegistries.BLOCK.getKey(Blocks.AIR);
|
||||||
private final StringReader reader;
|
private final StringReader reader;
|
||||||
private final Map<String, String> vagueProperties = Maps.newHashMap();
|
private final Map<String, String> vagueProperties = Maps.newHashMap();
|
||||||
private ResourceLocation block = null;
|
private ResourceLocation block = null;
|
||||||
@@ -157,7 +157,7 @@ public class BlockPredicateParser
|
|||||||
|
|
||||||
public Optional<Block> getBlock()
|
public Optional<Block> getBlock()
|
||||||
{
|
{
|
||||||
Block block = ForgeRegistries.BLOCKS.getValue(this.block);
|
Block block = BuiltInRegistries.BLOCK.get(this.block);
|
||||||
|
|
||||||
if(Blocks.AIR.equals(block) && !AIR_RESOURCE_LOCATION.equals(this.block))
|
if(Blocks.AIR.equals(block) && !AIR_RESOURCE_LOCATION.equals(this.block))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import net.minecraft.network.chat.Component;
|
|||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
import net.minecraft.world.item.Items;
|
import net.minecraft.world.item.Items;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
|
||||||
public class ItemPredicateParser
|
public class ItemPredicateParser
|
||||||
{
|
{
|
||||||
@@ -77,7 +77,7 @@ public class ItemPredicateParser
|
|||||||
|
|
||||||
public Optional<Item> getItem()
|
public Optional<Item> getItem()
|
||||||
{
|
{
|
||||||
Item item = ForgeRegistries.ITEMS.getValue(this.item);
|
Item item = BuiltInRegistries.ITEM.get(this.item);
|
||||||
|
|
||||||
if(Items.AIR.equals(item))
|
if(Items.AIR.equals(item))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import net.minecraft.resources.ResourceLocation;
|
|||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
import net.minecraft.world.item.Items;
|
import net.minecraft.world.item.Items;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
|
||||||
public class NBTHelper
|
public class NBTHelper
|
||||||
{
|
{
|
||||||
@@ -62,7 +62,7 @@ public class NBTHelper
|
|||||||
for(Item item : itemArray)
|
for(Item item : itemArray)
|
||||||
{
|
{
|
||||||
CompoundTag compound = new CompoundTag();
|
CompoundTag compound = new CompoundTag();
|
||||||
compound.putString("id", ForgeRegistries.ITEMS.getKey(item).toString());
|
compound.putString("id", BuiltInRegistries.ITEM.getKey(item).toString());
|
||||||
compound.putInt("Count", 1);
|
compound.putInt("Count", 1);
|
||||||
list.add(compound);
|
list.add(compound);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import net.minecraft.network.chat.Component;
|
|||||||
import net.minecraft.resources.ResourceKey;
|
import net.minecraft.resources.ResourceKey;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.item.enchantment.Enchantment;
|
import net.minecraft.world.item.enchantment.Enchantment;
|
||||||
import net.minecraftforge.registries.RegisterEvent;
|
import net.neoforged.neoforge.registries.RegisterEvent;
|
||||||
|
|
||||||
public class RegistryHelper
|
public class RegistryHelper
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import javax.annotation.Nullable;
|
|||||||
import exopandora.worldhandler.Main;
|
import exopandora.worldhandler.Main;
|
||||||
import exopandora.worldhandler.config.Config;
|
import exopandora.worldhandler.config.Config;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraftforge.registries.IForgeRegistry;
|
import net.minecraft.core.Registry;
|
||||||
|
|
||||||
public class ResourceHelper
|
public class ResourceHelper
|
||||||
{
|
{
|
||||||
@@ -20,13 +20,13 @@ public class ResourceHelper
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isRegistered(ResourceLocation resource, IForgeRegistry<?> registry)
|
public static boolean isRegistered(ResourceLocation resource, Registry<?> registry)
|
||||||
{
|
{
|
||||||
return resource != null && registry != null && registry.containsKey(resource);
|
return resource != null && registry != null && registry.containsKey(resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public static ResourceLocation assertRegistered(ResourceLocation resource, IForgeRegistry<?> registry)
|
public static ResourceLocation assertRegistered(ResourceLocation resource, Registry<?> registry)
|
||||||
{
|
{
|
||||||
if(resource != null && ResourceHelper.isRegistered(resource, registry))
|
if(resource != null && ResourceHelper.isRegistered(resource, registry))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import net.minecraft.stats.Stats;
|
|||||||
import net.minecraft.world.scores.Team.CollisionRule;
|
import net.minecraft.world.scores.Team.CollisionRule;
|
||||||
import net.minecraft.world.scores.Team.Visibility;
|
import net.minecraft.world.scores.Team.Visibility;
|
||||||
import net.minecraft.world.scores.criteria.ObjectiveCriteria;
|
import net.minecraft.world.scores.criteria.ObjectiveCriteria;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
|
||||||
public class ScoreboardHelper
|
public class ScoreboardHelper
|
||||||
{
|
{
|
||||||
@@ -44,7 +44,7 @@ public class ScoreboardHelper
|
|||||||
|
|
||||||
this.objectives.merge("minecraft", (parent, child) -> parent + "." + child);
|
this.objectives.merge("minecraft", (parent, child) -> parent + "." + child);
|
||||||
|
|
||||||
for(StatType<?> type : ForgeRegistries.STAT_TYPES)
|
for(StatType<?> type : BuiltInRegistries.STAT_TYPE)
|
||||||
{
|
{
|
||||||
if(!type.equals(Stats.CUSTOM))
|
if(!type.equals(Stats.CUSTOM))
|
||||||
{
|
{
|
||||||
@@ -55,7 +55,7 @@ public class ScoreboardHelper
|
|||||||
entries.add(new Node(this.buildKey(key)));
|
entries.add(new Node(this.buildKey(key)));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.objectives.addNode(this.buildKey(ForgeRegistries.STAT_TYPES.getKey(type)), entries);
|
this.objectives.addNode(this.buildKey(BuiltInRegistries.STAT_TYPE.getKey(type)), entries);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,29 +11,28 @@ import net.minecraft.world.effect.MobEffect;
|
|||||||
import net.minecraft.world.entity.EntityType;
|
import net.minecraft.world.entity.EntityType;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
import net.minecraftforge.registries.IForgeRegistry;
|
import net.minecraft.core.Registry;
|
||||||
|
|
||||||
public class TranslationHelper
|
public class TranslationHelper
|
||||||
{
|
{
|
||||||
private static final Map<IForgeRegistry<?>, Function<?, String>> FORGE = new HashMap<IForgeRegistry<?>, Function<?, String>>();
|
private static final Map<Registry<?>, Function<?, String>> FORGE = new HashMap<Registry<?>, Function<?, String>>();
|
||||||
|
|
||||||
static
|
static
|
||||||
{
|
{
|
||||||
registerRegistry(ForgeRegistries.BLOCKS, Block::getDescriptionId);
|
registerRegistry(BuiltInRegistries.BLOCK, Block::getDescriptionId);
|
||||||
registerRegistry(ForgeRegistries.ITEMS, Item::getDescriptionId);
|
registerRegistry(BuiltInRegistries.ITEM, Item::getDescriptionId);
|
||||||
registerRegistry(ForgeRegistries.MOB_EFFECTS, MobEffect::getDescriptionId);
|
registerRegistry(BuiltInRegistries.MOB_EFFECT, MobEffect::getDescriptionId);
|
||||||
registerRegistry(ForgeRegistries.BIOMES, biome -> ForgeRegistries.BIOMES.getKey(biome).toLanguageKey("biome"));
|
registerRegistry(BuiltInRegistries.ENTITY_TYPE, EntityType::getDescriptionId);
|
||||||
registerRegistry(ForgeRegistries.ENTITY_TYPES, EntityType::getDescriptionId);
|
registerRegistry(BuiltInRegistries.STAT_TYPE, stat -> "stat." + stat.toString().replace(':', '.'));
|
||||||
registerRegistry(ForgeRegistries.STAT_TYPES, stat -> "stat." + stat.toString().replace(':', '.'));
|
registerRegistry(BuiltInRegistries.VILLAGER_PROFESSION, profession ->
|
||||||
registerRegistry(ForgeRegistries.VILLAGER_PROFESSIONS, profession ->
|
|
||||||
{
|
{
|
||||||
ResourceLocation profName = ForgeRegistries.VILLAGER_PROFESSIONS.getKey(profession);
|
ResourceLocation profName = BuiltInRegistries.VILLAGER_PROFESSION.getKey(profession);
|
||||||
return EntityType.VILLAGER.getDescriptionId() + '.' + (!"minecraft".equals(profName.getNamespace()) ? profName.getNamespace() + '.' : "") + profName.getPath();
|
return EntityType.VILLAGER.getDescriptionId() + '.' + (!"minecraft".equals(profName.getNamespace()) ? profName.getNamespace() + '.' : "") + profName.getPath();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private static <T> void registerRegistry(IForgeRegistry<T> registry, Function<T, String> mapper)
|
private static <T> void registerRegistry(Registry<T> registry, Function<T, String> mapper)
|
||||||
{
|
{
|
||||||
FORGE.put(registry, mapper);
|
FORGE.put(registry, mapper);
|
||||||
}
|
}
|
||||||
@@ -47,11 +46,11 @@ public class TranslationHelper
|
|||||||
return RegistryHelper.getEnchantmentDescription(RegistryHelper.getEnchantment(resource)).getString();
|
return RegistryHelper.getEnchantmentDescription(RegistryHelper.getEnchantment(resource)).getString();
|
||||||
}
|
}
|
||||||
|
|
||||||
for(IForgeRegistry<?> registry : FORGE.keySet())
|
for(Registry<?> registry : FORGE.keySet())
|
||||||
{
|
{
|
||||||
if(registry.containsKey(resource))
|
if(registry.containsKey(resource))
|
||||||
{
|
{
|
||||||
return ((Function<T, String>) FORGE.get(registry)).apply((T) registry.getValue(resource));
|
return ((Function<T, String>) FORGE.get(registry)).apply((T) registry.get(resource));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
public net.minecraft.commands.arguments.blocks.BlockInput f_114664_ # tag
|
public net.minecraft.commands.arguments.blocks.BlockInput tag
|
||||||
public net.minecraft.server.MinecraftServer f_129744_ # storageSource
|
public net.minecraft.server.MinecraftServer storageSource
|
||||||
public net.minecraft.client.gui.screens.OptionsScreen m_96244_(Lnet/minecraft/server/packs/repository/PackRepository;)V # updatePackList
|
public net.minecraft.client.gui.screens.OptionsScreen updatePackList(Lnet/minecraft/server/packs/repository/PackRepository;)V
|
||||||
public net.minecraft.commands.arguments.EntityAnchorArgument$Anchor f_90367_ # name
|
public net.minecraft.commands.arguments.EntityAnchorArgument$Anchor name
|
||||||
public net.minecraft.commands.arguments.coordinates.LocalCoordinates m_119908_(Lcom/mojang/brigadier/StringReader;I)D # readDouble
|
public net.minecraft.commands.arguments.coordinates.LocalCoordinates readDouble(Lcom/mojang/brigadier/StringReader;I)D
|
||||||
public net.minecraft.advancements.critereon.MinMaxBounds$Doubles <init>(Ljava/util/Optional;Ljava/util/Optional;)V # constructor
|
public net.minecraft.advancements.critereon.MinMaxBounds$Doubles <init>(Ljava/util/Optional;Ljava/util/Optional;)V
|
||||||
public net.minecraft.advancements.critereon.MinMaxBounds$Ints <init>(Ljava/util/Optional;Ljava/util/Optional;)V # constructor
|
public net.minecraft.advancements.critereon.MinMaxBounds$Ints <init>(Ljava/util/Optional;Ljava/util/Optional;)V
|
||||||
public net.minecraft.network.chat.MutableComponent <init>(Lnet/minecraft/network/chat/ComponentContents;Ljava/util/List;Lnet/minecraft/network/chat/Style;)V # constructor
|
public net.minecraft.network.chat.MutableComponent <init>(Lnet/minecraft/network/chat/ComponentContents;Ljava/util/List;Lnet/minecraft/network/chat/Style;)V
|
||||||
public net.minecraft.commands.arguments.item.ItemParser f_120991_ # ERROR_NO_TAGS_ALLOWED
|
public net.minecraft.commands.arguments.item.ItemParser ERROR_NO_TAGS_ALLOWED
|
||||||
public net.minecraft.world.level.storage.PrimaryLevelData f_78443_ # settings
|
public net.minecraft.world.level.storage.PrimaryLevelData settings
|
||||||
public net.minecraft.client.gui.components.AbstractWidget m_280138_(Lnet/minecraft/client/gui/GuiGraphics;Lnet/minecraft/client/gui/Font;Lnet/minecraft/network/chat/Component;IIIII)V # renderScrollingString
|
public net.minecraft.client.gui.components.AbstractWidget renderScrollingString(Lnet/minecraft/client/gui/GuiGraphics;Lnet/minecraft/client/gui/Font;Lnet/minecraft/network/chat/Component;IIIII)V
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
modLoader="javafml"
|
modLoader="javafml"
|
||||||
loaderVersion="[52,)"
|
loaderVersion="${loader_version_range}"
|
||||||
updateJSONURL="https://raw.githubusercontent.com/Exopandora/worldhandler/master/version.json"
|
updateJSONURL="https://raw.githubusercontent.com/Exopandora/worldhandler/master/version.json"
|
||||||
issueTrackerURL="https://github.com/Exopandora/WorldHandler/issues"
|
issueTrackerURL="https://github.com/Exopandora/WorldHandler/issues"
|
||||||
displayURL="https://minecraft.curseforge.com/projects/world-handler-command-gui"
|
displayURL="https://minecraft.curseforge.com/projects/world-handler-command-gui"
|
||||||
@@ -17,7 +17,14 @@ license="GPL v3.0"
|
|||||||
|
|
||||||
[[dependencies.worldhandler]]
|
[[dependencies.worldhandler]]
|
||||||
modId="minecraft"
|
modId="minecraft"
|
||||||
mandatory=true
|
type="required"
|
||||||
versionRange="[1.21.1,1.21.2)"
|
versionRange="[1.21.1,1.21.2)"
|
||||||
ordering="NONE"
|
ordering="NONE"
|
||||||
side="BOTH"
|
side="BOTH"
|
||||||
|
|
||||||
|
[[dependencies.worldhandler]]
|
||||||
|
modId="neoforge"
|
||||||
|
type="required"
|
||||||
|
versionRange="[21.1.225,)"
|
||||||
|
ordering="NONE"
|
||||||
|
side="BOTH"
|
||||||
Reference in New Issue
Block a user