Update to 1.18.2
Swapped arguments for wh replace
This commit is contained in:
@@ -15,7 +15,7 @@ buildscript {
|
|||||||
apply plugin: 'net.minecraftforge.gradle'
|
apply plugin: 'net.minecraftforge.gradle'
|
||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
|
|
||||||
version = '1.18.1-3.0.1'
|
version = '1.18.2-3.0.1'
|
||||||
group = 'exopandora.worldhandler' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
group = 'exopandora.worldhandler' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||||
archivesBaseName = 'WorldHandler'
|
archivesBaseName = 'WorldHandler'
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ minecraft {
|
|||||||
//
|
//
|
||||||
// Use non-default mappings at your own risk. they may not always work.
|
// Use non-default mappings at your own risk. they may not always work.
|
||||||
// Simply re-run your setup task after changing the mappings to update your workspace.
|
// Simply re-run your setup task after changing the mappings to update your workspace.
|
||||||
mappings channel: 'official', version: '1.18.1'
|
mappings channel: 'official', version: '1.18.2'
|
||||||
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
|
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
|
||||||
|
|
||||||
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
|
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
|
||||||
@@ -106,7 +106,7 @@ dependencies {
|
|||||||
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
|
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
|
||||||
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
|
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
|
||||||
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
|
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
|
||||||
minecraft 'net.minecraftforge:forge:1.18.1-39.0.0'
|
minecraft 'net.minecraftforge:forge:1.18.2-40.0.2'
|
||||||
|
|
||||||
// You may put jars on which you depend on in ./libs or you may define them like so..
|
// You may put jars on which you depend on in ./libs or you may define them like so..
|
||||||
// compile "some.group:artifact:version:classifier"
|
// compile "some.group:artifact:version:classifier"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ public class Main
|
|||||||
{
|
{
|
||||||
public static final String NAME = "World Handler";
|
public static final String NAME = "World Handler";
|
||||||
public static final String MODID = "worldhandler";
|
public static final String MODID = "worldhandler";
|
||||||
public static final String MC_VERSION = "1.18.1";
|
public static final String MC_VERSION = "1.18.2";
|
||||||
public static final String MOD_VERSION = "3.0.1";
|
public static final String MOD_VERSION = "3.0.1";
|
||||||
public static final String URL = "https://minecraft.curseforge.com/projects/world-handler-command-gui";
|
public static final String URL = "https://minecraft.curseforge.com/projects/world-handler-command-gui";
|
||||||
|
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ public class BlockPredicateArgument extends TagArgument
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.resource = parser.getTag();
|
this.resource = parser.getTag().location();
|
||||||
this.isTag = true;
|
this.isTag = true;
|
||||||
this.properties = parser.getVagueProperties();
|
this.properties = parser.getVagueProperties();
|
||||||
this.setTag(parser.getNbt());
|
this.setTag(parser.getNbt());
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public class ItemPredicateArgument extends TagArgument
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.resource = parser.getTag();
|
this.resource = parser.getTag().location();
|
||||||
this.setTag(parser.getNbt());
|
this.setTag(parser.getNbt());
|
||||||
this.isTag = true;
|
this.isTag = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,9 +40,9 @@ public class CommandWH
|
|||||||
.executes(context -> fill(context.getSource(), BlockStateArgument.getBlock(context, "block")))))
|
.executes(context -> fill(context.getSource(), BlockStateArgument.getBlock(context, "block")))))
|
||||||
.then(Commands.literal("replace")
|
.then(Commands.literal("replace")
|
||||||
.requires(source -> source.hasPermission(2))
|
.requires(source -> source.hasPermission(2))
|
||||||
.then(Commands.argument("block", BlockStateArgument.block())
|
.then(Commands.argument("filter", BlockPredicateArgument.blockPredicate())
|
||||||
.then(Commands.argument("filter", BlockPredicateArgument.blockPredicate())
|
.then(Commands.argument("block", BlockStateArgument.block())
|
||||||
.executes(context -> replace(context.getSource(), BlockStateArgument.getBlock(context, "block"), getCommandNode("filter", context.getNodes()).getRange().get(context.getInput()))))))
|
.executes(context -> replace(context.getSource(), getCommandNode("filter", context.getNodes()).getRange().get(context.getInput()), BlockStateArgument.getBlock(context, "block"))))))
|
||||||
.then(Commands.literal("clone")
|
.then(Commands.literal("clone")
|
||||||
.requires(source -> source.hasPermission(2))
|
.requires(source -> source.hasPermission(2))
|
||||||
.executes(context -> clone(context.getSource(), "masked", null))
|
.executes(context -> clone(context.getSource(), "masked", null))
|
||||||
@@ -95,7 +95,7 @@ public class CommandWH
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int replace(CommandSourceStack source, BlockInput block, String filter)
|
private static int replace(CommandSourceStack source, String filter, BlockInput block)
|
||||||
{
|
{
|
||||||
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () ->
|
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () ->
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,12 +18,8 @@ import net.minecraft.client.gui.screens.multiplayer.SafetyScreen;
|
|||||||
import net.minecraft.client.gui.screens.worldselection.SelectWorldScreen;
|
import net.minecraft.client.gui.screens.worldselection.SelectWorldScreen;
|
||||||
import net.minecraft.client.multiplayer.ServerData;
|
import net.minecraft.client.multiplayer.ServerData;
|
||||||
import net.minecraft.client.multiplayer.resolver.ServerAddress;
|
import net.minecraft.client.multiplayer.resolver.ServerAddress;
|
||||||
import net.minecraft.client.server.IntegratedServer;
|
|
||||||
import net.minecraft.core.RegistryAccess;
|
|
||||||
import net.minecraft.network.chat.MutableComponent;
|
import net.minecraft.network.chat.MutableComponent;
|
||||||
import net.minecraft.network.chat.TranslatableComponent;
|
import net.minecraft.network.chat.TranslatableComponent;
|
||||||
import net.minecraft.world.level.LevelSettings;
|
|
||||||
import net.minecraft.world.level.levelgen.WorldGenSettings;
|
|
||||||
|
|
||||||
public class ContentChangeWorld extends ContentChild
|
public class ContentChangeWorld extends ContentChild
|
||||||
{
|
{
|
||||||
@@ -63,15 +59,11 @@ public class ContentChangeWorld extends ContentChild
|
|||||||
|
|
||||||
if(isIntegrated)
|
if(isIntegrated)
|
||||||
{
|
{
|
||||||
IntegratedServer integrated = Minecraft.getInstance().getSingleplayerServer();
|
String folder = Minecraft.getInstance().getSingleplayerServer().storageSource.getLevelId();
|
||||||
String folder = integrated.storageSource.getLevelId();
|
|
||||||
WorldGenSettings worldGenSettings = integrated.getWorldData().worldGenSettings();
|
|
||||||
LevelSettings levelSettings = integrated.getWorldData().getLevelSettings();
|
|
||||||
|
|
||||||
Minecraft.getInstance().level.disconnect();
|
Minecraft.getInstance().level.disconnect();
|
||||||
Minecraft.getInstance().clearLevel(new GenericDirtMessageScreen(new TranslatableComponent("menu.savingLevel")));
|
Minecraft.getInstance().clearLevel(new GenericDirtMessageScreen(new TranslatableComponent("menu.savingLevel")));
|
||||||
|
|
||||||
return new IntegratedConnection(folder, levelSettings, worldGenSettings);
|
return new IntegratedConnection(folder);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Minecraft.getInstance().level != null)
|
if(Minecraft.getInstance().level != null)
|
||||||
@@ -94,15 +86,13 @@ public class ContentChangeWorld extends ContentChild
|
|||||||
{
|
{
|
||||||
Minecraft.getInstance().setScreen(new RealmsMainScreen(new TitleScreen()));
|
Minecraft.getInstance().setScreen(new RealmsMainScreen(new TitleScreen()));
|
||||||
}
|
}
|
||||||
else if(connection instanceof IntegratedConnection)
|
else if(connection instanceof IntegratedConnection integrated)
|
||||||
{
|
{
|
||||||
IntegratedConnection integrated = (IntegratedConnection) connection;
|
Minecraft.getInstance().loadLevel(integrated.getFolder());;
|
||||||
Minecraft.getInstance().createLevel(integrated.getFolder(), integrated.getWorldSettings(), RegistryAccess.builtin(), integrated.getWorldGenSettings());
|
|
||||||
Minecraft.getInstance().mouseHandler.grabMouse();
|
Minecraft.getInstance().mouseHandler.grabMouse();
|
||||||
}
|
}
|
||||||
else if(connection instanceof DedicatedConnection)
|
else if(connection instanceof DedicatedConnection dedicated)
|
||||||
{
|
{
|
||||||
DedicatedConnection dedicated = (DedicatedConnection) connection;
|
|
||||||
ServerData data = dedicated.getData();
|
ServerData data = dedicated.getData();
|
||||||
ConnectScreen.startConnecting(new TitleScreen(), Minecraft.getInstance(), ServerAddress.parseString(data.ip), data);
|
ConnectScreen.startConnecting(new TitleScreen(), Minecraft.getInstance(), ServerAddress.parseString(data.ip), data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ import net.minecraft.server.packs.PackResources;
|
|||||||
import net.minecraft.server.packs.PackType;
|
import net.minecraft.server.packs.PackType;
|
||||||
import net.minecraft.server.packs.repository.Pack;
|
import net.minecraft.server.packs.repository.Pack;
|
||||||
import net.minecraft.server.packs.resources.PreparableReloadListener;
|
import net.minecraft.server.packs.resources.PreparableReloadListener;
|
||||||
|
import net.minecraft.server.packs.resources.ReloadableResourceManager;
|
||||||
import net.minecraft.server.packs.resources.ResourceManager;
|
import net.minecraft.server.packs.resources.ResourceManager;
|
||||||
import net.minecraft.server.packs.resources.SimpleReloadableResourceManager;
|
|
||||||
import net.minecraft.util.Unit;
|
import net.minecraft.util.Unit;
|
||||||
import net.minecraft.util.profiling.ProfilerFiller;
|
import net.minecraft.util.profiling.ProfilerFiller;
|
||||||
import net.minecraft.world.level.storage.loot.PredicateManager;
|
import net.minecraft.world.level.storage.loot.PredicateManager;
|
||||||
@@ -29,7 +29,7 @@ public class AdvancementHelper implements PreparableReloadListener
|
|||||||
{
|
{
|
||||||
return CompletableFuture.supplyAsync(() ->
|
return CompletableFuture.supplyAsync(() ->
|
||||||
{
|
{
|
||||||
SimpleReloadableResourceManager serverResourceManager = new SimpleReloadableResourceManager(PackType.SERVER_DATA);
|
ReloadableResourceManager serverResourceManager = new ReloadableResourceManager(PackType.SERVER_DATA);
|
||||||
serverResourceManager.registerReloadListener(this.manager);
|
serverResourceManager.registerReloadListener(this.manager);
|
||||||
return serverResourceManager;
|
return serverResourceManager;
|
||||||
}).thenCompose(stage::wait).thenAcceptAsync(serverResourceManager ->
|
}).thenCompose(stage::wait).thenAcceptAsync(serverResourceManager ->
|
||||||
|
|||||||
@@ -1,38 +1,22 @@
|
|||||||
package exopandora.worldhandler.util;
|
package exopandora.worldhandler.util;
|
||||||
|
|
||||||
import net.minecraft.client.multiplayer.ServerData;
|
import net.minecraft.client.multiplayer.ServerData;
|
||||||
import net.minecraft.world.level.LevelSettings;
|
|
||||||
import net.minecraft.world.level.levelgen.WorldGenSettings;
|
|
||||||
|
|
||||||
public interface IConnection
|
public interface IConnection
|
||||||
{
|
{
|
||||||
public static class IntegratedConnection implements IConnection
|
public static class IntegratedConnection implements IConnection
|
||||||
{
|
{
|
||||||
private final String folder;
|
private final String folder;
|
||||||
private final LevelSettings levelSettings;
|
|
||||||
private final WorldGenSettings worldGenSettings;
|
|
||||||
|
|
||||||
public IntegratedConnection(String folderName, LevelSettings levelSettings, WorldGenSettings worldGenSettings)
|
public IntegratedConnection(String folderName)
|
||||||
{
|
{
|
||||||
this.folder = folderName;
|
this.folder = folderName;
|
||||||
this.levelSettings = levelSettings;
|
|
||||||
this.worldGenSettings = worldGenSettings;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFolder()
|
public String getFolder()
|
||||||
{
|
{
|
||||||
return this.folder;
|
return this.folder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LevelSettings getWorldSettings()
|
|
||||||
{
|
|
||||||
return this.levelSettings;
|
|
||||||
}
|
|
||||||
|
|
||||||
public WorldGenSettings getWorldGenSettings()
|
|
||||||
{
|
|
||||||
return this.worldGenSettings;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class DedicatedConnection implements IConnection
|
public static class DedicatedConnection implements IConnection
|
||||||
|
|||||||
@@ -7,15 +7,12 @@ import java.util.function.Function;
|
|||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import exopandora.worldhandler.Main;
|
import exopandora.worldhandler.Main;
|
||||||
import net.minecraft.core.Registry;
|
|
||||||
import net.minecraft.core.RegistryAccess;
|
|
||||||
import net.minecraft.locale.Language;
|
import net.minecraft.locale.Language;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.effect.MobEffect;
|
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.item.enchantment.Enchantment;
|
import net.minecraft.world.item.enchantment.Enchantment;
|
||||||
import net.minecraft.world.level.biome.Biome;
|
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraftforge.registries.ForgeRegistries;
|
||||||
import net.minecraftforge.registries.ForgeRegistryEntry;
|
import net.minecraftforge.registries.ForgeRegistryEntry;
|
||||||
@@ -33,8 +30,7 @@ public class RegistryHelper
|
|||||||
registerRegistry(ForgeRegistries.MOB_EFFECTS, MobEffect::getDescriptionId);
|
registerRegistry(ForgeRegistries.MOB_EFFECTS, MobEffect::getDescriptionId);
|
||||||
registerRegistry(ForgeRegistries.BIOMES, biome ->
|
registerRegistry(ForgeRegistries.BIOMES, biome ->
|
||||||
{
|
{
|
||||||
Registry<Biome> registry = RegistryAccess.builtin().registryOrThrow(Registry.BIOME_REGISTRY);
|
ResourceLocation resource = biome.getRegistryName();
|
||||||
ResourceLocation resource = registry.getKey(biome);
|
|
||||||
String key = "biome." + biome.getRegistryName().getNamespace() + "." + resource.getPath();
|
String key = "biome." + biome.getRegistryName().getNamespace() + "." + resource.getPath();
|
||||||
return Language.getInstance().has(key) ? key : resource.toString();
|
return Language.getInstance().has(key) ? key : resource.toString();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
modLoader="javafml"
|
modLoader="javafml"
|
||||||
loaderVersion="[39,)"
|
loaderVersion="[40,)"
|
||||||
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"
|
||||||
@@ -11,7 +11,7 @@ license="GPL v3.0"
|
|||||||
|
|
||||||
[[mods]]
|
[[mods]]
|
||||||
modId="worldhandler"
|
modId="worldhandler"
|
||||||
version="1.18.1-3.0.1"
|
version="1.18.2-3.0.1"
|
||||||
displayName="World Handler"
|
displayName="World Handler"
|
||||||
description="The World Handler provides a simple and easy to use graphical user interface for commands. It lets you create powerful and complex sub-commands alongside NBT-structures within seconds."
|
description="The World Handler provides a simple and easy to use graphical user interface for commands. It lets you create powerful and complex sub-commands alongside NBT-structures within seconds."
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user