diff --git a/README.md b/README.md index ba95c4df..f0c0c7f4 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ A Bukkit server implementation utilizing Mixin. | Minecraft | Forge | Status | Build | | :----: | :----: | :---: | :---: | -| 1.16.x | 33.0.22 | ACTIVE | [![1.16 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-16?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-16) | -| 1.15.x | 31.2.30 | ACTIVE | [![1.15 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-15?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-15) | +| 1.16.x | 34.0.8 | ACTIVE | [![1.16 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-16?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-16) | +| 1.15.x | 31.2.37 | ACTIVE | [![1.15 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-15?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-15) | | 1.14.x | 28.2.0 | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/1.0.6) | [![1.14 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight) | * Legacy version still accepts pull requests. diff --git a/arclight-api/src/main/java/io/izzel/arclight/api/ArclightVersion.java b/arclight-api/src/main/java/io/izzel/arclight/api/ArclightVersion.java index 68c031e9..7ba95701 100644 --- a/arclight-api/src/main/java/io/izzel/arclight/api/ArclightVersion.java +++ b/arclight-api/src/main/java/io/izzel/arclight/api/ArclightVersion.java @@ -6,7 +6,7 @@ public class ArclightVersion { public static final ArclightVersion v1_14 = new ArclightVersion("1.14.4", 1140, "v1_14_R1"); public static final ArclightVersion v1_15 = new ArclightVersion("1.15.2", 1152, "v1_15_R1"); - public static final ArclightVersion v1_16 = new ArclightVersion("1.16.2", 1162, "v1_16_R2"); + public static final ArclightVersion v1_16 = new ArclightVersion("1.16.3", 1163, "v1_16_R2"); private final String name; private final int num; diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/EntityMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/EntityMixin.java index 2c2210b7..9cb47d62 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/EntityMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/EntityMixin.java @@ -197,6 +197,7 @@ public abstract class EntityMixin implements InternalEntityBridge, EntityBridge, @Shadow protected abstract void setOnFireFromLava(); @Shadow protected boolean firstUpdate; @Shadow public abstract boolean isSilent(); + @Shadow public abstract void setInvisible(boolean invisible); // @formatter:on private static final int CURRENT_LEVEL = 2; @@ -207,6 +208,7 @@ public abstract class EntityMixin implements InternalEntityBridge, EntityBridge, public org.spigotmc.ActivationRange.ActivationType activationType; public boolean defaultActivationState; public long activatedTick = Integer.MIN_VALUE; + public boolean persistentInvisibility = false; @Inject(method = "", at = @At("RETURN")) private void arclight$init(EntityType entityTypeIn, World worldIn, CallbackInfo ci) { @@ -516,6 +518,12 @@ public abstract class EntityMixin implements InternalEntityBridge, EntityBridge, compound.putLong("WorldUUIDMost", ((WorldBridge) this.world).bridge$getWorld().getUID().getMostSignificantBits()); compound.putInt("Bukkit.updateLevel", CURRENT_LEVEL); compound.putInt("Spigot.ticksLived", this.ticksExisted); + if (!this.persist) { + compound.putBoolean("Bukkit.persist", this.persist); + } + if (this.persistentInvisibility) { + compound.putBoolean("Bukkit.invisible", this.persistentInvisibility); + } } @Inject(method = "writeWithoutTypeId", at = @At(value = "RETURN")) @@ -566,9 +574,21 @@ public abstract class EntityMixin implements InternalEntityBridge, EntityBridge, setWorld(bworld == null ? null : ((CraftWorld) bworld).getHandle()); } this.getBukkitEntity().readBukkitValues(compound); + if (compound.contains("Bukkit.invisible")) { + boolean bukkitInvisible = compound.getBoolean("Bukkit.invisible"); + this.setInvisible(bukkitInvisible); + this.persistentInvisibility = bukkitInvisible; + } // CraftBukkit end } + @Inject(method = "setInvisible", cancellable = true, at = @At("HEAD")) + private void arclight$preventVisible(boolean invisible, CallbackInfo ci) { + if (this.persistentInvisibility) { + ci.cancel(); + } + } + @Redirect(method = "entityDropItem(Lnet/minecraft/item/ItemStack;F)Lnet/minecraft/entity/item/ItemEntity;", at = @At(value = "INVOKE", remap = false, ordinal = 0, target = "Lnet/minecraft/entity/Entity;captureDrops()Ljava/util/Collection;")) public Collection arclight$forceDrops(Entity entity) { Collection drops = entity.captureDrops(); diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/passive/MooshroomEntityMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/passive/MooshroomEntityMixin.java index 5e52057f..ea175280 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/passive/MooshroomEntityMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/passive/MooshroomEntityMixin.java @@ -23,11 +23,13 @@ import java.util.List; @Mixin(MooshroomEntity.class) public abstract class MooshroomEntityMixin extends AnimalEntityMixin { - @Redirect(method = "onSheared", remap = false, at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/MooshroomEntity;remove()V")) + @SuppressWarnings("UnresolvedMixinReference") + @Redirect(method = "onSheared", remap = false, at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/MooshroomEntity;func_70106_y()V")) private void arclight$animalTransformPre(MooshroomEntity mooshroomEntity) { } - @Inject(method = "onSheared", remap = false, cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;addEntity(Lnet/minecraft/entity/Entity;)Z")) + @SuppressWarnings("UnresolvedMixinReference") + @Inject(method = "onSheared", remap = false, cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;func_217376_c(Lnet/minecraft/entity/Entity;)Z")) private void arclight$animalTransform(PlayerEntity player, ItemStack item, World world, BlockPos pos, int fortune, CallbackInfoReturnable> cir, CowEntity cowEntity) { if (CraftEventFactory.callEntityTransformEvent((MooshroomEntity) (Object) this, cowEntity, EntityTransformEvent.TransformReason.SHEARED).isCancelled()) { cir.setReturnValue(Collections.emptyList()); diff --git a/arclight-forge-1.16/build.gradle b/arclight-forge-1.16/build.gradle index 82826608..c113a066 100644 --- a/arclight-forge-1.16/build.gradle +++ b/arclight-forge-1.16/build.gradle @@ -64,9 +64,9 @@ def embedLibs = ['org.spongepowered:mixin:0.8.1', 'org.ow2.asm:asm-util:8.0.1', 'org.xerial:sqlite-jdbc:3.32.3', 'mysql:mysql-connector-java:5.1.49', 'commons-lang:commons-lang:2.6', 'com.googlecode.json-simple:json-simple:1.1.1', 'org.apache.logging.log4j:log4j-jul:2.11.2', 'net.md-5:SpecialSource:1.8.6', - 'net.minecraftforge:eventbus:2.0.0-milestone.1:service', 'org.jline:jline-terminal-jansi:3.12.1', - 'org.fusesource.jansi:jansi:1.18', 'org.jline:jline-terminal:3.12.1', - 'org.jline:jline-reader:3.12.1', 'jline:jline:2.12.1'] + 'org.jline:jline-terminal-jansi:3.12.1', 'org.fusesource.jansi:jansi:1.18', + 'org.jline:jline-terminal:3.12.1', 'org.jline:jline-reader:3.12.1', + 'jline:jline:2.12.1'] dependencies { minecraft "net.minecraftforge:forge:$minecraftVersion-$forgeVersion" diff --git a/forge-installer/src/main/java/io/izzel/arclight/forgeinstaller/ForgeInstaller.java b/forge-installer/src/main/java/io/izzel/arclight/forgeinstaller/ForgeInstaller.java index 7e31d2ff..52663da8 100644 --- a/forge-installer/src/main/java/io/izzel/arclight/forgeinstaller/ForgeInstaller.java +++ b/forge-installer/src/main/java/io/izzel/arclight/forgeinstaller/ForgeInstaller.java @@ -53,7 +53,8 @@ public class ForgeInstaller { private static final String SERVER_URL = "https://bmclapi2.bangbang93.com/version/%s/server"; private static final Map VERSION_HASH = ImmutableMap.of( "1.14.4", "3dc3d84a581f14691199cf6831b71ed1296a9fdf", - "1.15.2", "bb2b6b1aefcd70dfd1892149ac3a215f6c636b07" + "1.15.2", "bb2b6b1aefcd70dfd1892149ac3a215f6c636b07", + "1.16.3", "f02f4473dbf152c23d7d484952121db0b36698cb" ); public static void install() throws Throwable {