Update forge to 43.1.47
This commit is contained in:
parent
ec4791afcf
commit
7ce41083cd
|
@ -6,7 +6,7 @@ A Bukkit server implementation utilizing Mixin.
|
||||||
|
|
||||||
| Release | Forge | Status | Build |
|
| Release | Forge | Status | Build |
|
||||||
|:-------------:|:-------:|:------:|:------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
|:-------------:|:-------:|:------:|:------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
||||||
| Horn (1.19.x) | 43.1.3 | ACTIVE | [![1.19 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-19?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-19) |
|
| Horn (1.19.x) | 43.1.47 | ACTIVE | [![1.19 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-19?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-19) |
|
||||||
| 1.18.x | 40.1.80 | LTS | [![1.18 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-18?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-18) |
|
| 1.18.x | 40.1.80 | LTS | [![1.18 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-18?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-18) |
|
||||||
| 1.16.x | 36.2.39 | LTS | [![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.2.39 | LTS | [![1.16 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-16?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-16) |
|
||||||
|
|
||||||
|
|
|
@ -1298,7 +1298,6 @@ public abstract class ServerPlayNetHandlerMixin implements ServerPlayNetHandlerB
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
InteractionResult enuminteractionresult = interaction.run(player, entity, hand);
|
InteractionResult enuminteractionresult = interaction.run(player, entity, hand);
|
||||||
if (ForgeHooks.onInteractEntityAt(player, entity, entity.position(), hand) != null) return;
|
|
||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
if (!itemInHand.isEmpty() && itemInHand.getCount() <= -1) {
|
if (!itemInHand.isEmpty() && itemInHand.getCount() <= -1) {
|
||||||
|
@ -1324,7 +1323,11 @@ public abstract class ServerPlayNetHandlerMixin implements ServerPlayNetHandlerB
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInteraction(InteractionHand hand, Vec3 vec) {
|
public void onInteraction(InteractionHand hand, Vec3 vec) {
|
||||||
this.performInteraction(hand, (player, e, h) -> e.interactAt(player, vec, h),
|
this.performInteraction(hand, (player, e, h) -> {
|
||||||
|
var onInteractEntityAtResult = ForgeHooks.onInteractEntityAt(player, entity, vec, hand);
|
||||||
|
if (onInteractEntityAtResult != null) return onInteractEntityAtResult;
|
||||||
|
return e.interactAt(player, vec, h);
|
||||||
|
},
|
||||||
new PlayerInteractAtEntityEvent(getCraftPlayer(), ((EntityBridge) entity).bridge$getBukkitEntity(),
|
new PlayerInteractAtEntityEvent(getCraftPlayer(), ((EntityBridge) entity).bridge$getBukkitEntity(),
|
||||||
new org.bukkit.util.Vector(vec.x, vec.y, vec.z), (hand == InteractionHand.OFF_HAND) ? EquipmentSlot.OFF_HAND : EquipmentSlot.HAND));
|
new org.bukkit.util.Vector(vec.x, vec.y, vec.z), (hand == InteractionHand.OFF_HAND) ? EquipmentSlot.OFF_HAND : EquipmentSlot.HAND));
|
||||||
}
|
}
|
||||||
|
|
|
@ -919,7 +919,7 @@ public abstract class LivingEntityMixin extends EntityMixin implements LivingEnt
|
||||||
org.bukkit.inventory.EquipmentSlot bukkitHand = null;
|
org.bukkit.inventory.EquipmentSlot bukkitHand = null;
|
||||||
for (InteractionHand hand : InteractionHand.values()) {
|
for (InteractionHand hand : InteractionHand.values()) {
|
||||||
itemstack1 = this.getItemInHand(hand);
|
itemstack1 = this.getItemInHand(hand);
|
||||||
if (itemstack1.getItem() == Items.TOTEM_OF_UNDYING) {
|
if (itemstack1.is(Items.TOTEM_OF_UNDYING) && ForgeHooks.onLivingUseTotem((LivingEntity) (Object) this, damageSourceIn, itemstack1, hand)) {
|
||||||
itemstack = itemstack1.copy();
|
itemstack = itemstack1.copy();
|
||||||
bukkitHand = CraftEquipmentSlot.getHand(hand);
|
bukkitHand = CraftEquipmentSlot.getHand(hand);
|
||||||
// itemstack1.shrink(1);
|
// itemstack1.shrink(1);
|
||||||
|
|
|
@ -22,6 +22,7 @@ import net.minecraft.world.entity.item.ItemEntity;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraftforge.common.ForgeHooks;
|
import net.minecraftforge.common.ForgeHooks;
|
||||||
|
import net.minecraftforge.event.entity.living.LivingChangeTargetEvent;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v.entity.CraftLivingEntity;
|
import org.bukkit.craftbukkit.v.entity.CraftLivingEntity;
|
||||||
import org.bukkit.craftbukkit.v.event.CraftEventFactory;
|
import org.bukkit.craftbukkit.v.event.CraftEventFactory;
|
||||||
|
@ -140,6 +141,12 @@ public abstract class MobMixin extends LivingEntityMixin implements MobEntityBri
|
||||||
} else {
|
} else {
|
||||||
livingEntity = null;
|
livingEntity = null;
|
||||||
}
|
}
|
||||||
|
var changeTargetEvent = ForgeHooks.onLivingChangeTarget((LivingEntity) (Object) this, livingEntity, LivingChangeTargetEvent.LivingTargetType.MOB_TARGET);
|
||||||
|
if (changeTargetEvent.isCanceled()) {
|
||||||
|
arclight$targetSuccess = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
livingEntity = changeTargetEvent.getNewTarget();
|
||||||
}
|
}
|
||||||
this.target = livingEntity;
|
this.target = livingEntity;
|
||||||
ForgeHooks.onLivingSetAttackTarget((Mob) (Object) this, this.target);
|
ForgeHooks.onLivingSetAttackTarget((Mob) (Object) this, this.target);
|
||||||
|
|
|
@ -5,6 +5,8 @@ import net.minecraft.world.entity.LivingEntity;
|
||||||
import net.minecraft.world.entity.Mob;
|
import net.minecraft.world.entity.Mob;
|
||||||
import net.minecraft.world.entity.ai.behavior.StartAttacking;
|
import net.minecraft.world.entity.ai.behavior.StartAttacking;
|
||||||
import net.minecraft.world.entity.ai.memory.MemoryModuleType;
|
import net.minecraft.world.entity.ai.memory.MemoryModuleType;
|
||||||
|
import net.minecraftforge.common.ForgeHooks;
|
||||||
|
import net.minecraftforge.event.entity.living.LivingChangeTargetEvent;
|
||||||
import org.bukkit.craftbukkit.v.entity.CraftLivingEntity;
|
import org.bukkit.craftbukkit.v.entity.CraftLivingEntity;
|
||||||
import org.bukkit.craftbukkit.v.event.CraftEventFactory;
|
import org.bukkit.craftbukkit.v.event.CraftEventFactory;
|
||||||
import org.bukkit.event.entity.EntityTargetEvent;
|
import org.bukkit.event.entity.EntityTargetEvent;
|
||||||
|
@ -25,7 +27,14 @@ public class StartAttackingMixin<E extends Mob> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
livingEntity = ((event.getTarget() != null) ? ((CraftLivingEntity) event.getTarget()).getHandle() : null);
|
livingEntity = ((event.getTarget() != null) ? ((CraftLivingEntity) event.getTarget()).getHandle() : null);
|
||||||
|
var changeTargetEvent = ForgeHooks.onLivingChangeTarget(mob, livingEntity, LivingChangeTargetEvent.LivingTargetType.BEHAVIOR_TARGET);
|
||||||
|
if (changeTargetEvent.isCanceled()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
livingEntity = changeTargetEvent.getNewTarget();
|
||||||
mob.getBrain().setMemory(MemoryModuleType.ATTACK_TARGET, livingEntity);
|
mob.getBrain().setMemory(MemoryModuleType.ATTACK_TARGET, livingEntity);
|
||||||
mob.getBrain().eraseMemory(MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE);
|
mob.getBrain().eraseMemory(MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE);
|
||||||
|
// noinspection removal
|
||||||
|
ForgeHooks.onLivingSetAttackTarget(mob, livingEntity, LivingChangeTargetEvent.LivingTargetType.BEHAVIOR_TARGET); // TODO: Remove in 1.20
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
package io.izzel.arclight.common.mixin.core.world.item;
|
||||||
|
|
||||||
|
import io.izzel.arclight.common.bridge.core.entity.player.ServerPlayerEntityBridge;
|
||||||
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
|
import net.minecraft.world.item.StandingAndWallBlockItem;
|
||||||
|
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.craftbukkit.v.block.CraftBlock;
|
||||||
|
import org.bukkit.craftbukkit.v.block.data.CraftBlockData;
|
||||||
|
import org.bukkit.event.block.BlockCanBuildEvent;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
||||||
|
|
||||||
|
@Mixin(StandingAndWallBlockItem.class)
|
||||||
|
public class StandingAndWallBlockItemMixin {
|
||||||
|
|
||||||
|
@Inject(method = "getPlacementState", cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD, at = @At("RETURN"))
|
||||||
|
private void arclight$blockCanPlace(BlockPlaceContext context, CallbackInfoReturnable<BlockState> cir, BlockState place, BlockState defaultReturn) {
|
||||||
|
if (defaultReturn != null) {
|
||||||
|
var result = cir.getReturnValue() != null;
|
||||||
|
var player = (context.getPlayer() instanceof ServerPlayerEntityBridge bridge) ? bridge.bridge$getBukkitEntity() : null;
|
||||||
|
|
||||||
|
var event = new BlockCanBuildEvent(CraftBlock.at(context.getLevel(), context.getClickedPos()), player, CraftBlockData.fromData(defaultReturn), result);
|
||||||
|
Bukkit.getPluginManager().callEvent(event);
|
||||||
|
|
||||||
|
cir.setReturnValue(event.isBuildable() ? defaultReturn : null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -304,6 +304,7 @@
|
||||||
"world.item.ShearsItemMixin",
|
"world.item.ShearsItemMixin",
|
||||||
"world.item.SnowballItemMixin",
|
"world.item.SnowballItemMixin",
|
||||||
"world.item.SpawnEggItemMixin",
|
"world.item.SpawnEggItemMixin",
|
||||||
|
"world.item.StandingAndWallBlockItemMixin",
|
||||||
"world.item.TridentItemMixin",
|
"world.item.TridentItemMixin",
|
||||||
"world.item.crafting.BlastingRecipeMixin",
|
"world.item.crafting.BlastingRecipeMixin",
|
||||||
"world.item.crafting.CampfireCookingRecipeMixin",
|
"world.item.crafting.CampfireCookingRecipeMixin",
|
||||||
|
|
|
@ -14,7 +14,7 @@ allprojects {
|
||||||
ext {
|
ext {
|
||||||
agpVersion = '1.23'
|
agpVersion = '1.23'
|
||||||
minecraftVersion = '1.19.2'
|
minecraftVersion = '1.19.2'
|
||||||
forgeVersion = '43.1.3'
|
forgeVersion = '43.1.47'
|
||||||
apiVersion = '1.5.0'
|
apiVersion = '1.5.0'
|
||||||
toolsVersion = '1.3.0'
|
toolsVersion = '1.3.0'
|
||||||
mixinVersion = '0.8.5'
|
mixinVersion = '0.8.5'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user