Update to 1.16.5, forge 36.0.1

This commit is contained in:
IzzelAliz 2021-01-21 22:27:58 +08:00
parent 98c16f0b15
commit c051d2ab16
11 changed files with 86 additions and 17 deletions

View File

@ -6,7 +6,7 @@ A Bukkit server implementation utilizing Mixin.
| Minecraft | Forge | Status | Build |
| :----: | :----: | :---: | :---: |
| 1.16.x | 35.1.29 | 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.16.x | 36.0.1 | 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.47 | 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) |

View File

@ -20,8 +20,8 @@ apply plugin: 'idea'
apply plugin: 'io.izzel.arclight'
ext {
minecraftVersion = '1.16.4'
forgeVersion = '35.1.29'
minecraftVersion = '1.16.5'
forgeVersion = '36.0.1'
}
arclight {
@ -53,14 +53,14 @@ 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.1'
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.3'
compile 'net.md-5:bungeecord-chat:1.16-R0.4'
compile 'mysql:mysql-connector-java:5.1.49'
compile 'org.yaml:snakeyaml:1.26'
compile 'org.yaml:snakeyaml:1.27'
compile project(':arclight-api')
compile project(':i18n-config')
}

View File

@ -1,5 +1,7 @@
package io.izzel.arclight.common.bridge.entity;
import net.minecraft.inventory.EquipmentSlotType;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Effect;
import net.minecraft.potion.EffectInstance;
import org.bukkit.craftbukkit.v.entity.CraftLivingEntity;
@ -10,6 +12,10 @@ import java.util.Optional;
public interface LivingEntityBridge extends EntityBridge {
void bridge$setSlot(EquipmentSlotType slotIn, ItemStack stack, boolean silent);
void bridge$playEquipSound(ItemStack stack, boolean silent);
boolean bridge$canPickUpLoot();
boolean bridge$isForceDrops();

View File

@ -172,6 +172,7 @@ public abstract class LivingEntityMixin extends EntityMixin implements LivingEnt
@Shadow public abstract boolean getShouldBeDead();
@Shadow public abstract int getArrowCountInEntity();
@Shadow @Final private static DataParameter<Integer> ARROW_COUNT_IN_ENTITY;
@Shadow public abstract void setItemStackToSlot(EquipmentSlotType slotIn, ItemStack stack);
// @formatter:on
public int expToDrop;
@ -1088,4 +1089,24 @@ public abstract class LivingEntityMixin extends EntityMixin implements LivingEnt
private boolean arclight$callArrowCountChange(int newCount, boolean reset) {
return CraftEventFactory.callArrowBodyCountChangeEvent((LivingEntity) (Object) this, this.getArrowCountInEntity(), newCount, reset).isCancelled();
}
public void setSlot(EquipmentSlotType slotIn, ItemStack stack, boolean silent) {
this.setItemStackToSlot(slotIn, stack);
}
@Override
public void bridge$setSlot(EquipmentSlotType slotIn, ItemStack stack, boolean silent) {
this.setSlot(slotIn, stack, silent);
}
protected void playEquipSound(ItemStack stack, boolean silent) {
if (!silent) {
this.playEquipSound(stack);
}
}
@Override
public void bridge$playEquipSound(ItemStack stack, boolean silent) {
this.playEquipSound(stack, silent);
}
}

View File

