From b7e47a47ed82d88177f5d07af9af18a3d5e5c069 Mon Sep 17 00:00:00 2001 From: IzzelAliz Date: Fri, 18 Sep 2020 09:21:59 +0800 Subject: [PATCH] Update mappings 20200916, 1.16.3 (#49)(#52) Fix UUID not sent in chat packet, close #52. --- arclight-common/build.gradle | 8 +-- arclight-common/extra_mapping.tsrg | 51 ++++++++++++++++++- .../mixin/core/block/IceBlockMixin.java | 2 +- .../core/block/RedstoneWireBlockMixin.java | 2 +- .../mixin/core/block/VineBlockMixin.java | 16 +++--- .../FrostWalkerEnchantmentMixin.java | 2 +- .../common/mixin/core/entity/EntityMixin.java | 6 +-- .../core/entity/ai/brain/BrainUtilMixin.java | 4 +- .../task/CreateBabyVillagerTaskMixin.java | 2 +- .../ai/brain/task/FarmerWorkTaskMixin.java | 4 +- .../brain/task/InteractWithDoorTaskMixin.java | 8 +-- .../entity/monster/ZombieEntityMixin.java | 2 +- .../monster/ZombieVillagerEntityMixin.java | 2 +- .../monster/piglin/PiglinTasksMixin.java | 2 +- .../core/entity/passive/CowEntityMixin.java | 2 +- .../entity/passive/MooshroomEntityMixin.java | 4 +- .../entity/passive/ParrotEntityMixin.java | 2 +- .../player/ServerPlayerEntityMixin.java | 8 +-- .../projectile/ShulkerBulletEntityMixin.java | 10 ++++ .../mixin/core/item/BlockItemMixin.java | 2 +- .../mixin/core/item/BucketItemMixin.java | 4 +- .../mixin/core/item/MerchantOfferMixin.java | 2 +- .../mixin/core/item/SpawnEggItemMixin.java | 2 +- .../core/loot/LootEntry_SerializerMixin.java | 8 +-- .../network/play/server/SChatPacketMixin.java | 3 ++ .../play/server/SWorldBorderPacketMixin.java | 4 +- .../core/server/MinecraftServerMixin.java | 4 +- .../server/management/PlayerListMixin.java | 4 +- .../mixin/core/util/text/ColorMixin.java | 4 +- .../mixin/core/world/ExplosionMixin.java | 12 ++--- .../mixin/core/world/TeleporterMixin.java | 18 +++---- .../common/mixin/core/world/WorldMixin.java | 2 +- .../common/mod/server/BukkitRegistry.java | 6 +-- .../common/mod/util/DelegateWorldInfo.java | 8 +-- arclight-forge-1.16/build.gradle | 8 +-- 35 files changed, 145 insertions(+), 83 deletions(-) diff --git a/arclight-common/build.gradle b/arclight-common/build.gradle index 8dd9b956..e4bc3ac9 100644 --- a/arclight-common/build.gradle +++ b/arclight-common/build.gradle @@ -20,8 +20,8 @@ apply plugin: 'idea' apply plugin: 'io.izzel.arclight' ext { - minecraftVersion = '1.16.2' - forgeVersion = '33.0.22' + minecraftVersion = '1.16.3' + forgeVersion = '34.0.8' } arclight { @@ -36,7 +36,7 @@ arclight { sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' minecraft { - mappings channel: 'snapshot', version: "20200820-1.16.1" + mappings channel: 'snapshot', version: "20200916-1.16.2" accessTransformer = project.file('src/main/resources/META-INF/accesstransformer.cfg') } @@ -55,7 +55,7 @@ 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' + compile 'org.spongepowered:mixin:0.8.1' compile 'com.github.ArclightTeam:mixin-tools:1.0.0' compile 'jline:jline:2.12.1' compile 'net.md-5:SpecialSource:1.8.6' diff --git a/arclight-common/extra_mapping.tsrg b/arclight-common/extra_mapping.tsrg index 92ca2f87..a1a6a112 100644 --- a/arclight-common/extra_mapping.tsrg +++ b/arclight-common/extra_mapping.tsrg @@ -11,5 +11,54 @@ net/minecraft/entity/monster/MonsterEntity net/minecraft/entity/monster/MonsterE setAttackTarget (Lnet/minecraft/entity/LivingEntity;)V func_70624_b net/minecraft/entity/passive/WolfEntity net/minecraft/entity/passive/WolfEntity setHealth (F)V func_70606_j + heal (F)V func_70691_i net/minecraft/block/BlockState net/minecraft/block/BlockState - get (Lnet/minecraft/state/Property;)Ljava/lang/Comparable; func_177229_b \ No newline at end of file + get (Lnet/minecraft/state/Property;)Ljava/lang/Comparable; func_177229_b +net/minecraft/entity/item/ArmorStandEntity net/minecraft/entity/item/ArmorStandEntity + remove ()V func_70106_y + setLocationAndAngles (DDDFF)V func_70012_b +net/minecraft/entity/merchant/villager/VillagerEntity net/minecraft/entity/merchant/villager/VillagerEntity + addPotionEffect (Lnet/minecraft/potion/EffectInstance;)Z func_195064_c +net/minecraft/entity/monster/SpiderEntity net/minecraft/entity/monster/SpiderEntity + addPotionEffect (Lnet/minecraft/potion/EffectInstance;)Z func_195064_c +net/minecraft/entity/monster/WitchEntity net/minecraft/entity/monster/WitchEntity + addPotionEffect (Lnet/minecraft/potion/EffectInstance;)Z func_195064_c +net/minecraft/entity/passive/ParrotEntity net/minecraft/entity/passive/ParrotEntity + addPotionEffect (Lnet/minecraft/potion/EffectInstance;)Z func_195064_c +net/minecraft/entity/monster/ZombieVillagerEntity net/minecraft/entity/monster/ZombieVillagerEntity + addPotionEffect (Lnet/minecraft/potion/EffectInstance;)Z func_195064_c + removePotionEffect (Lnet/minecraft/potion/Effect;)Z func_195063_d +net/minecraft/entity/MobEntity net/minecraft/entity/MobEntity + entityDropItem (Lnet/minecraft/util/IItemProvider;)Lnet/minecraft/entity/item/ItemEntity; func_199703_a +net/minecraft/entity/passive/ChickenEntity net/minecraft/entity/passive/ChickenEntity + entityDropItem (Lnet/minecraft/util/IItemProvider;)Lnet/minecraft/entity/item/ItemEntity; func_199703_a +net/minecraft/entity/passive/SheepEntity net/minecraft/entity/passive/SheepEntity + entityDropItem (Lnet/minecraft/util/IItemProvider;I)Lnet/minecraft/entity/item/ItemEntity; func_199702_a +net/minecraft/entity/passive/TurtleEntity net/minecraft/entity/passive/TurtleEntity + entityDropItem (Lnet/minecraft/util/IItemProvider;I)Lnet/minecraft/entity/item/ItemEntity; func_199702_a +net/minecraft/entity/monster/AbstractSkeletonEntity net/minecraft/entity/monster/AbstractSkeletonEntity + playSound (Lnet/minecraft/util/SoundEvent;FF)V func_184185_a +net/minecraft/entity/projectile/FishingBobberEntity net/minecraft/entity/projectile/FishingBobberEntity + playSound (Lnet/minecraft/util/SoundEvent;FF)V func_184185_a +net/minecraft/entity/monster/CreeperEntity net/minecraft/entity/monster/CreeperEntity + dataManager field_70180_af +net/minecraft/entity/passive/DolphinEntity net/minecraft/entity/passive/DolphinEntity + setItemStackToSlot (Lnet/minecraft/inventory/EquipmentSlotType;Lnet/minecraft/item/ItemStack;)V func_184201_a +net/minecraft/entity/monster/ShulkerEntity net/minecraft/entity/monster/ShulkerEntity + forceSetPosition (DDD)V func_226286_f_ +net/minecraft/entity/passive/horse/AbstractHorseEntity net/minecraft/entity/passive/horse/AbstractHorseEntity + heal (F)V func_70691_i +net/minecraft/entity/player/ServerPlayerEntity net/minecraft/entity/player/ServerPlayerEntity + ticksExisted field_70173_aa + addPotionEffect (Lnet/minecraft/potion/EffectInstance;)Z func_195064_c +net/minecraft/entity/player/PlayerEntity net/minecraft/entity/player/PlayerEntity + rotationYaw field_70177_z + setFlag (IZ)V func_70052_a +net/minecraft/block/SweetBerryBushBlock net/minecraft/block/SweetBerryBushBlock + spawnAsEntity (Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/item/ItemStack;)V func_180635_a +net/minecraft/entity/passive/TameableEntity net/minecraft/entity/passive/TameableEntity + setLocationAndAngles (DDDFF)V func_70012_b +net/minecraft/entity/boss/dragon/EnderDragonEntity net/minecraft/entity/boss/dragon/EnderDragonEntity + setHealth (F)V func_70606_j +net/minecraft/entity/monster/AbstractRaiderEntity net/minecraft/entity/monster/AbstractRaiderEntity + setAttackTarget (Lnet/minecraft/entity/LivingEntity;)V func_70624_b \ No newline at end of file diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/block/IceBlockMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/block/IceBlockMixin.java index a1785e35..0e9e4a03 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/block/IceBlockMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/block/IceBlockMixin.java @@ -16,7 +16,7 @@ public class IceBlockMixin { @Inject(method = "turnIntoWater", cancellable = true, at = @At("HEAD")) public void arclight$blockFade(BlockState blockState, World world, BlockPos blockPos, CallbackInfo ci) { - if (CraftEventFactory.callBlockFadeEvent(world, blockPos, world.func_230315_m_().func_236040_e_() + if (CraftEventFactory.callBlockFadeEvent(world, blockPos, world.getDimensionType().isUltrawarm() ? Blocks.AIR.getDefaultState() : Blocks.WATER.getDefaultState()).isCancelled()) { ci.cancel(); } diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/block/RedstoneWireBlockMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/block/RedstoneWireBlockMixin.java index b659312a..19ea02a1 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/block/RedstoneWireBlockMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/block/RedstoneWireBlockMixin.java @@ -19,7 +19,7 @@ public abstract class RedstoneWireBlockMixin { @Shadow protected abstract int getStrongestSignal(World world, BlockPos pos); // @formatter:on - @Redirect(method = "func_235547_a_", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/RedstoneWireBlock;getStrongestSignal(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)I")) + @Redirect(method = "updatePower", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/RedstoneWireBlock;getStrongestSignal(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)I")) public int arclight$blockRedstone(RedstoneWireBlock redstoneWireBlock, World world, BlockPos pos, World world1, BlockPos pos1, BlockState state) { int i = this.getStrongestSignal(world, pos); int oldPower = state.get(RedstoneWireBlock.POWER); diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/block/VineBlockMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/block/VineBlockMixin.java index fdcf3fb2..dd8d1853 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/block/VineBlockMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/block/VineBlockMixin.java @@ -21,11 +21,11 @@ public abstract class VineBlockMixin extends BlockMixin { // @formatter:off @Shadow public static BooleanProperty getPropertyFor(Direction side) { return null; } - @Shadow protected abstract boolean func_196539_a(IBlockReader p_196539_1_, BlockPos p_196539_2_); + @Shadow protected abstract boolean hasVineBelow(IBlockReader p_196539_1_, BlockPos p_196539_2_); @Shadow public static boolean canAttachTo(IBlockReader p_196542_0_, BlockPos worldIn, Direction neighborPos) { return false; } @Shadow @Final public static BooleanProperty UP; - @Shadow protected abstract boolean func_196541_a(IBlockReader p_196541_1_, BlockPos p_196541_2_, Direction p_196541_3_); - @Shadow protected abstract boolean func_196540_x(BlockState p_196540_1_); + @Shadow protected abstract boolean hasAttachment(IBlockReader p_196541_1_, BlockPos p_196541_2_, Direction p_196541_3_); + @Shadow protected abstract boolean isFacingCardinal(BlockState p_196540_1_); @Shadow protected abstract BlockState func_196544_a(BlockState p_196544_1_, BlockState p_196544_2_, Random p_196544_3_); // @formatter:on @@ -40,7 +40,7 @@ public abstract class VineBlockMixin extends BlockMixin { Direction direction = Direction.getRandomDirection(random); BlockPos blockpos = pos.up(); if (direction.getAxis().isHorizontal() && !state.get(getPropertyFor(direction))) { - if (this.func_196539_a(worldIn, pos)) { + if (this.hasVineBelow(worldIn, pos)) { BlockPos blockpos4 = pos.offset(direction); BlockState blockstate4 = worldIn.getBlockState(blockpos4); if (blockstate4.isAir(worldIn, blockpos4)) { @@ -71,13 +71,13 @@ public abstract class VineBlockMixin extends BlockMixin { } } else { if (direction == Direction.UP && pos.getY() < 255) { - if (this.func_196541_a(worldIn, pos, direction)) { + if (this.hasAttachment(worldIn, pos, direction)) { worldIn.setBlockState(pos, state.with(UP, Boolean.TRUE), 2); return; } if (worldIn.isAirBlock(blockpos)) { - if (!this.func_196539_a(worldIn, pos)) { + if (!this.hasVineBelow(worldIn, pos)) { return; } @@ -89,7 +89,7 @@ public abstract class VineBlockMixin extends BlockMixin { } } - if (this.func_196540_x(blockstate3)) { + if (this.isFacingCardinal(blockstate3)) { CraftEventFactory.handleBlockSpreadEvent(worldIn, pos, blockpos, blockstate3, 2); } @@ -103,7 +103,7 @@ public abstract class VineBlockMixin extends BlockMixin { if (blockstate.isAir(worldIn, blockpos) || blockstate.isIn((Block) (Object) this)) { BlockState blockstate1 = blockstate.isAir() ? this.getDefaultState() : blockstate; BlockState blockstate2 = this.func_196544_a(state, blockstate1, random); - if (blockstate1 != blockstate2 && this.func_196540_x(blockstate2)) { + if (blockstate1 != blockstate2 && this.isFacingCardinal(blockstate2)) { CraftEventFactory.handleBlockSpreadEvent(worldIn, pos, blockpos1, blockstate2, 2); } } diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/enchantment/FrostWalkerEnchantmentMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/enchantment/FrostWalkerEnchantmentMixin.java index c2ab3a63..173de8d9 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/enchantment/FrostWalkerEnchantmentMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/enchantment/FrostWalkerEnchantmentMixin.java @@ -35,7 +35,7 @@ public class FrostWalkerEnchantmentMixin { if (blockstate1.isAir(worldIn, blockpos$mutable)) { BlockState blockstate2 = worldIn.getBlockState(blockpos); boolean isFull = blockstate2.getBlock() == Blocks.WATER && blockstate2.get(FlowingFluidBlock.LEVEL) == 0; //TODO: Forge, modded waters? - if (blockstate2.getMaterial() == Material.WATER && isFull && blockstate.isValidPosition(worldIn, blockpos) && worldIn.func_226663_a_(blockstate, blockpos, ISelectionContext.dummy()) && !net.minecraftforge.event.ForgeEventFactory.onBlockPlace(living, net.minecraftforge.common.util.BlockSnapshot.create(worldIn.getDimensionKey(), worldIn, blockpos), net.minecraft.util.Direction.UP)) { + if (blockstate2.getMaterial() == Material.WATER && isFull && blockstate.isValidPosition(worldIn, blockpos) && worldIn.placedBlockCollides(blockstate, blockpos, ISelectionContext.dummy()) && !net.minecraftforge.event.ForgeEventFactory.onBlockPlace(living, net.minecraftforge.common.util.BlockSnapshot.create(worldIn.getDimensionKey(), worldIn, blockpos), net.minecraft.util.Direction.UP)) { if (CraftEventFactory.handleBlockFormEvent(worldIn, blockpos, blockstate, living)) { worldIn.getPendingBlockTicks().scheduleTick(blockpos, Blocks.FROSTED_ICE, MathHelper.nextInt(living.getRNG(), 60, 120)); } 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 9107b196..2c2210b7 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 @@ -825,7 +825,7 @@ public abstract class EntityMixin implements InternalEntityBridge, EntityBridge, Entity entity = this.getType().create(world); if (entity != null) { entity.copyDataFromOld((Entity) (Object) this); - entity.setLocationAndAngles(portalinfo.pos.x, portalinfo.pos.y, portalinfo.pos.z, portalinfo.field_242960_c, entity.rotationPitch); + entity.setLocationAndAngles(portalinfo.pos.x, portalinfo.pos.y, portalinfo.pos.z, portalinfo.rotationYaw, entity.rotationPitch); entity.setMotion(portalinfo.motion); world.addFromAnotherDimension(entity); if (((WorldBridge) world).bridge$getTypeKey() == DimensionType.THE_END) { @@ -876,7 +876,7 @@ public abstract class EntityMixin implements InternalEntityBridge, EntityBridge, double d1 = Math.max(-2.9999872E7D, worldborder.minZ() + 16.0D); double d2 = Math.min(2.9999872E7D, worldborder.maxX() - 16.0D); double d3 = Math.min(2.9999872E7D, worldborder.maxZ() - 16.0D); - double d4 = DimensionType.func_242715_a(this.world.func_230315_m_(), world.func_230315_m_()); + double d4 = DimensionType.getCoordinateDifference(this.world.getDimensionType(), world.getDimensionType()); BlockPos blockpos1 = new BlockPos(MathHelper.clamp(this.getPosX() * d4, d0, d2), this.getPosY(), MathHelper.clamp(this.getPosZ() * d4, d1, d3)); CraftPortalEvent event = this.callPortalEvent((Entity) (Object) this, world, blockpos1, PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, flag2 ? 16 : 128, 16); @@ -892,7 +892,7 @@ public abstract class EntityMixin implements InternalEntityBridge, EntityBridge, Vector3d vector3d; if (blockstate.hasProperty(BlockStateProperties.HORIZONTAL_AXIS)) { direction$axis = blockstate.get(BlockStateProperties.HORIZONTAL_AXIS); - TeleportationRepositioner.Result teleportationrepositioner$result = TeleportationRepositioner.func_243676_a(this.field_242271_ac, direction$axis, 21, Direction.Axis.Y, 21, (p_242276_2_) -> { + TeleportationRepositioner.Result teleportationrepositioner$result = TeleportationRepositioner.findLargestRectangle(this.field_242271_ac, direction$axis, 21, Direction.Axis.Y, 21, (p_242276_2_) -> { return this.world.getBlockState(p_242276_2_) == blockstate; }); vector3d = this.func_241839_a(direction$axis, teleportationrepositioner$result); diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/ai/brain/BrainUtilMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/ai/brain/BrainUtilMixin.java index 55da519c..1e74b5dd 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/ai/brain/BrainUtilMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/ai/brain/BrainUtilMixin.java @@ -18,12 +18,12 @@ import org.spongepowered.asm.mixin.injection.callback.LocalCapture; @Mixin(BrainUtil.class) public class BrainUtilMixin { - @Inject(method = "func_233865_a_", cancellable = true, at = @At("HEAD")) + @Inject(method = "spawnItemNearEntity", cancellable = true, at = @At("HEAD")) private static void arclight$noEmptyLoot(LivingEntity entity, ItemStack stack, Vector3d p_233865_2_, CallbackInfo ci) { if (stack.isEmpty()) ci.cancel(); } - @Inject(method = "func_233865_a_", cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD, + @Inject(method = "spawnItemNearEntity", cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;addEntity(Lnet/minecraft/entity/Entity;)Z")) private static void arclight$entityDropItem(LivingEntity entity, ItemStack stack, Vector3d p_233865_2_, CallbackInfo ci, double d, ItemEntity itemEntity) { EntityDropItemEvent event = new EntityDropItemEvent(((EntityBridge) entity).bridge$getBukkitEntity(), (Item) ((EntityBridge) itemEntity).bridge$getBukkitEntity()); diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/ai/brain/task/CreateBabyVillagerTaskMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/ai/brain/task/CreateBabyVillagerTaskMixin.java index f1c52243..18f4f594 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/ai/brain/task/CreateBabyVillagerTaskMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/ai/brain/task/CreateBabyVillagerTaskMixin.java @@ -14,7 +14,7 @@ import org.spongepowered.asm.mixin.injection.Redirect; @Mixin(CreateBabyVillagerTask.class) public class CreateBabyVillagerTaskMixin { - @Redirect(method = "func_242307_b", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/merchant/villager/VillagerEntity;func_241840_a(Lnet/minecraft/world/server/ServerWorld;Lnet/minecraft/entity/AgeableEntity;)Lnet/minecraft/entity/merchant/villager/VillagerEntity;")) + @Redirect(method = "createChild", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/merchant/villager/VillagerEntity;func_241840_a(Lnet/minecraft/world/server/ServerWorld;Lnet/minecraft/entity/AgeableEntity;)Lnet/minecraft/entity/merchant/villager/VillagerEntity;")) private VillagerEntity arclight$entityBreed(VillagerEntity lona, ServerWorld world, AgeableEntity anonymous) { VillagerEntity child = lona.func_241840_a(world, anonymous); if (child != null && !CraftEventFactory.callEntityBreedEvent(child, lona, anonymous, null, null, 0).isCancelled()) { diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/ai/brain/task/FarmerWorkTaskMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/ai/brain/task/FarmerWorkTaskMixin.java index c9c8ea21..70c2f483 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/ai/brain/task/FarmerWorkTaskMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/ai/brain/task/FarmerWorkTaskMixin.java @@ -14,12 +14,12 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(FarmerWorkTask.class) public class FarmerWorkTaskMixin { - @Inject(method = "func_234016_a_", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/ComposterBlock;empty(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/block/BlockState;")) + @Inject(method = "compost", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/ComposterBlock;empty(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/block/BlockState;")) private void arclight$captureVillager1(ServerWorld p_234016_1_, VillagerEntity p_234016_2_, GlobalPos p_234016_3_, BlockState p_234016_4_, CallbackInfo ci) { ArclightCaptures.captureEntityChangeBlock(p_234016_2_); } - @Inject(method = "func_234016_a_", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/ComposterBlock;attemptFill(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/server/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/block/BlockState;")) + @Inject(method = "compost", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/ComposterBlock;attemptFill(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/server/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/block/BlockState;")) private void arclight$captureVillager2(ServerWorld p_234016_1_, VillagerEntity p_234016_2_, GlobalPos p_234016_3_, BlockState p_234016_4_, CallbackInfo ci) { ArclightCaptures.captureEntityChangeBlock(p_234016_2_); } diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/ai/brain/task/InteractWithDoorTaskMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/ai/brain/task/InteractWithDoorTaskMixin.java index 7e70ea87..dda0aa6e 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/ai/brain/task/InteractWithDoorTaskMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/ai/brain/task/InteractWithDoorTaskMixin.java @@ -43,13 +43,13 @@ public abstract class InteractWithDoorTaskMixin { BlockState blockstate = worldIn.getBlockState(blockpos); if (blockstate.isIn(BlockTags.WOODEN_DOORS)) { DoorBlock doorblock = (DoorBlock) blockstate.getBlock(); - if (!doorblock.func_242664_h(blockstate)) { + if (!doorblock.isOpen(blockstate)) { EntityInteractEvent event = new org.bukkit.event.entity.EntityInteractEvent(((EntityBridge) entityIn).bridge$getBukkitEntity(), CraftBlock.at(entityIn.world, blockpos)); Bukkit.getPluginManager().callEvent(event); if (event.isCancelled()) { return; } - doorblock.func_242663_a(worldIn, blockstate, blockpos, true); + doorblock.openDoor(worldIn, blockstate, blockpos, true); } this.func_242301_c(worldIn, entityIn, blockpos); @@ -59,14 +59,14 @@ public abstract class InteractWithDoorTaskMixin { BlockState blockstate1 = worldIn.getBlockState(blockpos1); if (blockstate1.isIn(BlockTags.WOODEN_DOORS)) { DoorBlock doorblock1 = (DoorBlock) blockstate1.getBlock(); - if (!doorblock1.func_242664_h(blockstate1)) { + if (!doorblock1.isOpen(blockstate1)) { // todo check this blockpos1 EntityInteractEvent event = new org.bukkit.event.entity.EntityInteractEvent(((EntityBridge) entityIn).bridge$getBukkitEntity(), CraftBlock.at(entityIn.world, blockpos1)); Bukkit.getPluginManager().callEvent(event); if (event.isCancelled()) { return; } - doorblock1.func_242663_a(worldIn, blockstate1, blockpos1, true); + doorblock1.openDoor(worldIn, blockstate1, blockpos1, true); this.func_242301_c(worldIn, entityIn, blockpos1); } } diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/monster/ZombieEntityMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/monster/ZombieEntityMixin.java index c41ffa62..b6bfc4d4 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/monster/ZombieEntityMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/monster/ZombieEntityMixin.java @@ -66,7 +66,7 @@ public abstract class ZombieEntityMixin extends CreatureEntityMixin { } } - @Eject(method = "func_241847_a", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/merchant/villager/VillagerEntity;func_233656_b_(Lnet/minecraft/entity/EntityType;Z)Lnet/minecraft/entity/MobEntity;")) + @Eject(method = "func_241847_a", at = @At(value = "INVOKE", remap = false, target = "Lnet/minecraft/entity/merchant/villager/VillagerEntity;func_233656_b_(Lnet/minecraft/entity/EntityType;Z)Lnet/minecraft/entity/MobEntity;")) private T arclight$transform(VillagerEntity villagerEntity, EntityType entityType, boolean flag, CallbackInfo ci) { T t = this.a(entityType, flag, EntityTransformEvent.TransformReason.INFECTION, CreatureSpawnEvent.SpawnReason.INFECTION); if (t == null) { diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/monster/ZombieVillagerEntityMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/monster/ZombieVillagerEntityMixin.java index 279b8823..cb70998b 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/monster/ZombieVillagerEntityMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/monster/ZombieVillagerEntityMixin.java @@ -30,7 +30,7 @@ public abstract class ZombieVillagerEntityMixin extends ZombieEntityMixin { bridge$pushEffectCause(EntityPotionEffectEvent.Cause.CONVERSION); } - @Eject(method = "cureZombie", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/monster/ZombieVillagerEntity;func_233656_b_(Lnet/minecraft/entity/EntityType;Z)Lnet/minecraft/entity/MobEntity;")) + @Eject(method = "cureZombie", at = @At(value = "INVOKE", remap = false, target = "Lnet/minecraft/entity/monster/ZombieVillagerEntity;func_233656_b_(Lnet/minecraft/entity/EntityType;Z)Lnet/minecraft/entity/MobEntity;")) private T arclight$cure(ZombieVillagerEntity zombieVillagerEntity, EntityType entityType, boolean flag, CallbackInfo ci) { T t = this.a(entityType, flag, EntityTransformEvent.TransformReason.CURED, CreatureSpawnEvent.SpawnReason.CURED); if (t == null) { diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/monster/piglin/PiglinTasksMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/monster/piglin/PiglinTasksMixin.java index d5553907..6e39cc75 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/monster/piglin/PiglinTasksMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/monster/piglin/PiglinTasksMixin.java @@ -49,7 +49,7 @@ public abstract class PiglinTasksMixin { } Item item = itemstack.getItem(); if (func_234480_a_(item)) { - piglinEntity.getBrain().removeMemory(MemoryModuleType.field_242310_O); + piglinEntity.getBrain().removeMemory(MemoryModuleType.TIME_TRYING_TO_REACH_ADMIRE_ITEM); func_241427_c_(piglinEntity, itemstack); func_234501_d_(piglinEntity); } else if (func_234499_c_(item) && !func_234538_z_(piglinEntity)) { diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/passive/CowEntityMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/passive/CowEntityMixin.java index bc8c3aee..ef09d827 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/passive/CowEntityMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/passive/CowEntityMixin.java @@ -31,7 +31,7 @@ public abstract class CowEntityMixin extends AnimalEntityMixin { if (event.isCancelled()) { return ActionResultType.PASS; } - ItemStack itemstack1 = DrinkHelper.func_242398_a(itemstack, playerEntity, CraftItemStack.asNMSCopy(event.getItemStack())); + ItemStack itemstack1 = DrinkHelper.fill(itemstack, playerEntity, CraftItemStack.asNMSCopy(event.getItemStack())); playerEntity.setHeldItem(hand, itemstack1); return ActionResultType.func_233537_a_(this.world.isRemote); } else { 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 954ccf87..5e52057f 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,11 @@ import java.util.List; @Mixin(MooshroomEntity.class) public abstract class MooshroomEntityMixin extends AnimalEntityMixin { - @Redirect(method = "onSheared", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/MooshroomEntity;remove()V")) + @Redirect(method = "onSheared", remap = false, at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/MooshroomEntity;remove()V")) private void arclight$animalTransformPre(MooshroomEntity mooshroomEntity) { } - @Inject(method = "onSheared", cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;addEntity(Lnet/minecraft/entity/Entity;)Z")) + @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")) 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-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/passive/ParrotEntityMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/passive/ParrotEntityMixin.java index c695c939..eed01d40 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/passive/ParrotEntityMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/passive/ParrotEntityMixin.java @@ -19,7 +19,7 @@ public abstract class ParrotEntityMixin extends AnimalEntityMixin { bridge$pushEffectCause(EntityPotionEffectEvent.Cause.FOOD); } - @Redirect(method = "attackEntityFrom", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/ParrotEntity;func_233687_w_(Z)V")) + @Redirect(method = "attackEntityFrom", at = @At(value = "INVOKE", remap = false, target = "Lnet/minecraft/entity/passive/ParrotEntity;func_233687_w_(Z)V")) private void arclight$handledInSuper(ParrotEntity parrotEntity, boolean p_233687_1_) { } } diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/player/ServerPlayerEntityMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/player/ServerPlayerEntityMixin.java index ce258201..0a01e2f3 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/player/ServerPlayerEntityMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/player/ServerPlayerEntityMixin.java @@ -193,7 +193,7 @@ public abstract class ServerPlayerEntityMixin extends PlayerEntityMixin implemen public final BlockPos getSpawnPoint(ServerWorld worldserver) { BlockPos blockposition = worldserver.getSpawnPoint(); - if (worldserver.func_230315_m_().hasSkyLight() && worldserver.field_241103_E_.getGameType() != GameType.ADVENTURE) { + if (worldserver.getDimensionType().hasSkyLight() && worldserver.field_241103_E_.getGameType() != GameType.ADVENTURE) { long k; long l; int i = Math.max(0, this.server.getSpawnRadius(worldserver)); @@ -483,7 +483,7 @@ public abstract class ServerPlayerEntityMixin extends PlayerEntityMixin implemen } Location enter = this.getBukkitEntity().getLocation(); - Location exit = (exitWorld[0] == null) ? null : new Location(((WorldBridge) exitWorld[0]).bridge$getWorld(), portalinfo.pos.x, portalinfo.pos.y, portalinfo.pos.z, portalinfo.field_242960_c, portalinfo.field_242961_d); + Location exit = (exitWorld[0] == null) ? null : new Location(((WorldBridge) exitWorld[0]).bridge$getWorld(), portalinfo.pos.x, portalinfo.pos.y, portalinfo.pos.z, portalinfo.rotationYaw, portalinfo.rotationPitch); PlayerTeleportEvent tpEvent = new PlayerTeleportEvent(this.getBukkitEntity(), enter, exit, cause); Bukkit.getServer().getPluginManager().callEvent(tpEvent); if (tpEvent.isCancelled() || tpEvent.getTo() == null) { @@ -497,7 +497,7 @@ public abstract class ServerPlayerEntityMixin extends PlayerEntityMixin implemen this.invulnerableDimensionChange = true; IWorldInfo iworldinfo = exitWorld[0].getWorldInfo(); - this.connection.sendPacket(new SRespawnPacket(exitWorld[0].func_230315_m_(), exitWorld[0].getDimensionKey(), BiomeManager.func_235200_a_(exitWorld[0].getSeed()), this.interactionManager.getGameType(), this.interactionManager.func_241815_c_(), exitWorld[0].isDebug(), exitWorld[0].func_241109_A_(), true)); + this.connection.sendPacket(new SRespawnPacket(exitWorld[0].getDimensionType(), exitWorld[0].getDimensionKey(), BiomeManager.getHashedSeed(exitWorld[0].getSeed()), this.interactionManager.getGameType(), this.interactionManager.func_241815_c_(), exitWorld[0].isDebug(), exitWorld[0].func_241109_A_(), true)); this.connection.sendPacket(new SServerDifficultyPacket(iworldinfo.getDifficulty(), iworldinfo.isDifficultyLocked())); playerlist.updatePermissionLevel((ServerPlayerEntity) (Object) this); serverworld.removeEntity((ServerPlayerEntity) (Object) this, true); //Forge: the player entity is moved to the new world, NOT cloned. So keep the data alive with no matching invalidate call. @@ -571,7 +571,7 @@ public abstract class ServerPlayerEntityMixin extends PlayerEntityMixin implemen private Either getBedResult(BlockPos blockposition, Direction enumdirection) { if (!this.isSleeping() && this.isAlive()) { - if (!this.world.func_230315_m_().func_236043_f_()) { + if (!this.world.getDimensionType().isNatural()) { return Either.left(PlayerEntity.SleepResult.NOT_POSSIBLE_HERE); } if (!this.func_241147_a_(blockposition, enumdirection)) { diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/projectile/ShulkerBulletEntityMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/projectile/ShulkerBulletEntityMixin.java index c86f30c2..5bafceb7 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/projectile/ShulkerBulletEntityMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/entity/projectile/ShulkerBulletEntityMixin.java @@ -5,15 +5,18 @@ import io.izzel.arclight.common.mixin.core.entity.EntityMixin; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.projectile.ShulkerBulletEntity; +import net.minecraft.util.DamageSource; import net.minecraft.util.Direction; import net.minecraft.util.math.EntityRayTraceResult; import net.minecraft.world.World; +import org.bukkit.craftbukkit.v.event.CraftEventFactory; import org.bukkit.event.entity.EntityPotionEffectEvent; import org.spongepowered.asm.mixin.Mixin; 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.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import javax.annotation.Nullable; @@ -36,6 +39,13 @@ public abstract class ShulkerBulletEntityMixin extends EntityMixin { ((LivingEntityBridge) result.getEntity()).bridge$pushEffectCause(EntityPotionEffectEvent.Cause.ATTACK); } + @Inject(method = "attackEntityFrom", cancellable = true, at = @At("HEAD")) + private void arclight$damageBullet(DamageSource source, float amount, CallbackInfoReturnable cir) { + if (CraftEventFactory.handleNonLivingEntityDamageEvent((ShulkerBulletEntity) (Object) this, source, amount, false)) { + cir.setReturnValue(false); + } + } + public Entity getTarget() { return this.target; } diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/item/BlockItemMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/item/BlockItemMixin.java index 177c06a5..69cab4ee 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/item/BlockItemMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/item/BlockItemMixin.java @@ -84,7 +84,7 @@ public abstract class BlockItemMixin { protected boolean canPlace(BlockItemUseContext context, BlockState state) { PlayerEntity playerentity = context.getPlayer(); ISelectionContext iselectioncontext = playerentity == null ? ISelectionContext.dummy() : ISelectionContext.forEntity(playerentity); - boolean original = (!this.checkPosition() || state.isValidPosition(context.getWorld(), context.getPos())) && context.getWorld().func_226663_a_(state, context.getPos(), iselectioncontext); + boolean original = (!this.checkPosition() || state.isValidPosition(context.getWorld(), context.getPos())) && context.getWorld().placedBlockCollides(state, context.getPos(), iselectioncontext); Player player = (context.getPlayer() instanceof ServerPlayerEntityBridge) ? ((ServerPlayerEntityBridge) context.getPlayer()).bridge$getBukkitEntity() : null; BlockCanBuildEvent event = new BlockCanBuildEvent(CraftBlock.at(context.getWorld(), context.getPos()), player, CraftBlockData.fromData(state), original); diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/item/BucketItemMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/item/BucketItemMixin.java index 2fbbf60b..aaa332c3 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/item/BucketItemMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/item/BucketItemMixin.java @@ -72,7 +72,7 @@ public abstract class BucketItemMixin { private transient org.bukkit.inventory.@Nullable ItemStack arclight$captureItem; - @ModifyArg(method = "onItemRightClick", index = 2, at = @At(value = "INVOKE", target = "Lnet/minecraft/util/DrinkHelper;func_242398_a(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/item/ItemStack;)Lnet/minecraft/item/ItemStack;")) + @ModifyArg(method = "onItemRightClick", index = 2, at = @At(value = "INVOKE", target = "Lnet/minecraft/util/DrinkHelper;fill(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/item/ItemStack;)Lnet/minecraft/item/ItemStack;")) private ItemStack arclight$useEventItem(ItemStack itemStack) { return arclight$captureItem == null ? itemStack : CraftItemStack.asNMSCopy(arclight$captureItem); } @@ -94,7 +94,7 @@ public abstract class BucketItemMixin { private transient BlockPos arclight$click; private transient ItemStack arclight$stack; - @Inject(method = "tryPlaceContainedLiquid", cancellable = true, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/DimensionType;func_236040_e_()Z")) + @Inject(method = "tryPlaceContainedLiquid", cancellable = true, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/DimensionType;isUltrawarm()Z")) private void arclight$bucketEmpty(PlayerEntity player, World worldIn, BlockPos posIn, BlockRayTraceResult p_180616_4_, CallbackInfoReturnable cir) { if (player != null) { PlayerBucketEmptyEvent event = CraftEventFactory.callPlayerBucketEmptyEvent((ServerWorld) worldIn, player, posIn, arclight$click, arclight$direction, arclight$stack); diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/item/MerchantOfferMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/item/MerchantOfferMixin.java index 504c8454..d3a99286 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/item/MerchantOfferMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/item/MerchantOfferMixin.java @@ -37,7 +37,7 @@ public class MerchantOfferMixin implements MerchantOfferBridge { return asBukkit(); } - @Inject(method = "func_222205_b", at = @At("HEAD")) + @Inject(method = "getDiscountedBuyingStackFirst", at = @At("HEAD")) private void arclight$fix(CallbackInfoReturnable cir) { if (this.buyingStackFirst.getCount() <= 0) { cir.setReturnValue(ItemStack.EMPTY); diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/item/SpawnEggItemMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/item/SpawnEggItemMixin.java index d060b339..fe27a797 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/item/SpawnEggItemMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/item/SpawnEggItemMixin.java @@ -19,7 +19,7 @@ import java.util.Optional; @Mixin(SpawnEggItem.class) public class SpawnEggItemMixin { - @Inject(method = "func_234809_a_", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/server/ServerWorld;func_242417_l(Lnet/minecraft/entity/Entity;)V")) + @Inject(method = "getChildToSpawn", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/server/ServerWorld;func_242417_l(Lnet/minecraft/entity/Entity;)V")) private void arclight$reason(PlayerEntity p_234809_1_, MobEntity p_234809_2_, EntityType p_234809_3_, ServerWorld world, Vector3d p_234809_5_, ItemStack p_234809_6_, CallbackInfoReturnable> cir) { ((WorldBridge) world).bridge$pushAddEntityReason(CreatureSpawnEvent.SpawnReason.SPAWNER_EGG); } diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/loot/LootEntry_SerializerMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/loot/LootEntry_SerializerMixin.java index b6cf583a..07f8f05f 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/loot/LootEntry_SerializerMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/loot/LootEntry_SerializerMixin.java @@ -11,15 +11,15 @@ import org.spongepowered.asm.mixin.Shadow; public abstract class LootEntry_SerializerMixin { // @formatter:off - @Shadow public abstract void func_230424_a_(JsonObject p_230424_1_, T p_230424_2_, JsonSerializationContext p_230424_3_); - @Shadow public abstract T func_230423_a_(JsonObject p_230423_1_, JsonDeserializationContext p_230423_2_); + @Shadow public abstract void serialize(JsonObject p_230424_1_, T p_230424_2_, JsonSerializationContext p_230424_3_); + @Shadow public abstract T deserialize(JsonObject p_230423_1_, JsonDeserializationContext p_230423_2_); // @formatter:on public final void a(JsonObject object, T t0, JsonSerializationContext context) { - this.func_230424_a_(object, t0, context); + this.serialize(object, t0, context); } public final T a(JsonObject object, JsonDeserializationContext context) { - return this.func_230423_a_(object, context); + return this.deserialize(object, context); } } diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/network/play/server/SChatPacketMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/network/play/server/SChatPacketMixin.java index f5d305cd..2af73e92 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/network/play/server/SChatPacketMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/network/play/server/SChatPacketMixin.java @@ -11,6 +11,7 @@ import org.spongepowered.asm.mixin.Overwrite; import org.spongepowered.asm.mixin.Shadow; import java.io.IOException; +import java.util.UUID; @Mixin(SChatPacket.class) public class SChatPacketMixin { @@ -18,6 +19,7 @@ public class SChatPacketMixin { // @formatter:off @Shadow private ITextComponent chatComponent; @Shadow private ChatType type; + @Shadow private UUID field_240809_c_; // @formatter:on public BaseComponent[] components; @@ -34,5 +36,6 @@ public class SChatPacketMixin { buf.writeTextComponent(this.chatComponent); } buf.writeByte(this.type.getId()); + buf.writeUniqueId(this.field_240809_c_); } } diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/network/play/server/SWorldBorderPacketMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/network/play/server/SWorldBorderPacketMixin.java index 8833ba09..0809a4eb 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/network/play/server/SWorldBorderPacketMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/network/play/server/SWorldBorderPacketMixin.java @@ -19,7 +19,7 @@ public class SWorldBorderPacketMixin { @Inject(method = "(Lnet/minecraft/world/border/WorldBorder;Lnet/minecraft/network/play/server/SWorldBorderPacket$Action;)V", at = @At("RETURN")) private void arclight$nether(WorldBorder border, SWorldBorderPacket.Action actionIn, CallbackInfo ci) { - this.centerX = border.getCenterX() * (((WorldBorderBridge) border).bridge$getWorld().func_230315_m_().func_242724_f()); - this.centerZ = border.getCenterZ() * (((WorldBorderBridge) border).bridge$getWorld().func_230315_m_().func_242724_f()); + this.centerX = border.getCenterX() * (((WorldBorderBridge) border).bridge$getWorld().getDimensionType().getCoordinateScale()); + this.centerZ = border.getCenterZ() * (((WorldBorderBridge) border).bridge$getWorld().getDimensionType().getCoordinateScale()); } } diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/server/MinecraftServerMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/server/MinecraftServerMixin.java index 922924df..d3b91407 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/server/MinecraftServerMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/server/MinecraftServerMixin.java @@ -332,7 +332,7 @@ public abstract class MinecraftServerMixin extends RecursiveEventLoop> p_229976_0_, ItemStack p_229976_1_, BlockPos p_229976_2_) { } + @Shadow private static void handleExplosionDrops(ObjectArrayList> p_229976_0_, ItemStack p_229976_1_, BlockPos p_229976_2_) { } // @formatter:on - @Shadow @Final private ExplosionContext field_234893_k_; + @Shadow @Final private ExplosionContext context; @Inject(method = "(Lnet/minecraft/world/World;Lnet/minecraft/entity/Entity;DDDFZLnet/minecraft/world/Explosion$Mode;)V", at = @At("RETURN")) @@ -119,12 +119,12 @@ public abstract class ExplosionMixin implements ExplosionBridge { BlockPos blockpos = new BlockPos(d4, d6, d8); BlockState blockstate = this.world.getBlockState(blockpos); FluidState fluidstate = this.world.getFluidState(blockpos); - Optional optional = this.field_234893_k_.getExplosionResistance((Explosion) (Object) this, this.world, blockpos, blockstate, fluidstate); + Optional optional = this.context.getExplosionResistance((Explosion) (Object) this, this.world, blockpos, blockstate, fluidstate); if (optional.isPresent()) { f -= (optional.get() + 0.3F) * 0.3F; } - if (f > 0.0F && this.field_234893_k_.canExplosionDestroyBlock((Explosion) (Object) this, this.world, blockpos, blockstate, f)) { + if (f > 0.0F && this.context.canExplosionDestroyBlock((Explosion) (Object) this, this.world, blockpos, blockstate, f)) { set.add(blockpos); } @@ -242,7 +242,7 @@ public abstract class ExplosionMixin implements ExplosionBridge { } blockstate.getDrops(lootcontext$builder).forEach((p_229977_2_) -> { - func_229976_a_(objectarraylist, p_229977_2_, blockpos1); + handleExplosionDrops(objectarraylist, p_229977_2_, blockpos1); }); } @@ -268,7 +268,7 @@ public abstract class ExplosionMixin implements ExplosionBridge { } } - @Inject(method = "func_229976_a_", cancellable = true, at = @At("HEAD")) + @Inject(method = "handleExplosionDrops", cancellable = true, at = @At("HEAD")) private static void arclight$fix(ObjectArrayList> p_229976_0_, ItemStack stack, BlockPos p_229976_2_, CallbackInfo ci) { if (stack.isEmpty()) ci.cancel(); } diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/TeleporterMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/TeleporterMixin.java index fefa59d4..41f0be5f 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/TeleporterMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/TeleporterMixin.java @@ -32,12 +32,12 @@ import java.util.Optional; public abstract class TeleporterMixin implements TeleporterBridge { // @formatter:off - @Shadow public abstract Optional func_242956_a(BlockPos p_242956_1_, Direction.Axis p_242956_2_); + @Shadow public abstract Optional makePortal(BlockPos p_242956_1_, Direction.Axis p_242956_2_); @Shadow @Final protected ServerWorld world; - @Shadow public abstract Optional func_242957_a(BlockPos p_242957_1_, boolean p_242957_2_); + @Shadow public abstract Optional getExistingPortal(BlockPos p_242957_1_, boolean p_242957_2_); // @formatter:on - @ModifyVariable(method = "func_242957_a", index = 4, at = @At(value = "INVOKE", target = "Lnet/minecraft/village/PointOfInterestManager;ensureLoadedAndValid(Lnet/minecraft/world/IWorldReader;Lnet/minecraft/util/math/BlockPos;I)V")) + @ModifyVariable(method = "getExistingPortal", index = 4, at = @At(value = "INVOKE", target = "Lnet/minecraft/village/PointOfInterestManager;ensureLoadedAndValid(Lnet/minecraft/world/IWorldReader;Lnet/minecraft/util/math/BlockPos;I)V")) private int arclight$useSearchRadius(int i) { return this.arclight$searchRadius == -1 ? i : this.arclight$searchRadius; } @@ -47,7 +47,7 @@ public abstract class TeleporterMixin implements TeleporterBridge { public Optional findPortal(BlockPos pos, int searchRadius) { this.arclight$searchRadius = searchRadius; try { - return this.func_242957_a(pos, false); + return this.getExistingPortal(pos, false); } finally { this.arclight$searchRadius = -1; } @@ -58,12 +58,12 @@ public abstract class TeleporterMixin implements TeleporterBridge { return findPortal(pos, searchRadius); } - @ModifyArg(method = "func_242956_a", index = 1, at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/BlockPos;func_243514_a(Lnet/minecraft/util/math/BlockPos;ILnet/minecraft/util/Direction;Lnet/minecraft/util/Direction;)Ljava/lang/Iterable;")) + @ModifyArg(method = "makePortal", index = 1, at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/BlockPos;func_243514_a(Lnet/minecraft/util/math/BlockPos;ILnet/minecraft/util/Direction;Lnet/minecraft/util/Direction;)Ljava/lang/Iterable;")) private int arclight$changeRadius(int i) { return this.arclight$createRadius == -1 ? i : this.arclight$createRadius; } - @Redirect(method = "func_242956_a", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/server/ServerWorld;setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Z")) + @Redirect(method = "makePortal", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/server/ServerWorld;setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Z")) private boolean arclight$captureBlocks1(ServerWorld serverWorld, BlockPos pos, BlockState state) { if (this.arclight$populator == null) { this.arclight$populator = new BlockStateListPopulator(serverWorld); @@ -71,7 +71,7 @@ public abstract class TeleporterMixin implements TeleporterBridge { return this.arclight$populator.setBlockState(pos, state, 3); } - @Redirect(method = "func_242956_a", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/server/ServerWorld;setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;I)Z")) + @Redirect(method = "makePortal", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/server/ServerWorld;setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;I)Z")) private boolean arclight$captureBlocks2(ServerWorld serverWorld, BlockPos pos, BlockState state, int flags) { if (this.arclight$populator == null) { this.arclight$populator = new BlockStateListPopulator(serverWorld); @@ -80,7 +80,7 @@ public abstract class TeleporterMixin implements TeleporterBridge { } @SuppressWarnings({"unchecked", "rawtypes"}) - @Inject(method = "func_242956_a", at = @At("RETURN")) + @Inject(method = "makePortal", at = @At("RETURN")) private void arclight$portalCreate(BlockPos pos, Direction.Axis axis, CallbackInfoReturnable> cir) { CraftWorld craftWorld = ((WorldBridge) this.world).bridge$getWorld(); List blockStates; @@ -105,7 +105,7 @@ public abstract class TeleporterMixin implements TeleporterBridge { this.arclight$entity = entity; this.arclight$createRadius = createRadius; try { - return this.func_242956_a(pos, axis); + return this.makePortal(pos, axis); } finally { this.arclight$entity = null; this.arclight$createRadius = -1; 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 c4cdd250..2c4f352a 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 @@ -94,7 +94,7 @@ public abstract class WorldMixin implements WorldBridge { this.ticksPerWaterSpawns = this.getServer().getTicksPerWaterSpawns(); this.ticksPerWaterAmbientSpawns = this.getServer().getTicksPerWaterAmbientSpawns(); this.ticksPerAmbientSpawns = this.getServer().getTicksPerAmbientSpawns(); - this.typeKey = this.getServer().getHandle().getServer().func_244267_aX().func_230520_a_().func_230519_c_(dimensionType) + this.typeKey = this.getServer().getHandle().getServer().func_244267_aX().func_230520_a_().getOptionalKey(dimensionType) .orElseThrow(() -> new IllegalStateException("Unregistered dimension type: " + dimType)); } diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mod/server/BukkitRegistry.java b/arclight-common/src/main/java/io/izzel/arclight/common/mod/server/BukkitRegistry.java index 55799099..001b0e74 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mod/server/BukkitRegistry.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mod/server/BukkitRegistry.java @@ -129,17 +129,17 @@ public class BukkitRegistry { public static void registerEnvironments() { int i = World.Environment.values().length; List newTypes = new ArrayList<>(); - Registry registry = ArclightServer.getMinecraftServer().func_244267_aX().func_243612_b(Registry.DIMENSION_TYPE_KEY); + Registry registry = ArclightServer.getMinecraftServer().func_244267_aX().getRegistry(Registry.DIMENSION_TYPE_KEY); for (Map.Entry, DimensionType> entry : registry.getEntries()) { RegistryKey key = entry.getKey(); World.Environment environment = DIM_MAP.get(key); if (environment == null) { - String name = ResourceLocationUtil.standardize(key.func_240901_a_()); + String name = ResourceLocationUtil.standardize(key.getLocation()); environment = EnumHelper.makeEnum(World.Environment.class, name, i, ENV_CTOR, ImmutableList.of(i - 1)); newTypes.add(environment); ENVIRONMENT_MAP.put(i - 1, environment); DIM_MAP.put(key, environment); - ArclightMod.LOGGER.debug("Registered {} as environment {}", key.func_240901_a_(), environment); + ArclightMod.LOGGER.debug("Registered {} as environment {}", key.getLocation(), environment); i++; } } diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mod/util/DelegateWorldInfo.java b/arclight-common/src/main/java/io/izzel/arclight/common/mod/util/DelegateWorldInfo.java index 472eb10c..9849e263 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mod/util/DelegateWorldInfo.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mod/util/DelegateWorldInfo.java @@ -45,8 +45,8 @@ public class DelegateWorldInfo extends ServerWorldInfo { } @Override - public float func_241860_d() { - return derivedWorldInfo.func_241860_d(); + public float getSpawnAngle() { + return derivedWorldInfo.getSpawnAngle(); } @Override @@ -115,8 +115,8 @@ public class DelegateWorldInfo extends ServerWorldInfo { } @Override - public void func_241859_a(float p_241859_1_) { - derivedWorldInfo.func_241859_a(p_241859_1_); + public void setSpawnAngle(float p_241859_1_) { + derivedWorldInfo.setSpawnAngle(p_241859_1_); } @Override diff --git a/arclight-forge-1.16/build.gradle b/arclight-forge-1.16/build.gradle index afe43ebe..82826608 100644 --- a/arclight-forge-1.16/build.gradle +++ b/arclight-forge-1.16/build.gradle @@ -20,8 +20,8 @@ apply plugin: 'idea' apply plugin: 'io.izzel.arclight' ext { - minecraftVersion = '1.16.2' - forgeVersion = '33.0.22' + minecraftVersion = '1.16.3' + forgeVersion = '34.0.8' } arclight { @@ -41,7 +41,7 @@ configurations { } minecraft { - mappings channel: 'snapshot', version: "20200813-1.16.1" + mappings channel: 'snapshot', version: "20200916-1.16.2" accessTransformer = project(':arclight-common').file('src/main/resources/META-INF/accesstransformer.cfg') } @@ -59,7 +59,7 @@ repositories { maven { url = 'https://jitpack.io/' } } -def embedLibs = ['org.spongepowered:mixin:0.8', 'org.ow2.asm:asm-util:8.0.1', +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', 'commons-lang:commons-lang:2.6', 'com.googlecode.json-simple:json-simple:1.1.1',