From b6cd9f597552efc422583bf7a476f1908b32e573 Mon Sep 17 00:00:00 2001 From: Gabriel Harris-Rouquette Date: Fri, 4 Sep 2020 23:39:39 -0700 Subject: [PATCH] Add extra srg file for workaround with SpongePowered/Mixin#438 Signed-off-by: Gabriel Harris-Rouquette --- build.gradle.kts | 2 ++ extra.srgs | 1 + .../common/mixin/core/world/spawner/AbstractSpawnerMixin.java | 4 ++-- .../org/spongepowered/vanilla/installer/InstallerMain.java | 4 ++-- 4 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 extra.srgs diff --git a/build.gradle.kts b/build.gradle.kts index 75633babdc1..4b421b5f423 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -257,9 +257,11 @@ dependencies { add(mixins.get().implementationConfigurationName, mixinsConfig) add(mixins.get().implementationConfigurationName, project(":SpongeAPI")) } +val extraSrgs = file("extra.srgs") mixin { add("mixins", "spongecommon.mixins.refmap.json") add("accessors", "spongecommon.accessors.refmap.json") + extraMappings(extraSrgs) } fun debug(logger: Logger, messsage: String) { println(message = messsage) diff --git a/extra.srgs b/extra.srgs new file mode 100644 index 00000000000..86623db8e6c --- /dev/null +++ b/extra.srgs @@ -0,0 +1 @@ +MD: net/minecraft/world/World/isPlayerWithin(DDDD)Z net/minecraft/world/World/func_217358_a(DDDD)Z diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/spawner/AbstractSpawnerMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/spawner/AbstractSpawnerMixin.java index 40877018aa6..c56287ce32d 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/spawner/AbstractSpawnerMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/spawner/AbstractSpawnerMixin.java @@ -94,8 +94,8 @@ public abstract class AbstractSpawnerMixin implements AbstractSpawnerBridge { @Redirect(method = "isActivated()Z", at = @At(value = "INVOKE", - target = "Lnet/minecraft/world/IEntityReader;isPlayerWithin(DDDD)Z")) - public boolean onIsPlayerWithin(final IEntityReader world, final double x, final double y, final double z, final double distance) { + target = "Lnet/minecraft/world/World;isPlayerWithin(DDDD)Z")) + public boolean onIsPlayerWithin(final World world, final double x, final double y, final double z, final double distance) { // Like vanilla but filter out players with !bridge$affectsSpawning for (final PlayerEntity playerentity : world.getPlayers()) { if (EntityPredicates.NOT_SPECTATING.test(playerentity) diff --git a/vanilla/src/installer/java/org/spongepowered/vanilla/installer/InstallerMain.java b/vanilla/src/installer/java/org/spongepowered/vanilla/installer/InstallerMain.java index b296bdcd234..8b78069bfb6 100644 --- a/vanilla/src/installer/java/org/spongepowered/vanilla/installer/InstallerMain.java +++ b/vanilla/src/installer/java/org/spongepowered/vanilla/installer/InstallerMain.java @@ -95,9 +95,9 @@ public void run(final String[] args) throws Exception { final String javaHome = System.getProperty("java.home"); final String javaBin = javaHome + File.separator + "bin" + File.separator + "java"; final String jvmArgs = String.join(" ", ManagementFactory.getRuntimeMXBean().getInputArguments()); - final String depsClasspath = dependencies.stream().map(p -> p.toAbsolutePath().toString()).collect(Collectors.joining(File.pathSeparator)); + final String depsClasspath = dependencies.stream().map(Path::toAbsolutePath).map(Path::toString).collect(Collectors.joining(File.pathSeparator)); final String classpath = System.getProperty("java.class.path") + File.pathSeparator + depsClasspath + File.pathSeparator + - gameJar.toAbsolutePath().toString() + File.pathSeparator; + gameJar.toAbsolutePath().toString(); this.logger.debug("Setting classpath to: " + classpath);