This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Mixin(ShipwreckPiece.class) | |
class ShipwreckPieceMixin { | |
// Fix https://bugs.mojang.com/browse/MC-131745 | |
@Redirect(method = "postProcess", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/RandomSource;nextInt(I)I")) | |
int usePositionalRandom(RandomSource random, int randomBound) { | |
var self = (ShipwreckPiece) (Object) this; | |
return self.placeSettings().getRandom(self.templatePosition().atY(0)).nextInt(randomBound); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
afterEvaluate { | |
loom.runs.configureEach { | |
// https://fabricmc.net/wiki/tutorial:mixin_hotswaps | |
vmArg "-javaagent:${ configurations.compileClasspath.find { it.name.contains("sponge-mixin") } }" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'org.apache.groovy:groovy-json:4.0.0-beta-2' | |
} | |
} | |
import groovy.json.JsonOutput |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.nio.channels.Channels | |
def paper = { String version -> | |
String paperPath = this.gradle.getGradleHomeDir().getAbsolutePath() + "\\papers\\paper-${version}.jar" | |
File paper = new File(paperPath) | |
if (paper.parentFile != null || !paper.parentFile.exists()) { | |
paper.parentFile.mkdir() | |
} |