Accessors (update 8 of 20)

This commit is contained in:
SD 2021-02-11 22:36:42 +05:30
parent 424993db2d
commit 78408baa69
No known key found for this signature in database
GPG key ID: E36B57EE08544BC5
6 changed files with 9 additions and 49 deletions

View file

@ -11,7 +11,7 @@ import net.minecraft.world.gen.chunk.StructuresConfig;
@Mixin(ChunkGeneratorSettings.class)
public interface ChunkGeneratorSettingsAccessor {
@Invoker("<init>")
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();
}
}

View file

@ -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("<init>")
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();
}
}

View file

@ -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("<init>")
static ListTag of(List<Tag> list, byte type) {
throw new AssertionError();
}
}

View file

@ -119,7 +119,9 @@ public final class ModDimensions {
-10,
5,
8,
false
false,
true,
true
);
}
}

View file

@ -11,10 +11,8 @@
"accessor.ChunkGeneratorAccessor",
"accessor.ChunkGeneratorSettingsAccessor",
"accessor.DefaultParticleTypeAccessor",
"accessor.DimensionTypeAccessor",
"accessor.DirectionAccessor",
"accessor.GenerationSettingsAccessor",
"accessor.ListTagAccessor",
"accessor.RedstoneWireBlockAccessor",
"accessor.StatsAccessor"
],

View file

@ -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))));
}
}