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:
SD 2020-10-03 15:15:25 +05:30
parent cadea89b76
commit 1484432ffe
No known key found for this signature in database
GPG key ID: E36B57EE08544BC5
21 changed files with 44 additions and 1767 deletions

File diff suppressed because one or more lines are too long

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,4 +1,4 @@
package org.dimdev.dimcore.schematic;
package org.dimdev.dimdoors.util.schematic;
import java.util.ArrayList;
import java.util.HashMap;

View file

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

View file

@ -1,4 +1,4 @@
package org.dimdev.dimcore.schematic;
package org.dimdev.dimdoors.util.schematic;
import java.lang.reflect.Method;

View file

@ -1,4 +1,4 @@
package org.dimdev.dimcore.schematic;
package org.dimdev.dimdoors.util.schematic;
import java.io.InputStream;
import java.util.concurrent.ExecutionException;

View file

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

View file

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

View file

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

View file

@ -1,4 +1,4 @@
package org.dimdev.dimcore.schematic.v2;
package org.dimdev.dimdoors.util.schematic.v2;
import java.util.List;

View file

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

View file

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

View file

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

View file

@ -11,7 +11,8 @@
"DirectionAccessor",
"EntityMixin",
"ListTagAccessor",
"PlayerEntityMixin"
"PlayerEntityMixin",
"RedstoneWireBlockAccessor"
],
"client": [
"client.GlStateManagerAccessor",