From 78408baa697fc52d44927b4b635c4bf4287a358b Mon Sep 17 00:00:00 2001 From: SD Date: Thu, 11 Feb 2021 22:36:42 +0530 Subject: [PATCH] Accessors (update 8 of 20) --- .../ChunkGeneratorSettingsAccessor.java | 2 +- .../mixin/accessor/DimensionTypeAccessor.java | 17 ----------------- .../mixin/accessor/ListTagAccessor.java | 17 ----------------- .../dimdev/dimdoors/world/ModDimensions.java | 4 +++- src/main/resources/dimdoors.mixins.json | 2 -- .../util/schematic/v2/SchematicPlacer.java | 16 +++++----------- 6 files changed, 9 insertions(+), 49 deletions(-) delete mode 100644 src/main/java/org/dimdev/dimdoors/mixin/accessor/DimensionTypeAccessor.java delete mode 100644 src/main/java/org/dimdev/dimdoors/mixin/accessor/ListTagAccessor.java diff --git a/src/main/java/org/dimdev/dimdoors/mixin/accessor/ChunkGeneratorSettingsAccessor.java b/src/main/java/org/dimdev/dimdoors/mixin/accessor/ChunkGeneratorSettingsAccessor.java index 922cdaad..9aedd2d8 100644 --- a/src/main/java/org/dimdev/dimdoors/mixin/accessor/ChunkGeneratorSettingsAccessor.java +++ b/src/main/java/org/dimdev/dimdoors/mixin/accessor/ChunkGeneratorSettingsAccessor.java @@ -11,7 +11,7 @@ import net.minecraft.world.gen.chunk.StructuresConfig; @Mixin(ChunkGeneratorSettings.class) public interface ChunkGeneratorSettingsAccessor { @Invoker("") - static ChunkGeneratorSettings invokeInit(StructuresConfig structuresConfig, GenerationShapeConfig generationShapeConfig, BlockState defaultBlock, BlockState defaultFluid, int bedrockCeilingY, int bedrockFloorY, int seaLevel, boolean mobGenerationDisabled) { + static ChunkGeneratorSettings invokeInit(StructuresConfig structuresConfig, GenerationShapeConfig generationShapeConfig, BlockState defaultBlock, BlockState defaultFluid, int bedrockCeilingY, int bedrockFloorY, int seaLevel, boolean mobGenerationDisabled, boolean bl, boolean bl2) { throw new AssertionError(); } } diff --git a/src/main/java/org/dimdev/dimdoors/mixin/accessor/DimensionTypeAccessor.java b/src/main/java/org/dimdev/dimdoors/mixin/accessor/DimensionTypeAccessor.java deleted file mode 100644 index d913fe32..00000000 --- a/src/main/java/org/dimdev/dimdoors/mixin/accessor/DimensionTypeAccessor.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.dimdev.dimdoors.mixin.accessor; - -import java.util.OptionalLong; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.gen.Invoker; - -import net.minecraft.util.Identifier; -import net.minecraft.world.dimension.DimensionType; - -@Mixin(DimensionType.class) -public interface DimensionTypeAccessor { - @Invoker("") - static DimensionType invokeInit(OptionalLong fixedTime, boolean hasSkylight, boolean hasCeiling, boolean ultrawarm, boolean natural, double coordinateScale, boolean piglinSafe, boolean bedWorks, boolean respawnAnchorWorks, boolean hasRaids, int logicalHeight, Identifier infiniburn, Identifier skyProperties, float ambientLight) { - throw new AssertionError(); - } -} diff --git a/src/main/java/org/dimdev/dimdoors/mixin/accessor/ListTagAccessor.java b/src/main/java/org/dimdev/dimdoors/mixin/accessor/ListTagAccessor.java deleted file mode 100644 index 18ea02c8..00000000 --- a/src/main/java/org/dimdev/dimdoors/mixin/accessor/ListTagAccessor.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.dimdev.dimdoors.mixin.accessor; - -import java.util.List; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.gen.Invoker; - -import net.minecraft.nbt.ListTag; -import net.minecraft.nbt.Tag; - -@Mixin(ListTag.class) -public interface ListTagAccessor { - @Invoker("") - static ListTag of(List list, byte type) { - throw new AssertionError(); - } -} diff --git a/src/main/java/org/dimdev/dimdoors/world/ModDimensions.java b/src/main/java/org/dimdev/dimdoors/world/ModDimensions.java index a879e32e..59ee042e 100644 --- a/src/main/java/org/dimdev/dimdoors/world/ModDimensions.java +++ b/src/main/java/org/dimdev/dimdoors/world/ModDimensions.java @@ -119,7 +119,9 @@ public final class ModDimensions { -10, 5, 8, - false + false, + true, + true ); } } diff --git a/src/main/resources/dimdoors.mixins.json b/src/main/resources/dimdoors.mixins.json index 5b047b2d..de1c8bbe 100644 --- a/src/main/resources/dimdoors.mixins.json +++ b/src/main/resources/dimdoors.mixins.json @@ -11,10 +11,8 @@ "accessor.ChunkGeneratorAccessor", "accessor.ChunkGeneratorSettingsAccessor", "accessor.DefaultParticleTypeAccessor", - "accessor.DimensionTypeAccessor", "accessor.DirectionAccessor", "accessor.GenerationSettingsAccessor", - "accessor.ListTagAccessor", "accessor.RedstoneWireBlockAccessor", "accessor.StatsAccessor" ], diff --git a/src/main/schematics/org/dimdev/dimdoors/util/schematic/v2/SchematicPlacer.java b/src/main/schematics/org/dimdev/dimdoors/util/schematic/v2/SchematicPlacer.java index ad310d9f..ebf28d47 100644 --- a/src/main/schematics/org/dimdev/dimdoors/util/schematic/v2/SchematicPlacer.java +++ b/src/main/schematics/org/dimdev/dimdoors/util/schematic/v2/SchematicPlacer.java @@ -2,17 +2,17 @@ package org.dimdev.dimdoors.util.schematic.v2; import java.util.List; import java.util.Objects; +import java.util.stream.Stream; -import com.google.common.collect.ImmutableList; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.dimdev.dimdoors.mixin.accessor.ListTagAccessor; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.DoubleTag; import net.minecraft.nbt.ListTag; +import net.minecraft.nbt.NbtOps; import net.minecraft.util.math.BlockPos; import net.minecraft.world.StructureWorldAccess; @@ -100,14 +100,8 @@ public final class SchematicPlacer { double y = listTag.getDouble(1); double z = listTag.getDouble(2); tag.remove("Pos"); - tag.put("Pos", ListTagAccessor.of( - ImmutableList.of( - DoubleTag.of(x + originX), - DoubleTag.of(y + originY), - DoubleTag.of(z + originZ) - ), - (byte) 6 - ) - ); + tag.put("Pos", NbtOps.INSTANCE.createList(Stream.of(DoubleTag.of(x + originX), + DoubleTag.of(y + originY), + DoubleTag.of(z + originZ)))); } }