diff --git a/README.md b/README.md index 14ad8e87..38dd5741 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ A Bukkit server implementation utilizing Mixin. | Minecraft | Forge | | ---- | ---- | | ![MC 1.14.4](https://img.shields.io/badge/MC-1.14.4-FF69B4?style=flat-square) | ![Forge 28.2.0](https://img.shields.io/badge/Forge-28.2.0-purple?style=flat-square) | -| ![MC 1.15.2](https://img.shields.io/badge/MC-1.15.2-6666FF?style=flat-square) | ![Forge 28.2.0](https://img.shields.io/badge/Forge-31.2.0-AA66FF?style=flat-square) | +| ![MC 1.15.2](https://img.shields.io/badge/MC-1.15.2-6666FF?style=flat-square) | ![Forge 31.2.30](https://img.shields.io/badge/Forge-31.2.30-AA66FF?style=flat-square) | ![](.github/arclightlogo.jpg) diff --git a/arclight-common/build.gradle b/arclight-common/build.gradle index 603aafa8..cb9a4815 100644 --- a/arclight-common/build.gradle +++ b/arclight-common/build.gradle @@ -21,7 +21,7 @@ apply plugin: 'io.izzel.arclight' ext { minecraftVersion = '1.15.2' - forgeVersion = '31.2.0' + forgeVersion = '31.2.30' } arclight { @@ -36,7 +36,7 @@ arclight { sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' minecraft { - mappings channel: 'snapshot', version: "20200530-1.15.1" + mappings channel: 'snapshot', version: "20200705-1.15.1" accessTransformer = project.file('src/main/resources/META-INF/accesstransformer.cfg') } diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/v1_15/block/ChorusFlowerBlockMixin_1_15.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/v1_15/block/ChorusFlowerBlockMixin_1_15.java index 4e90c895..0d343d75 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/v1_15/block/ChorusFlowerBlockMixin_1_15.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/v1_15/block/ChorusFlowerBlockMixin_1_15.java @@ -27,7 +27,7 @@ public abstract class ChorusFlowerBlockMixin_1_15 extends BlockMixin { // @formatter:off @Shadow @Final public static IntegerProperty AGE; - @Shadow @Final private ChorusPlantBlock field_196405_b; + @Shadow @Final private ChorusPlantBlock plantBlock; @Shadow private static boolean areAllNeighborsEmpty(IWorldReader worldIn, BlockPos pos, @Nullable Direction excludingSide) { return false; } @Shadow protected abstract void placeGrownFlower(World worldIn, BlockPos pos, int age); @Shadow protected abstract void placeDeadFlower(World worldIn, BlockPos pos); @@ -52,12 +52,12 @@ public abstract class ChorusFlowerBlockMixin_1_15 extends BlockMixin { Block block = blockstate.getBlock(); if (block == Blocks.END_STONE) { flag = true; - } else if (block == this.field_196405_b) { + } else if (block == this.plantBlock) { int j = 1; for (int k = 0; k < 4; ++k) { Block block1 = worldIn.getBlockState(pos.down(j + 1)).getBlock(); - if (block1 != this.field_196405_b) { + if (block1 != this.plantBlock) { if (block1 == Blocks.END_STONE) { flag1 = true; } @@ -76,7 +76,7 @@ public abstract class ChorusFlowerBlockMixin_1_15 extends BlockMixin { if (flag && areAllNeighborsEmpty(worldIn, blockpos, (Direction) null) && worldIn.isAirBlock(pos.up(2))) { if (CraftEventFactory.handleBlockSpreadEvent(worldIn, pos, pos.up(), state.with(ChorusFlowerBlock.AGE, i), 2)) { - worldIn.setBlockState(pos, this.field_196405_b.makeConnections(worldIn, pos), 2); + worldIn.setBlockState(pos, this.plantBlock.makeConnections(worldIn, pos), 2); this.placeGrownFlower(worldIn, blockpos, i); } } else if (i < 4) { @@ -99,7 +99,7 @@ public abstract class ChorusFlowerBlockMixin_1_15 extends BlockMixin { } if (flag2) { - worldIn.setBlockState(pos, this.field_196405_b.makeConnections(worldIn, pos), 2); + worldIn.setBlockState(pos, this.plantBlock.makeConnections(worldIn, pos), 2); } else { if (CraftEventFactory.handleBlockGrowEvent(worldIn, pos, this.getDefaultState().with(ChorusFlowerBlock.AGE, 5), 2)) { this.placeDeadFlower(worldIn, pos); diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/v1_15/entity/ai/goal/FollowOwnerGoalMixin_1_15.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/v1_15/entity/ai/goal/FollowOwnerGoalMixin_1_15.java index 92f73291..2a3f3453 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/v1_15/entity/ai/goal/FollowOwnerGoalMixin_1_15.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/v1_15/entity/ai/goal/FollowOwnerGoalMixin_1_15.java @@ -24,7 +24,7 @@ public class FollowOwnerGoalMixin_1_15 { private transient boolean arclight$cancelled; - @Redirect(method = "func_226328_a_", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/TameableEntity;setLocationAndAngles(DDDFF)V")) + @Redirect(method = "tryToTeleportToLocation", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/TameableEntity;setLocationAndAngles(DDDFF)V")) public void arclight$teleport(TameableEntity tameableEntity, double x, double y, double z, float yaw, float pitch) { CraftEntity craftEntity = ((EntityBridge) this.tameable).bridge$getBukkitEntity(); Location location = new Location(craftEntity.getWorld(), x, y, z, yaw, pitch); @@ -35,7 +35,7 @@ public class FollowOwnerGoalMixin_1_15 { } } - @Inject(method = "func_226328_a_", cancellable = true, at = @At(value = "INVOKE", target = "Lnet/minecraft/pathfinding/PathNavigator;clearPath()V")) + @Inject(method = "tryToTeleportToLocation", cancellable = true, at = @At(value = "INVOKE", target = "Lnet/minecraft/pathfinding/PathNavigator;clearPath()V")) public void arclight$returnIfFail(int p_226328_1_, int p_226328_2_, int p_226328_3_, CallbackInfoReturnable cir) { if (arclight$cancelled) { cir.setReturnValue(false); diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/v1_15/item/LeadItemMixin_1_15.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/v1_15/item/LeadItemMixin_1_15.java index 6454f24a..8828ba95 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/v1_15/item/LeadItemMixin_1_15.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/v1_15/item/LeadItemMixin_1_15.java @@ -28,7 +28,7 @@ public class LeadItemMixin_1_15 { * @reason */ @Overwrite - public static ActionResultType func_226641_a_(PlayerEntity player, World worldIn, BlockPos fence) { + public static ActionResultType bindPlayerMobs(PlayerEntity player, World worldIn, BlockPos fence) { LeashKnotEntity leashknotentity = null; boolean flag = false; double d0 = 7.0D; diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mod/ArclightLocator.java b/arclight-common/src/main/java/io/izzel/arclight/common/mod/ArclightLocator.java index d8317659..c7642da2 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mod/ArclightLocator.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mod/ArclightLocator.java @@ -2,27 +2,22 @@ package io.izzel.arclight.common.mod; import com.google.common.collect.ImmutableList; import net.minecraftforge.fml.loading.moddiscovery.AbstractJarFileLocator; -import net.minecraftforge.fml.loading.moddiscovery.ModFile; import net.minecraftforge.forgespi.locating.IModFile; -import java.io.File; -import java.net.URISyntaxException; import java.util.List; import java.util.Map; -public class ArclightLocator extends AbstractJarFileLocator { +public abstract class ArclightLocator extends AbstractJarFileLocator { private final IModFile arclight; public ArclightLocator() { - try { - this.arclight = new ModFile(new File(ArclightLocator.class.getProtectionDomain().getCodeSource().getLocation().toURI()).toPath(), this); - this.modJars.put(arclight, createFileSystem(arclight)); - } catch (URISyntaxException e) { - throw new IllegalArgumentException(e); - } + this.arclight = loadJars(); + this.modJars.put(arclight, createFileSystem(arclight)); } + protected abstract IModFile loadJars(); + @Override public List scanMods() { return ImmutableList.of(arclight); diff --git a/arclight-common/src/main/resources/META-INF/services/net.minecraftforge.forgespi.locating.IModLocator b/arclight-common/src/main/resources/META-INF/services/net.minecraftforge.forgespi.locating.IModLocator deleted file mode 100644 index 6fe0525f..00000000 --- a/arclight-common/src/main/resources/META-INF/services/net.minecraftforge.forgespi.locating.IModLocator +++ /dev/null @@ -1 +0,0 @@ -io.izzel.arclight.common.mod.ArclightLocator \ No newline at end of file diff --git a/arclight-forge-1.14/src/main/java/io/izzel/arclight/impl/ArclightLocator_1_14.java b/arclight-forge-1.14/src/main/java/io/izzel/arclight/impl/ArclightLocator_1_14.java new file mode 100644 index 00000000..55a93440 --- /dev/null +++ b/arclight-forge-1.14/src/main/java/io/izzel/arclight/impl/ArclightLocator_1_14.java @@ -0,0 +1,20 @@ +package io.izzel.arclight.impl; + +import io.izzel.arclight.common.mod.ArclightLocator; +import net.minecraftforge.fml.loading.moddiscovery.ModFile; +import net.minecraftforge.forgespi.locating.IModFile; + +import java.io.File; +import java.net.URISyntaxException; + +public class ArclightLocator_1_14 extends ArclightLocator { + + @Override + protected IModFile loadJars() { + try { + return new ModFile(new File(ArclightLocator.class.getProtectionDomain().getCodeSource().getLocation().toURI()).toPath(), this); + } catch (URISyntaxException e) { + throw new RuntimeException(e); + } + } +} diff --git a/arclight-forge-1.14/src/main/resources/META-INF/services/net.minecraftforge.forgespi.locating.IModLocator b/arclight-forge-1.14/src/main/resources/META-INF/services/net.minecraftforge.forgespi.locating.IModLocator new file mode 100644 index 00000000..84201c02 --- /dev/null +++ b/arclight-forge-1.14/src/main/resources/META-INF/services/net.minecraftforge.forgespi.locating.IModLocator @@ -0,0 +1 @@ +io.izzel.arclight.impl.ArclightLocator_1_14 \ No newline at end of file diff --git a/arclight-forge-1.15/build.gradle b/arclight-forge-1.15/build.gradle index 3b857e48..57ffc5c4 100644 --- a/arclight-forge-1.15/build.gradle +++ b/arclight-forge-1.15/build.gradle @@ -21,7 +21,7 @@ apply plugin: 'io.izzel.arclight' ext { minecraftVersion = '1.15.2' - forgeVersion = '31.2.0' + forgeVersion = '31.2.30' } arclight { @@ -41,7 +41,7 @@ configurations { } minecraft { - mappings channel: 'snapshot', version: "20200530-1.15.1" + mappings channel: 'snapshot', version: "20200705-1.15.1" accessTransformer = project(':arclight-common').file('src/main/resources/META-INF/accesstransformer.cfg') } diff --git a/arclight-forge-1.15/src/main/java/io/izzel/arclight/impl/ArclightLocator_1_15.java b/arclight-forge-1.15/src/main/java/io/izzel/arclight/impl/ArclightLocator_1_15.java new file mode 100644 index 00000000..cc28a34c --- /dev/null +++ b/arclight-forge-1.15/src/main/java/io/izzel/arclight/impl/ArclightLocator_1_15.java @@ -0,0 +1,20 @@ +package io.izzel.arclight.impl; + +import io.izzel.arclight.common.mod.ArclightLocator; +import net.minecraftforge.fml.loading.moddiscovery.ModFile; +import net.minecraftforge.forgespi.locating.IModFile; + +import java.io.File; +import java.net.URISyntaxException; + +public class ArclightLocator_1_15 extends ArclightLocator { + + @Override + protected IModFile loadJars() { + try { + return ModFile.newFMLInstance(new File(ArclightLocator.class.getProtectionDomain().getCodeSource().getLocation().toURI()).toPath(), this); + } catch (URISyntaxException e) { + throw new RuntimeException(e); + } + } +} diff --git a/arclight-forge-1.15/src/main/resources/META-INF/services/net.minecraftforge.forgespi.locating.IModLocator b/arclight-forge-1.15/src/main/resources/META-INF/services/net.minecraftforge.forgespi.locating.IModLocator new file mode 100644 index 00000000..81f8c48e --- /dev/null +++ b/arclight-forge-1.15/src/main/resources/META-INF/services/net.minecraftforge.forgespi.locating.IModLocator @@ -0,0 +1 @@ +io.izzel.arclight.impl.ArclightLocator_1_15 \ No newline at end of file diff --git a/i18n-config/src/main/resources/META-INF/arclight.conf b/i18n-config/src/main/resources/META-INF/arclight.conf index ae1ce797..de97ba14 100644 --- a/i18n-config/src/main/resources/META-INF/arclight.conf +++ b/i18n-config/src/main/resources/META-INF/arclight.conf @@ -6,3 +6,8 @@ locale { optimization { remove-stream = true } +compatibility { + property-override { + + } +} \ No newline at end of file