Update ForgeGradle, update Gradle wrapper, add gitignores, add lastPhysicsProblem, add ATs (#140)

* Add gitignores; bump gradle; bump forge gradle

* Add bin folder to gitignores

* Remove gitignores from bin folder

* Fixed problems; added lastPhysicsProblem

* Added to accesstransformer

NibbleArray#setIndex for FAWE support

* Added to accesstransformer

BiomeContainer#biomeRegistry

* Downgrade FG to 4.0.9

* Bump FG to 4.0.13 + remove reobfJar
This commit is contained in:
Joseph Tarbit 2021-01-28 11:51:42 +00:00 committed by GitHub
parent e1681ffb95
commit f63854801c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 89 additions and 34 deletions

6
.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
/.gradle/
/.settings/
/build/
/bin/
/.project
/.settings/

5
arclight-api/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
/build/
/bin/
/.project
/.classpath
/.settings/

5
arclight-common/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
/build/
/bin/
/.project
/.classpath
/.settings/

View File

@ -7,7 +7,7 @@ buildscript {
maven { url = 'https://maven.izzel.io/releases' }
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: "${forge_gradle_version}"
classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
classpath "io.izzel.arclight:arclight-gradle-plugin:$agpVersion"
}
@ -51,18 +51,23 @@ repositories {
dependencies {
minecraft "net.minecraftforge:forge:$minecraftVersion-$forgeVersion"
compile "org.spigotmc:spigot-api:$minecraftVersion-R0.1-SNAPSHOT@jar"
compile 'org.jetbrains:annotations:19.0.0'
compile 'org.spongepowered:mixin:0.8.2'
compile 'com.github.ArclightTeam:mixin-tools:1.0.0'
compile 'jline:jline:2.12.1'
compile 'net.md-5:SpecialSource:1.8.6'
compile 'org.apache.logging.log4j:log4j-jul:2.11.2'
compile 'net.md-5:bungeecord-chat:1.16-R0.4'
compile 'mysql:mysql-connector-java:5.1.49'
compile 'org.yaml:snakeyaml:1.27'
compile project(':arclight-api')
compile project(':i18n-config')
implementation "org.spigotmc:spigot-api:$minecraftVersion-R0.1-SNAPSHOT@jar"
implementation 'org.jetbrains:annotations:19.0.0'
implementation 'org.spongepowered:mixin:0.8.2'
annotationProcessor 'org.spongepowered:mixin:0.8.2:processor'
implementation 'com.github.ArclightTeam:mixin-tools:1.0.0'
annotationProcessor 'com.github.ArclightTeam:mixin-tools:1.0.0'
implementation 'jline:jline:2.12.1'
implementation 'net.md-5:SpecialSource:1.8.6'
implementation 'org.apache.logging.log4j:log4j-jul:2.11.2'
implementation 'net.md-5:bungeecord-chat:1.16-R0.4'
implementation 'mysql:mysql-connector-java:5.1.49'
implementation 'org.yaml:snakeyaml:1.27'
implementation project(':arclight-api')
implementation project(':i18n-config')
}
remapSpigotJar {

View File

@ -78,6 +78,8 @@ public abstract class WorldMixin implements WorldBridge {
public org.bukkit.generator.ChunkGenerator generator;
protected org.bukkit.World.Environment environment;
public org.spigotmc.SpigotWorldConfig spigotConfig;
@SuppressWarnings("unused") // Access transformed to public by ArclightMixinPlugin
private static BlockPos lastPhysicsProblem; // Spigot
public void arclight$constructor(ISpawnWorldInfo worldInfo, RegistryKey<World> dimension, final DimensionType dimensionType, Supplier<IProfiler> profiler, boolean isRemote, boolean isDebug, long seed) {
throw new RuntimeException();
@ -167,12 +169,16 @@ public abstract class WorldMixin implements WorldBridge {
@Inject(method = "markAndNotifyBlock", cancellable = true, at = @At(value = "INVOKE", target = "Lnet/minecraft/block/BlockState;updateNeighbours(Lnet/minecraft/world/IWorld;Lnet/minecraft/util/math/BlockPos;II)V"))
private void arclight$callBlockPhysics(BlockPos pos, Chunk chunk, BlockState blockstate, BlockState state, int flags, int recursionLeft, CallbackInfo ci) {
if (this.world != null) {
BlockPhysicsEvent event = new BlockPhysicsEvent(CraftBlock.at((IWorld) this, pos), CraftBlockData.fromData(state));
Bukkit.getPluginManager().callEvent(event);
if (event.isCancelled()) {
ci.cancel();
try {
if (this.world != null) {
BlockPhysicsEvent event = new BlockPhysicsEvent(CraftBlock.at((IWorld) this, pos), CraftBlockData.fromData(state));
Bukkit.getPluginManager().callEvent(event);
if (event.isCancelled()) {
ci.cancel();
}
}
} catch(StackOverflowError e) {
lastPhysicsProblem = pos;
}
}
@ -180,13 +186,17 @@ public abstract class WorldMixin implements WorldBridge {
at = @At(value = "INVOKE", target = "Lnet/minecraft/block/BlockState;neighborChanged(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;Lnet/minecraft/util/math/BlockPos;Z)V"),
locals = LocalCapture.CAPTURE_FAILHARD)
private void arclight$callBlockPhysics2(BlockPos pos, Block blockIn, BlockPos fromPos, CallbackInfo ci, BlockState blockState) {
if (this.world != null) {
IWorld iWorld = (IWorld) this;
BlockPhysicsEvent event = new BlockPhysicsEvent(CraftBlock.at(iWorld, pos), CraftBlockData.fromData(blockState), CraftBlock.at(iWorld, fromPos));
Bukkit.getPluginManager().callEvent(event);
if (event.isCancelled()) {
ci.cancel();
try {
if (this.world != null) {
IWorld iWorld = (IWorld) this;
BlockPhysicsEvent event = new BlockPhysicsEvent(CraftBlock.at(iWorld, pos), CraftBlockData.fromData(blockState), CraftBlock.at(iWorld, fromPos));
Bukkit.getPluginManager().callEvent(event);
if (event.isCancelled()) {
ci.cancel();
}
}
} catch(StackOverflowError e) {
lastPhysicsProblem = pos;
}
}

View File

@ -27,6 +27,13 @@ public class ArclightMixinPlugin implements IMixinConfigPlugin {
private final Map<String, Map.Entry<List<FieldNode>, List<MethodNode>>> accessTransformer =
ImmutableMap.<String, Map.Entry<List<FieldNode>, List<MethodNode>>>builder()
.put("net.minecraft.world.World",
Maps.immutableEntry(
ImmutableList.of(
new FieldNode(Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC, "lastPhysicsProblem", "Lnet/minecraft/util/math/BlockPos;", null, null)
),
ImmutableList.of()
))
.put("net.minecraft.server.MinecraftServer",
Maps.immutableEntry(
ImmutableList.of(

View File

@ -418,7 +418,8 @@ protected-f net.minecraft.server.MinecraftServer field_240768_i_
public-f net.minecraft.world.WorldSettings field_77170_d
public-f net.minecraft.world.WorldSettings field_234943_a_
public net.minecraft.entity.projectile.FishingBobberEntity$State
public net.minecraft.world.biome.BiomeContainer field_242704_g
public net.minecraft.world.chunk.NibbleArray func_177482_a(II)V # setIndex
public net.minecraft.world.biome.BiomeContainer field_242704_g # biomeRegistry
public net.minecraft.util.datafix.fixes.BlockStateFlatteningMap func_199194_a(ILjava/lang/String;[Ljava/lang/String;)V
public net.minecraft.entity.item.ArmorStandEntity field_175442_bg
public net.minecraft.entity.projectile.FishingBobberEntity field_184528_c
@ -433,4 +434,4 @@ public net.minecraft.entity.item.TNTEntity field_94084_b
public net.minecraft.item.ItemUseContext <init>(Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/Hand;Lnet/minecraft/item/ItemStack;Lnet/minecraft/util/math/BlockRayTraceResult;)V
public net.minecraft.server.MinecraftServer field_240767_f_
public net.minecraft.block.SoundType field_185862_o
public net.minecraft.block.SoundType field_185865_r
public net.minecraft.block.SoundType field_185865_r

5
arclight-forge-1.16/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
/build/
/bin/
/.project
/.classpath
/.settings/

View File

@ -7,7 +7,7 @@ buildscript {
maven { url = 'https://maven.izzel.io/releases' }
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: "${forge_gradle_version}"
classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
classpath "io.izzel.arclight:arclight-gradle-plugin:$agpVersion"
}
@ -38,7 +38,7 @@ sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = co
configurations {
embed
compile.extendsFrom(embed)
implementation.extendsFrom(embed)
}
minecraft {
@ -69,8 +69,8 @@ def embedLibs = [/*'org.spongepowered:mixin:0.8.1',*/ 'org.ow2.asm:asm-util:9.0'
dependencies {
minecraft "net.minecraftforge:forge:$minecraftVersion-$forgeVersion"
compile group: 'org.jetbrains', name: 'annotations', version: '19.0.0'
compile(project(':arclight-common')) {
implementation group: 'org.jetbrains', name: 'annotations', version: '19.0.0'
implementation(project(':arclight-common')) {
exclude module: 'forge'
}
embed project(':i18n-config')
@ -80,7 +80,7 @@ dependencies {
}
embed 'net.md-5:bungeecord-chat:1.16-R0.4@jar'
embed "org.spigotmc:spigot-api:$minecraftVersion-R0.1-SNAPSHOT@jar"
embed 'com.github.ArclightTeam:mixin-tools:1.0.0@jar'
embed 'com.github.ArclightTeam:mixin-tools:1.0.0@jar'
}
def getGitHash = { ->
@ -165,7 +165,7 @@ task sourceJar(type: Jar) {
publishing {
repositories {
maven {
name = "IzzelAliz Repo"
name = "IzzelAliz"
url = uri('https://maven.izzel.io/' + (project.version.toString().endsWith('SNAPSHOT') ? 'snapshots' : 'releases'))
credentials {
username = project.findProperty("mavenUser") ?: System.getenv("ARCLIGHT_USER")

5
forge-installer/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
/bin/
/.project
/.classpath
/.settings/
/build/

View File

@ -1 +1,2 @@
org.gradle.jvmargs=-Xmx4g -Dfile.encoding=utf-8
org.gradle.jvmargs=-Xmx4g -Dfile.encoding=utf-8
forge_gradle_version=4.0.13

View File

@ -1,5 +1,5 @@
#Sun Feb 09 15:27:43 CST 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists

5
i18n-config/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
/build/
/bin/
/.project
/.classpath
/.settings/