This commit is contained in:
gnembon committed 2020-03-25 15:42:40 -03:00
1 parent b16a980106
commit 061ab76b19
4 files changed
+6 -6

No files matched your search

@@ -41,7 +41,7 @@ public class ClientPlayNetworkHandler_smoothClientAnimationsMixin
if (blockState.getBlock() == Blocks.MOVING_PISTON) { if (blockState.getBlock() == Blocks.MOVING_PISTON) {
tag.putFloat("progress", Math.min(tag.getFloat("progress") + 0.5F, 1.0F)); tag.putFloat("progress", Math.min(tag.getFloat("progress") + 0.5F, 1.0F));
blockEntity = new PistonBlockEntity(); blockEntity = new PistonBlockEntity();
blockEntity.fromTag(tag); blockEntity.fromTag(blockState, tag);
world.setBlockEntity(blockPos, blockEntity); world.setBlockEntity(blockPos, blockEntity);
blockEntity.resetBlock(); blockEntity.resetBlock();
} }
@@ -116,14 +116,14 @@ public abstract class PistonBlockEntity_movableTEMixin extends BlockEntity imple
} }
@Inject(method = "fromTag", at = @At(value = "TAIL")) @Inject(method = "fromTag", at = @At(value = "TAIL"))
private void onFromTag(CompoundTag compoundTag_1, CallbackInfo ci) private void onFromTag(BlockState state, CompoundTag compoundTag_1, CallbackInfo ci)
{ {
if (CarpetSettings.movableBlockEntities && compoundTag_1.contains("carriedTileEntityCM", 10)) if (CarpetSettings.movableBlockEntities && compoundTag_1.contains("carriedTileEntityCM", 10))
{ {
if (this.pushedBlock.getBlock() instanceof BlockEntityProvider) if (this.pushedBlock.getBlock() instanceof BlockEntityProvider)
this.carriedBlockEntity = ((BlockEntityProvider) (this.pushedBlock.getBlock())).createBlockEntity(this.world); this.carriedBlockEntity = ((BlockEntityProvider) (this.pushedBlock.getBlock())).createBlockEntity(this.world);
if (carriedBlockEntity != null) //Can actually be null, as BlockPistonMoving.createNewTileEntity(...) returns null if (carriedBlockEntity != null) //Can actually be null, as BlockPistonMoving.createNewTileEntity(...) returns null
this.carriedBlockEntity.fromTag(compoundTag_1.getCompound("carriedTileEntityCM")); this.carriedBlockEntity.fromTag(state, compoundTag_1.getCompound("carriedTileEntityCM"));
} }
} }
@@ -13,7 +13,7 @@ import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(Structure.class) @Mixin(Structure.class)
public class Structure_fillUpdatesMixin public class Structure_fillUpdatesMixin
{ {
@Redirect( method = "place(Lnet/minecraft/world/IWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;I)Z", at = @At( @Redirect( method = "place(Lnet/minecraft/world/IWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;I)Z", at = @At(
value = "INVOKE", value = "INVOKE",
target = "Lnet/minecraft/world/IWorld;updateNeighbors(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;)V" target = "Lnet/minecraft/world/IWorld;updateNeighbors(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;)V"
)) ))
@@ -23,7 +23,7 @@ public class Structure_fillUpdatesMixin
iWorld.updateNeighbors(var1, var2); iWorld.updateNeighbors(var1, var2);
} }
@Redirect(method = "place(Lnet/minecraft/world/IWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;I)Z", at = @At( @Redirect(method = "place(Lnet/minecraft/world/IWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;I)Z", at = @At(
value = "INVOKE", value = "INVOKE",
target = "Lnet/minecraft/structure/StructurePlacementData;shouldUpdateNeighbors()Z" target = "Lnet/minecraft/structure/StructurePlacementData;shouldUpdateNeighbors()Z"
)) ))
@@ -827,7 +827,7 @@ public class CarpetExpression
destTag.putInt("x", targetPos.getX()); destTag.putInt("x", targetPos.getX());
destTag.putInt("y", targetPos.getY()); destTag.putInt("y", targetPos.getY());
destTag.putInt("z", targetPos.getZ()); destTag.putInt("z", targetPos.getZ());
be.fromTag(destTag); be.fromTag(finalSourceBlockState, destTag);
be.markDirty(); be.markDirty();
} }
} }