This commit is contained in:
gnembon committed 2021-02-17 20:17:01 -04:00
1 parent 695d66da50
commit 6d320866e6
7 files changed
+21 -19

No files matched your search

+3 -3
View File
@@ -4,10 +4,10 @@ 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=21w06a minecraft_version=21w07a
yarn_mappings=21w06a+build.21 yarn_mappings=21w07a+build.1
loader_version=0.11.1 loader_version=0.11.1
fabric_version=0.30.2+1.17 fabric_version=0.30.5+1.17
# Mod Properties # Mod Properties
mod_version = 1.4.26 mod_version = 1.4.26
@@ -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 * Remove all markers that do not belong to any script host and not part of the global one when loaded
* @param ci * @param ci
*/ */
@Inject(method = "readCustomDataFromTag", at = @At("HEAD")) @Inject(method = "readCustomDataFromNbt", at = @At("HEAD"))
private void checkScarpetMarkerUnloaded(CallbackInfo ci) private void checkScarpetMarkerUnloaded(CallbackInfo ci)
{ {
if (!world.isClient) 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) private void onFromTag(CompoundTag compoundTag_1, CallbackInfo ci)
{ {
if (CarpetSettings.movableBlockEntities && compoundTag_1.contains("carriedTileEntityCM", 10)) 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) if (this.pushedBlock.getBlock() instanceof BlockEntityProvider)
this.carriedBlockEntity = ((BlockEntityProvider) (this.pushedBlock.getBlock())).createBlockEntity(pos, pushedBlock);// this.world); this.carriedBlockEntity = ((BlockEntityProvider) (this.pushedBlock.getBlock())).createBlockEntity(pos, pushedBlock);// 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.readNbt(compoundTag_1.getCompound("carriedTileEntityCM"));
setCarriedBlockEntity(carriedBlockEntity); 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) private void onToTag(CompoundTag compoundTag_1, CallbackInfoReturnable<CompoundTag> cir)
{ {
if (CarpetSettings.movableBlockEntities && this.carriedBlockEntity != null) if (CarpetSettings.movableBlockEntities && this.carriedBlockEntity != null)
{ {
//Leave name "carriedTileEntityCM" instead of "carriedBlockEntityCM" for upgrade compatibility with 1.13.2 movable TE //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 public abstract class StructureBlockBlockEntity_limitsMixin
{ {
@ModifyConstant( @ModifyConstant(
method = "fromTag", method = "readNbt",
constant = @Constant(intValue = 48) constant = @Constant(intValue = 48)
) )
private int positiveLimit(int original) { private int positiveLimit(int original) {
@@ -23,7 +23,7 @@ public abstract class StructureBlockBlockEntity_limitsMixin
} }
@ModifyConstant( @ModifyConstant(
method = "fromTag", method = "readNbt",
constant = @Constant(intValue = -48) constant = @Constant(intValue = -48)
) )
private int negativeLimit(int original) { private int negativeLimit(int original) {
@@ -41,7 +41,7 @@ public abstract class StructureBlockBlockEntity_limitsMixin
private Block ignoredBlock(Block original) { private Block ignoredBlock(Block original) {
return CarpetSettings.structureBlockIgnoredBlock; return CarpetSettings.structureBlockIgnoredBlock;
} }
/*
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
@ModifyConstant( @ModifyConstant(
method = "getSquaredRenderDistance", method = "getSquaredRenderDistance",
@@ -50,4 +50,6 @@ public abstract class StructureBlockBlockEntity_limitsMixin
private double outlineRenderDistanceLimit(double original) { private double outlineRenderDistanceLimit(double original) {
return CarpetSettings.structureBlockOutlineDistance; return CarpetSettings.structureBlockOutlineDistance;
} }
*/
} }
@@ -836,7 +836,7 @@ public class WorldAccess {
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.readNbt(destTag);
be.markDirty(); be.markDirty();
success = true; success = true;
} }
@@ -121,7 +121,7 @@ public class BlockValue extends Value
data = tag; data = tag;
return null; return null;
} }
data = be.toTag(tag); data = be.writeNbt(tag);
return data; return data;
} }
return null; return null;
@@ -841,7 +841,7 @@ public class EntityValue extends Value
}); });
put("nbt",(e, a) -> { put("nbt",(e, a) -> {
CompoundTag nbttagcompound = e.toTag((new CompoundTag())); CompoundTag nbttagcompound = e.writeNbt((new CompoundTag()));
if (a==null) if (a==null)
return new NBTSerializableValue(nbttagcompound); return new NBTSerializableValue(nbttagcompound);
return new NBTSerializableValue(nbttagcompound).get(a); return new NBTSerializableValue(nbttagcompound).get(a);
@@ -884,7 +884,7 @@ public class EntityValue extends Value
EnumSet<PlayerPositionLookS2CPacket.Flag> set = EnumSet.noneOf(PlayerPositionLookS2CPacket.Flag.class); EnumSet<PlayerPositionLookS2CPacket.Flag> set = EnumSet.noneOf(PlayerPositionLookS2CPacket.Flag.class);
set.add(PlayerPositionLookS2CPacket.Flag.X_ROT); set.add(PlayerPositionLookS2CPacket.Flag.X_ROT);
set.add(PlayerPositionLookS2CPacket.Flag.Y_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 else
{ {
@@ -1458,7 +1458,7 @@ public class EntityValue extends Value
Value tagValue = NBTSerializableValue.fromValue(v); Value tagValue = NBTSerializableValue.fromValue(v);
if (tagValue instanceof NBTSerializableValue) if (tagValue instanceof NBTSerializableValue)
{ {
e.fromTag(((NBTSerializableValue) tagValue).getCompoundTag()); e.readNbt(((NBTSerializableValue) tagValue).getCompoundTag());
e.setUuid(uUID); e.setUuid(uUID);
} }
} }
@@ -1470,9 +1470,9 @@ public class EntityValue extends Value
Value tagValue = NBTSerializableValue.fromValue(v); Value tagValue = NBTSerializableValue.fromValue(v);
if (tagValue instanceof NBTSerializableValue) if (tagValue instanceof NBTSerializableValue)
{ {
CompoundTag nbttagcompound = e.toTag((new CompoundTag())); CompoundTag nbttagcompound = e.writeNbt((new CompoundTag()));
nbttagcompound.copyFrom(((NBTSerializableValue) tagValue).getCompoundTag()); nbttagcompound.copyFrom(((NBTSerializableValue) tagValue).getCompoundTag());
e.fromTag(nbttagcompound); e.readNbt(nbttagcompound);
e.setUuid(uUID); e.setUuid(uUID);
} }
} }
@@ -1497,7 +1497,7 @@ public class EntityValue extends Value
{ {
if (!force) throw new NBTSerializableValue.IncompatibleTypeException(this); if (!force) throw new NBTSerializableValue.IncompatibleTypeException(this);
CompoundTag tag = new CompoundTag(); 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())); tag.put("Name", StringTag.of(Registry.ENTITY_TYPE.getId(getEntity().getType()).toString()));
return tag; return tag;
} }