@ -15,6 +15,7 @@ import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.Slice;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(TriggerSkeletonTrapGoal.class)
@ -24,18 +25,20 @@ public class TriggerSkeletonTrapGoalMixin {
@Shadow @Final private SkeletonHorseEntity horse;
// @formatter:on
@Inject(method = "tick", at = @At(value = "INVOKE", ordinal = 0, target = "Lnet/minecraft/world/server/ServerWorld;func_242417_l(Lnet/minecraft/entity/Entity;)V"))
@Inject(method = "*", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/server/ServerWorld;func_242417_l(Lnet/minecraft/entity/Entity;)V"),
slice = @Slice(to = @At(value = "INVOKE", target = "Lnet/minecraft/entity/ai/goal/TriggerSkeletonTrapGoal;createHorse(Lnet/minecraft/world/DifficultyInstance;)Lnet/minecraft/entity/passive/horse/AbstractHorseEntity;")))
private void arclight$thunder(CallbackInfo ci) {
((WorldBridge) this.horse.world).bridge$pushAddEntityReason(CreatureSpawnEvent.SpawnReason.TRAP);
}
@Redirect(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/server/ServerWorld;addEntity(Lnet/minecraft/entity/Entity;)Z"))
@Redirect(method = "*", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/server/ServerWorld;addEntity(Lnet/minecraft/entity/Entity;)Z"))
private boolean arclight$addHorse(ServerWorld world, Entity entityIn) {
((ServerWorldBridge) world).bridge$strikeLightning((LightningBoltEntity) entityIn, LightningStrikeEvent.Cause.TRAP);
return true;
}
@Inject(method = "tick", at = @At(value = "INVOKE", ordinal = 1, target = "Lnet/minecraft/world/server/ServerWorld;func_242417_l(Lnet/minecraft/entity/Entity;)V"))
@Inject(method = "*", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/server/ServerWorld;func_242417_l(Lnet/minecraft/entity/Entity;)V"),
slice = @Slice(from = @At(value = "INVOKE", target = "Lnet/minecraft/entity/ai/goal/TriggerSkeletonTrapGoal;createHorse(Lnet/minecraft/world/DifficultyInstance;)Lnet/minecraft/entity/passive/horse/AbstractHorseEntity;")))
private void arclight$jockey(CallbackInfo ci) {
((WorldBridge) this.horse.world).bridge$pushAddEntityReason(CreatureSpawnEvent.SpawnReason.JOCKEY);
}

View File

@ -11,6 +11,7 @@ import net.minecraft.inventory.EquipmentSlotType;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.util.Hand;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.GameRules;
import net.minecraft.world.World;
@ -22,6 +23,7 @@ import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerArmorStandManipulateEvent;
import org.bukkit.inventory.EquipmentSlot;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
@ -41,6 +43,8 @@ public abstract class ArmorStandEntityMixin extends LivingEntityMixin {
// @formatter:off
@Shadow private boolean canInteract;
@Shadow public abstract ItemStack getItemStackFromSlot(EquipmentSlotType slotIn);
@Shadow @Final private NonNullList<ItemStack> handItems;
@Shadow @Final private NonNullList<ItemStack> armorItems;
// @formatter:on
@Override
@ -157,4 +161,18 @@ public abstract class ArmorStandEntityMixin extends LivingEntityMixin {
cir.setReturnValue(true);
}
}
@Override
public void setSlot(EquipmentSlotType slotIn, ItemStack stack, boolean silent) {
switch (slotIn.getSlotType()) {
case HAND:
this.bridge$playEquipSound(stack, silent);
this.handItems.set(slotIn.getIndex(), stack);
break;
case ARMOR:
this.bridge$playEquipSound(stack, silent);
this.armorItems.set(slotIn.getIndex(), stack);
}
}
}

View File

@ -27,6 +27,7 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.inventory.EnderChestInventory;
import net.minecraft.inventory.EquipmentSlotType;
import net.minecraft.inventory.container.Container;
import net.minecraft.inventory.container.PlayerContainer;
import net.minecraft.item.ItemStack;
@ -492,4 +493,18 @@ public abstract class PlayerEntityMixin extends LivingEntityMixin implements Pla
public CraftHumanEntity bridge$getBukkitEntity() {
return (CraftHumanEntity) ((InternalEntityBridge) this).internal$getBukkitEntity();
}
@Override
public void setSlot(EquipmentSlotType slotIn, ItemStack stack, boolean silent) {
if (slotIn == EquipmentSlotType.MAINHAND) {
this.bridge$playEquipSound(stack, silent);
this.inventory.mainInventory.set(this.inventory.currentItem, stack);
} else if (slotIn == EquipmentSlotType.OFFHAND) {
this.bridge$playEquipSound(stack, silent);
this.inventory.offHandInventory.set(0, stack);
} else if (slotIn.getSlotType() == EquipmentSlotType.Group.ARMOR) {
this.bridge$playEquipSound(stack, silent);
this.inventory.armorInventory.set(slotIn.getIndex(), stack);
}
}
}

View File

@ -120,7 +120,7 @@ public abstract class MinecraftServerMixin extends RecursiveEventLoop<TickDelaye
@Shadow protected abstract void func_240778_a_(IServerConfiguration p_240778_1_);
@Shadow protected IServerConfiguration serverConfig;
@Shadow private static void func_240786_a_(ServerWorld p_240786_0_, IServerWorldInfo p_240786_1_, boolean hasBonusChest, boolean p_240786_3_, boolean p_240786_4_) { }
@Shadow @Deprecated public abstract void markWorldsDirty();
@Shadow(remap = false) @Deprecated public abstract void markWorldsDirty();
// @formatter:on
public MinecraftServerMixin(String name) {

View File

@ -18,5 +18,10 @@
"net/minecraft/world/server/ChunkManager": {
"func_219210_a(Lnet/minecraft/entity/Entity;)V": "entity track",
"func_219231_b(Lnet/minecraft/entity/Entity;)V": "entity untrack"
},
"net/minecraft/world/chunk/Chunk": {
"func_177414_a(Lnet/minecraft/entity/Entity;Lnet/minecraft/util/math/AxisAlignedBB;Ljava/util/List;Ljava/util/function/Predicate;)V": "chunk entity get",
"func_217313_a(Lnet/minecraft/entity/EntityType;Lnet/minecraft/util/math/AxisAlignedBB;Ljava/util/List;Ljava/util/function/Predicate;)V": "chunk entity get",
"func_177430_a(Ljava/lang/Class;Lnet/minecraft/util/math/AxisAlignedBB;Ljava/util/List;Ljava/util/function/Predicate;)V": "chunk entity get"
}
}

View File

@ -21,8 +21,8 @@ apply plugin: 'io.izzel.arclight'
apply plugin: 'maven-publish'
ext {
minecraftVersion = '1.16.4'
forgeVersion = '35.1.29'
minecraftVersion = '1.16.5'
forgeVersion = '36.0.1'
}
arclight {
@ -58,9 +58,9 @@ repositories {
maven { url = 'https://jitpack.io/' }
}
def embedLibs = [/*'org.spongepowered:mixin:0.8.1',*/ 'org.ow2.asm:asm-util:8.0.1',
'org.ow2.asm:asm-analysis:8.0.1', 'org.yaml:snakeyaml:1.26',
'org.xerial:sqlite-jdbc:3.32.3', 'mysql:mysql-connector-java:5.1.49',
def embedLibs = [/*'org.spongepowered:mixin:0.8.1',*/ 'org.ow2.asm:asm-util:9.0',
'org.ow2.asm:asm-analysis:9.0', 'org.yaml:snakeyaml:1.27',
'org.xerial:sqlite-jdbc:3.34.0', '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',
'org.jline:jline-terminal-jansi:3.12.1', 'org.fusesource.jansi:jansi:1.18',
@ -78,7 +78,7 @@ dependencies {
for (def lib : embedLibs) {
arclight lib
}
embed 'net.md-5:bungeecord-chat:1.16-R0.3@jar'
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'
}

View File

@ -48,7 +48,8 @@ public class ForgeInstaller {
"1.14.4", "3dc3d84a581f14691199cf6831b71ed1296a9fdf",
"1.15.2", "bb2b6b1aefcd70dfd1892149ac3a215f6c636b07",
"1.16.3", "f02f4473dbf152c23d7d484952121db0b36698cb",
"1.16.4", "35139deedbd5182953cf1caa23835da59ca3d7cd"
"1.16.4", "35139deedbd5182953cf1caa23835da59ca3d7cd",
"1.16.5", "1b557e7b033b583cd9f66746b7a9ab1ec1673ced"
);
public static void install() throws Throwable {