Update to forge 40.1.31
This commit is contained in:
parent
1e501daced
commit
23e365fc14
@ -6,7 +6,7 @@ A Bukkit server implementation utilizing Mixin.
|
|||||||
|
|
||||||
| Minecraft | Forge | Status | Build |
|
| Minecraft | Forge | Status | Build |
|
||||||
| :----: |:-------:| :---: | :---: |
|
| :----: |:-------:| :---: | :---: |
|
||||||
| 1.18.x | 40.1.0 | ACTIVE | [](https://ci.appveyor.com/project/IzzelAliz/arclight-18) |
|
| 1.18.x | 40.1.31 | ACTIVE | [](https://ci.appveyor.com/project/IzzelAliz/arclight-18) |
|
||||||
| 1.17.x | 37.1.0 | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/1.17/1.0.2) | [](https://ci.appveyor.com/project/IzzelAliz/arclight-17) |
|
| 1.17.x | 37.1.0 | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/1.17/1.0.2) | [](https://ci.appveyor.com/project/IzzelAliz/arclight-17) |
|
||||||
| 1.16.x | 36.2.26 | ACTIVE | [](https://ci.appveyor.com/project/IzzelAliz/arclight-16) |
|
| 1.16.x | 36.2.26 | ACTIVE | [](https://ci.appveyor.com/project/IzzelAliz/arclight-16) |
|
||||||
| 1.15.x | 31.2.48 | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/1.15/1.0.19) | [](https://ci.appveyor.com/project/IzzelAliz/arclight-15) |
|
| 1.15.x | 31.2.48 | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/1.15/1.0.19) | [](https://ci.appveyor.com/project/IzzelAliz/arclight-15) |
|
||||||
|
|||||||
@ -590,7 +590,7 @@ public abstract class ServerPlayNetHandlerMixin implements ServerPlayNetHandlerB
|
|||||||
|
|
||||||
this.player.absMoveTo(d0, d1, d2, f, f1);
|
this.player.absMoveTo(d0, d1, d2, f, f1);
|
||||||
if (!this.player.noPhysics && !this.player.isSleeping() && (flag1 && worldserver.noCollision(this.player, axisalignedbb) || this.isPlayerCollidingWithAnythingNew((LevelReader) worldserver, axisalignedbb))) {
|
if (!this.player.noPhysics && !this.player.isSleeping() && (flag1 && worldserver.noCollision(this.player, axisalignedbb) || this.isPlayerCollidingWithAnythingNew((LevelReader) worldserver, axisalignedbb))) {
|
||||||
this.teleport(d3, d4, d5, f, f1);
|
this.internalTeleport(d3, d4, d5, f, f1, Collections.emptySet(), false); // CraftBukkit - SPIGOT-1807: Don't call teleport event, when the client thinks the player is falling, because the chunks are not loaded on the client yet.
|
||||||
} else {
|
} else {
|
||||||
this.player.absMoveTo(prevX, prevY, prevZ, prevYaw, prevPitch);
|
this.player.absMoveTo(prevX, prevY, prevZ, prevYaw, prevPitch);
|
||||||
CraftPlayer player = this.getCraftPlayer();
|
CraftPlayer player = this.getCraftPlayer();
|
||||||
@ -1166,11 +1166,11 @@ public abstract class ServerPlayNetHandlerMixin implements ServerPlayNetHandlerB
|
|||||||
if (!world.getWorldBorder().isWithinBounds(entity.blockPosition())) {
|
if (!world.getWorldBorder().isWithinBounds(entity.blockPosition())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
double d0 = 36.0D;
|
|
||||||
if (this.player.distanceToSqr(entity) < 36.0D) {
|
|
||||||
class Handler implements ServerboundInteractPacket.Handler {
|
class Handler implements ServerboundInteractPacket.Handler {
|
||||||
|
|
||||||
private void performInteraction(InteractionHand hand, ServerGamePacketListenerImpl.EntityInteraction interaction, PlayerInteractEntityEvent event) { // CraftBukkit
|
private void performInteraction(InteractionHand hand, ServerGamePacketListenerImpl.EntityInteraction interaction, PlayerInteractEntityEvent event) { // CraftBukkit
|
||||||
|
if (!player.canInteractWith(entity, 1.5D))
|
||||||
|
return; //Forge: If the entity cannot be reached, do nothing. Original check was dist < 6, range is 4.5, so vanilla used padding=1.5
|
||||||
ItemStack itemstack = player.getItemInHand(hand).copy();
|
ItemStack itemstack = player.getItemInHand(hand).copy();
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
ItemStack itemInHand = player.getItemInHand(hand);
|
ItemStack itemInHand = player.getItemInHand(hand);
|
||||||
@ -1236,7 +1236,9 @@ public abstract class ServerPlayNetHandlerMixin implements ServerPlayNetHandlerB
|
|||||||
public void onAttack() {
|
public void onAttack() {
|
||||||
if (!(entity instanceof ItemEntity) && !(entity instanceof ExperienceOrb) && !(entity instanceof AbstractArrow) && (entity != player || player.isSpectator())) {
|
if (!(entity instanceof ItemEntity) && !(entity instanceof ExperienceOrb) && !(entity instanceof AbstractArrow) && (entity != player || player.isSpectator())) {
|
||||||
ItemStack itemInHand = player.getMainHandItem();
|
ItemStack itemInHand = player.getMainHandItem();
|
||||||
|
if (player.canHit(entity, 3)) { //Forge: Perform attack range check. Original check was dist < 6, range is 3, so vanilla used padding=3
|
||||||
player.attack(entity);
|
player.attack(entity);
|
||||||
|
}
|
||||||
|
|
||||||
if (!itemInHand.isEmpty() && itemInHand.getCount() <= -1) {
|
if (!itemInHand.isEmpty() && itemInHand.getCount() <= -1) {
|
||||||
player.containerMenu.sendAllDataToRemote();
|
player.containerMenu.sendAllDataToRemote();
|
||||||
@ -1250,7 +1252,6 @@ public abstract class ServerPlayNetHandlerMixin implements ServerPlayNetHandlerB
|
|||||||
packetIn.dispatch(new Handler());
|
packetIn.dispatch(new Handler());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Inject(method = "handleContainerClose", cancellable = true, at = @At(value = "INVOKE", target = "Lnet/minecraft/server/level/ServerPlayer;doCloseContainer()V"))
|
@Inject(method = "handleContainerClose", cancellable = true, at = @At(value = "INVOKE", target = "Lnet/minecraft/server/level/ServerPlayer;doCloseContainer()V"))
|
||||||
private void arclight$invClose(ServerboundContainerClosePacket packetIn, CallbackInfo ci) {
|
private void arclight$invClose(ServerboundContainerClosePacket packetIn, CallbackInfo ci) {
|
||||||
|
|||||||
@ -20,8 +20,10 @@ import net.minecraft.world.entity.item.ItemEntity;
|
|||||||
import net.minecraft.world.item.DoubleHighBlockItem;
|
import net.minecraft.world.item.DoubleHighBlockItem;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.item.context.UseOnContext;
|
import net.minecraft.world.item.context.UseOnContext;
|
||||||
|
import net.minecraft.world.level.ChunkPos;
|
||||||
import net.minecraft.world.level.GameType;
|
import net.minecraft.world.level.GameType;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
|
import net.minecraft.world.level.block.Blocks;
|
||||||
import net.minecraft.world.level.block.CakeBlock;
|
import net.minecraft.world.level.block.CakeBlock;
|
||||||
import net.minecraft.world.level.block.DoorBlock;
|
import net.minecraft.world.level.block.DoorBlock;
|
||||||
import net.minecraft.world.level.block.TrapDoorBlock;
|
import net.minecraft.world.level.block.TrapDoorBlock;
|
||||||
@ -95,16 +97,20 @@ public abstract class ServerPlayerGameModeMixin implements PlayerInteractionMana
|
|||||||
double d2 = this.player.getY() - (blockPos.getY() + 0.5) + 1.5;
|
double d2 = this.player.getY() - (blockPos.getY() + 0.5) + 1.5;
|
||||||
double d3 = this.player.getZ() - (blockPos.getZ() + 0.5);
|
double d3 = this.player.getZ() - (blockPos.getZ() + 0.5);
|
||||||
double d4 = d0 * d0 + d2 * d2 + d3 * d3;
|
double d4 = d0 * d0 + d2 * d2 + d3 * d3;
|
||||||
double dist = player.getAttribute(net.minecraftforge.common.ForgeMod.REACH_DISTANCE.get()).getValue() + 1;
|
|
||||||
dist *= dist;
|
|
||||||
net.minecraftforge.event.entity.player.PlayerInteractEvent.LeftClickBlock forgeEvent = net.minecraftforge.common.ForgeHooks.onLeftClickBlock(player, blockPos, direction);
|
net.minecraftforge.event.entity.player.PlayerInteractEvent.LeftClickBlock forgeEvent = net.minecraftforge.common.ForgeHooks.onLeftClickBlock(player, blockPos, direction);
|
||||||
if (forgeEvent.isCanceled() || (!this.isCreative() && forgeEvent.getUseItem() == net.minecraftforge.eventbus.api.Event.Result.DENY)) { // Restore block and te data
|
if (forgeEvent.isCanceled() || (!this.isCreative() && forgeEvent.getUseItem() == net.minecraftforge.eventbus.api.Event.Result.DENY)) { // Restore block and te data
|
||||||
player.connection.send(new ClientboundBlockBreakAckPacket(blockPos, level.getBlockState(blockPos), action, false, "mod canceled"));
|
player.connection.send(new ClientboundBlockBreakAckPacket(blockPos, level.getBlockState(blockPos), action, false, "mod canceled"));
|
||||||
level.sendBlockUpdated(blockPos, level.getBlockState(blockPos), level.getBlockState(blockPos), 3);
|
level.sendBlockUpdated(blockPos, level.getBlockState(blockPos), level.getBlockState(blockPos), 3);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (d4 > dist) {
|
if (!this.player.canInteractWith(blockPos, 1)) {
|
||||||
this.player.connection.send(new ClientboundBlockBreakAckPacket(blockPos, this.level.getBlockState(blockPos), action, false, "too far"));
|
BlockState state;
|
||||||
|
if (this.player.level.getServer() != null && this.player.chunkPosition().getChessboardDistance(new ChunkPos(blockPos)) < this.player.level.getServer().getPlayerList().getViewDistance()) {
|
||||||
|
state = this.level.getBlockState(blockPos);
|
||||||
|
} else {
|
||||||
|
state = Blocks.AIR.defaultBlockState();
|
||||||
|
}
|
||||||
|
this.player.connection.send(new ClientboundBlockBreakAckPacket(blockPos, state, action, false, "too far"));
|
||||||
} else if (blockPos.getY() >= i) {
|
} else if (blockPos.getY() >= i) {
|
||||||
this.player.connection.send(new ClientboundBlockBreakAckPacket(blockPos, this.level.getBlockState(blockPos), action, false, "too high"));
|
this.player.connection.send(new ClientboundBlockBreakAckPacket(blockPos, this.level.getBlockState(blockPos), action, false, "too high"));
|
||||||
} else if (action == ServerboundPlayerActionPacket.Action.START_DESTROY_BLOCK) {
|
} else if (action == ServerboundPlayerActionPacket.Action.START_DESTROY_BLOCK) {
|
||||||
|
|||||||
@ -54,6 +54,7 @@ import net.minecraft.world.level.portal.PortalShape;
|
|||||||
import net.minecraft.world.phys.AABB;
|
import net.minecraft.world.phys.AABB;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
import net.minecraft.world.scores.Team;
|
import net.minecraft.world.scores.Team;
|
||||||
|
import net.minecraftforge.common.ForgeHooks;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
@ -857,6 +858,8 @@ public abstract class EntityMixin implements InternalEntityBridge, EntityBridge,
|
|||||||
@Overwrite(remap = false)
|
@Overwrite(remap = false)
|
||||||
@Nullable
|
@Nullable
|
||||||
public Entity changeDimension(ServerLevel server, net.minecraftforge.common.util.ITeleporter teleporter) {
|
public Entity changeDimension(ServerLevel server, net.minecraftforge.common.util.ITeleporter teleporter) {
|
||||||
|
if (!ForgeHooks.onTravelToDimension((Entity) (Object) this, server.dimension()))
|
||||||
|
return null;
|
||||||
if (this.level instanceof ServerLevel && !this.isRemoved()) {
|
if (this.level instanceof ServerLevel && !this.isRemoved()) {
|
||||||
this.level.getProfiler().push("changeDimension");
|
this.level.getProfiler().push("changeDimension");
|
||||||
if (server == null) {
|
if (server == null) {
|
||||||
|
|||||||
@ -326,7 +326,7 @@ public abstract class PlayerMixin extends LivingEntityMixin implements PlayerEnt
|
|||||||
final float f5 = 1.0f + EnchantmentHelper.getSweepingDamageRatio((net.minecraft.world.entity.player.Player) (Object) this) * f;
|
final float f5 = 1.0f + EnchantmentHelper.getSweepingDamageRatio((net.minecraft.world.entity.player.Player) (Object) this) * f;
|
||||||
final List<LivingEntity> list = this.level.getEntitiesOfClass(LivingEntity.class, this.getItemInHand(InteractionHand.MAIN_HAND).getSweepHitBox((net.minecraft.world.entity.player.Player) (Object) this, entity));
|
final List<LivingEntity> list = this.level.getEntitiesOfClass(LivingEntity.class, this.getItemInHand(InteractionHand.MAIN_HAND).getSweepHitBox((net.minecraft.world.entity.player.Player) (Object) this, entity));
|
||||||
for (final LivingEntity entityliving : list) {
|
for (final LivingEntity entityliving : list) {
|
||||||
if (entityliving != (Object) this && entityliving != entity && !this.isAlliedTo(entityliving) && (!(entityliving instanceof ArmorStand) || !((ArmorStand) entityliving).isMarker()) && this.distanceToSqr(entityliving) < 9.0 && entityliving.hurt(((DamageSourceBridge) DamageSource.playerAttack((net.minecraft.world.entity.player.Player) (Object) this)).bridge$sweep(), f5)) {
|
if (entityliving != (Object) this && entityliving != entity && !this.isAlliedTo(entityliving) && (!(entityliving instanceof ArmorStand) || !((ArmorStand) entityliving).isMarker()) && this.lastHurtByPlayer.canHit(entityliving, 0) && entityliving.hurt(((DamageSourceBridge) DamageSource.playerAttack((net.minecraft.world.entity.player.Player) (Object) this)).bridge$sweep(), f5)) {
|
||||||
entityliving.knockback(0.4f, Mth.sin(this.getYRot() * 0.017453292f), -Mth.cos(this.getYRot() * 0.017453292f));
|
entityliving.knockback(0.4f, Mth.sin(this.getYRot() * 0.017453292f), -Mth.cos(this.getYRot() * 0.017453292f));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -948,6 +948,7 @@ public abstract class ServerPlayerMixin extends PlayerMixin implements ServerPla
|
|||||||
this.giveExperiencePoints(this.newExp);
|
this.giveExperiencePoints(this.newExp);
|
||||||
}
|
}
|
||||||
this.keepLevel = false;
|
this.keepLevel = false;
|
||||||
|
this.setDeltaMovement(0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -1,12 +1,9 @@
|
|||||||
package io.izzel.arclight.common.mixin.forge;
|
package io.izzel.arclight.common.mixin.forge;
|
||||||
|
|
||||||
import io.izzel.arclight.common.mod.util.ArclightCaptures;
|
import io.izzel.arclight.common.mod.util.ArclightCaptures;
|
||||||
import net.minecraft.core.BlockPos;
|
|
||||||
import net.minecraft.world.InteractionHand;
|
import net.minecraft.world.InteractionHand;
|
||||||
import net.minecraft.world.InteractionResult;
|
import net.minecraft.world.InteractionResult;
|
||||||
import net.minecraft.world.entity.LivingEntity;
|
|
||||||
import net.minecraft.world.item.context.UseOnContext;
|
import net.minecraft.world.item.context.UseOnContext;
|
||||||
import net.minecraft.world.level.Level;
|
|
||||||
import net.minecraftforge.common.ForgeHooks;
|
import net.minecraftforge.common.ForgeHooks;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
@ -25,11 +22,4 @@ public class ForgeHooksMixin {
|
|||||||
private static void arclight$removeHand(UseOnContext context, CallbackInfoReturnable<InteractionResult> cir) {
|
private static void arclight$removeHand(UseOnContext context, CallbackInfoReturnable<InteractionResult> cir) {
|
||||||
ArclightCaptures.getPlaceEventHand(InteractionHand.MAIN_HAND);
|
ArclightCaptures.getPlaceEventHand(InteractionHand.MAIN_HAND);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "canEntityDestroy", cancellable = true, remap = false, at = @At("HEAD"))
|
|
||||||
private static void arclight$returnIfNotLoaded(Level world, BlockPos pos, LivingEntity entity, CallbackInfoReturnable<Boolean> cir) {
|
|
||||||
if (!world.isLoaded(pos)) {
|
|
||||||
cir.setReturnValue(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,7 @@ allprojects {
|
|||||||
ext {
|
ext {
|
||||||
agpVersion = '1.22'
|
agpVersion = '1.22'
|
||||||
minecraftVersion = '1.18.2'
|
minecraftVersion = '1.18.2'
|
||||||
forgeVersion = '40.1.0'
|
forgeVersion = '40.1.31'
|
||||||
apiVersion = '1.2.6'
|
apiVersion = '1.2.6'
|
||||||
toolsVersion = '1.3.+'
|
toolsVersion = '1.3.+'
|
||||||
mixinVersion = '0.8.5'
|
mixinVersion = '0.8.5'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user