diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..72d49ec5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +/.gradle/ +/.settings/ +/build/ +/bin/ +/.project +/.settings/ diff --git a/arclight-api/.gitignore b/arclight-api/.gitignore new file mode 100644 index 00000000..bbf8b21f --- /dev/null +++ b/arclight-api/.gitignore @@ -0,0 +1,5 @@ +/build/ +/bin/ +/.project +/.classpath +/.settings/ diff --git a/arclight-common/.gitignore b/arclight-common/.gitignore new file mode 100644 index 00000000..bd513ae6 --- /dev/null +++ b/arclight-common/.gitignore @@ -0,0 +1,5 @@ +/build/ +/bin/ +/.project +/.classpath +/.settings/ \ No newline at end of file diff --git a/arclight-common/build.gradle b/arclight-common/build.gradle index bf28614a..5ed0991a 100644 --- a/arclight-common/build.gradle +++ b/arclight-common/build.gradle @@ -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 { diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/WorldMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/WorldMixin.java index 743784f3..c0241b2a 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/WorldMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/WorldMixin.java @@ -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 dimension, final DimensionType dimensionType, Supplier 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; } } diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mod/ArclightMixinPlugin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mod/ArclightMixinPlugin.java index f7688bf4..35d39439 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mod/ArclightMixinPlugin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mod/ArclightMixinPlugin.java @@ -27,6 +27,13 @@ public class ArclightMixinPlugin implements IMixinConfigPlugin { private final Map, List>> accessTransformer = ImmutableMap., List>>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( diff --git a/arclight-common/src/main/resources/META-INF/accesstransformer.cfg b/arclight-common/src/main/resources/META-INF/accesstransformer.cfg index 7b6ce11c..4bd1e535 100644 --- a/arclight-common/src/main/resources/META-INF/accesstransformer.cfg +++ b/arclight-common/src/main/resources/META-INF/accesstransformer.cfg @@ -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 (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 \ No newline at end of file diff --git a/arclight-forge-1.16/.gitignore b/arclight-forge-1.16/.gitignore new file mode 100644 index 00000000..bd513ae6 --- /dev/null +++ b/arclight-forge-1.16/.gitignore @@ -0,0 +1,5 @@ +/build/ +/bin/ +/.project +/.classpath +/.settings/ \ No newline at end of file diff --git a/arclight-forge-1.16/build.gradle b/arclight-forge-1.16/build.gradle index 4db50085..7d3422da 100644 --- a/arclight-forge-1.16/build.gradle +++ b/arclight-forge-1.16/build.gradle @@ -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") diff --git a/forge-installer/.gitignore b/forge-installer/.gitignore new file mode 100644 index 00000000..af702842 --- /dev/null +++ b/forge-installer/.gitignore @@ -0,0 +1,5 @@ +/bin/ +/.project +/.classpath +/.settings/ +/build/ diff --git a/gradle.properties b/gradle.properties index 10ac8f35..ae063600 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1,2 @@ -org.gradle.jvmargs=-Xmx4g -Dfile.encoding=utf-8 \ No newline at end of file +org.gradle.jvmargs=-Xmx4g -Dfile.encoding=utf-8 +forge_gradle_version=4.0.13 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 808f40af..e11710aa 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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 diff --git a/i18n-config/.gitignore b/i18n-config/.gitignore new file mode 100644 index 00000000..bd513ae6 --- /dev/null +++ b/i18n-config/.gitignore @@ -0,0 +1,5 @@ +/build/ +/bin/ +/.project +/.classpath +/.settings/ \ No newline at end of file