Refactored schematics
Changes to be committed: deleted: src/main/java/org/dimdev/dimcore/schematic/SeparateClassToAvoidIdeaLag.java modified: src/main/java/org/dimdev/dimdoors/DimensionalDoorsInitializer.java modified: src/main/java/org/dimdev/dimdoors/command/SchematicCommand.java modified: src/main/java/org/dimdev/dimdoors/command/SchematicV2Command.java new file: src/main/java/org/dimdev/dimdoors/mixin/RedstoneWireBlockAccessor.java modified: src/main/java/org/dimdev/dimdoors/pockets/PocketTemplate.java modified: src/main/java/org/dimdev/dimdoors/pockets/PocketTemplateV2.java modified: src/main/java/org/dimdev/dimdoors/pockets/SchematicHandler.java modified: src/main/java/org/dimdev/dimdoors/pockets/SchematicV2Handler.java renamed: src/main/java/org/dimdev/dimcore/schematic/Schematic.java -> src/main/java/org/dimdev/dimdoors/util/schematic/Schematic.java renamed: src/main/java/org/dimdev/dimcore/schematic/SchematicConverter.java -> src/main/java/org/dimdev/dimdoors/util/schematic/SchematicConverter.java renamed: src/main/java/org/dimdev/dimcore/schematic/SchematicRedstoneFixer.java -> src/main/java/org/dimdev/dimdoors/util/schematic/SchematicRedstoneFixer.java renamed: src/main/java/org/dimdev/dimcore/schematic/SchematicStorage.java -> src/main/java/org/dimdev/dimdoors/util/schematic/SchematicStorage.java renamed: src/main/java/org/dimdev/dimcore/schematic/v2/RelativeBlockSample.java -> src/main/java/org/dimdev/dimdoors/util/schematic/v2/RelativeBlockSample.java renamed: src/main/java/org/dimdev/dimcore/schematic/v2/Schematic.java -> src/main/java/org/dimdev/dimdoors/util/schematic/v2/Schematic.java renamed: src/main/java/org/dimdev/dimcore/schematic/v2/SchematicBlockPalette.java -> src/main/java/org/dimdev/dimdoors/util/schematic/v2/SchematicBlockPalette.java renamed: src/main/java/org/dimdev/dimcore/schematic/v2/SchematicMetadata.java -> src/main/java/org/dimdev/dimdoors/util/schematic/v2/SchematicMetadata.java renamed: src/main/java/org/dimdev/dimcore/schematic/v2/SchematicPlacer.java -> src/main/java/org/dimdev/dimdoors/util/schematic/v2/SchematicPlacer.java renamed: src/main/java/org/dimdev/dimcore/schematic/v2/SchematicTest.java -> src/main/java/org/dimdev/dimdoors/util/schematic/v2/SchematicTest.java modified: src/main/java/org/dimdev/dimdoors/world/feature/gateway/schematic/SchematicV2Gateway.java modified: src/main/resources/dimdoors.mixins.json
This commit is contained in:
parent
cadea89b76
commit
1484432ffe
21 changed files with 44 additions and 1767 deletions
File diff suppressed because one or more lines are too long
|
@ -2,7 +2,7 @@ package org.dimdev.dimdoors;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.dimdev.dimcore.schematic.v2.SchematicTest;
|
||||
import org.dimdev.dimdoors.util.schematic.v2.SchematicTest;
|
||||
import org.dimdev.dimdoors.block.ModBlocks;
|
||||
import org.dimdev.dimdoors.block.entity.ModBlockEntityTypes;
|
||||
import org.dimdev.dimdoors.command.ModCommands;
|
||||
|
|
|
@ -3,8 +3,8 @@ package org.dimdev.dimdoors.command;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.dimdev.dimcore.schematic.Schematic;
|
||||
import org.dimdev.dimcore.schematic.SchematicConverter;
|
||||
import org.dimdev.dimdoors.util.schematic.Schematic;
|
||||
import org.dimdev.dimdoors.util.schematic.SchematicConverter;
|
||||
import org.dimdev.dimdoors.command.arguments.SchematicNamespaceArgumentType;
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.mojang.brigadier.arguments.StringArgumentType;
|
||||
|
|
|
@ -5,8 +5,8 @@ import java.io.InputStream;
|
|||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dimdev.dimcore.schematic.v2.Schematic;
|
||||
import org.dimdev.dimcore.schematic.v2.SchematicPlacer;
|
||||
import org.dimdev.dimdoors.util.schematic.v2.Schematic;
|
||||
import org.dimdev.dimdoors.util.schematic.v2.SchematicPlacer;
|
||||
import org.dimdev.dimdoors.DimensionalDoorsInitializer;
|
||||
import org.dimdev.dimdoors.command.arguments.SchematicNamespaceArgumentType;
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
package org.dimdev.dimdoors.mixin;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Invoker;
|
||||
|
||||
import net.minecraft.block.RedstoneWireBlock;
|
||||
import net.minecraft.block.enums.WireConnection;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.world.BlockView;
|
||||
|
||||
@Mixin(RedstoneWireBlock.class)
|
||||
public interface RedstoneWireBlockAccessor {
|
||||
@Invoker
|
||||
WireConnection invokeGetRenderConnectionType(BlockView blockView, BlockPos blockPos, Direction direction);
|
||||
}
|
|
@ -5,7 +5,7 @@ import java.util.List;
|
|||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dimdev.dimcore.schematic.Schematic;
|
||||
import org.dimdev.dimdoors.util.schematic.Schematic;
|
||||
import org.dimdev.dimdoors.DimensionalDoorsInitializer;
|
||||
import org.dimdev.dimdoors.block.entity.EntranceRiftBlockEntity;
|
||||
import org.dimdev.dimdoors.block.entity.ModBlockEntityTypes;
|
||||
|
|
|
@ -6,8 +6,8 @@ import java.util.Objects;
|
|||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dimdev.dimcore.schematic.v2.Schematic;
|
||||
import org.dimdev.dimcore.schematic.v2.SchematicPlacer;
|
||||
import org.dimdev.dimdoors.util.schematic.v2.Schematic;
|
||||
import org.dimdev.dimdoors.util.schematic.v2.SchematicPlacer;
|
||||
import org.dimdev.dimdoors.DimensionalDoorsInitializer;
|
||||
import org.dimdev.dimdoors.block.entity.EntranceRiftBlockEntity;
|
||||
import org.dimdev.dimdoors.block.entity.ModBlockEntityTypes;
|
||||
|
|
|
@ -26,7 +26,7 @@ import java.util.stream.Collectors;
|
|||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dimdev.dimcore.schematic.Schematic;
|
||||
import org.dimdev.dimdoors.util.schematic.Schematic;
|
||||
import org.dimdev.dimdoors.DimensionalDoorsInitializer;
|
||||
import org.dimdev.dimdoors.ModConfig;
|
||||
import org.dimdev.dimdoors.util.math.MathUtil;
|
||||
|
|
|
@ -11,11 +11,10 @@ import java.util.Collection;
|
|||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dimdev.dimcore.schematic.v2.Schematic;
|
||||
import org.dimdev.dimdoors.util.schematic.v2.Schematic;
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Lists;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package org.dimdev.dimcore.schematic;
|
||||
package org.dimdev.dimdoors.util.schematic;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
|
@ -1,4 +1,4 @@
|
|||
package org.dimdev.dimcore.schematic;
|
||||
package org.dimdev.dimdoors.util.schematic;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
|
@ -1,4 +1,4 @@
|
|||
package org.dimdev.dimcore.schematic;
|
||||
package org.dimdev.dimdoors.util.schematic;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.dimdev.dimcore.schematic;
|
||||
package org.dimdev.dimdoors.util.schematic;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.concurrent.ExecutionException;
|
|
@ -1,4 +1,4 @@
|
|||
package org.dimdev.dimcore.schematic.v2;
|
||||
package org.dimdev.dimdoors.util.schematic.v2;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
|
@ -1,4 +1,4 @@
|
|||
package org.dimdev.dimcore.schematic.v2;
|
||||
package org.dimdev.dimdoors.util.schematic.v2;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Collection;
|
||||
|
@ -7,6 +7,8 @@ import java.util.Map;
|
|||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.google.common.collect.BiMap;
|
||||
import com.google.common.collect.HashBiMap;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.mojang.serialization.Codec;
|
||||
|
@ -48,7 +50,7 @@ public class Schematic {
|
|||
private final short length;
|
||||
private final Vec3i offset;
|
||||
private final int paletteMax;
|
||||
private final Map<BlockState, Integer> blockPalette;
|
||||
private final BiMap<BlockState, Integer> blockPalette;
|
||||
private final ByteBuffer blockData;
|
||||
private List<CompoundTag> blockEntities;
|
||||
private List<CompoundTag> entities;
|
||||
|
@ -62,7 +64,7 @@ public class Schematic {
|
|||
this.length = length;
|
||||
this.offset = offset;
|
||||
this.paletteMax = paletteMax;
|
||||
this.blockPalette = blockPalette;
|
||||
this.blockPalette = HashBiMap.create(blockPalette);
|
||||
this.blockData = blockData;
|
||||
this.blockEntities = blockEntities;
|
||||
this.entities = entities;
|
|
@ -1,4 +1,4 @@
|
|||
package org.dimdev.dimcore.schematic.v2;
|
||||
package org.dimdev.dimdoors.util.schematic.v2;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Objects;
|
|
@ -1,4 +1,4 @@
|
|||
package org.dimdev.dimcore.schematic.v2;
|
||||
package org.dimdev.dimdoors.util.schematic.v2;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.dimdev.dimcore.schematic.v2;
|
||||
package org.dimdev.dimdoors.util.schematic.v2;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
|
@ -1,4 +1,4 @@
|
|||
package org.dimdev.dimcore.schematic.v2;
|
||||
package org.dimdev.dimdoors.util.schematic.v2;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
|
@ -6,8 +6,8 @@ import java.io.InputStream;
|
|||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dimdev.dimcore.schematic.v2.Schematic;
|
||||
import org.dimdev.dimcore.schematic.v2.SchematicPlacer;
|
||||
import org.dimdev.dimdoors.util.schematic.v2.Schematic;
|
||||
import org.dimdev.dimdoors.util.schematic.v2.SchematicPlacer;
|
||||
import org.dimdev.dimdoors.DimensionalDoorsInitializer;
|
||||
import org.dimdev.dimdoors.world.feature.gateway.Gateway;
|
||||
import com.google.common.collect.BiMap;
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
"DirectionAccessor",
|
||||
"EntityMixin",
|
||||
"ListTagAccessor",
|
||||
"PlayerEntityMixin"
|
||||
"PlayerEntityMixin",
|
||||
"RedstoneWireBlockAccessor"
|
||||
],
|
||||
"client": [
|
||||
"client.GlStateManagerAccessor",
|
||||
|
|
Loading…
Reference in a new issue