This commit is contained in:
gnembon committed 2020-12-02 19:22:56 -04:00
1 parent 1c39914f4f
commit 5422493c33
9 files changed
+24 -20

No files matched your search

+2 -2
View File
@@ -4,8 +4,8 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/use # check these on https://fabricmc.net/use
# or better: https://modmuss50.me/fabric.html # or better: https://modmuss50.me/fabric.html
minecraft_version=20w48a minecraft_version=20w49a
yarn_mappings=20w48a+build.7 yarn_mappings=20w49a+build.1
loader_version=0.10.8 loader_version=0.10.8
# Mod Properties # Mod Properties
@@ -305,7 +305,7 @@ public class EntityPlayerActionPack
BlockHitResult blockHit = (BlockHitResult) hit; BlockHitResult blockHit = (BlockHitResult) hit;
BlockPos pos = blockHit.getBlockPos(); BlockPos pos = blockHit.getBlockPos();
Direction side = blockHit.getSide(); 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); ActionResult result = player.interactionManager.interactBlock(player, world, player.getStackInHand(hand), hand, blockHit);
if (result.isAccepted()) if (result.isAccepted())
@@ -393,7 +393,7 @@ public class EntityPlayerActionPack
boolean blockBroken = false; boolean blockBroken = false;
if (player.interactionManager.getGameMode().isCreative()) 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; ap.blockHitDelay = 5;
blockBroken = true; blockBroken = true;
} }
@@ -401,9 +401,9 @@ public class EntityPlayerActionPack
{ {
if (ap.currentBlock != null) 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(); boolean notAir = !state.isAir();
if (notAir && ap.curBlockDamageMP == 0) if (notAir && ap.curBlockDamageMP == 0)
{ {
@@ -426,7 +426,7 @@ public class EntityPlayerActionPack
ap.curBlockDamageMP += state.calcBlockBreakingDelta(player, player.world, pos); ap.curBlockDamageMP += state.calcBlockBreakingDelta(player, player.world, pos);
if (ap.curBlockDamageMP >= 1) 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.currentBlock = null;
ap.blockHitDelay = 5; ap.blockHitDelay = 5;
blockBroken = true; blockBroken = true;
@@ -448,7 +448,7 @@ public class EntityPlayerActionPack
EntityPlayerActionPack ap = ((ServerPlayerEntityInterface) player).getActionPack(); EntityPlayerActionPack ap = ((ServerPlayerEntityInterface) player).getActionPack();
if (ap.currentBlock == null) return; if (ap.currentBlock == null) return;
player.world.setBlockBreakingInfo(-1, ap.currentBlock, -1); 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; ap.currentBlock = null;
} }
}, },
@@ -35,12 +35,12 @@ public class InventoryHelper
changed = true; changed = true;
} }
if (bet.isEmpty()) if (bet.method_33133()) // isEmpty
{ {
tag.remove("BlockEntityTag"); tag.remove("BlockEntityTag");
changed = true; changed = true;
} }
if (tag.isEmpty()) if (tag.method_33133())
{ {
stack.setTag(null); stack.setTag(null);
changed = true; 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 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 Biome[] data;
@Shadow @Final private int field_28126;
@Shadow @Final private int field_28127;
@Override @Override
public void setBiomeAtIndex(BlockPos pos, World world, Biome what) public void setBiomeAtIndex(BlockPos pos, World world, Biome what)
{ {
int int_4 = (pos.getX() >> 2) & HORIZONTAL_BIT_MASK; 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; 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; 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( @Redirect(method = "place", at = @At(
value = "INVOKE", 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) if(!CarpetSettings.fillUpdates)
CarpetSettings.impendingFillSkipUpdates = true; CarpetSettings.impendingFillSkipUpdates = true;
try try
{ {
structure.place(serverWorldAccess, pos, placementData, random); return structure.place(serverWorldAccess, pos, blockPos, placementData, random, i); // serverWorldAccess, pos, placementData, random);
} }
finally finally
{ {
@@ -48,7 +48,7 @@ public class EntityPlayerMPFake extends ServerPlayerEntity
instance.setHealth(20.0F); instance.setHealth(20.0F);
instance.unsetRemoved(); instance.unsetRemoved();
instance.stepHeight = 0.6F; 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 EntitySetHeadYawS2CPacket(instance, (byte) (instance.headYaw * 256 / 360)), dimensionId);//instance.dimension);
server.getPlayerManager().sendToDimension(new EntityPositionS2CPacket(instance), dimensionId);//instance.dimension); server.getPlayerManager().sendToDimension(new EntityPositionS2CPacket(instance), dimensionId);//instance.dimension);
instance.getServerWorld().getChunkManager().updateCameraPosition(instance); instance.getServerWorld().getChunkManager().updateCameraPosition(instance);
@@ -67,7 +67,7 @@ public class EntityPlayerMPFake extends ServerPlayerEntity
playerShadow.setHealth(player.getHealth()); playerShadow.setHealth(player.getHealth());
playerShadow.networkHandler.requestTeleport(player.getX(), player.getY(), player.getZ(), player.yaw, player.pitch); 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()); ((ServerPlayerEntityInterface) playerShadow).getActionPack().copyFrom(((ServerPlayerEntityInterface) player).getActionPack());
playerShadow.stepHeight = 0.6F; playerShadow.stepHeight = 0.6F;
playerShadow.dataTracker.set(PLAYER_MODEL_PARTS, player.getDataTracker().get(PLAYER_MODEL_PARTS)); 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 != null)
{ {
if (data.isEmpty()) if (data.method_33133())
return null; return null;
return data; return data;
} }
@@ -1295,7 +1295,7 @@ public class EntityValue extends Value
GameMode toSet = v instanceof NumericValue ? GameMode toSet = v instanceof NumericValue ?
GameMode.byId(((NumericValue) v).getInt(), null) : GameMode.byId(((NumericValue) v).getInt(), null) :
GameMode.byName(v.getString().toLowerCase(Locale.ROOT), 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)->{ put("jumping",(e,v)->{
@@ -392,7 +392,7 @@ public class NBTSerializableValue extends Value implements ContainerValueInterfa
{ {
Tag tag = getTag(); Tag tag = getTag();
if (tag instanceof CompoundTag) if (tag instanceof CompoundTag)
return !((CompoundTag) tag).isEmpty(); return !((CompoundTag) tag).method_33133();
if (tag instanceof AbstractListTag) if (tag instanceof AbstractListTag)
return ((AbstractListTag) tag).isEmpty(); return ((AbstractListTag) tag).isEmpty();
if (tag instanceof AbstractNumberTag) if (tag instanceof AbstractNumberTag)