diff --git a/gradle.properties b/gradle.properties index 72a418cc..f061ddd8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,9 +5,9 @@ org.gradle.jvmargs=-Xmx1G # check these on https://fabricmc.net/use # or better: https://modmuss50.me/fabric.html minecraft_version=21w13a - yarn_mappings=21w13a+build.2 + yarn_mappings=21w13a+build.34 loader_version=0.11.3 - fabric_version=0.32.5+1.17 + fabric_version=0.32.6+1.17 # Mod Properties mod_version = 1.4.30 diff --git a/src/main/java/carpet/commands/ScriptCommand.java b/src/main/java/carpet/commands/ScriptCommand.java index bc9d5b4e..679474ef 100644 --- a/src/main/java/carpet/commands/ScriptCommand.java +++ b/src/main/java/carpet/commands/ScriptCommand.java @@ -470,7 +470,7 @@ public class ScriptCommand CarpetScriptHost host = getHost(context); BlockBox area = BlockBox.create(a, b); CarpetExpression cexpr = new CarpetExpression(host.main, expr, source, origin); - int int_1 = area.getBlockCountX() * area.getBlockCountY() * area.method_35414(); // X Y Z + int int_1 = area.getBlockCountX() * area.getBlockCountY() * area.getBlockCountZ(); // X Y Z if (int_1 > CarpetSettings.fillLimit) { Messenger.m(source, "r too many blocks to evaluate: " + int_1); @@ -480,11 +480,11 @@ public class ScriptCommand CarpetSettings.impendingFillSkipUpdates = !CarpetSettings.fillUpdates; try { - for (int x = area.method_35420(); x <= area.method_35417(); x++) //minx maxx + for (int x = area.getMinX(); x <= area.getMaxX(); x++) { - for (int y = area.method_35415(); y <= area.method_35418(); y++) // miny maxy + for (int y = area.getMinY(); y <= area.getMaxY(); y++) { - for (int z = area.method_35416(); z <= area.method_35419(); z++) // minz maxz + for (int z = area.getMinZ(); z <= area.getMaxZ(); z++) { try { @@ -519,29 +519,29 @@ public class ScriptCommand CarpetScriptHost host = getHost(context); BlockBox area = BlockBox.create(a, b); CarpetExpression cexpr = new CarpetExpression(host.main, expr, source, origin); - int int_1 = area.getBlockCountX() * area.getBlockCountY() * area.method_35414(); + int int_1 = area.getBlockCountX() * area.getBlockCountY() * area.getBlockCountZ(); if (int_1 > CarpetSettings.fillLimit) { Messenger.m(source, "r too many blocks to evaluate: "+ int_1); return 1; } - boolean[][][] volume = new boolean[area.getBlockCountY()][area.method_35414()][area.getBlockCountX()]; //X then Y then Z got messedup + boolean[][][] volume = new boolean[area.getBlockCountX()][area.getBlockCountY()][area.getBlockCountZ()]; //X then Y then Z got messedup BlockPos.Mutable mbpos = origin.mutableCopy(); ServerWorld world = source.getWorld(); - for (int x = area.method_35420(); x <= area.method_35417(); x++) //minx maxx + for (int x = area.getMinX(); x <= area.getMaxX(); x++) { - for (int y = area.method_35415(); y <= area.method_35418(); y++) // miny maxy + for (int y = area.getMinY(); y <= area.getMaxY(); y++) { - for (int z = area.method_35416(); z <= area.method_35419(); z++) // minz maxz + for (int z = area.getMinZ(); z <= area.getMaxZ(); z++) { try { if (cexpr.fillAndScanCommand(host, x, y, z)) { - volume[x-area.method_35420()][y-area.method_35415()][z-area.method_35416()]=true; + volume[x-area.getMinX()][y-area.getMinY()][z-area.getMinZ()]=true; } } catch (CarpetExpressionException e) @@ -555,12 +555,12 @@ public class ScriptCommand } } } - final int maxx = area.getBlockCountY()-1; //x - final int maxy = area.method_35414()-1; //y - final int maxz = area.getBlockCountX()-1; //z + final int maxx = area.getBlockCountX()-1; + final int maxy = area.getBlockCountY()-1; + final int maxz = area.getBlockCountZ()-1; if ("outline".equalsIgnoreCase(mode)) { - boolean[][][] newVolume = new boolean[area.getBlockCountY()][area.method_35414()][area.getBlockCountX()]; //X then Y then Z got messedup + boolean[][][] newVolume = new boolean[area.getBlockCountX()][area.getBlockCountY()][area.getBlockCountZ()]; for (int x = 0; x <= maxx; x++) { for (int y = 0; y <= maxy; y++) @@ -596,7 +596,7 @@ public class ScriptCommand { if (volume[x][y][z]) { - mbpos.set(x+area.method_35420(), y+area.method_35415(), z+area.method_35416()); + mbpos.set(x+area.getMinX(), y+area.getMinY(), z+area.getMinZ()); if (replacement == null || replacement.test( new CachedBlockPosition( world, mbpos, true))) { @@ -624,7 +624,7 @@ public class ScriptCommand { if (volume[x][y][z]) { - mbpos.set(x+area.method_35420(), y+area.method_35415(), z+area.method_35416()); + mbpos.set(x+area.getMinX(), y+area.getMinY(), z+area.getMinZ()); Block blokc = world.getBlockState(mbpos).getBlock(); world.updateNeighbors(mbpos, blokc); } @@ -632,7 +632,7 @@ public class ScriptCommand } } } - Messenger.m(source, "gi Affected "+affected+" blocks in "+area.getBlockCountX() * area.getBlockCountY() * area.method_35414()+" block volume"); + Messenger.m(source, "gi Affected "+affected+" blocks in "+area.getBlockCountX() * area.getBlockCountY() * area.getBlockCountZ()+" block volume"); return 1; } } diff --git a/src/main/java/carpet/fakes/InventoryBearerInterface.java b/src/main/java/carpet/fakes/InventoryBearerInterface.java index a1426973..5355786b 100644 --- a/src/main/java/carpet/fakes/InventoryBearerInterface.java +++ b/src/main/java/carpet/fakes/InventoryBearerInterface.java @@ -1,6 +1,5 @@ package carpet.fakes; -import net.minecraft.class_6067; import net.minecraft.inventory.Inventory; public interface InventoryBearerInterface diff --git a/src/main/java/carpet/helpers/BlockRotator.java b/src/main/java/carpet/helpers/BlockRotator.java index 8f9e9936..fe3cd568 100644 --- a/src/main/java/carpet/helpers/BlockRotator.java +++ b/src/main/java/carpet/helpers/BlockRotator.java @@ -226,7 +226,7 @@ public class BlockRotator { Direction sourceFace = source.getBlockState().get(DispenserBlock.FACING); World world = source.getWorld(); - BlockPos blockpos = source.getBlockPos().method_35851(sourceFace); // offset + BlockPos blockpos = source.getBlockPos().offset(sourceFace); // offset BlockState iblockstate = world.getBlockState(blockpos); Block block = iblockstate.getBlock(); diff --git a/src/main/java/carpet/helpers/FeatureGenerator.java b/src/main/java/carpet/helpers/FeatureGenerator.java index fc1c500a..e5062707 100644 --- a/src/main/java/carpet/helpers/FeatureGenerator.java +++ b/src/main/java/carpet/helpers/FeatureGenerator.java @@ -49,7 +49,7 @@ public class FeatureGenerator return custom.plop(world, pos); } Identifier id = new Identifier(featureName); - ConfiguredStructureFeature structureFeature = world.getRegistryManager().get(Registry.CONFIGURED_STRUCTURE_FEATURE_WORLDGEN).get(id); + ConfiguredStructureFeature structureFeature = world.getRegistryManager().get(Registry.CONFIGURED_STRUCTURE_FEATURE_KEY).get(id); if (structureFeature != null) { return ((StructureFeatureInterface)structureFeature.feature).plopAnywhere( @@ -58,7 +58,7 @@ public class FeatureGenerator } - ConfiguredFeature feature = world.getRegistryManager().get(Registry.CONFIGURED_FEATURE_WORLDGEN).get(id); + ConfiguredFeature feature = world.getRegistryManager().get(Registry.CONFIGURED_FEATURE_KEY).get(id); if (feature != null) { CarpetSettings.skipGenerationChecks = true; @@ -77,7 +77,7 @@ public class FeatureGenerator public static ConfiguredStructureFeature resolveConfiguredStructure(String name, ServerWorld world, BlockPos pos) { Identifier id = new Identifier(name); - ConfiguredStructureFeature configuredStructureFeature = world.getRegistryManager().get(Registry.CONFIGURED_STRUCTURE_FEATURE_WORLDGEN).get(id); + ConfiguredStructureFeature configuredStructureFeature = world.getRegistryManager().get(Registry.CONFIGURED_STRUCTURE_FEATURE_KEY).get(id); if (configuredStructureFeature != null) return configuredStructureFeature; StructureFeature structureFeature = Registry.STRUCTURE_FEATURE.get(id); if (structureFeature == null) return null; @@ -137,7 +137,7 @@ public class FeatureGenerator { ConfiguredStructureFeature configuredFeature = world.getBiome(pos).getGenerationSettings().method_30978(structure.configure(null)); if (configuredFeature.config != null || !tryHard) return configuredFeature; - return world.getRegistryManager().get(Registry.CONFIGURED_STRUCTURE_FEATURE_WORLDGEN).getEntries().stream(). + return world.getRegistryManager().get(Registry.CONFIGURED_STRUCTURE_FEATURE_KEY).getEntries().stream(). filter(cS -> cS.getValue().feature == structure). findFirst().map(Map.Entry::getValue).orElse(null); } diff --git a/src/main/java/carpet/mixins/FluidBlock_renewableBlackstoneMixin.java b/src/main/java/carpet/mixins/FluidBlock_renewableBlackstoneMixin.java index 5a522daa..1a55a6af 100644 --- a/src/main/java/carpet/mixins/FluidBlock_renewableBlackstoneMixin.java +++ b/src/main/java/carpet/mixins/FluidBlock_renewableBlackstoneMixin.java @@ -33,7 +33,7 @@ public abstract class FluidBlock_renewableBlackstoneMixin for(Direction direction : Direction.values()) { if (direction != Direction.DOWN) { - BlockPos blockPos = pos.method_35851(direction); // offset + BlockPos blockPos = pos.offset(direction); // offset if (world.getBlockState(blockPos).isOf(Blocks.BLUE_ICE)) { world.setBlockState(pos, Blocks.BLACKSTONE.getDefaultState()); playExtinguishSound(world, pos); diff --git a/src/main/java/carpet/mixins/HopperBlockEntityMixin.java b/src/main/java/carpet/mixins/HopperBlockEntityMixin.java index 10225ef9..60e7f2cf 100644 --- a/src/main/java/carpet/mixins/HopperBlockEntityMixin.java +++ b/src/main/java/carpet/mixins/HopperBlockEntityMixin.java @@ -36,7 +36,7 @@ public abstract class HopperBlockEntityMixin extends LootableContainerBlockEntit if (CarpetSettings.hopperCounters) { DyeColor wool_color = WoolTool.getWoolColorAtPosition( world, - blockPos.method_35851(blockState.get(HopperBlock.FACING))); // offset + blockPos.offset(blockState.get(HopperBlock.FACING))); // offset if (wool_color != null) { for (int i = 0; i < inventory.size(); ++i) diff --git a/src/main/java/carpet/mixins/PillagerEntity_scarpetMixin.java b/src/main/java/carpet/mixins/PillagerEntity_scarpetMixin.java deleted file mode 100644 index 66db248f..00000000 --- a/src/main/java/carpet/mixins/PillagerEntity_scarpetMixin.java +++ /dev/null @@ -1,21 +0,0 @@ -package carpet.mixins; - -import carpet.fakes.InventoryBearerInterface; -import net.minecraft.entity.mob.PillagerEntity; -import net.minecraft.inventory.Inventory; -import net.minecraft.inventory.SimpleInventory; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; - -@Mixin(PillagerEntity.class) -public class PillagerEntity_scarpetMixin implements InventoryBearerInterface -{ - @Shadow @Final private SimpleInventory inventory; - - @Override - public Inventory getCMInventory() - { - return inventory; - } -} diff --git a/src/main/java/carpet/mixins/PistonHandler_customStickyMixin.java b/src/main/java/carpet/mixins/PistonHandler_customStickyMixin.java index 9a026549..a251f251 100644 --- a/src/main/java/carpet/mixins/PistonHandler_customStickyMixin.java +++ b/src/main/java/carpet/mixins/PistonHandler_customStickyMixin.java @@ -196,7 +196,7 @@ public abstract class PistonHandler_customStickyMixin // stickyDirection = blockState_1.get(FacingBlock.FACING); //} - return stickyDirection == null || this.tryMove(blockPos_1.method_35851(stickyDirection), stickyDirection); //offset + return stickyDirection == null || this.tryMove(blockPos_1.offset(stickyDirection), stickyDirection); //offset } diff --git a/src/main/java/carpet/mixins/StructureFeatureMixin.java b/src/main/java/carpet/mixins/StructureFeatureMixin.java index d62055a9..d65a771c 100644 --- a/src/main/java/carpet/mixins/StructureFeatureMixin.java +++ b/src/main/java/carpet/mixins/StructureFeatureMixin.java @@ -56,7 +56,7 @@ public abstract class StructureFeatureMixin implements structurestart.generateStructure(world, world.getStructureAccessor(), generator, rand,box, new ChunkPos(j, k)); } //structurestart.notifyPostProcessAt(new ChunkPos(j, k)); - int i = Math.max(box.getBlockCountY(),box.getBlockCountX())/16+1; // X Z + int i = Math.max(box.getBlockCountX(),box.getBlockCountZ())/16+1; //int i = getRadius(); for (int k1 = j - i; k1 <= j + i; ++k1) diff --git a/src/main/java/carpet/script/api/Auxiliary.java b/src/main/java/carpet/script/api/Auxiliary.java index b8c165d9..1428e029 100644 --- a/src/main/java/carpet/script/api/Auxiliary.java +++ b/src/main/java/carpet/script/api/Auxiliary.java @@ -788,13 +788,13 @@ public class Auxiliary { ListValue.wrap(Registry.FEATURE.getIds().stream().sorted().map(ValueConversions::of).collect(Collectors.toList())) ); plopData.put(StringValue.of("configured_features"), - ListValue.wrap(registryManager.get(Registry.CONFIGURED_FEATURE_WORLDGEN).getIds().stream().sorted().map(ValueConversions::of).collect(Collectors.toList())) + ListValue.wrap(registryManager.get(Registry.CONFIGURED_FEATURE_KEY).getIds().stream().sorted().map(ValueConversions::of).collect(Collectors.toList())) ); plopData.put(StringValue.of("structures"), ListValue.wrap(Registry.STRUCTURE_FEATURE.getIds().stream().sorted().map(ValueConversions::of).collect(Collectors.toList())) ); plopData.put(StringValue.of("configured_structures"), - ListValue.wrap(registryManager.get(Registry.CONFIGURED_STRUCTURE_FEATURE_WORLDGEN).getIds().stream().sorted().map(ValueConversions::of).collect(Collectors.toList())) + ListValue.wrap(registryManager.get(Registry.CONFIGURED_STRUCTURE_FEATURE_KEY).getIds().stream().sorted().map(ValueConversions::of).collect(Collectors.toList())) ); Value ret = MapValue.wrap(plopData); return (_c, _t) -> ret; @@ -1188,7 +1188,7 @@ public class Auxiliary { if (!existing_worlds.containsKey(registryKey)) { addeds.add(ValueConversions.of(registryKey.getValue())); - RegistryKey registryKey2 = RegistryKey.of(Registry.DIMENSION, registryKey.getValue()); + RegistryKey registryKey2 = RegistryKey.of(Registry.WORLD_KEY, registryKey.getValue()); DimensionType dimensionType3 = entry.getValue().getDimensionType(); ChunkGenerator chunkGenerator3 = entry.getValue().getChunkGenerator(); UnmodifiableLevelProperties unmodifiableLevelProperties = new UnmodifiableLevelProperties(saveProperties, ((ServerWorldInterface) server.getOverworld()).getWorldPropertiesCM()); diff --git a/src/main/java/carpet/script/api/BlockIterators.java b/src/main/java/carpet/script/api/BlockIterators.java index a16b733e..03582021 100644 --- a/src/main/java/carpet/script/api/BlockIterators.java +++ b/src/main/java/carpet/script/api/BlockIterators.java @@ -216,10 +216,10 @@ public class BlockIterators { List neighbours = new ArrayList<>(); neighbours.add(new BlockValue(null, world, center.up())); neighbours.add(new BlockValue(null, world, center.down())); - neighbours.add(new BlockValue(null, world, center.method_35861())); // north - neighbours.add(new BlockValue(null, world, center.method_35859())); // sourh - neighbours.add(new BlockValue(null, world, center.method_35855())); // east - neighbours.add(new BlockValue(null, world, center.method_35857())); // west + neighbours.add(new BlockValue(null, world, center.north())); + neighbours.add(new BlockValue(null, world, center.south())); + neighbours.add(new BlockValue(null, world, center.east())); + neighbours.add(new BlockValue(null, world, center.west())); Value retval = ListValue.wrap(neighbours); return (c_, t_) -> retval; }); diff --git a/src/main/java/carpet/script/api/WorldAccess.java b/src/main/java/carpet/script/api/WorldAccess.java index 78affeb0..71404393 100644 --- a/src/main/java/carpet/script/api/WorldAccess.java +++ b/src/main/java/carpet/script/api/WorldAccess.java @@ -1307,7 +1307,7 @@ public class WorldAccess { BlockBox box = start.setBoundingBoxFromChildren(); structureList.put( new StringValue(NBTSerializableValue.nameFromRegistryId(Registry.STRUCTURE_FEATURE.getId(entry.getKey()))), - ListValue.of(ListValue.fromTriple(box.method_35420(), box.method_35415(), box.method_35416()), ListValue.fromTriple(box.method_35417(), box.method_35418(), box.method_35419())) + ListValue.of(ListValue.fromTriple(box.getMinX(), box.getMinY(), box.getMinZ()), ListValue.fromTriple(box.getMaxX(), box.getMaxY(), box.getMaxZ())) ); } Value ret = MapValue.wrap(structureList); @@ -1357,9 +1357,9 @@ public class WorldAccess { StructureStart start = structures.get(structure); ChunkPos structureChunkPos = start.getPos(); // new ChunkPos(start.getChunkX(), start.getChunkZ()); BlockBox box = start.setBoundingBoxFromChildren(); - for (int chx = box.method_35420() / 16; chx <= box.method_35417() / 16; chx++) // minx maxx + for (int chx = box.getMinX() / 16; chx <= box.getMaxX() / 16; chx++) // minx maxx { - for (int chz = box.method_35416() / 16; chz <= box.method_35419() / 16; chz++) //minZ maxZ + for (int chz = box.getMinZ() / 16; chz <= box.getMaxZ() / 16; chz++) //minZ maxZ { ChunkPos chpos = new ChunkPos(chx, chz); // getting a chunk will convert it to full, allowing to modify references diff --git a/src/main/java/carpet/script/utils/BiomeInfo.java b/src/main/java/carpet/script/utils/BiomeInfo.java index 9ff63005..db5bad46 100644 --- a/src/main/java/carpet/script/utils/BiomeInfo.java +++ b/src/main/java/carpet/script/utils/BiomeInfo.java @@ -34,7 +34,7 @@ public class BiomeInfo put("scale", (w, b) -> NumericValue.of(b.getScale())); put("features", (w, b) -> { - Registry> registry = w.getRegistryManager().get(Registry.CONFIGURED_FEATURE_WORLDGEN); + Registry> registry = w.getRegistryManager().get(Registry.CONFIGURED_FEATURE_KEY); return ListValue.wrap( b.getGenerationSettings().getFeatures().stream().map(step -> ListValue.wrap(step.stream().map(cfp -> @@ -44,7 +44,7 @@ public class BiomeInfo ); }); put("structures", (w, b) -> { - Registry> registry = w.getRegistryManager().get(Registry.CONFIGURED_STRUCTURE_FEATURE_WORLDGEN); + Registry> registry = w.getRegistryManager().get(Registry.CONFIGURED_STRUCTURE_FEATURE_KEY); return ListValue.wrap(b.getGenerationSettings().getStructureFeatures().stream().map(str -> ValueConversions.of(registry.getId(str.get())))); }); }}; diff --git a/src/main/java/carpet/script/utils/ShapeDispatcher.java b/src/main/java/carpet/script/utils/ShapeDispatcher.java index 0ad2922d..1e48f591 100644 --- a/src/main/java/carpet/script/utils/ShapeDispatcher.java +++ b/src/main/java/carpet/script/utils/ShapeDispatcher.java @@ -314,7 +314,7 @@ public class ShapeDispatcher key = 0; followEntity = -1; - shapeDimension = RegistryKey.of(Registry.DIMENSION, new Identifier(options.get("dim").getString())); + shapeDimension = RegistryKey.of(Registry.WORLD_KEY, new Identifier(options.get("dim").getString())); if (options.containsKey("follow")) { followEntity = NumericValue.asNumber(options.getOrDefault("follow", optional.get("follow"))).getInt(); diff --git a/src/main/java/carpet/script/utils/WorldTools.java b/src/main/java/carpet/script/utils/WorldTools.java index 1fcd553d..e90f3d44 100644 --- a/src/main/java/carpet/script/utils/WorldTools.java +++ b/src/main/java/carpet/script/utils/WorldTools.java @@ -100,20 +100,20 @@ public class WorldTools DimensionType dimensionType2; if (dimensionOptions == null) { dimensionType2 = server.getRegistryManager().getMutable(Registry.DIMENSION_TYPE_KEY).getOrThrow(DimensionType.OVERWORLD_REGISTRY_KEY); - chunkGenerator2 = GeneratorOptions.createOverworldGenerator(server.getRegistryManager().get(Registry.BIOME_KEY), server.getRegistryManager().get(Registry.NOISE_SETTINGS_WORLDGEN), (new Random()).nextLong()); + chunkGenerator2 = GeneratorOptions.createOverworldGenerator(server.getRegistryManager().get(Registry.BIOME_KEY), server.getRegistryManager().get(Registry.CHUNK_GENERATOR_SETTINGS_KEY), (new Random()).nextLong()); } else { dimensionType2 = dimensionOptions.getDimensionType(); chunkGenerator2 = dimensionOptions.getChunkGenerator(); } - RegistryKey customWorld = RegistryKey.of(Registry.DIMENSION, worldId); + RegistryKey customWorld = RegistryKey.of(Registry.WORLD_KEY, worldId); //chunkGenerator2 = GeneratorOptions.createOverworldGenerator(server.getRegistryManager().get(Registry.BIOME_KEY), server.getRegistryManager().get(Registry.NOISE_SETTINGS_WORLDGEN), (seed==null)?l:seed); chunkGenerator2 = new NoiseChunkGenerator( new VanillaLayeredBiomeSource((seed==null)?l:seed, false, false, server.getRegistryManager().get(Registry.BIOME_KEY)), (seed==null)?l:seed, - () -> server.getRegistryManager().get(Registry.NOISE_SETTINGS_WORLDGEN).getOrThrow(ChunkGeneratorSettings.OVERWORLD) + () -> server.getRegistryManager().get(Registry.CHUNK_GENERATOR_SETTINGS_KEY).getOrThrow(ChunkGeneratorSettings.OVERWORLD) ); ServerWorld serverWorld = new ServerWorld( diff --git a/src/main/java/carpet/script/value/NBTSerializableValue.java b/src/main/java/carpet/script/value/NBTSerializableValue.java index 88ffe668..98bcf052 100644 --- a/src/main/java/carpet/script/value/NBTSerializableValue.java +++ b/src/main/java/carpet/script/value/NBTSerializableValue.java @@ -15,11 +15,11 @@ import net.minecraft.block.ChestBlock; import net.minecraft.block.InventoryProvider; import net.minecraft.block.entity.BlockEntity; import net.minecraft.block.entity.ChestBlockEntity; -import net.minecraft.class_6067; import net.minecraft.command.argument.ItemStackArgument; import net.minecraft.command.argument.ItemStringReader; import net.minecraft.command.argument.NbtPathArgumentType; import net.minecraft.entity.Entity; +import net.minecraft.entity.InventoryOwner; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.passive.MerchantEntity; @@ -226,8 +226,8 @@ public class NBTSerializableValue extends Value implements ContainerValueInterfa Entity e = ((EntityValue) v1).getEntity(); if (e instanceof PlayerEntity) inv = ((PlayerEntity) e).getInventory(); else if (e instanceof Inventory) inv = (Inventory) e; - else if (e instanceof class_6067) inv = ((class_6067) e).method_35199(); // getInentory // now covers pillagers - else if (e instanceof InventoryBearerInterface) inv = ((InventoryBearerInterface)e).getCMInventory(); + else if (e instanceof InventoryOwner) inv = ((InventoryOwner) e).getInventory(); + else if (e instanceof InventoryBearerInterface) inv = ((InventoryBearerInterface)e).getCMInventory(); // horse only else if (e instanceof LivingEntity) return new InventoryLocator(e, e.getBlockPos(), new EquipmentInventory((MobEntity) e), offset+1); if (inv == null) return null; diff --git a/src/main/java/carpet/script/value/ValueConversions.java b/src/main/java/carpet/script/value/ValueConversions.java index 38199c8c..d0c92ecf 100644 --- a/src/main/java/carpet/script/value/ValueConversions.java +++ b/src/main/java/carpet/script/value/ValueConversions.java @@ -302,27 +302,32 @@ public class ValueConversions ); } + public static Value of(BlockBox box) + { + return ListValue.of( + ListValue.fromTriple(box.getMinX(), box.getMinY(), box.getMinZ()), + ListValue.fromTriple(box.getMaxX(), box.getMaxY(), box.getMaxZ()) + ); + } + public static Value of(StructureStart structure) { if (structure == null || structure == StructureStart.DEFAULT) return Value.NULL; BlockBox boundingBox = structure.setBoundingBoxFromChildren(); - if (boundingBox.method_35417() < boundingBox.method_35420() || boundingBox.method_35418() < boundingBox.method_35415() || boundingBox.method_35419() < boundingBox.method_35416()) return Value.NULL; + if (boundingBox.getMaxX() < boundingBox.getMinX() || boundingBox.getMaxY() < boundingBox.getMinY() || boundingBox.getMaxZ() < boundingBox.getMinZ()) return Value.NULL; Map ret = new HashMap<>(); - ret.put(new StringValue("box"), ListValue.of( - ListValue.fromTriple(boundingBox.method_35420(), boundingBox.method_35415(), boundingBox.method_35416()), - ListValue.fromTriple(boundingBox.method_35417(), boundingBox.method_35418(), boundingBox.method_35419()) - )); + ret.put(new StringValue("box"), of(boundingBox)); List pieces = new ArrayList<>(); for (StructurePiece piece : structure.getChildren()) { BlockBox box = piece.getBoundingBox(); - if (box.method_35417() >= box.method_35420() && box.method_35418() >= box.method_35415() && box.method_35419() >= box.method_35416()) + if (box.getMaxX() >= box.getMinX() && box.getMaxY() >= box.getMinY() && box.getMaxZ() >= box.getMinZ()) { pieces.add(ListValue.of( new StringValue(NBTSerializableValue.nameFromRegistryId(Registry.STRUCTURE_PIECE.getId(piece.getType()))), (piece.getFacing() == null) ? Value.NULL : new StringValue(piece.getFacing().getName()), - ListValue.fromTriple(box.method_35420(), box.method_35415(), box.method_35416()), - ListValue.fromTriple(box.method_35417(), box.method_35418(), box.method_35419()) + ListValue.fromTriple(box.getMinX(), box.getMinY(), box.getMinZ()), + ListValue.fromTriple(box.getMaxX(), box.getMaxY(), box.getMaxZ()) )); } } diff --git a/src/main/java/carpet/utils/BlockInfo.java b/src/main/java/carpet/utils/BlockInfo.java index a3aa1886..1a7a933c 100644 --- a/src/main/java/carpet/utils/BlockInfo.java +++ b/src/main/java/carpet/utils/BlockInfo.java @@ -184,7 +184,7 @@ public class BlockInfo put(Material.REPAIR_STATION , "anvil" ); put(Material.BARRIER , "barrier" ); put(Material.PISTON , "piston" ); - put(Material.UNUSED_PLANT , "coral" ); + put(Material.MOSS_BLOCK , "moss" ); put(Material.GOURD , "gourd" ); put(Material.EGG , "dragon_egg" ); put(Material.CAKE , "cake" ); diff --git a/src/main/resources/carpet.mixins.json b/src/main/resources/carpet.mixins.json index e1ed21fe..83f5c19e 100644 --- a/src/main/resources/carpet.mixins.json +++ b/src/main/resources/carpet.mixins.json @@ -186,7 +186,6 @@ "StatePredicate_scarpetMixin", "TagPredicate_scarpetMixin", "HorseBaseEntity_scarpetMixin", - "PillagerEntity_scarpetMixin", "BlockEntity_movableBEMixin", "PistonBlock_movableTEMixin",