Splitting and refactoring

This commit is contained in:
SD 2021-03-25 21:01:11 +05:30
parent 6e092e35fa
commit 2c196e3bf2
124 changed files with 483 additions and 407 deletions

View file

@ -1,17 +1,19 @@
package org.dimdev.dimdoors;
import java.nio.file.Path;
import java.util.List;
import java.util.function.Supplier;
import me.sargunvohra.mcmods.autoconfig1u.AutoConfig;
import me.sargunvohra.mcmods.autoconfig1u.ConfigHolder;
import org.dimdev.dimdoors.api.DimensionalDoorsApi;
import org.dimdev.dimdoors.block.ModBlocks;
import org.dimdev.dimdoors.block.door.data.condition.Condition;
import org.dimdev.dimdoors.block.entity.ModBlockEntityTypes;
import org.dimdev.dimdoors.command.ModCommands;
import org.dimdev.dimdoors.entity.ModEntityTypes;
import org.dimdev.dimdoors.entity.stat.ModStats;
import org.dimdev.dimdoors.event.UseItemOnBlockCallback;
import org.dimdev.dimdoors.api.event.UseItemOnBlockCallback;
import org.dimdev.dimdoors.fluid.ModFluids;
import org.dimdev.dimdoors.item.ModItems;
import org.dimdev.dimdoors.listener.AttackBlockCallbackListener;
@ -30,7 +32,6 @@ import org.dimdev.dimdoors.pockets.virtual.VirtualSingularPocket;
import org.dimdev.dimdoors.rift.targets.Targets;
import org.dimdev.dimdoors.rift.targets.VirtualTarget;
import org.dimdev.dimdoors.sound.ModSoundEvents;
import org.dimdev.dimdoors.util.SubRootJanksonConfigSerializer;
import org.dimdev.dimdoors.world.ModBiomes;
import org.dimdev.dimdoors.world.ModDimensions;
import org.dimdev.dimdoors.world.feature.ModFeatures;
@ -59,8 +60,9 @@ import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.api.ModContainer;
public class DimensionalDoorsInitializer implements ModInitializer {
public static List<DimensionalDoorsApi> apiSubscribers;
private static final Supplier<Path> CONFIG_ROOT = () -> FabricLoader.getInstance().getConfigDir().resolve("dimdoors").toAbsolutePath();
private static final ConfigHolder<ModConfig> CONFIG_MANAGER = AutoConfig.register(ModConfig.class, SubRootJanksonConfigSerializer::new);
private static final ConfigHolder<ModConfig> CONFIG_MANAGER = AutoConfig.register(ModConfig.class, ModConfig.SubRootJanksonConfigSerializer::new);
private static MinecraftServer server;
private static ModContainer dimDoorsMod;
@ -90,6 +92,7 @@ public class DimensionalDoorsInitializer implements ModInitializer {
@Override
public void onInitialize() {
apiSubscribers = FabricLoader.getInstance().getEntrypoints("dimdoors:api", DimensionalDoorsApi.class);
dimDoorsMod = FabricLoader.getInstance().getModContainer("dimdoors").orElseThrow(RuntimeException::new);
ServerLifecycleEvents.SERVER_STARTING.register((minecraftServer) -> {
server = minecraftServer;
@ -121,6 +124,7 @@ public class DimensionalDoorsInitializer implements ModInitializer {
ResourceManagerHelper.registerBuiltinResourcePack(new Identifier("dimdoors", "default_pockets"), dimDoorsMod, ResourcePackActivationType.DEFAULT_ENABLED);
registerListeners();
apiSubscribers.forEach(DimensionalDoorsApi::postInitialize);
}
private void registerListeners() {

View file

@ -1,17 +1,21 @@
package org.dimdev.dimdoors;
import java.io.BufferedWriter;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.LinkedList;
import java.util.List;
import me.sargunvohra.mcmods.autoconfig1u.AutoConfig;
import blue.endless.jankson.Jankson;
import me.sargunvohra.mcmods.autoconfig1u.ConfigData;
import me.sargunvohra.mcmods.autoconfig1u.annotation.Config;
import me.sargunvohra.mcmods.autoconfig1u.annotation.ConfigEntry;
import me.sargunvohra.mcmods.autoconfig1u.annotation.ConfigEntry.Category;
import me.sargunvohra.mcmods.autoconfig1u.annotation.ConfigEntry.Gui.RequiresRestart;
import me.sargunvohra.mcmods.autoconfig1u.annotation.ConfigEntry.Gui.Tooltip;
import me.sargunvohra.mcmods.autoconfig1u.annotation.ConfigEntry.Gui.TransitiveObject;
import me.sargunvohra.mcmods.autoconfig1u.serializer.JanksonConfigSerializer;
import me.sargunvohra.mcmods.autoconfig1u.serializer.ConfigSerializer;
import me.sargunvohra.mcmods.autoconfig1u.util.Utils;
@SuppressWarnings("FieldMayBeFinal")
@Config(name = "dimdoors")
@ -118,4 +122,51 @@ public final class ModConfig implements ConfigData {
@Tooltip public double riftSize = 1;
@Tooltip public double riftJitter = 1;
}
public static class SubRootJanksonConfigSerializer<T extends ConfigData> implements ConfigSerializer<T> {
private static final Jankson JANKSON = Jankson.builder().build();
private final Config definition;
private final Class<T> configClass;
public SubRootJanksonConfigSerializer(Config definition, Class<T> configClass) {
this.definition = definition;
this.configClass = configClass;
}
private Path getConfigPath() {
return DimensionalDoorsInitializer.getConfigRoot().resolve(definition.name() + "-config.json5");
}
@Override
public void serialize(T config) throws SerializationException {
Path configPath = getConfigPath();
try {
Files.createDirectories(configPath.getParent());
BufferedWriter writer = Files.newBufferedWriter(configPath);
writer.write(JANKSON.toJson(config).toJson(true, true));
writer.close();
} catch (IOException e) {
throw new SerializationException(e);
}
}
@Override
public T deserialize() throws SerializationException {
Path configPath = getConfigPath();
if (Files.exists(configPath)) {
try {
return JANKSON.fromJson(JANKSON.load(getConfigPath().toFile()), configClass);
} catch (Throwable e) {
throw new SerializationException(e);
}
} else {
return createDefault();
}
}
@Override
public T createDefault() {
return Utils.constructUnsafely(configClass);
}
}
}

View file

@ -0,0 +1,37 @@
package org.dimdev.dimdoors.api;
import org.dimdev.dimdoors.block.door.data.condition.Condition;
import org.dimdev.dimdoors.pockets.generator.PocketGenerator;
import org.dimdev.dimdoors.pockets.modifier.Modifier;
import org.dimdev.dimdoors.pockets.virtual.VirtualSingularPocket;
import org.dimdev.dimdoors.rift.targets.VirtualTarget;
import org.dimdev.dimdoors.world.pocket.type.AbstractPocket;
import org.dimdev.dimdoors.world.pocket.type.addon.PocketAddon;
import net.minecraft.util.registry.Registry;
// TODO: javadocs for everything, refactoring
public interface DimensionalDoorsApi {
default void registerVirtualTargetTypes(Registry<VirtualTarget.VirtualTargetType<?>> registry) {
}
default void registerVirtualSingularPocketTypes(Registry<VirtualSingularPocket.VirtualSingularPocketType<?>> registry) {
}
default void registerModifierTypes(Registry<Modifier.ModifierType<?>> registry) {
}
default void registerPocketGeneratorTypes(Registry<PocketGenerator.PocketGeneratorType<?>> registry) {
}
default void registerAbstractPocketTypes(Registry<AbstractPocket.AbstractPocketType<?>> registry) {
}
default void registerPocketAddonTypes(Registry<PocketAddon.PocketAddonType<?>> registry) {
}
default void registerConditionTypes(Registry<Condition.ConditionType<?>> registry) {
}
default void postInitialize() {}
}

View file

@ -1,4 +1,4 @@
package org.dimdev.dimdoors.client;
package org.dimdev.dimdoors.api.client;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.math.Direction;

View file

@ -0,0 +1,65 @@
package org.dimdev.dimdoors.api.client;
import java.util.Collections;
import java.util.Random;
import org.dimdev.dimdoors.client.ModShaders;
import org.dimdev.dimdoors.mixin.client.accessor.RenderLayerAccessor;
import net.minecraft.client.model.ModelPart;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.RenderPhase;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.VertexFormat;
import net.minecraft.client.render.VertexFormats;
import net.minecraft.client.render.block.entity.EndPortalBlockEntityRenderer;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.Identifier;
public final class DimensionalPortalRenderer {
public static final Identifier WARP_PATH;
private static final RenderPhase.class_5942 DIMENSIONAL_PORTAL_SHADER;
private static final RenderLayer RENDER_LAYER;
private static final ModelPart MODEL;
private static final ModelPart TALL_MODEL;
public static void renderDimensionalPortal(MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, Transformer transformer, float tickDelta, int light, int overlay) {
renderDimensionalPortal(matrixStack, vertexConsumerProvider, transformer, tickDelta, light, overlay, true);
}
public static void renderDimensionalPortal(MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, Transformer transformer, float tickDelta, int light, int overlay, boolean tall) {
ModelPart model = tall ? TALL_MODEL : MODEL;
renderModelWithPortalShader(model, matrixStack, vertexConsumerProvider, transformer, tickDelta, light, overlay);
}
public static void renderModelWithPortalShader(ModelPart model, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, Transformer transformer, float tickDelta, int light, int overlay) {
transformer.transform(matrixStack);
model.render(matrixStack, vertexConsumerProvider.getBuffer(RENDER_LAYER), light, overlay);
}
static {
WARP_PATH = new Identifier("dimdoors:textures/other/warp.png");
DIMENSIONAL_PORTAL_SHADER = new RenderPhase.class_5942(ModShaders::getDimensionalPortal);
RENDER_LAYER = RenderLayerFactory.create(
"dimensional_portal",
VertexFormats.POSITION,
VertexFormat.DrawMode.QUADS,
256,
false,
false,
RenderLayer.MultiPhaseParameters.builder()
.method_34578(DIMENSIONAL_PORTAL_SHADER)
.method_34577(
RenderPhase.class_5940.method_34560()
.method_34563(EndPortalBlockEntityRenderer.SKY_TEXTURE, false, false)
.method_34563(WARP_PATH, false, false)
.method_34562()
)
.build(false)
);
ModelPart.Cuboid small = new ModelPart.Cuboid(0, 0, 0, 0, 0, 16, 16, 0.2F, 0, 0, 0, false, 1024, 1024);
MODEL = new ModelPart(Collections.singletonList(small), Collections.emptyMap());
ModelPart.Cuboid big = new ModelPart.Cuboid(0, 0, 0, 0, 0, 16, 32, 0.2F, 0, 0, 0, false, 1024, 1024);
TALL_MODEL = new ModelPart(Collections.singletonList(big), Collections.emptyMap());
}
}

View file

@ -0,0 +1,12 @@
package org.dimdev.dimdoors.api.client;
import org.dimdev.dimdoors.mixin.client.accessor.RenderLayerAccessor;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.VertexFormat;
public class RenderLayerFactory {
public static RenderLayer create(String name, VertexFormat vertexFormat, VertexFormat.DrawMode drawMode, int expectedBufferSize, boolean hasCrumbling, boolean translucent, RenderLayer.MultiPhaseParameters phases) {
return RenderLayerAccessor.callOf(name, vertexFormat, drawMode, expectedBufferSize, hasCrumbling, translucent, phases);
}
}

View file

@ -1,4 +1,4 @@
package org.dimdev.dimdoors.client;
package org.dimdev.dimdoors.api.client;
import net.minecraft.client.util.math.MatrixStack;

View file

@ -1,4 +1,4 @@
package org.dimdev.dimdoors.event;
package org.dimdev.dimdoors.api.event;
import net.fabricmc.fabric.api.event.Event;
import net.fabricmc.fabric.api.event.EventFactory;

View file

@ -1,4 +1,4 @@
package org.dimdev.dimdoors.rift.targets;
package org.dimdev.dimdoors.api.rift.target;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.EulerAngle;

View file

@ -1,4 +1,4 @@
package org.dimdev.dimdoors.rift.targets;
package org.dimdev.dimdoors.api.rift.target;
import net.minecraft.fluid.Fluid;
import net.minecraft.util.math.Direction;

View file

@ -1,4 +1,4 @@
package org.dimdev.dimdoors.rift.targets;
package org.dimdev.dimdoors.api.rift.target;
import net.minecraft.item.ItemStack;

View file

@ -1,4 +1,4 @@
package org.dimdev.dimdoors.rift.targets;
package org.dimdev.dimdoors.api.rift.target;
import net.minecraft.util.math.Direction;

View file

@ -1,4 +1,6 @@
package org.dimdev.dimdoors.rift.targets;
package org.dimdev.dimdoors.api.rift.target;
import org.dimdev.dimdoors.rift.targets.DefaultTargets;
public interface Target {

View file

@ -1,4 +1,4 @@
package org.dimdev.dimdoors.util;
package org.dimdev.dimdoors.api.util;
import net.minecraft.util.math.BlockBox;

View file

@ -1,4 +1,4 @@
package org.dimdev.dimdoors.util;
package org.dimdev.dimdoors.api.util;
import java.util.HashMap;
import java.util.Map;

View file

@ -1,4 +1,4 @@
package org.dimdev.dimdoors.util;
package org.dimdev.dimdoors.api.util;
import net.minecraft.entity.Entity;
import net.minecraft.entity.ItemEntity;

View file

@ -1,4 +1,4 @@
package org.dimdev.dimdoors.util;
package org.dimdev.dimdoors.api.util;
import org.jgrapht.Graph;

View file

@ -1,14 +1,14 @@
package org.dimdev.dimdoors.util;
package org.dimdev.dimdoors.api.util;
import java.util.HashMap;
import java.util.Map;
public class InstanceMap { // Type safe map between classes and instances
private final Map<Class<?>, Object> uncheckedMap = new HashMap<>();
public InstanceMap() {
}
private final Map<Class<?>, Object> uncheckedMap = new HashMap<>();
public <T> void put(Class<T> key, T value) {
this.uncheckedMap.put(key, value);
}

View file

@ -1,4 +1,4 @@
package org.dimdev.dimdoors.util;
package org.dimdev.dimdoors.api.util;
import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;

View file

@ -1,4 +1,4 @@
package org.dimdev.dimdoors.util;
package org.dimdev.dimdoors.api.util;
import com.mojang.serialization.Codec;

View file

@ -1,10 +1,6 @@
package org.dimdev.dimdoors.util;
package org.dimdev.dimdoors.api.util;
import java.util.NoSuchElementException;
import java.util.function.IntConsumer;
import java.util.function.IntSupplier;
import java.util.function.Supplier;
import java.util.stream.IntStream;
import it.unimi.dsi.fastutil.booleans.BooleanConsumer;

View file

@ -1,4 +1,4 @@
package org.dimdev.dimdoors.util;
package org.dimdev.dimdoors.api.util;
import java.util.Iterator;
import java.util.Objects;

View file

@ -1,7 +1,4 @@
package org.dimdev.dimdoors.util;
import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
package org.dimdev.dimdoors.api.util;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.util.Identifier;

View file

@ -1,10 +1,10 @@
package org.dimdev.dimdoors.util;
package org.dimdev.dimdoors.api.util;
import java.util.Map;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.dimdev.dimdoors.util.math.Equation;
import org.dimdev.dimdoors.api.util.math.Equation;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.ListTag;

View file

@ -1,4 +1,4 @@
package org.dimdev.dimdoors.util;
package org.dimdev.dimdoors.api.util;
import java.util.concurrent.ThreadLocalRandom;
@ -14,8 +14,8 @@ import net.minecraft.world.TeleportTarget;
import net.minecraft.world.World;
import net.fabricmc.fabric.api.dimension.v1.FabricDimensions;
import org.dimdev.dimdoors.network.ExtendedServerPlayNetworkHandler;
import org.dimdev.dimdoors.network.ServerPacketHandler;
@SuppressWarnings("deprecation")
public final class TeleportUtil {

View file

@ -1,4 +1,4 @@
package org.dimdev.dimdoors.util;
package org.dimdev.dimdoors.api.util;
public interface Weighted<P> {
// Should always return the same number if the same parameters are provided.

View file

@ -1,4 +1,4 @@
package org.dimdev.dimdoors.util;
package org.dimdev.dimdoors.api.util;
import java.util.ArrayList;
import java.util.Collection;

View file

@ -1,14 +1,12 @@
package org.dimdev.dimdoors.util.math;
package org.dimdev.dimdoors.api.util.math;
import java.util.Arrays;
public abstract class MatrixdImpl<T extends MatrixdImpl<T>> {
public abstract class AbstractMatrixd<T extends AbstractMatrixd<T>> {
private final int dimensionX;
private final int dimensionY;
protected double[][] matrix;
public MatrixdImpl(double[][] matrix) {
public AbstractMatrixd(double[][] matrix) {
if (matrix.length > 0) { // Allow matrices of dimension 0x0. Why? No reason not to.
int length = matrix[0].length;
for (int i = 1; i < matrix.length; i++) {
@ -21,14 +19,14 @@ public abstract class MatrixdImpl<T extends MatrixdImpl<T>> {
this.dimensionY = matrix[0].length;
}
public MatrixdImpl(MatrixdImpl<?> matrixd) {
public AbstractMatrixd(AbstractMatrixd<?> matrixd) {
this.matrix = matrixd.getMatrix();
this.dimensionX = matrixd.getDimensionX();
this.dimensionY = matrixd.getDimensionY();
}
public MatrixdImpl(Vectord... vectors) {
public AbstractMatrixd(Vectord... vectors) {
double[][] matrix = new double[vectors.length][vectors[0].size()];
for (int i = 0; i < vectors.length; i++) {
matrix[i] = vectors[i].getVec();
@ -47,7 +45,7 @@ public abstract class MatrixdImpl<T extends MatrixdImpl<T>> {
public abstract T construct(double[][] matrix);
public abstract T construct(MatrixdImpl<?> matrixd);
public abstract T construct(AbstractMatrixd<?> matrixd);
public abstract T construct(Vectord... vectors);
@ -168,7 +166,7 @@ public abstract class MatrixdImpl<T extends MatrixdImpl<T>> {
return sum;
}
public T product(MatrixdImpl<?> matrix) {
public T product(AbstractMatrixd<?> matrix) {
if (dimensionX != matrix.dimensionY) throw new UnsupportedOperationException("Cannot perform matrix product on matrices of non matching row length and column length");
double[][] result = new double[matrix.dimensionX][dimensionY];
for (int i = 0; i < matrix.dimensionX; i++) {
@ -179,7 +177,7 @@ public abstract class MatrixdImpl<T extends MatrixdImpl<T>> {
return construct(result);
}
public Matrixd universalProduct(MatrixdImpl<?> matrix) {
public Matrixd universalProduct(AbstractMatrixd<?> matrix) {
if (dimensionX != matrix.dimensionY) throw new UnsupportedOperationException("Cannot perform matrix product on matrices of non matching row length and column length");
double[][] result = new double[matrix.dimensionX][dimensionY];
for (int i = 0; i < matrix.dimensionX; i++) {
@ -191,7 +189,7 @@ public abstract class MatrixdImpl<T extends MatrixdImpl<T>> {
}
public Vectord product(Vectord vector) {
MatrixdImpl<?> matrix = new Matrixd(vector);
AbstractMatrixd<?> matrix = new Matrixd(vector);
return universalProduct(matrix).asVector();
}
@ -216,8 +214,8 @@ public abstract class MatrixdImpl<T extends MatrixdImpl<T>> {
@Override
public boolean equals(Object o) {
if (!(o instanceof MatrixdImpl)) return false;
MatrixdImpl<?> matrixd = (MatrixdImpl<?>) o;
if (!(o instanceof AbstractMatrixd)) return false;
AbstractMatrixd<?> matrixd = (AbstractMatrixd<?>) o;
if (matrixd.dimensionX != dimensionX || matrixd.dimensionY != dimensionY) return false;
for (int i = 0; i < dimensionX; i++) {

View file

@ -1,4 +1,4 @@
package org.dimdev.dimdoors.util.math;
package org.dimdev.dimdoors.api.util.math;
import java.util.ArrayList;
import java.util.Arrays;

View file

@ -1,4 +1,4 @@
package org.dimdev.dimdoors.util.math;
package org.dimdev.dimdoors.api.util.math;
import net.minecraft.util.math.BlockPos;

View file

@ -1,14 +1,15 @@
package org.dimdev.dimdoors.util.math;
package org.dimdev.dimdoors.api.util.math;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.EulerAngle;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import java.util.Map;
import java.util.Random;
import org.dimdev.dimdoors.api.util.math.TransformationMatrix3d;
public final class MathUtil {
public static <T> T weightedRandom(Map<T, Float> weights) {
if (weights.size() == 0) return null;

View file

@ -1,6 +1,6 @@
package org.dimdev.dimdoors.util.math;
package org.dimdev.dimdoors.api.util.math;
public class Matrixd extends MatrixdImpl<Matrixd> {
public class Matrixd extends AbstractMatrixd<Matrixd> {
public static Matrixd identity(int i, int j) {
double[][] identityMatrix = new double[i][j];
for (int n = 0; n < i && n < j; n++) {
@ -21,7 +21,7 @@ public class Matrixd extends MatrixdImpl<Matrixd> {
super(matrix);
}
public Matrixd(MatrixdImpl<? extends MatrixdImpl<?>> matrixd) {
public Matrixd(AbstractMatrixd<? extends AbstractMatrixd<?>> matrixd) {
super(matrixd);
}
@ -35,7 +35,7 @@ public class Matrixd extends MatrixdImpl<Matrixd> {
}
@Override
public Matrixd construct(MatrixdImpl<? extends MatrixdImpl<?>> matrixd) {
public Matrixd construct(AbstractMatrixd<? extends AbstractMatrixd<?>> matrixd) {
return new Matrixd(matrixd);
}

View file

@ -1,4 +1,4 @@
package org.dimdev.dimdoors.util.math;
package org.dimdev.dimdoors.api.util.math;
import net.minecraft.util.math.EulerAngle;
import net.minecraft.util.math.Vec3d;
@ -8,7 +8,7 @@ public class TransformationMatrix3d extends TransformationMatrixdImpl<Transforma
super(matrix);
}
public TransformationMatrix3d(MatrixdImpl<? extends MatrixdImpl<?>> matrix) {
public TransformationMatrix3d(AbstractMatrixd<? extends AbstractMatrixd<?>> matrix) {
super(matrix);
}
@ -26,7 +26,7 @@ public class TransformationMatrix3d extends TransformationMatrixdImpl<Transforma
}
@Override
public TransformationMatrix3d construct(MatrixdImpl<? extends MatrixdImpl<?>> matrixd) {
public TransformationMatrix3d construct(AbstractMatrixd<? extends AbstractMatrixd<?>> matrixd) {
return new TransformationMatrix3d(matrixd);
}

View file

@ -1,11 +1,11 @@
package org.dimdev.dimdoors.util.math;
package org.dimdev.dimdoors.api.util.math;
public class TransformationMatrixd extends TransformationMatrixdImpl<TransformationMatrixd> {
public TransformationMatrixd(double[][] matrix) {
super(matrix);
}
public TransformationMatrixd(MatrixdImpl<? extends MatrixdImpl<?>> matrix) {
public TransformationMatrixd(AbstractMatrixd<? extends AbstractMatrixd<?>> matrix) {
super(matrix);
}
@ -28,7 +28,7 @@ public class TransformationMatrixd extends TransformationMatrixdImpl<Transformat
}
@Override
public TransformationMatrixd construct(MatrixdImpl<? extends MatrixdImpl<?>> matrixd) {
public TransformationMatrixd construct(AbstractMatrixd<? extends AbstractMatrixd<?>> matrixd) {
return new TransformationMatrixd(matrixd);
}

View file

@ -1,9 +1,9 @@
package org.dimdev.dimdoors.util.math;
package org.dimdev.dimdoors.api.util.math;
import java.util.ArrayList;
import java.util.List;
public abstract class TransformationMatrixdImpl<T extends MatrixdImpl<T>> extends MatrixdImpl<T> {
public abstract class TransformationMatrixdImpl<T extends AbstractMatrixd<T>> extends AbstractMatrixd<T> {
public TransformationMatrixdImpl(double[][] matrix) {
super(matrix);
if (getDimensionX() != getDimensionY()) {
@ -11,7 +11,7 @@ public abstract class TransformationMatrixdImpl<T extends MatrixdImpl<T>> extend
}
}
public TransformationMatrixdImpl(MatrixdImpl<?> matrix) {
public TransformationMatrixdImpl(AbstractMatrixd<?> matrix) {
super(matrix);
if (getDimensionX() != getDimensionY()) {
throw new UnsupportedOperationException("Cannot create TransformationMatrixd from non square matrix.");

View file

@ -1,4 +1,4 @@
package org.dimdev.dimdoors.util.math;
package org.dimdev.dimdoors.api.util.math;
public class Vectord {
private final double[] vec;

View file

@ -4,7 +4,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.EulerAngle;
import net.minecraft.util.math.Vec3d;
import org.dimdev.dimdoors.util.math.TransformationMatrix3d;
import org.dimdev.dimdoors.api.util.math.TransformationMatrix3d;
public interface CoordinateTransformerBlock {
TransformationMatrix3d.TransformationMatrix3dBuilder transformationBuilder(BlockState state, BlockPos pos);

View file

@ -2,7 +2,7 @@ package org.dimdev.dimdoors.block;
import net.minecraft.util.math.Vec3d;
import org.dimdev.dimdoors.fluid.ModFluids;
import org.dimdev.dimdoors.rift.targets.EntityTarget;
import org.dimdev.dimdoors.api.rift.target.EntityTarget;
import org.dimdev.dimdoors.rift.targets.EscapeTarget;
import net.minecraft.block.Block;
@ -11,7 +11,7 @@ import net.minecraft.block.FluidBlock;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import org.dimdev.dimdoors.util.math.MathUtil;
import org.dimdev.dimdoors.api.util.math.MathUtil;
public class EternalFluidBlock extends FluidBlock {
private static final EntityTarget TARGET = new EscapeTarget(true);

View file

@ -1,6 +1,5 @@
package org.dimdev.dimdoors.block.door;
import net.minecraft.block.BlockRenderType;
import net.minecraft.util.math.Vec3d;
import org.dimdev.dimdoors.DimensionalDoorsInitializer;
@ -9,8 +8,8 @@ import org.dimdev.dimdoors.block.ModBlocks;
import org.dimdev.dimdoors.block.RiftProvider;
import org.dimdev.dimdoors.block.entity.DetachedRiftBlockEntity;
import org.dimdev.dimdoors.block.entity.EntranceRiftBlockEntity;
import org.dimdev.dimdoors.util.math.MathUtil;
import org.dimdev.dimdoors.util.math.TransformationMatrix3d;
import org.dimdev.dimdoors.api.util.math.MathUtil;
import org.dimdev.dimdoors.api.util.math.TransformationMatrix3d;
import org.jetbrains.annotations.Nullable;
import net.minecraft.block.BlockState;

View file

@ -16,7 +16,7 @@ import org.dimdev.dimdoors.block.entity.EntranceRiftBlockEntity;
import org.dimdev.dimdoors.item.DimensionalDoorItem;
import org.dimdev.dimdoors.item.ItemExtensions;
import org.dimdev.dimdoors.item.ModItems;
import org.dimdev.dimdoors.util.OptionalBool;
import org.dimdev.dimdoors.api.util.OptionalBool;
import net.minecraft.block.Block;
import net.minecraft.item.Item;

View file

@ -30,7 +30,7 @@ import org.dimdev.dimdoors.rift.targets.PublicPocketTarget;
import org.dimdev.dimdoors.rift.targets.RandomTarget;
import org.dimdev.dimdoors.rift.targets.UnstableTarget;
import org.dimdev.dimdoors.rift.targets.VirtualTarget;
import org.dimdev.dimdoors.util.OptionalBool;
import org.dimdev.dimdoors.api.util.OptionalBool;
import org.dimdev.dimdoors.world.ModDimensions;
import net.minecraft.util.Pair;

View file

@ -5,6 +5,7 @@ import java.util.function.Function;
import com.google.gson.JsonObject;
import com.mojang.serialization.Lifecycle;
import org.dimdev.dimdoors.DimensionalDoorsInitializer;
import org.dimdev.dimdoors.block.entity.EntranceRiftBlockEntity;
import net.minecraft.util.Identifier;
@ -48,6 +49,7 @@ public interface Condition {
}
static void register() {
DimensionalDoorsInitializer.apiSubscribers.forEach(d -> d.registerConditionTypes(REGISTRY));
}
static <T extends Condition> ConditionType<T> register(String name, Function<JsonObject, T> fromJson) {

View file

@ -6,7 +6,7 @@ import net.minecraft.util.math.EulerAngle;
import net.minecraft.util.math.Vec3d;
import org.dimdev.dimdoors.DimensionalDoorsInitializer;
import org.dimdev.dimdoors.block.ModBlocks;
import org.dimdev.dimdoors.util.TeleportUtil;
import org.dimdev.dimdoors.api.util.TeleportUtil;
import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity;

View file

@ -4,22 +4,20 @@ import java.util.Optional;
import org.dimdev.dimdoors.DimensionalDoorsInitializer;
import org.dimdev.dimdoors.block.CoordinateTransformerBlock;
import org.dimdev.dimdoors.block.ModBlocks;
import org.dimdev.dimdoors.block.RiftProvider;
import org.dimdev.dimdoors.block.door.data.DoorDataReader;
import org.dimdev.dimdoors.client.DefaultTransformation;
import org.dimdev.dimdoors.client.Transformer;
import org.dimdev.dimdoors.api.client.DefaultTransformation;
import org.dimdev.dimdoors.api.client.Transformer;
import org.dimdev.dimdoors.item.RiftKeyItem;
import org.dimdev.dimdoors.rift.registry.Rift;
import org.dimdev.dimdoors.rift.targets.EscapeTarget;
import org.dimdev.dimdoors.util.EntityUtils;
import org.dimdev.dimdoors.util.TeleportUtil;
import org.dimdev.dimdoors.util.math.TransformationMatrix3d;
import org.dimdev.dimdoors.api.util.EntityUtils;
import org.dimdev.dimdoors.api.util.TeleportUtil;
import org.dimdev.dimdoors.api.util.math.TransformationMatrix3d;
import org.dimdev.dimdoors.world.ModDimensions;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.DoorBlock;
import net.minecraft.block.HorizontalFacingBlock;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;

View file

@ -10,15 +10,15 @@ import org.apache.logging.log4j.Logger;
import org.dimdev.dimdoors.block.CoordinateTransformerBlock;
import org.dimdev.dimdoors.rift.registry.LinkProperties;
import org.dimdev.dimdoors.rift.registry.Rift;
import org.dimdev.dimdoors.rift.targets.EntityTarget;
import org.dimdev.dimdoors.api.rift.target.EntityTarget;
import org.dimdev.dimdoors.rift.targets.MessageTarget;
import org.dimdev.dimdoors.rift.targets.Target;
import org.dimdev.dimdoors.api.rift.target.Target;
import org.dimdev.dimdoors.rift.targets.Targets;
import org.dimdev.dimdoors.rift.targets.VirtualTarget;
import org.dimdev.dimdoors.util.EntityUtils;
import org.dimdev.dimdoors.util.Location;
import org.dimdev.dimdoors.util.RGBA;
import org.dimdev.dimdoors.util.math.TransformationMatrix3d;
import org.dimdev.dimdoors.api.util.EntityUtils;
import org.dimdev.dimdoors.api.util.Location;
import org.dimdev.dimdoors.api.util.RGBA;
import org.dimdev.dimdoors.api.util.math.TransformationMatrix3d;
import org.dimdev.dimdoors.world.level.registry.DimensionalRegistry;
import org.dimdev.dimdoors.world.pocket.VirtualLocation;
import org.jetbrains.annotations.NotNull;

View file

@ -6,7 +6,7 @@ import io.github.cottonmc.cotton.gui.widget.WWidget;
import io.github.cottonmc.cotton.gui.widget.data.Axis;
import org.dimdev.dimdoors.rift.registry.LinkProperties;
import org.dimdev.dimdoors.rift.targets.VirtualTarget;
import org.dimdev.dimdoors.util.RGBA;
import org.dimdev.dimdoors.api.util.RGBA;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.text.LiteralText;

View file

@ -7,7 +7,7 @@ import org.dimdev.dimdoors.DimensionalDoorsInitializer;
import org.dimdev.dimdoors.block.entity.DetachedRiftBlockEntity;
import org.dimdev.dimdoors.block.entity.RiftBlockEntity;
import org.dimdev.dimdoors.client.tesseract.Tesseract;
import org.dimdev.dimdoors.util.RGBA;
import org.dimdev.dimdoors.api.util.RGBA;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.client.render.VertexConsumerProvider;

View file

@ -1,74 +1,19 @@
package org.dimdev.dimdoors.client;
import java.util.Collections;
import java.util.Random;
import org.dimdev.dimdoors.api.client.DimensionalPortalRenderer;
import org.dimdev.dimdoors.block.entity.EntranceRiftBlockEntity;
import org.dimdev.dimdoors.mixin.client.accessor.RenderLayerAccessor;
import net.minecraft.client.model.ModelPart;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.RenderPhase;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.VertexFormat;
import net.minecraft.client.render.VertexFormats;
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
import net.minecraft.client.render.block.entity.EndPortalBlockEntityRenderer;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Matrix4f;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
@Environment(EnvType.CLIENT)
public class EntranceRiftBlockEntityRenderer implements BlockEntityRenderer<EntranceRiftBlockEntity> {
public static final Identifier WARP_PATH;
private static final RenderPhase.class_5942 DIMENSIONAL_PORTAL_SHADER;
private static final RenderLayer RENDER_LAYER;
private static final ModelPart MODEL;
private static final ModelPart TALL_MODEL;
private static final Random RANDOM = new Random();
@Override
public void render(EntranceRiftBlockEntity blockEntity, float tickDelta, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int light, int overlay) {
float r = MathHelper.clamp((RANDOM.nextFloat() * 0.3F + 0.1F) * tickDelta, 0, 1);
float g = MathHelper.clamp((RANDOM.nextFloat() * 0.4F + 0.1F) * tickDelta, 0, 1);
float b = MathHelper.clamp((RANDOM.nextFloat() * 0.5F + 0.6F) * tickDelta, 0, 1);
blockEntity.getTransformer().transform(matrixStack);
if (blockEntity.isTall()) {
TALL_MODEL.render(matrixStack, vertexConsumerProvider.getBuffer(RENDER_LAYER), light, overlay, r, g, b, 1);
} else {
MODEL.render(matrixStack, vertexConsumerProvider.getBuffer(RENDER_LAYER), light, overlay, r, g, b, 1);
}
}
static {
WARP_PATH = new Identifier("dimdoors:textures/other/warp.png");
DIMENSIONAL_PORTAL_SHADER = new RenderPhase.class_5942(ModShaders::getDimensionalPortal);
RENDER_LAYER = RenderLayerAccessor.callOf(
"dimensional_portal",
VertexFormats.POSITION,
VertexFormat.DrawMode.QUADS,
256,
false,
false,
RenderLayer.MultiPhaseParameters.builder()
.method_34578(DIMENSIONAL_PORTAL_SHADER)
.method_34577(
RenderPhase.class_5940.method_34560()
.method_34563(EndPortalBlockEntityRenderer.SKY_TEXTURE, false, false)
.method_34563(WARP_PATH, false, false)
.method_34562()
)
.build(false)
);
ModelPart.Cuboid small = new ModelPart.Cuboid(0, 0, 0, 0, 0, 16, 16, 0.2F, 0, 0, 0, false, 1024, 1024);
MODEL = new ModelPart(Collections.singletonList(small), Collections.emptyMap());
ModelPart.Cuboid big = new ModelPart.Cuboid(0, 0, 0, 0, 0, 16, 32, 0.2F, 0, 0, 0, false, 1024, 1024);
TALL_MODEL = new ModelPart(Collections.singletonList(big), Collections.emptyMap());
DimensionalPortalRenderer.renderDimensionalPortal(matrixStack, vertexConsumerProvider, blockEntity.getTransformer(), tickDelta, light, overlay, blockEntity.isTall());
}
}

View file

@ -4,6 +4,7 @@ import java.util.Random;
import com.flowpowered.math.vector.VectorNi;
import com.mojang.blaze3d.systems.RenderSystem;
import org.dimdev.dimdoors.api.client.RenderLayerFactory;
import org.dimdev.dimdoors.mixin.client.accessor.RenderLayerAccessor;
import org.lwjgl.opengl.GL11;
@ -28,7 +29,7 @@ public class MyRenderLayer extends RenderLayer {
super(string, vertexFormat, drawMode, j, bl, bl2, runnable, runnable2);
}
public static RenderLayer CRACK = RenderLayerAccessor.callOf("crack",
public static RenderLayer CRACK = RenderLayerFactory.create("crack",
VertexFormats.POSITION_COLOR,
VertexFormat.DrawMode.QUADS,
256,
@ -51,7 +52,7 @@ public class MyRenderLayer extends RenderLayer {
.build(false)
);
public static RenderLayer TESSERACT = RenderLayerAccessor.callOf("tesseract",
public static RenderLayer TESSERACT = RenderLayerFactory.create("tesseract",
VertexFormats.POSITION_COLOR_TEXTURE,
VertexFormat.DrawMode.QUADS,
256,
@ -70,6 +71,6 @@ public class MyRenderLayer extends RenderLayer {
public static RenderLayer getMonolith(Identifier texture) {
RenderLayer.MultiPhaseParameters multiPhaseParameters = RenderLayer.MultiPhaseParameters.builder().method_34577(new RenderPhase.Texture(texture, false, false)).transparency(RenderPhase.TRANSLUCENT_TRANSPARENCY).cull(DISABLE_CULLING).lightmap(ENABLE_LIGHTMAP).depthTest(RenderPhase.ALWAYS_DEPTH_TEST).overlay(ENABLE_OVERLAY_COLOR).build(false);
return RenderLayerAccessor.callOf("monolith", VertexFormats.POSITION_COLOR_TEXTURE_OVERLAY_LIGHT_NORMAL, VertexFormat.DrawMode.QUADS, 256, true, true, multiPhaseParameters);
return RenderLayerFactory.create("monolith", VertexFormats.POSITION_COLOR_TEXTURE_OVERLAY_LIGHT_NORMAL, VertexFormat.DrawMode.QUADS, 256, true, true, multiPhaseParameters);
}
}

View file

@ -346,4 +346,4 @@ public final class RiftCurves {
return this.x * 31 + this.y;
}
}
}
}

View file

@ -3,7 +3,7 @@ package org.dimdev.dimdoors.client.tesseract;
import com.flowpowered.math.matrix.Matrix4f;
import com.flowpowered.math.vector.Vector3f;
import com.flowpowered.math.vector.Vector4f;
import org.dimdev.dimdoors.util.RGBA;
import org.dimdev.dimdoors.api.util.RGBA;
import net.minecraft.client.render.VertexConsumer;

View file

@ -1,7 +1,7 @@
package org.dimdev.dimdoors.client.tesseract;
import com.flowpowered.math.vector.Vector4f;
import org.dimdev.dimdoors.util.RGBA;
import org.dimdev.dimdoors.api.util.RGBA;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.util.math.Matrix4f;

View file

@ -2,7 +2,7 @@ package org.dimdev.dimdoors.command;
import com.mojang.brigadier.Command;
import com.mojang.brigadier.CommandDispatcher;
import org.dimdev.dimdoors.util.TeleportUtil;
import org.dimdev.dimdoors.api.util.TeleportUtil;
import net.minecraft.command.argument.DimensionArgumentType;
import net.minecraft.command.argument.Vec3ArgumentType;
@ -12,7 +12,7 @@ import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.math.Vec3d;
import org.dimdev.dimdoors.util.math.MathUtil;
import org.dimdev.dimdoors.api.util.math.MathUtil;
public class DimTeleportCommand {
public static void register(CommandDispatcher<ServerCommandSource> dispatcher) {

View file

@ -12,7 +12,7 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.dimdev.dimdoors.DimensionalDoorsInitializer;
import org.dimdev.dimdoors.command.arguments.SchematicNamespaceArgumentType;
import org.dimdev.dimdoors.util.BlockPlacementType;
import org.dimdev.dimdoors.api.util.BlockPlacementType;
import org.dimdev.dimdoors.util.schematic.Schematic;
import org.dimdev.dimdoors.util.schematic.SchematicPlacer;

View file

@ -6,9 +6,8 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.dimdev.dimdoors.block.entity.RiftBlockEntity;
import org.dimdev.dimdoors.network.ServerPacketHandler;
import org.dimdev.dimdoors.network.s2c.PlayerInventorySlotUpdateS2CPacket;
import org.dimdev.dimdoors.rift.targets.IdMarker;
import org.dimdev.dimdoors.util.EntityUtils;
import org.dimdev.dimdoors.api.util.EntityUtils;
import org.dimdev.dimdoors.world.level.component.CounterComponent;
import net.minecraft.block.entity.BlockEntity;

View file

@ -11,14 +11,13 @@ import org.dimdev.dimdoors.block.entity.RiftBlockEntity;
import org.dimdev.dimdoors.mixin.accessor.ListTagAccessor;
import org.dimdev.dimdoors.network.ServerPacketHandler;
import org.dimdev.dimdoors.rift.registry.Rift;
import org.dimdev.dimdoors.util.EntityUtils;
import org.dimdev.dimdoors.util.Location;
import org.dimdev.dimdoors.api.util.EntityUtils;
import org.dimdev.dimdoors.api.util.Location;
import org.dimdev.dimdoors.world.level.registry.DimensionalRegistry;
import org.jetbrains.annotations.Nullable;
import net.minecraft.block.BlockState;
import net.minecraft.client.item.TooltipContext;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
@ -30,7 +29,6 @@ import net.minecraft.text.LiteralText;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.collection.DefaultedList;
import net.minecraft.util.dynamic.DynamicSerializableUuid;
import net.minecraft.world.World;

View file

@ -7,8 +7,8 @@ import org.dimdev.dimdoors.block.ModBlocks;
import org.dimdev.dimdoors.block.entity.DetachedRiftBlockEntity;
import org.dimdev.dimdoors.rift.targets.RiftReference;
import org.dimdev.dimdoors.sound.ModSoundEvents;
import org.dimdev.dimdoors.util.Location;
import org.dimdev.dimdoors.util.RotatedLocation;
import org.dimdev.dimdoors.api.util.Location;
import org.dimdev.dimdoors.api.util.RotatedLocation;
import org.jetbrains.annotations.NotNull;
import net.minecraft.client.item.TooltipContext;

View file

@ -7,8 +7,8 @@ import org.dimdev.dimdoors.block.ModBlocks;
import org.dimdev.dimdoors.block.entity.DetachedRiftBlockEntity;
import org.dimdev.dimdoors.rift.targets.RiftReference;
import org.dimdev.dimdoors.sound.ModSoundEvents;
import org.dimdev.dimdoors.util.Location;
import org.dimdev.dimdoors.util.RotatedLocation;
import org.dimdev.dimdoors.api.util.Location;
import org.dimdev.dimdoors.api.util.RotatedLocation;
import net.minecraft.client.item.TooltipContext;
import net.minecraft.entity.player.PlayerEntity;

View file

@ -7,7 +7,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import org.dimdev.dimdoors.network.ClientPacketHandler;
import org.dimdev.dimdoors.network.ExtendedClientPlayNetworkHandler;
import org.dimdev.dimdoors.util.math.GridUtil;
import org.dimdev.dimdoors.api.util.math.GridUtil;
import org.dimdev.dimdoors.world.ModDimensions;
import org.dimdev.dimdoors.world.level.registry.DimensionalRegistry;
import org.dimdev.dimdoors.world.pocket.type.Pocket;

View file

@ -5,7 +5,7 @@ import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.world.World;
import org.dimdev.dimdoors.event.UseItemOnBlockCallback;
import org.dimdev.dimdoors.api.event.UseItemOnBlockCallback;
import java.util.List;

View file

@ -1,7 +1,7 @@
package org.dimdev.dimdoors.mixin;
import org.dimdev.dimdoors.entity.stat.ModStats;
import org.dimdev.dimdoors.util.TeleportUtil;
import org.dimdev.dimdoors.api.util.TeleportUtil;
import org.dimdev.dimdoors.world.ModDimensions;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

View file

@ -7,7 +7,7 @@ import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.world.World;
import org.dimdev.dimdoors.event.UseItemOnBlockCallback;
import org.dimdev.dimdoors.api.event.UseItemOnBlockCallback;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;

View file

@ -6,7 +6,7 @@ import net.minecraft.client.world.ClientWorld;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import org.dimdev.dimdoors.event.UseItemOnBlockCallback;
import org.dimdev.dimdoors.api.event.UseItemOnBlockCallback;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;

View file

@ -1,4 +1,4 @@
package org.dimdev.dimdoors.util;
package org.dimdev.dimdoors.pockets;
import net.minecraft.server.world.ServerWorld;
@ -9,13 +9,13 @@ import org.dimdev.dimdoors.world.pocket.VirtualLocation;
import java.util.Map;
public class PocketGenerationParameters {
public class PocketGenerationContext {
private final ServerWorld world;
private final VirtualLocation sourceVirtualLocation;
private final VirtualTarget linkTo;
private final LinkProperties linkProperties;
public PocketGenerationParameters(ServerWorld world, VirtualLocation sourceVirtualLocation, VirtualTarget linkTo, LinkProperties linkProperties) {
public PocketGenerationContext(ServerWorld world, VirtualLocation sourceVirtualLocation, VirtualTarget linkTo, LinkProperties linkProperties) {
this.world = world;
this.sourceVirtualLocation = sourceVirtualLocation;
this.linkTo = linkTo;

View file

@ -7,7 +7,6 @@ import org.dimdev.dimdoors.DimensionalDoorsInitializer;
import org.dimdev.dimdoors.pockets.virtual.reference.PocketGeneratorReference;
import org.dimdev.dimdoors.rift.registry.LinkProperties;
import org.dimdev.dimdoors.rift.targets.VirtualTarget;
import org.dimdev.dimdoors.util.PocketGenerationParameters;
import org.dimdev.dimdoors.world.ModDimensions;
import org.dimdev.dimdoors.world.pocket.type.Pocket;
import org.dimdev.dimdoors.world.pocket.VirtualLocation;
@ -38,12 +37,12 @@ public final class PocketGenerator {
}
public static Pocket generateFromPocketGroupV2(ServerWorld world, Identifier group, VirtualLocation virtualLocation, VirtualTarget linkTo, LinkProperties linkProperties) {
PocketGenerationParameters parameters = new PocketGenerationParameters(world, virtualLocation, linkTo, linkProperties);
return generatePocketV2(PocketLoader.getInstance().getGroup(group).getNextPocketGeneratorReference(parameters), parameters);
PocketGenerationContext context = new PocketGenerationContext(world, virtualLocation, linkTo, linkProperties);
return generatePocketV2(PocketLoader.getInstance().getGroup(group).getNextPocketGeneratorReference(context), context);
}
public static Pocket generatePocketV2(PocketGeneratorReference pocketGeneratorReference, PocketGenerationParameters parameters) {
return pocketGeneratorReference.prepareAndPlacePocket(parameters);
public static Pocket generatePocketV2(PocketGeneratorReference pocketGeneratorReference, PocketGenerationContext context) {
return pocketGeneratorReference.prepareAndPlacePocket(context);
}
public static Pocket generateDungeonPocketV2(VirtualLocation virtualLocation, VirtualTarget linkTo, LinkProperties linkProperties) {

View file

@ -25,8 +25,7 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.dimdev.dimdoors.pockets.generator.PocketGenerator;
import org.dimdev.dimdoors.pockets.virtual.VirtualPocket;
import org.dimdev.dimdoors.util.PocketGenerationParameters;
import org.dimdev.dimdoors.util.WeightedList;
import org.dimdev.dimdoors.api.util.WeightedList;
import org.dimdev.dimdoors.util.schematic.Schematic;
public class PocketLoader implements SimpleSynchronousResourceReloadListener {
@ -150,7 +149,7 @@ public class PocketLoader implements SimpleSynchronousResourceReloadListener {
}
}
public WeightedList<PocketGenerator, PocketGenerationParameters> getPocketsMatchingTags(List<String> required, List<String> blackList, boolean exact) {
public WeightedList<PocketGenerator, PocketGenerationContext> getPocketsMatchingTags(List<String> required, List<String> blackList, boolean exact) {
return new WeightedList<>(pocketGeneratorMap.values().stream().filter(pocketGenerator -> pocketGenerator.checkTags(required, blackList, exact)).collect(Collectors.toList()));
}

View file

@ -1,13 +1,12 @@
package org.dimdev.dimdoors.pockets;
import net.minecraft.block.BlockState;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.dimdev.dimdoors.DimensionalDoorsInitializer;
import org.dimdev.dimdoors.block.entity.RiftBlockEntity;
import org.dimdev.dimdoors.util.BlockPlacementType;
import org.dimdev.dimdoors.api.util.BlockPlacementType;
import org.dimdev.dimdoors.util.schematic.Schematic;
import org.dimdev.dimdoors.util.schematic.SchematicPlacer;
import org.dimdev.dimdoors.world.pocket.type.LazyGenerationPocket;

View file

@ -18,8 +18,8 @@ import org.dimdev.dimdoors.rift.targets.PocketEntranceMarker;
import org.dimdev.dimdoors.rift.targets.PocketExitMarker;
import org.dimdev.dimdoors.rift.targets.VirtualTarget;
import org.dimdev.dimdoors.world.level.registry.DimensionalRegistry;
import org.dimdev.dimdoors.util.Location;
import org.dimdev.dimdoors.util.math.MathUtil;
import org.dimdev.dimdoors.api.util.Location;
import org.dimdev.dimdoors.api.util.math.MathUtil;
import org.dimdev.dimdoors.util.schematic.Schematic;
import org.dimdev.dimdoors.world.pocket.type.Pocket;

View file

@ -25,7 +25,7 @@ import org.dimdev.dimdoors.block.ModBlocks;
import org.dimdev.dimdoors.block.entity.DetachedRiftBlockEntity;
import org.dimdev.dimdoors.block.entity.ModBlockEntityTypes;
import org.dimdev.dimdoors.rift.targets.PocketEntranceMarker;
import org.dimdev.dimdoors.util.PocketGenerationParameters;
import org.dimdev.dimdoors.pockets.PocketGenerationContext;
import org.dimdev.dimdoors.world.level.registry.DimensionalRegistry;
import org.dimdev.dimdoors.world.pocket.type.Pocket;
import org.dimdev.dimdoors.world.pocket.VirtualLocation;
@ -70,7 +70,7 @@ public class ChunkGenerator extends PocketGenerator {
}
@Override
public Pocket prepareAndPlacePocket(PocketGenerationParameters parameters, Pocket.PocketBuilder<?, ?> builder) {
public Pocket prepareAndPlacePocket(PocketGenerationContext parameters, Pocket.PocketBuilder<?, ?> builder) {
ServerWorld world = parameters.getWorld();
VirtualLocation sourceVirtualLocation = parameters.getSourceVirtualLocation();
@ -189,7 +189,7 @@ public class ChunkGenerator extends PocketGenerator {
}
@Override
public Vec3i getSize(PocketGenerationParameters parameters) {
public Vec3i getSize(PocketGenerationContext parameters) {
return size;
}

View file

@ -17,14 +17,15 @@ import net.minecraft.util.registry.RegistryKey;
import net.minecraft.util.registry.SimpleRegistry;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.dimdev.dimdoors.DimensionalDoorsInitializer;
import org.dimdev.dimdoors.pockets.TemplateUtils;
import org.dimdev.dimdoors.pockets.modifier.Modifier;
import org.dimdev.dimdoors.pockets.modifier.RiftManager;
import org.dimdev.dimdoors.util.Location;
import org.dimdev.dimdoors.util.PocketGenerationParameters;
import org.dimdev.dimdoors.util.Weighted;
import org.dimdev.dimdoors.util.math.Equation;
import org.dimdev.dimdoors.util.math.Equation.EquationParseException;
import org.dimdev.dimdoors.api.util.Location;
import org.dimdev.dimdoors.pockets.PocketGenerationContext;
import org.dimdev.dimdoors.api.util.Weighted;
import org.dimdev.dimdoors.api.util.math.Equation;
import org.dimdev.dimdoors.api.util.math.Equation.EquationParseException;
import org.dimdev.dimdoors.world.pocket.type.AbstractPocket;
import org.dimdev.dimdoors.world.pocket.type.LazyGenerationPocket;
import org.dimdev.dimdoors.world.pocket.type.Pocket;
@ -32,7 +33,7 @@ import org.dimdev.dimdoors.world.pocket.type.Pocket;
import java.util.*;
import java.util.function.Supplier;
public abstract class PocketGenerator implements Weighted<PocketGenerationParameters> {
public abstract class PocketGenerator implements Weighted<PocketGenerationContext> {
private static final Logger LOGGER = LogManager.getLogger();
public static final Registry<PocketGeneratorType<? extends PocketGenerator>> REGISTRY = FabricRegistryBuilder.from(new SimpleRegistry<PocketGeneratorType<? extends PocketGenerator>>(RegistryKey.ofRegistry(new Identifier("dimdoors", "pocket_generator_type")), Lifecycle.stable())).buildAndRegister();
@ -133,14 +134,14 @@ public abstract class PocketGenerator implements Weighted<PocketGenerationParame
return tag;
}
public abstract Pocket prepareAndPlacePocket(PocketGenerationParameters parameters, Pocket.PocketBuilder<?, ?> builder);
public abstract Pocket prepareAndPlacePocket(PocketGenerationContext parameters, Pocket.PocketBuilder<?, ?> builder);
public abstract PocketGeneratorType<? extends PocketGenerator> getType();
public abstract String getKey();
@Override
public double getWeight(PocketGenerationParameters parameters) {
public double getWeight(PocketGenerationContext parameters) {
return this.weightEquation.apply(parameters.toVariableMap(new HashMap<>()));
}
@ -148,19 +149,19 @@ public abstract class PocketGenerator implements Weighted<PocketGenerationParame
return setupLoot != null && setupLoot;
}
public void applyModifiers(PocketGenerationParameters parameters, RiftManager manager) {
public void applyModifiers(PocketGenerationContext parameters, RiftManager manager) {
for (Modifier modifier : modifierList) {
modifier.apply(parameters, manager);
}
}
public void applyModifiers(PocketGenerationParameters parameters, Pocket.PocketBuilder<?, ?> builder) {
public void applyModifiers(PocketGenerationContext parameters, Pocket.PocketBuilder<?, ?> builder) {
for (Modifier modifier : modifierList) {
modifier.apply(parameters, builder);
}
}
public void setup(Pocket pocket, RiftManager manager, PocketGenerationParameters parameters, boolean setupLootTables) {
public void setup(Pocket pocket, RiftManager manager, PocketGenerationContext parameters, boolean setupLootTables) {
ServerWorld world = parameters.getWorld();
if (!(pocket instanceof LazyGenerationPocket)) { // should not iterate over that which does not exist & area may be massive, getBlockEntities() might force generation
@ -203,7 +204,7 @@ public abstract class PocketGenerator implements Weighted<PocketGenerationParame
return true;
}
public Pocket.PocketBuilder<?, ?> pocketBuilder(PocketGenerationParameters parameters) { // TODO: PocketBuilder from json
public Pocket.PocketBuilder<?, ?> pocketBuilder(PocketGenerationContext parameters) { // TODO: PocketBuilder from json
if (builderTag == null){
return Pocket.builder()
.expand(getSize(parameters));
@ -217,7 +218,7 @@ public abstract class PocketGenerator implements Weighted<PocketGenerationParame
return builder.expand(getSize(parameters));
}
public abstract Vec3i getSize(PocketGenerationParameters parameters);
public abstract Vec3i getSize(PocketGenerationContext parameters);
public interface PocketGeneratorType<T extends PocketGenerator> {
PocketGeneratorType<SchematicGenerator> SCHEMATIC = register(new Identifier("dimdoors", SchematicGenerator.KEY), SchematicGenerator::new);
@ -229,6 +230,7 @@ public abstract class PocketGenerator implements Weighted<PocketGenerationParame
CompoundTag toTag(CompoundTag tag);
static void register() {
DimensionalDoorsInitializer.apiSubscribers.forEach(d -> d.registerPocketGeneratorTypes(REGISTRY));
}
static <U extends PocketGenerator> PocketGeneratorType<U> register(Identifier id, Supplier<U> constructor) {

View file

@ -14,8 +14,8 @@ import org.dimdev.dimdoors.pockets.PocketLoader;
import org.dimdev.dimdoors.pockets.PocketTemplate;
import org.dimdev.dimdoors.pockets.modifier.AbsoluteRiftBlockEntityModifier;
import org.dimdev.dimdoors.pockets.modifier.RiftManager;
import org.dimdev.dimdoors.util.BlockPlacementType;
import org.dimdev.dimdoors.util.PocketGenerationParameters;
import org.dimdev.dimdoors.api.util.BlockPlacementType;
import org.dimdev.dimdoors.pockets.PocketGenerationContext;
import org.dimdev.dimdoors.util.schematic.Schematic;
import org.dimdev.dimdoors.world.level.registry.DimensionalRegistry;
import org.dimdev.dimdoors.world.pocket.type.LazyGenerationPocket;
@ -135,7 +135,7 @@ public class SchematicGenerator extends LazyPocketGenerator{
}
@Override
public Pocket prepareAndPlacePocket(PocketGenerationParameters parameters, Pocket.PocketBuilder<?, ?> builder) {
public Pocket prepareAndPlacePocket(PocketGenerationContext parameters, Pocket.PocketBuilder<?, ?> builder) {
ServerWorld world = parameters.getWorld();
Map<String, Double> variableMap = parameters.toVariableMap(new HashMap<>());
@ -168,7 +168,7 @@ public class SchematicGenerator extends LazyPocketGenerator{
}
@Override
public Vec3i getSize(PocketGenerationParameters parameters) {
public Vec3i getSize(PocketGenerationContext parameters) {
PocketTemplate template = PocketLoader.getInstance().getTemplates().get(templateID);
if (template == null) throw new RuntimeException("Pocket template of id " + templateID + " not found!");
Schematic schem = template.getSchematic();

View file

@ -5,9 +5,9 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3i;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.dimdev.dimdoors.util.PocketGenerationParameters;
import org.dimdev.dimdoors.util.math.Equation;
import org.dimdev.dimdoors.util.math.Equation.EquationParseException;
import org.dimdev.dimdoors.pockets.PocketGenerationContext;
import org.dimdev.dimdoors.api.util.math.Equation;
import org.dimdev.dimdoors.api.util.math.Equation.EquationParseException;
import org.dimdev.dimdoors.world.level.registry.DimensionalRegistry;
import org.dimdev.dimdoors.world.pocket.type.Pocket;
@ -25,7 +25,7 @@ public class VoidGenerator extends LazyPocketGenerator {
private Equation lengthEquation;
@Override
public Pocket prepareAndPlacePocket(PocketGenerationParameters parameters, Pocket.PocketBuilder<?, ?> builder) {
public Pocket prepareAndPlacePocket(PocketGenerationContext parameters, Pocket.PocketBuilder<?, ?> builder) {
Pocket pocket = DimensionalRegistry.getPocketDirectory(parameters.getWorld().getRegistryKey()).newPocket(builder);
Map<String, Double> variableMap = parameters.toVariableMap(new HashMap<>());
pocket.setSize((int) widthEquation.apply(variableMap), (int) heightEquation.apply(variableMap), (int) lengthEquation.apply(variableMap));
@ -44,7 +44,7 @@ public class VoidGenerator extends LazyPocketGenerator {
}
@Override
public Vec3i getSize(PocketGenerationParameters parameters) {
public Vec3i getSize(PocketGenerationContext parameters) {
Map<String, Double> variableMap = parameters.toVariableMap(new HashMap<>());
return new Vec3i((int) widthEquation.apply(variableMap), (int) heightEquation.apply(variableMap), (int) lengthEquation.apply(variableMap));
}

View file

@ -11,7 +11,7 @@ import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import org.dimdev.dimdoors.DimensionalDoorsInitializer;
import org.dimdev.dimdoors.block.entity.RiftBlockEntity;
import org.dimdev.dimdoors.util.PocketGenerationParameters;
import org.dimdev.dimdoors.pockets.PocketGenerationContext;
import org.dimdev.dimdoors.world.pocket.type.LazyGenerationPocket;
import org.dimdev.dimdoors.world.pocket.type.Pocket;
@ -70,7 +70,7 @@ public class AbsoluteRiftBlockEntityModifier implements LazyModifier {
}
@Override
public void apply(PocketGenerationParameters parameters, RiftManager manager) {
public void apply(PocketGenerationContext parameters, RiftManager manager) {
if (!manager.isPocketLazy()) { // rifts is guaranteed to exist at this stage since this modifier is not supposed to be loaded from json
World world = DimensionalDoorsInitializer.getWorld(manager.getPocket().getWorld());
rifts.values().forEach(world::addBlockEntity);
@ -78,7 +78,7 @@ public class AbsoluteRiftBlockEntityModifier implements LazyModifier {
}
@Override
public void apply(PocketGenerationParameters parameters, Pocket.PocketBuilder<?, ?> builder) {
public void apply(PocketGenerationContext parameters, Pocket.PocketBuilder<?, ?> builder) {
}

View file

@ -20,16 +20,15 @@ import com.google.common.base.MoreObjects;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.dimdev.dimdoors.block.door.DimensionalDoorBlock;
import org.dimdev.dimdoors.block.ModBlocks;
import org.dimdev.dimdoors.block.entity.EntranceRiftBlockEntity;
import org.dimdev.dimdoors.block.entity.ModBlockEntityTypes;
import org.dimdev.dimdoors.block.entity.RiftData;
import org.dimdev.dimdoors.pockets.PocketLoader;
import org.dimdev.dimdoors.rift.targets.IdMarker;
import org.dimdev.dimdoors.util.PocketGenerationParameters;
import org.dimdev.dimdoors.util.TagEquations;
import org.dimdev.dimdoors.util.math.Equation;
import org.dimdev.dimdoors.util.math.Equation.EquationParseException;
import org.dimdev.dimdoors.pockets.PocketGenerationContext;
import org.dimdev.dimdoors.api.util.TagEquations;
import org.dimdev.dimdoors.api.util.math.Equation;
import org.dimdev.dimdoors.api.util.math.Equation.EquationParseException;
import org.dimdev.dimdoors.world.pocket.type.LazyGenerationPocket;
import org.dimdev.dimdoors.world.pocket.type.Pocket;
@ -129,7 +128,7 @@ public class DimensionalDoorModifier implements LazyCompatibleModifier {
}
@Override
public void apply(PocketGenerationParameters parameters, RiftManager manager) {
public void apply(PocketGenerationContext parameters, RiftManager manager) {
Map<String, Double> variableMap = manager.getPocket().toVariableMap(new HashMap<>());
BlockPos pocketOrigin = manager.getPocket().getOrigin();
BlockPos pos = new BlockPos(xEquation.apply(variableMap) + pocketOrigin.getX(), yEquation.apply(variableMap) + pocketOrigin.getY(), zEquation.apply(variableMap) + pocketOrigin.getZ());
@ -168,7 +167,7 @@ public class DimensionalDoorModifier implements LazyCompatibleModifier {
}
@Override
public void apply(PocketGenerationParameters parameters, Pocket.PocketBuilder<?, ?> builder) {
public void apply(PocketGenerationContext parameters, Pocket.PocketBuilder<?, ?> builder) {
}
}

View file

@ -8,7 +8,8 @@ import net.minecraft.util.registry.Registry;
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.util.registry.SimpleRegistry;
import org.dimdev.dimdoors.util.PocketGenerationParameters;
import org.dimdev.dimdoors.DimensionalDoorsInitializer;
import org.dimdev.dimdoors.pockets.PocketGenerationContext;
import org.dimdev.dimdoors.world.pocket.type.Pocket;
import java.util.function.Supplier;
@ -36,9 +37,9 @@ public interface Modifier {
String getKey();
void apply(PocketGenerationParameters parameters, RiftManager manager);
void apply(PocketGenerationContext parameters, RiftManager manager);
void apply(PocketGenerationParameters parameters, Pocket.PocketBuilder<?, ?> builder);
void apply(PocketGenerationContext parameters, Pocket.PocketBuilder<?, ?> builder);
interface ModifierType<T extends Modifier> {
ModifierType<ShellModifier> SHELL_MODIFIER_TYPE = register(new Identifier("dimdoors", ShellModifier.KEY), ShellModifier::new);
@ -54,6 +55,7 @@ public interface Modifier {
CompoundTag toTag(CompoundTag tag);
static void register() {
DimensionalDoorsInitializer.apiSubscribers.forEach(d -> d.registerModifierTypes(REGISTRY));
}
static <U extends Modifier> ModifierType<U> register(Identifier id, Supplier<U> factory) {

View file

@ -4,8 +4,8 @@ import net.minecraft.nbt.CompoundTag;
import net.minecraft.util.math.Vec3i;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.dimdev.dimdoors.util.PocketGenerationParameters;
import org.dimdev.dimdoors.util.math.Equation;
import org.dimdev.dimdoors.pockets.PocketGenerationContext;
import org.dimdev.dimdoors.api.util.math.Equation;
import org.dimdev.dimdoors.world.pocket.type.Pocket;
import java.util.HashMap;
@ -61,12 +61,12 @@ public class OffsetModifier implements Modifier {
}
@Override
public void apply(PocketGenerationParameters parameters, RiftManager manager) {
public void apply(PocketGenerationContext parameters, RiftManager manager) {
}
@Override
public void apply(PocketGenerationParameters parameters, Pocket.PocketBuilder<?, ?> builder) {
public void apply(PocketGenerationContext parameters, Pocket.PocketBuilder<?, ?> builder) {
Map<String, Double> variableMap = parameters.toVariableMap(new HashMap<>());
builder.offsetOrigin(new Vec3i((int) offsetXEquation.apply(variableMap), (int) offsetYEquation.apply(variableMap), (int) offsetZEquation.apply(variableMap)));
}

View file

@ -5,7 +5,7 @@ import net.minecraft.nbt.CompoundTag;
import com.google.common.base.MoreObjects;
import org.dimdev.dimdoors.rift.targets.PocketEntranceMarker;
import org.dimdev.dimdoors.rift.targets.PocketExitMarker;
import org.dimdev.dimdoors.util.PocketGenerationParameters;
import org.dimdev.dimdoors.pockets.PocketGenerationContext;
import org.dimdev.dimdoors.world.pocket.type.Pocket;
public class PocketEntranceModifier implements Modifier {
@ -53,7 +53,7 @@ public class PocketEntranceModifier implements Modifier {
}
@Override
public void apply(PocketGenerationParameters parameters, RiftManager manager) {
public void apply(PocketGenerationContext parameters, RiftManager manager) {
manager.consume(id, rift -> {
rift.setDestination(PocketEntranceMarker.builder().ifDestination(new PocketExitMarker()).weight(1.0f).build());
return true;
@ -61,7 +61,7 @@ public class PocketEntranceModifier implements Modifier {
}
@Override
public void apply(PocketGenerationParameters parameters, Pocket.PocketBuilder<?, ?> builder) {
public void apply(PocketGenerationContext parameters, Pocket.PocketBuilder<?, ?> builder) {
}
}

View file

@ -9,8 +9,8 @@ import com.google.common.base.MoreObjects;
import org.dimdev.dimdoors.block.entity.RiftBlockEntity;
import org.dimdev.dimdoors.rift.targets.LocalReference;
import org.dimdev.dimdoors.rift.targets.RiftReference;
import org.dimdev.dimdoors.util.Location;
import org.dimdev.dimdoors.util.PocketGenerationParameters;
import org.dimdev.dimdoors.api.util.Location;
import org.dimdev.dimdoors.pockets.PocketGenerationContext;
import org.dimdev.dimdoors.world.pocket.type.Pocket;
public class RelativeReferenceModifier implements Modifier {
@ -44,7 +44,7 @@ public class RelativeReferenceModifier implements Modifier {
}
@Override
public void apply(PocketGenerationParameters parameters, RiftManager manager) {
public void apply(PocketGenerationContext parameters, RiftManager manager) {
Optional<Location> riftA = manager.get(point_a).map(rift -> new Location((ServerWorld) rift.getWorld(), rift.getPos()));
Optional<Location> riftB = manager.get(point_b).map(rift -> new Location((ServerWorld) rift.getWorld(), rift.getPos()));
@ -58,7 +58,7 @@ public class RelativeReferenceModifier implements Modifier {
}
@Override
public void apply(PocketGenerationParameters parameters, Pocket.PocketBuilder<?, ?> builder) {
public void apply(PocketGenerationContext parameters, Pocket.PocketBuilder<?, ?> builder) {
}

View file

@ -17,8 +17,8 @@ import org.dimdev.dimdoors.block.entity.RiftBlockEntity;
import org.dimdev.dimdoors.block.entity.RiftData;
import org.dimdev.dimdoors.pockets.PocketLoader;
import org.dimdev.dimdoors.rift.targets.VirtualTarget;
import org.dimdev.dimdoors.util.PocketGenerationParameters;
import org.dimdev.dimdoors.util.TagEquations;
import org.dimdev.dimdoors.pockets.PocketGenerationContext;
import org.dimdev.dimdoors.api.util.TagEquations;
import org.dimdev.dimdoors.world.pocket.type.Pocket;
public class RiftDataModifier implements Modifier {
@ -83,7 +83,7 @@ public class RiftDataModifier implements Modifier {
}
@Override
public void apply(PocketGenerationParameters parameters, RiftManager manager) {
public void apply(PocketGenerationContext parameters, RiftManager manager) {
Map<String, Double> variableMap = manager.getPocket().toVariableMap(new HashMap<>());
Consumer<RiftBlockEntity> riftBlockEntityConsumer;
@ -107,6 +107,6 @@ public class RiftDataModifier implements Modifier {
}
@Override
public void apply(PocketGenerationParameters parameters, Pocket.PocketBuilder<?, ?> builder) {
public void apply(PocketGenerationContext parameters, Pocket.PocketBuilder<?, ?> builder) {
}
}

View file

@ -21,9 +21,9 @@ import net.minecraft.world.chunk.Chunk;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.dimdev.dimdoors.util.BlockBoxUtil;
import org.dimdev.dimdoors.util.PocketGenerationParameters;
import org.dimdev.dimdoors.util.math.Equation;
import org.dimdev.dimdoors.api.util.BlockBoxUtil;
import org.dimdev.dimdoors.pockets.PocketGenerationContext;
import org.dimdev.dimdoors.api.util.math.Equation;
import org.dimdev.dimdoors.util.schematic.SchematicBlockPalette;
import org.dimdev.dimdoors.world.pocket.type.LazyGenerationPocket;
import org.dimdev.dimdoors.world.pocket.type.Pocket;
@ -146,7 +146,7 @@ public class ShellModifier implements LazyModifier {
}
@Override
public void apply(PocketGenerationParameters parameters, RiftManager manager) {
public void apply(PocketGenerationContext parameters, RiftManager manager) {
Pocket pocket = manager.getPocket();
if (pocket instanceof LazyGenerationPocket) {
Map<String, Double> variableMap = pocket.toVariableMap(new HashMap<>());
@ -159,7 +159,7 @@ public class ShellModifier implements LazyModifier {
}
@Override
public void apply(PocketGenerationParameters parameters, Pocket.PocketBuilder<?, ?> builder) {
public void apply(PocketGenerationContext parameters, Pocket.PocketBuilder<?, ?> builder) {
Map<String, Double> variableMap = parameters.toVariableMap(new HashMap<>());
for (Layer layer : layers) {
int thickness = layer.getThickness(variableMap);

View file

@ -4,13 +4,13 @@ import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.ListTag;
import net.minecraft.nbt.Tag;
import org.dimdev.dimdoors.pockets.virtual.reference.PocketGeneratorReference;
import org.dimdev.dimdoors.util.PocketGenerationParameters;
import org.dimdev.dimdoors.util.Weighted;
import org.dimdev.dimdoors.pockets.PocketGenerationContext;
import org.dimdev.dimdoors.api.util.Weighted;
import org.dimdev.dimdoors.world.pocket.type.Pocket;
import net.fabricmc.fabric.api.util.NbtType;
public interface VirtualPocket extends Weighted<PocketGenerationParameters> {
public interface VirtualPocket extends Weighted<PocketGenerationContext> {
static VirtualPocket deserialize(Tag tag) {
if (tag.getType() == NbtType.LIST) {
@ -27,9 +27,9 @@ public interface VirtualPocket extends Weighted<PocketGenerationParameters> {
}
Pocket prepareAndPlacePocket(PocketGenerationParameters parameters);
Pocket prepareAndPlacePocket(PocketGenerationContext parameters);
PocketGeneratorReference getNextPocketGeneratorReference(PocketGenerationParameters parameters);
PocketGeneratorReference getNextPocketGeneratorReference(PocketGenerationContext parameters);
PocketGeneratorReference peekNextPocketGeneratorReference(PocketGenerationParameters parameters);
PocketGeneratorReference peekNextPocketGeneratorReference(PocketGenerationContext parameters);
}

View file

@ -2,12 +2,12 @@ package org.dimdev.dimdoors.pockets.virtual;
import net.minecraft.nbt.ListTag;
import org.dimdev.dimdoors.pockets.virtual.reference.PocketGeneratorReference;
import org.dimdev.dimdoors.util.PocketGenerationParameters;
import org.dimdev.dimdoors.util.WeightedList;
import org.dimdev.dimdoors.pockets.PocketGenerationContext;
import org.dimdev.dimdoors.api.util.WeightedList;
import org.dimdev.dimdoors.world.pocket.type.Pocket;
// TODO: add weight tha
public class VirtualPocketList extends WeightedList<VirtualPocket, PocketGenerationParameters> implements VirtualPocket {
public class VirtualPocketList extends WeightedList<VirtualPocket, PocketGenerationContext> implements VirtualPocket {
public static VirtualPocketList deserialize(ListTag tag) {
return new VirtualPocketList().fromTag(tag);
@ -36,20 +36,20 @@ public class VirtualPocketList extends WeightedList<VirtualPocket, PocketGenerat
}
@Override
public Pocket prepareAndPlacePocket(PocketGenerationParameters parameters) {
public Pocket prepareAndPlacePocket(PocketGenerationContext parameters) {
return getNextPocketGeneratorReference(parameters).prepareAndPlacePocket(parameters);
}
public PocketGeneratorReference getNextPocketGeneratorReference(PocketGenerationParameters parameters) {
public PocketGeneratorReference getNextPocketGeneratorReference(PocketGenerationContext parameters) {
return getNextRandomWeighted(parameters).getNextPocketGeneratorReference(parameters);
}
public PocketGeneratorReference peekNextPocketGeneratorReference(PocketGenerationParameters parameters) {
public PocketGeneratorReference peekNextPocketGeneratorReference(PocketGenerationContext parameters) {
return peekNextRandomWeighted(parameters).peekNextPocketGeneratorReference(parameters);
}
@Override
public double getWeight(PocketGenerationParameters parameters) {
public double getWeight(PocketGenerationContext parameters) {
return peekNextRandomWeighted(parameters).getWeight(parameters);
}
}

View file

@ -7,11 +7,13 @@ import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.util.registry.SimpleRegistry;
import org.dimdev.dimdoors.DimensionalDoorsInitializer;
import org.dimdev.dimdoors.pockets.virtual.reference.IdReference;
import org.dimdev.dimdoors.pockets.virtual.reference.PocketGeneratorReference;
import org.dimdev.dimdoors.pockets.virtual.reference.TagReference;
import org.dimdev.dimdoors.pockets.virtual.selection.ConditionalSelector;
import org.dimdev.dimdoors.util.PocketGenerationParameters;
import org.dimdev.dimdoors.pockets.PocketGenerationContext;
import org.dimdev.dimdoors.world.pocket.type.Pocket;
import java.util.function.Supplier;
@ -50,6 +52,7 @@ public abstract class VirtualSingularPocket implements VirtualPocket {
CompoundTag toTag(CompoundTag tag);
static void register() {
DimensionalDoorsInitializer.apiSubscribers.forEach(d -> d.registerVirtualSingularPocketTypes(REGISTRY));
}
static <U extends VirtualSingularPocket> VirtualSingularPocketType<U> register(Identifier id, Supplier<U> factory) {
@ -74,17 +77,17 @@ public abstract class VirtualSingularPocket implements VirtualPocket {
public static final NoneVirtualPocket NONE = new NoneVirtualPocket();
@Override
public Pocket prepareAndPlacePocket(PocketGenerationParameters parameters) {
public Pocket prepareAndPlacePocket(PocketGenerationContext parameters) {
throw new UnsupportedOperationException("Cannot call this method on a NoneVirtualPocket");
}
@Override
public PocketGeneratorReference getNextPocketGeneratorReference(PocketGenerationParameters parameters) {
public PocketGeneratorReference getNextPocketGeneratorReference(PocketGenerationContext parameters) {
throw new UnsupportedOperationException("Cannot call this method on a NoneVirtualPocket");
}
@Override
public PocketGeneratorReference peekNextPocketGeneratorReference(PocketGenerationParameters parameters) {
public PocketGeneratorReference peekNextPocketGeneratorReference(PocketGenerationContext parameters) {
throw new UnsupportedOperationException("Cannot call this method on a NoneVirtualPocket");
}
@ -104,7 +107,7 @@ public abstract class VirtualSingularPocket implements VirtualPocket {
}
@Override
public double getWeight(PocketGenerationParameters parameters) {
public double getWeight(PocketGenerationContext parameters) {
return 0;
}
}

View file

@ -7,7 +7,7 @@ import net.minecraft.util.Identifier;
import org.dimdev.dimdoors.pockets.PocketLoader;
import org.dimdev.dimdoors.pockets.generator.PocketGenerator;
import org.dimdev.dimdoors.pockets.virtual.VirtualSingularPocket;
import org.dimdev.dimdoors.util.PocketGenerationParameters;
import org.dimdev.dimdoors.pockets.PocketGenerationContext;
public class IdReference extends PocketGeneratorReference {
public static final String KEY = "id";
@ -34,12 +34,12 @@ public class IdReference extends PocketGeneratorReference {
}
@Override
public PocketGenerator peekReferencedPocketGenerator(PocketGenerationParameters parameters) {
public PocketGenerator peekReferencedPocketGenerator(PocketGenerationContext parameters) {
return getReferencedPocketGenerator(parameters);
}
@Override
public PocketGenerator getReferencedPocketGenerator(PocketGenerationParameters parameters) {
public PocketGenerator getReferencedPocketGenerator(PocketGenerationContext parameters) {
return PocketLoader.getInstance().getGenerator(id);
}

View file

@ -21,9 +21,9 @@ import org.dimdev.dimdoors.pockets.modifier.LazyModifier;
import org.dimdev.dimdoors.pockets.modifier.Modifier;
import org.dimdev.dimdoors.pockets.modifier.RiftManager;
import org.dimdev.dimdoors.pockets.virtual.VirtualSingularPocket;
import org.dimdev.dimdoors.util.PocketGenerationParameters;
import org.dimdev.dimdoors.util.math.Equation;
import org.dimdev.dimdoors.util.math.Equation.EquationParseException;
import org.dimdev.dimdoors.pockets.PocketGenerationContext;
import org.dimdev.dimdoors.api.util.math.Equation;
import org.dimdev.dimdoors.api.util.math.Equation.EquationParseException;
import org.dimdev.dimdoors.world.pocket.type.LazyGenerationPocket;
import org.dimdev.dimdoors.world.pocket.type.Pocket;
@ -103,7 +103,7 @@ public abstract class PocketGeneratorReference extends VirtualSingularPocket {
}
@Override
public double getWeight(PocketGenerationParameters parameters) {
public double getWeight(PocketGenerationContext parameters) {
try {
return weightEquation != null ? this.weightEquation.apply(parameters.toVariableMap(Maps.newHashMap())) : peekReferencedPocketGenerator(parameters).getWeight(parameters);
} catch (RuntimeException e) {
@ -112,20 +112,20 @@ public abstract class PocketGeneratorReference extends VirtualSingularPocket {
}
}
public void applyModifiers(PocketGenerationParameters parameters, RiftManager manager) {
public void applyModifiers(PocketGenerationContext parameters, RiftManager manager) {
for (Modifier modifier : modifierList) {
modifier.apply(parameters, manager);
}
}
public void applyModifiers(PocketGenerationParameters parameters, Pocket.PocketBuilder<?, ?> builder) {
public void applyModifiers(PocketGenerationContext parameters, Pocket.PocketBuilder<?, ?> builder) {
for (Modifier modifier : modifierList) {
modifier.apply(parameters, builder);
}
}
@Override
public Pocket prepareAndPlacePocket(PocketGenerationParameters parameters) {
public Pocket prepareAndPlacePocket(PocketGenerationContext parameters) {
PocketGenerator generator = getReferencedPocketGenerator(parameters);
@ -176,18 +176,18 @@ public abstract class PocketGeneratorReference extends VirtualSingularPocket {
}
@Override
public PocketGeneratorReference peekNextPocketGeneratorReference(PocketGenerationParameters parameters) {
public PocketGeneratorReference peekNextPocketGeneratorReference(PocketGenerationContext parameters) {
return this;
}
@Override
public PocketGeneratorReference getNextPocketGeneratorReference(PocketGenerationParameters parameters) {
public PocketGeneratorReference getNextPocketGeneratorReference(PocketGenerationContext parameters) {
return this;
}
public abstract PocketGenerator peekReferencedPocketGenerator(PocketGenerationParameters parameters);
public abstract PocketGenerator peekReferencedPocketGenerator(PocketGenerationContext parameters);
public abstract PocketGenerator getReferencedPocketGenerator(PocketGenerationParameters parameters);
public abstract PocketGenerator getReferencedPocketGenerator(PocketGenerationContext parameters);
@Override
public abstract String toString();

View file

@ -9,8 +9,8 @@ import com.google.common.base.MoreObjects;
import org.dimdev.dimdoors.pockets.PocketLoader;
import org.dimdev.dimdoors.pockets.generator.PocketGenerator;
import org.dimdev.dimdoors.pockets.virtual.VirtualSingularPocket;
import org.dimdev.dimdoors.util.PocketGenerationParameters;
import org.dimdev.dimdoors.util.WeightedList;
import org.dimdev.dimdoors.pockets.PocketGenerationContext;
import org.dimdev.dimdoors.api.util.WeightedList;
import java.util.ArrayList;
import java.util.List;
@ -22,7 +22,7 @@ public class TagReference extends PocketGeneratorReference{
private final List<String> blackList = new ArrayList<>();
private Boolean exact;
private WeightedList<PocketGenerator, PocketGenerationParameters> pockets;
private WeightedList<PocketGenerator, PocketGenerationContext> pockets;
@Override
public VirtualSingularPocket fromTag(CompoundTag tag) {
@ -86,13 +86,13 @@ public class TagReference extends PocketGeneratorReference{
}
// TODO: this will break if pockets change in between (which they could if we add a tool for creating pocket json config stuff ingame)
@Override
public PocketGenerator peekReferencedPocketGenerator(PocketGenerationParameters parameters) {
public PocketGenerator peekReferencedPocketGenerator(PocketGenerationContext parameters) {
if (pockets == null) pockets = PocketLoader.getInstance().getPocketsMatchingTags(required, blackList, exact);
return pockets.peekNextRandomWeighted(parameters);
}
@Override
public PocketGenerator getReferencedPocketGenerator(PocketGenerationParameters parameters) {
public PocketGenerator getReferencedPocketGenerator(PocketGenerationContext parameters) {
if (pockets == null) pockets = PocketLoader.getInstance().getPocketsMatchingTags(required, blackList, exact);
return pockets.getNextRandomWeighted(parameters);
}

View file

@ -8,8 +8,8 @@ import org.apache.logging.log4j.Logger;
import org.dimdev.dimdoors.pockets.virtual.VirtualPocket;
import org.dimdev.dimdoors.pockets.virtual.VirtualSingularPocket;
import org.dimdev.dimdoors.pockets.virtual.reference.PocketGeneratorReference;
import org.dimdev.dimdoors.util.PocketGenerationParameters;
import org.dimdev.dimdoors.util.math.Equation;
import org.dimdev.dimdoors.pockets.PocketGenerationContext;
import org.dimdev.dimdoors.api.util.math.Equation;
import org.dimdev.dimdoors.world.pocket.type.Pocket;
import java.util.HashMap;
@ -67,17 +67,17 @@ public class ConditionalSelector extends VirtualSingularPocket {
}
@Override
public Pocket prepareAndPlacePocket(PocketGenerationParameters parameters) {
public Pocket prepareAndPlacePocket(PocketGenerationContext parameters) {
return getNextPocket(parameters).prepareAndPlacePocket(parameters);
}
@Override
public PocketGeneratorReference getNextPocketGeneratorReference(PocketGenerationParameters parameters) {
public PocketGeneratorReference getNextPocketGeneratorReference(PocketGenerationContext parameters) {
return getNextPocket(parameters).getNextPocketGeneratorReference(parameters);
}
@Override
public PocketGeneratorReference peekNextPocketGeneratorReference(PocketGenerationParameters parameters) {
public PocketGeneratorReference peekNextPocketGeneratorReference(PocketGenerationContext parameters) {
return getNextPocket(parameters).peekNextPocketGeneratorReference(parameters);
}
@ -92,11 +92,11 @@ public class ConditionalSelector extends VirtualSingularPocket {
}
@Override
public double getWeight(PocketGenerationParameters parameters) {
public double getWeight(PocketGenerationContext parameters) {
return getNextPocket(parameters).getWeight(parameters);
}
private VirtualPocket getNextPocket(PocketGenerationParameters parameters) {
private VirtualPocket getNextPocket(PocketGenerationContext parameters) {
for (Map.Entry<String, VirtualPocket> entry : pocketMap.entrySet()) {
if (equationMap.get(entry.getKey()).asBoolean(parameters.toVariableMap(new HashMap<>()))) {
return entry.getValue();

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.dimdev.dimdoors.block.entity.RiftBlockEntity;
import org.dimdev.dimdoors.util.Location;
import org.dimdev.dimdoors.api.util.Location;
import org.dimdev.dimdoors.world.level.registry.DimensionalRegistry;
import net.minecraft.nbt.CompoundTag;

View file

@ -8,8 +8,8 @@ import net.fabricmc.fabric.api.util.NbtType;
import net.minecraft.util.Pair;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.dimdev.dimdoors.util.GraphUtils;
import org.dimdev.dimdoors.util.Location;
import org.dimdev.dimdoors.api.util.GraphUtils;
import org.dimdev.dimdoors.api.util.Location;
import org.dimdev.dimdoors.world.level.registry.DimensionalRegistry;
import org.dimdev.dimdoors.world.pocket.type.Pocket;
import org.dimdev.dimdoors.world.pocket.PocketDirectory;

View file

@ -1,6 +1,7 @@
package org.dimdev.dimdoors.rift.targets;
import org.dimdev.dimdoors.util.InstanceMap;
import org.dimdev.dimdoors.api.rift.target.Target;
import org.dimdev.dimdoors.api.util.InstanceMap;
public final class DefaultTargets {
private static final InstanceMap DEFAULT_TARGETS = new InstanceMap();

View file

@ -6,9 +6,11 @@ import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import net.minecraft.util.math.EulerAngle;
import net.minecraft.util.math.Vec3d;
import org.dimdev.dimdoors.api.rift.target.EntityTarget;
import org.dimdev.dimdoors.block.entity.RiftBlockEntity;
import org.dimdev.dimdoors.util.Location;
import org.dimdev.dimdoors.util.TeleportUtil;
import org.dimdev.dimdoors.api.util.Location;
import org.dimdev.dimdoors.api.util.TeleportUtil;
import org.dimdev.dimdoors.world.ModDimensions;
import org.dimdev.dimdoors.world.level.registry.DimensionalRegistry;
import org.dimdev.dimdoors.world.pocket.VirtualLocation;
@ -19,7 +21,7 @@ import net.minecraft.server.world.ServerWorld;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.math.BlockPos;
import static org.dimdev.dimdoors.util.EntityUtils.chat;
import static org.dimdev.dimdoors.api.util.EntityUtils.chat;
public class EscapeTarget extends VirtualTarget implements EntityTarget { // TODO: createRift option
public static final Codec<EscapeTarget> CODEC = RecordCodecBuilder.create(instance -> instance.group(

View file

@ -1,7 +1,7 @@
package org.dimdev.dimdoors.rift.targets;
import com.mojang.serialization.Codec;
import org.dimdev.dimdoors.util.Location;
import org.dimdev.dimdoors.api.util.Location;
import net.minecraft.nbt.CompoundTag;

View file

@ -2,7 +2,9 @@ package org.dimdev.dimdoors.rift.targets;
import net.minecraft.util.math.EulerAngle;
import net.minecraft.util.math.Vec3d;
import org.dimdev.dimdoors.util.EntityUtils;
import org.dimdev.dimdoors.api.rift.target.EntityTarget;
import org.dimdev.dimdoors.api.util.EntityUtils;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.CompoundTag;

View file

@ -3,7 +3,9 @@ package org.dimdev.dimdoors.rift.targets;
import com.mojang.serialization.Codec;
import net.minecraft.util.math.EulerAngle;
import net.minecraft.util.math.Vec3d;
import org.dimdev.dimdoors.util.TeleportUtil;
import org.dimdev.dimdoors.api.rift.target.EntityTarget;
import org.dimdev.dimdoors.api.util.TeleportUtil;
import org.dimdev.dimdoors.world.ModDimensions;
import net.minecraft.entity.Entity;

View file

@ -1,7 +1,7 @@
package org.dimdev.dimdoors.rift.targets;
import com.mojang.serialization.Codec;
import org.dimdev.dimdoors.util.Location;
import org.dimdev.dimdoors.api.util.Location;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.util.math.BlockPos;

View file

@ -2,7 +2,10 @@ package org.dimdev.dimdoors.rift.targets;
import net.minecraft.util.math.EulerAngle;
import net.minecraft.util.math.Vec3d;
import org.dimdev.dimdoors.util.EntityUtils;
import org.dimdev.dimdoors.api.rift.target.EntityTarget;
import org.dimdev.dimdoors.api.rift.target.Target;
import org.dimdev.dimdoors.api.util.EntityUtils;
import net.minecraft.entity.Entity;
import net.minecraft.text.TranslatableText;

View file

@ -4,7 +4,8 @@ import net.minecraft.util.math.EulerAngle;
import net.minecraft.util.math.Vec3d;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.dimdev.dimdoors.util.EntityUtils;
import org.dimdev.dimdoors.api.rift.target.EntityTarget;
import org.dimdev.dimdoors.api.util.EntityUtils;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.CompoundTag;

View file

@ -3,7 +3,9 @@ package org.dimdev.dimdoors.rift.targets;
import com.mojang.serialization.Codec;
import net.minecraft.util.math.EulerAngle;
import net.minecraft.util.math.Vec3d;
import org.dimdev.dimdoors.util.EntityUtils;
import org.dimdev.dimdoors.api.rift.target.EntityTarget;
import org.dimdev.dimdoors.api.util.EntityUtils;
import net.minecraft.entity.Entity;
import net.minecraft.text.TranslatableText;

View file

@ -4,10 +4,12 @@ import java.util.UUID;
import net.minecraft.util.math.EulerAngle;
import net.minecraft.util.math.Vec3d;
import org.dimdev.dimdoors.api.rift.target.EntityTarget;
import org.dimdev.dimdoors.block.entity.RiftBlockEntity;
import org.dimdev.dimdoors.util.EntityUtils;
import org.dimdev.dimdoors.util.Location;
import org.dimdev.dimdoors.util.RGBA;
import org.dimdev.dimdoors.api.util.EntityUtils;
import org.dimdev.dimdoors.api.util.Location;
import org.dimdev.dimdoors.api.util.RGBA;
import org.dimdev.dimdoors.world.ModDimensions;
import org.dimdev.dimdoors.world.level.registry.DimensionalRegistry;
import org.dimdev.dimdoors.world.pocket.type.Pocket;

View file

@ -6,10 +6,11 @@ import net.minecraft.util.math.EulerAngle;
import net.minecraft.util.math.Vec3d;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.dimdev.dimdoors.api.rift.target.EntityTarget;
import org.dimdev.dimdoors.pockets.PocketGenerator;
import org.dimdev.dimdoors.util.EntityUtils;
import org.dimdev.dimdoors.util.Location;
import org.dimdev.dimdoors.util.RGBA;
import org.dimdev.dimdoors.api.util.EntityUtils;
import org.dimdev.dimdoors.api.util.Location;
import org.dimdev.dimdoors.api.util.RGBA;
import org.dimdev.dimdoors.world.level.registry.DimensionalRegistry;
import org.dimdev.dimdoors.world.pocket.type.Pocket;
import org.dimdev.dimdoors.world.pocket.VirtualLocation;

Some files were not shown because too many files have changed in this diff Show more