21w07a
This commit is contained in:
1 parent
695d66da50
commit
6d320866e6
7 files changed
+21
-19
No files matched your search
@@ -26,7 +26,7 @@ public abstract class ArmorStandEntity_scarpetMarkerMixin extends LivingEntity
|
||||
* Remove all markers that do not belong to any script host and not part of the global one when loaded
|
||||
* @param ci
|
||||
*/
|
||||
@Inject(method = "readCustomDataFromTag", at = @At("HEAD"))
|
||||
@Inject(method = "readCustomDataFromNbt", at = @At("HEAD"))
|
||||
private void checkScarpetMarkerUnloaded(CallbackInfo ci)
|
||||
{
|
||||
if (!world.isClient)
|
||||
|
||||
@@ -127,7 +127,7 @@ public abstract class PistonBlockEntity_movableTEMixin extends BlockEntity imple
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "fromTag", at = @At(value = "TAIL"))
|
||||
@Inject(method = "readNbt", at = @At(value = "TAIL"))
|
||||
private void onFromTag(CompoundTag compoundTag_1, CallbackInfo ci)
|
||||
{
|
||||
if (CarpetSettings.movableBlockEntities && compoundTag_1.contains("carriedTileEntityCM", 10))
|
||||
@@ -135,18 +135,18 @@ public abstract class PistonBlockEntity_movableTEMixin extends BlockEntity imple
|
||||
if (this.pushedBlock.getBlock() instanceof BlockEntityProvider)
|
||||
this.carriedBlockEntity = ((BlockEntityProvider) (this.pushedBlock.getBlock())).createBlockEntity(pos, pushedBlock);// this.world);
|
||||
if (carriedBlockEntity != null) //Can actually be null, as BlockPistonMoving.createNewTileEntity(...) returns null
|
||||
this.carriedBlockEntity.fromTag(compoundTag_1.getCompound("carriedTileEntityCM"));
|
||||
this.carriedBlockEntity.readNbt(compoundTag_1.getCompound("carriedTileEntityCM"));
|
||||
setCarriedBlockEntity(carriedBlockEntity);
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "toTag", at = @At(value = "RETURN", shift = At.Shift.BEFORE))
|
||||
@Inject(method = "writeNbt", at = @At(value = "RETURN", shift = At.Shift.BEFORE))
|
||||
private void onToTag(CompoundTag compoundTag_1, CallbackInfoReturnable<CompoundTag> cir)
|
||||
{
|
||||
if (CarpetSettings.movableBlockEntities && this.carriedBlockEntity != null)
|
||||
{
|
||||
//Leave name "carriedTileEntityCM" instead of "carriedBlockEntityCM" for upgrade compatibility with 1.13.2 movable TE
|
||||
compoundTag_1.put("carriedTileEntityCM", this.carriedBlockEntity.toTag(new CompoundTag()));
|
||||
compoundTag_1.put("carriedTileEntityCM", this.carriedBlockEntity.writeNbt(new CompoundTag()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
public abstract class StructureBlockBlockEntity_limitsMixin
|
||||
{
|
||||
@ModifyConstant(
|
||||
method = "fromTag",
|
||||
method = "readNbt",
|
||||
constant = @Constant(intValue = 48)
|
||||
)
|
||||
private int positiveLimit(int original) {
|
||||
@@ -23,7 +23,7 @@ public abstract class StructureBlockBlockEntity_limitsMixin
|
||||
}
|
||||
|
||||
@ModifyConstant(
|
||||
method = "fromTag",
|
||||
method = "readNbt",
|
||||
constant = @Constant(intValue = -48)
|
||||
)
|
||||
private int negativeLimit(int original) {
|
||||
@@ -41,7 +41,7 @@ public abstract class StructureBlockBlockEntity_limitsMixin
|
||||
private Block ignoredBlock(Block original) {
|
||||
return CarpetSettings.structureBlockIgnoredBlock;
|
||||
}
|
||||
|
||||
/*
|
||||
@Environment(EnvType.CLIENT)
|
||||
@ModifyConstant(
|
||||
method = "getSquaredRenderDistance",
|
||||
@@ -50,4 +50,6 @@ public abstract class StructureBlockBlockEntity_limitsMixin
|
||||
private double outlineRenderDistanceLimit(double original) {
|
||||
return CarpetSettings.structureBlockOutlineDistance;
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
@@ -836,7 +836,7 @@ public class WorldAccess {
|
||||
destTag.putInt("x", targetPos.getX());
|
||||
destTag.putInt("y", targetPos.getY());
|
||||
destTag.putInt("z", targetPos.getZ());
|
||||
be.fromTag(destTag);
|
||||
be.readNbt(destTag);
|
||||
be.markDirty();
|
||||
success = true;
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ public class BlockValue extends Value
|
||||
data = tag;
|
||||
return null;
|
||||
}
|
||||
data = be.toTag(tag);
|
||||
data = be.writeNbt(tag);
|
||||
return data;
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -841,7 +841,7 @@ public class EntityValue extends Value
|
||||
});
|
||||
|
||||
put("nbt",(e, a) -> {
|
||||
CompoundTag nbttagcompound = e.toTag((new CompoundTag()));
|
||||
CompoundTag nbttagcompound = e.writeNbt((new CompoundTag()));
|
||||
if (a==null)
|
||||
return new NBTSerializableValue(nbttagcompound);
|
||||
return new NBTSerializableValue(nbttagcompound).get(a);
|
||||
@@ -884,7 +884,7 @@ public class EntityValue extends Value
|
||||
EnumSet<PlayerPositionLookS2CPacket.Flag> set = EnumSet.noneOf(PlayerPositionLookS2CPacket.Flag.class);
|
||||
set.add(PlayerPositionLookS2CPacket.Flag.X_ROT);
|
||||
set.add(PlayerPositionLookS2CPacket.Flag.Y_ROT);
|
||||
((ServerPlayerEntity)e).networkHandler.teleportRequest(x, y, z, yaw, pitch, set );
|
||||
((ServerPlayerEntity)e).networkHandler.requestTeleport(x, y, z, yaw, pitch, set );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1458,7 +1458,7 @@ public class EntityValue extends Value
|
||||
Value tagValue = NBTSerializableValue.fromValue(v);
|
||||
if (tagValue instanceof NBTSerializableValue)
|
||||
{
|
||||
e.fromTag(((NBTSerializableValue) tagValue).getCompoundTag());
|
||||
e.readNbt(((NBTSerializableValue) tagValue).getCompoundTag());
|
||||
e.setUuid(uUID);
|
||||
}
|
||||
}
|
||||
@@ -1470,9 +1470,9 @@ public class EntityValue extends Value
|
||||
Value tagValue = NBTSerializableValue.fromValue(v);
|
||||
if (tagValue instanceof NBTSerializableValue)
|
||||
{
|
||||
CompoundTag nbttagcompound = e.toTag((new CompoundTag()));
|
||||
CompoundTag nbttagcompound = e.writeNbt((new CompoundTag()));
|
||||
nbttagcompound.copyFrom(((NBTSerializableValue) tagValue).getCompoundTag());
|
||||
e.fromTag(nbttagcompound);
|
||||
e.readNbt(nbttagcompound);
|
||||
e.setUuid(uUID);
|
||||
}
|
||||
}
|
||||
@@ -1497,7 +1497,7 @@ public class EntityValue extends Value
|
||||
{
|
||||
if (!force) throw new NBTSerializableValue.IncompatibleTypeException(this);
|
||||
CompoundTag tag = new CompoundTag();
|
||||
tag.put("Data", getEntity().toTag( new CompoundTag()));
|
||||
tag.put("Data", getEntity().writeNbt( new CompoundTag()));
|
||||
tag.put("Name", StringTag.of(Registry.ENTITY_TYPE.getId(getEntity().getType()).toString()));
|
||||
return tag;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user