20w49a
This commit is contained in:
1 parent
1c39914f4f
commit
5422493c33
9 files changed
+24
-20
No files matched your search
@@ -305,7 +305,7 @@ public class EntityPlayerActionPack
|
||||
BlockHitResult blockHit = (BlockHitResult) hit;
|
||||
BlockPos pos = blockHit.getBlockPos();
|
||||
Direction side = blockHit.getSide();
|
||||
if (pos.getY() < player.server.getWorldHeight() - (side == Direction.UP ? 1 : 0) && world.canPlayerModifyAt(player, pos))
|
||||
if (pos.getY() < player.getServerWorld().getTopHeightLimit() - (side == Direction.UP ? 1 : 0) && world.canPlayerModifyAt(player, pos))
|
||||
{
|
||||
ActionResult result = player.interactionManager.interactBlock(player, world, player.getStackInHand(hand), hand, blockHit);
|
||||
if (result.isAccepted())
|
||||
@@ -393,7 +393,7 @@ public class EntityPlayerActionPack
|
||||
boolean blockBroken = false;
|
||||
if (player.interactionManager.getGameMode().isCreative())
|
||||
{
|
||||
player.interactionManager.processBlockBreakingAction(pos, PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, side, player.server.getWorldHeight());
|
||||
player.interactionManager.processBlockBreakingAction(pos, PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, side, player.getServerWorld().getTopHeightLimit());
|
||||
ap.blockHitDelay = 5;
|
||||
blockBroken = true;
|
||||
}
|
||||
@@ -401,9 +401,9 @@ public class EntityPlayerActionPack
|
||||
{
|
||||
if (ap.currentBlock != null)
|
||||
{
|
||||
player.interactionManager.processBlockBreakingAction(ap.currentBlock, PlayerActionC2SPacket.Action.ABORT_DESTROY_BLOCK, side, player.server.getWorldHeight());
|
||||
player.interactionManager.processBlockBreakingAction(ap.currentBlock, PlayerActionC2SPacket.Action.ABORT_DESTROY_BLOCK, side, player.getServerWorld().getTopHeightLimit());
|
||||
}
|
||||
player.interactionManager.processBlockBreakingAction(pos, PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, side, player.server.getWorldHeight());
|
||||
player.interactionManager.processBlockBreakingAction(pos, PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, side, player.getServerWorld().getTopHeightLimit());
|
||||
boolean notAir = !state.isAir();
|
||||
if (notAir && ap.curBlockDamageMP == 0)
|
||||
{
|
||||
@@ -426,7 +426,7 @@ public class EntityPlayerActionPack
|
||||
ap.curBlockDamageMP += state.calcBlockBreakingDelta(player, player.world, pos);
|
||||
if (ap.curBlockDamageMP >= 1)
|
||||
{
|
||||
player.interactionManager.processBlockBreakingAction(pos, PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, side, player.server.getWorldHeight());
|
||||
player.interactionManager.processBlockBreakingAction(pos, PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, side, player.getServerWorld().getTopHeightLimit());
|
||||
ap.currentBlock = null;
|
||||
ap.blockHitDelay = 5;
|
||||
blockBroken = true;
|
||||
@@ -448,7 +448,7 @@ public class EntityPlayerActionPack
|
||||
EntityPlayerActionPack ap = ((ServerPlayerEntityInterface) player).getActionPack();
|
||||
if (ap.currentBlock == null) return;
|
||||
player.world.setBlockBreakingInfo(-1, ap.currentBlock, -1);
|
||||
player.interactionManager.processBlockBreakingAction(ap.currentBlock, PlayerActionC2SPacket.Action.ABORT_DESTROY_BLOCK, Direction.DOWN, player.server.getWorldHeight());
|
||||
player.interactionManager.processBlockBreakingAction(ap.currentBlock, PlayerActionC2SPacket.Action.ABORT_DESTROY_BLOCK, Direction.DOWN, player.getServerWorld().getTopHeightLimit());
|
||||
ap.currentBlock = null;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -35,12 +35,12 @@ public class InventoryHelper
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (bet.isEmpty())
|
||||
if (bet.method_33133()) // isEmpty
|
||||
{
|
||||
tag.remove("BlockEntityTag");
|
||||
changed = true;
|
||||
}
|
||||
if (tag.isEmpty())
|
||||
if (tag.method_33133())
|
||||
{
|
||||
stack.setTag(null);
|
||||
changed = true;
|
||||
|
||||
@@ -18,15 +18,19 @@ public class BiomeArray_getBiomeArrayMixin implements BiomeArrayInterface
|
||||
|
||||
@Shadow @Final public static int HORIZONTAL_BIT_MASK;
|
||||
|
||||
@Shadow @Final public static int VERTICAL_BIT_MASK;
|
||||
//@Shadow @Final public static int VERTICAL_BIT_MASK;
|
||||
|
||||
@Shadow @Final private Biome[] data;
|
||||
|
||||
@Shadow @Final private int field_28126;
|
||||
|
||||
@Shadow @Final private int field_28127;
|
||||
|
||||
@Override
|
||||
public void setBiomeAtIndex(BlockPos pos, World world, Biome what)
|
||||
{
|
||||
int int_4 = (pos.getX() >> 2) & HORIZONTAL_BIT_MASK;
|
||||
int int_5 = MathHelper.clamp((pos.getY() >> 2), 0, VERTICAL_BIT_MASK);
|
||||
int int_5 = MathHelper.clamp((pos.getY() >> 2)-field_28126, 0, field_28127);
|
||||
int int_6 = (pos.getZ() >> 2) & HORIZONTAL_BIT_MASK;
|
||||
data[(int_5 << (HORIZONTAL_SECTION_COUNT + HORIZONTAL_SECTION_COUNT)) | (int_6 << HORIZONTAL_SECTION_COUNT) | int_4] = what;
|
||||
}
|
||||
|
||||
@@ -17,15 +17,15 @@ public abstract class StructureBlockBlockEntity_fillUpdatesMixin
|
||||
{
|
||||
@Redirect(method = "place", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/structure/Structure;place(Lnet/minecraft/world/ServerWorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;Ljava/util/Random;)V"
|
||||
target = "Lnet/minecraft/structure/Structure;place(Lnet/minecraft/world/ServerWorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;Ljava/util/Random;I)Z"
|
||||
))
|
||||
private void onStructurePlacen(Structure structure, ServerWorldAccess serverWorldAccess, BlockPos pos, StructurePlacementData placementData, Random random)
|
||||
private boolean onStructurePlacen(Structure structure, ServerWorldAccess serverWorldAccess, BlockPos pos, BlockPos blockPos, StructurePlacementData placementData, Random random, int i)
|
||||
{
|
||||
if(!CarpetSettings.fillUpdates)
|
||||
CarpetSettings.impendingFillSkipUpdates = true;
|
||||
try
|
||||
{
|
||||
structure.place(serverWorldAccess, pos, placementData, random);
|
||||
return structure.place(serverWorldAccess, pos, blockPos, placementData, random, i); // serverWorldAccess, pos, placementData, random);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
@@ -48,7 +48,7 @@ public class EntityPlayerMPFake extends ServerPlayerEntity
|
||||
instance.setHealth(20.0F);
|
||||
instance.unsetRemoved();
|
||||
instance.stepHeight = 0.6F;
|
||||
instance.interactionManager.setGameMode(gamemode);
|
||||
instance.interactionManager.changeGameMode(gamemode);
|
||||
server.getPlayerManager().sendToDimension(new EntitySetHeadYawS2CPacket(instance, (byte) (instance.headYaw * 256 / 360)), dimensionId);//instance.dimension);
|
||||
server.getPlayerManager().sendToDimension(new EntityPositionS2CPacket(instance), dimensionId);//instance.dimension);
|
||||
instance.getServerWorld().getChunkManager().updateCameraPosition(instance);
|
||||
@@ -67,7 +67,7 @@ public class EntityPlayerMPFake extends ServerPlayerEntity
|
||||
|
||||
playerShadow.setHealth(player.getHealth());
|
||||
playerShadow.networkHandler.requestTeleport(player.getX(), player.getY(), player.getZ(), player.yaw, player.pitch);
|
||||
playerShadow.interactionManager.setGameMode(player.interactionManager.getGameMode());
|
||||
playerShadow.interactionManager.changeGameMode(player.interactionManager.getGameMode());
|
||||
((ServerPlayerEntityInterface) playerShadow).getActionPack().copyFrom(((ServerPlayerEntityInterface) player).getActionPack());
|
||||
playerShadow.stepHeight = 0.6F;
|
||||
playerShadow.dataTracker.set(PLAYER_MODEL_PARTS, player.getDataTracker().get(PLAYER_MODEL_PARTS));
|
||||
|
||||
@@ -108,7 +108,7 @@ public class BlockValue extends Value
|
||||
{
|
||||
if (data != null)
|
||||
{
|
||||
if (data.isEmpty())
|
||||
if (data.method_33133())
|
||||
return null;
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -1295,7 +1295,7 @@ public class EntityValue extends Value
|
||||
GameMode toSet = v instanceof NumericValue ?
|
||||
GameMode.byId(((NumericValue) v).getInt(), null) :
|
||||
GameMode.byName(v.getString().toLowerCase(Locale.ROOT), null);
|
||||
if (toSet != null) ((ServerPlayerEntity) e).setGameMode(toSet);
|
||||
if (toSet != null) ((ServerPlayerEntity) e).changeGameMode(toSet);
|
||||
});
|
||||
|
||||
put("jumping",(e,v)->{
|
||||
|
||||
@@ -392,7 +392,7 @@ public class NBTSerializableValue extends Value implements ContainerValueInterfa
|
||||
{
|
||||
Tag tag = getTag();
|
||||
if (tag instanceof CompoundTag)
|
||||
return !((CompoundTag) tag).isEmpty();
|
||||
return !((CompoundTag) tag).method_33133();
|
||||
if (tag instanceof AbstractListTag)
|
||||
return ((AbstractListTag) tag).isEmpty();
|
||||
if (tag instanceof AbstractNumberTag)
|
||||
|
||||
Reference in new issue
Block a user