Skip to content

Commit

Permalink
Add extra srg file for workaround with SpongePowered/Mixin#438
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Harris-Rouquette <[email protected]>
  • Loading branch information
gabizou committed Sep 5, 2020
1 parent 973288d commit b6cd9f5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions extra.srgs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MD: net/minecraft/world/World/isPlayerWithin(DDDD)Z net/minecraft/world/World/func_217358_a(DDDD)Z
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit b6cd9f5

Please sign in to comment.