Shifting Things Around
- Removed some old resources inherited from TMA - Introduced a new package structure, grouping by modules rather than types
|
@ -1,13 +1,13 @@
|
||||||
package com.simibubi.create;
|
package com.simibubi.create;
|
||||||
|
|
||||||
import com.simibubi.create.block.CreativeCrateBlock;
|
import com.simibubi.create.foundation.block.IRenderUtilityBlock;
|
||||||
import com.simibubi.create.block.RenderingBlock;
|
import com.simibubi.create.foundation.block.RenderUtilityBlock;
|
||||||
import com.simibubi.create.block.SchematicTableBlock;
|
import com.simibubi.create.modules.schematics.block.CreativeCrateBlock;
|
||||||
import com.simibubi.create.block.SchematicannonBlock;
|
import com.simibubi.create.modules.schematics.block.SchematicTableBlock;
|
||||||
import com.simibubi.create.block.symmetry.CrossPlaneSymmetryBlock;
|
import com.simibubi.create.modules.schematics.block.SchematicannonBlock;
|
||||||
import com.simibubi.create.block.symmetry.PlaneSymmetryBlock;
|
import com.simibubi.create.modules.symmetry.block.CrossPlaneSymmetryBlock;
|
||||||
import com.simibubi.create.block.symmetry.TriplePlaneSymmetryBlock;
|
import com.simibubi.create.modules.symmetry.block.PlaneSymmetryBlock;
|
||||||
import com.simibubi.create.utility.IJustForRendering;
|
import com.simibubi.create.modules.symmetry.block.TriplePlaneSymmetryBlock;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
|
@ -18,8 +18,8 @@ import net.minecraftforge.registries.IForgeRegistry;
|
||||||
public enum AllBlocks {
|
public enum AllBlocks {
|
||||||
|
|
||||||
SCHEMATICANNON(new SchematicannonBlock()),
|
SCHEMATICANNON(new SchematicannonBlock()),
|
||||||
SCHEMATICANNON_CONNECTOR(new RenderingBlock()),
|
SCHEMATICANNON_CONNECTOR(new RenderUtilityBlock()),
|
||||||
SCHEMATICANNON_PIPE(new RenderingBlock()),
|
SCHEMATICANNON_PIPE(new RenderUtilityBlock()),
|
||||||
CREATIVE_CRATE(new CreativeCrateBlock()),
|
CREATIVE_CRATE(new CreativeCrateBlock()),
|
||||||
|
|
||||||
SCHEMATIC_TABLE(new SchematicTableBlock()),
|
SCHEMATIC_TABLE(new SchematicTableBlock()),
|
||||||
|
@ -43,7 +43,7 @@ public enum AllBlocks {
|
||||||
|
|
||||||
public static void registerItemBlocks(IForgeRegistry<Item> registry) {
|
public static void registerItemBlocks(IForgeRegistry<Item> registry) {
|
||||||
for (AllBlocks block : values()) {
|
for (AllBlocks block : values()) {
|
||||||
if (block.get() instanceof IJustForRendering)
|
if (block.get() instanceof IRenderUtilityBlock)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
registry.register(new BlockItem(block.get(), AllItems.standardProperties())
|
registry.register(new BlockItem(block.get(), AllItems.standardProperties())
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package com.simibubi.create;
|
package com.simibubi.create;
|
||||||
|
|
||||||
import com.simibubi.create.block.SchematicTableContainer;
|
import com.simibubi.create.modules.schematics.block.SchematicTableContainer;
|
||||||
import com.simibubi.create.block.SchematicannonContainer;
|
import com.simibubi.create.modules.schematics.block.SchematicTableScreen;
|
||||||
import com.simibubi.create.gui.SchematicTableScreen;
|
import com.simibubi.create.modules.schematics.block.SchematicannonContainer;
|
||||||
import com.simibubi.create.gui.SchematicannonScreen;
|
import com.simibubi.create.modules.schematics.block.SchematicannonScreen;
|
||||||
|
|
||||||
import net.minecraft.client.gui.IHasContainer;
|
import net.minecraft.client.gui.IHasContainer;
|
||||||
import net.minecraft.client.gui.ScreenManager;
|
import net.minecraft.client.gui.ScreenManager;
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package com.simibubi.create;
|
package com.simibubi.create;
|
||||||
|
|
||||||
import com.simibubi.create.item.BlueprintItem;
|
import com.simibubi.create.modules.curiosities.item.TreeFertilizerItem;
|
||||||
import com.simibubi.create.item.BlueprintAndQuillItem;
|
import com.simibubi.create.modules.schematics.item.BlueprintAndQuillItem;
|
||||||
import com.simibubi.create.item.TreeFertilizerItem;
|
import com.simibubi.create.modules.schematics.item.BlueprintItem;
|
||||||
import com.simibubi.create.item.SymmetryWandItem;
|
import com.simibubi.create.modules.symmetry.SymmetryWandItem;
|
||||||
|
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.Item.Properties;
|
import net.minecraft.item.Item.Properties;
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
package com.simibubi.create.networking;
|
package com.simibubi.create;
|
||||||
|
|
||||||
import com.simibubi.create.Create;
|
import com.simibubi.create.foundation.packet.NbtPacket;
|
||||||
|
import com.simibubi.create.modules.schematics.packet.ConfigureSchematicannonPacket;
|
||||||
|
import com.simibubi.create.modules.schematics.packet.SchematicPlacePacket;
|
||||||
|
import com.simibubi.create.modules.schematics.packet.SchematicUploadPacket;
|
||||||
|
import com.simibubi.create.modules.symmetry.SymmetryEffectPacket;
|
||||||
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.fml.network.NetworkRegistry;
|
import net.minecraftforge.fml.network.NetworkRegistry;
|
21
src/main/java/com/simibubi/create/AllSpecialTextures.java
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
package com.simibubi.create;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
public enum AllSpecialTextures {
|
||||||
|
|
||||||
|
Selection("selection.png");
|
||||||
|
|
||||||
|
public static final String ASSET_PATH = "textures/special/";
|
||||||
|
private ResourceLocation location;
|
||||||
|
|
||||||
|
private AllSpecialTextures(String filename) {
|
||||||
|
location = new ResourceLocation(Create.ID, ASSET_PATH + filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void bind() {
|
||||||
|
Minecraft.getInstance().getTextureManager().bindTexture(location);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -2,9 +2,9 @@ package com.simibubi.create;
|
||||||
|
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
import com.simibubi.create.block.SchematicTableTileEntity;
|
import com.simibubi.create.modules.schematics.block.SchematicTableTileEntity;
|
||||||
import com.simibubi.create.block.SchematicannonRenderer;
|
import com.simibubi.create.modules.schematics.block.SchematicannonRenderer;
|
||||||
import com.simibubi.create.block.SchematicannonTileEntity;
|
import com.simibubi.create.modules.schematics.block.SchematicannonTileEntity;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
|
@ -3,10 +3,11 @@ package com.simibubi.create;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
import com.simibubi.create.networking.AllPackets;
|
import com.simibubi.create.foundation.utility.KeyboardHelper;
|
||||||
import com.simibubi.create.schematic.BlueprintHandler;
|
import com.simibubi.create.modules.schematics.ClientSchematicLoader;
|
||||||
import com.simibubi.create.schematic.SchematicHologram;
|
import com.simibubi.create.modules.schematics.ServerSchematicLoader;
|
||||||
import com.simibubi.create.utility.Keyboard;
|
import com.simibubi.create.modules.schematics.client.BlueprintHandler;
|
||||||
|
import com.simibubi.create.modules.schematics.client.SchematicHologram;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.settings.KeyBinding;
|
import net.minecraft.client.settings.KeyBinding;
|
||||||
|
@ -62,7 +63,7 @@ public class Create {
|
||||||
new SchematicHologram();
|
new SchematicHologram();
|
||||||
new BlueprintHandler();
|
new BlueprintHandler();
|
||||||
ScrollFixer.init();
|
ScrollFixer.init();
|
||||||
TOOL_MENU = new KeyBinding("Tool Menu (Hold)", Keyboard.LALT, NAME);
|
TOOL_MENU = new KeyBinding("Tool Menu (Hold)", KeyboardHelper.LALT, NAME);
|
||||||
ClientRegistry.registerKeyBinding(TOOL_MENU);
|
ClientRegistry.registerKeyBinding(TOOL_MENU);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
package com.simibubi.create.block;
|
|
||||||
|
|
||||||
import com.simibubi.create.utility.IJustForRendering;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
|
|
||||||
public class RenderingBlock extends Block implements IJustForRendering {
|
|
||||||
|
|
||||||
public RenderingBlock() {
|
|
||||||
super(Properties.create(Material.AIR));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
package com.simibubi.create.block.symmetry;
|
|
||||||
|
|
||||||
import com.simibubi.create.utility.IJustForRendering;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
|
|
||||||
public class SymmetryBlock extends Block implements IJustForRendering {
|
|
||||||
|
|
||||||
public SymmetryBlock(Properties properties) {
|
|
||||||
super(properties);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.simibubi.create.foundation.block;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Blocks only registered for use in other blocks' renderers.
|
||||||
|
*/
|
||||||
|
public interface IRenderUtilityBlock {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.simibubi.create.foundation.block;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
|
public class RenderUtilityBlock extends Block implements IRenderUtilityBlock {
|
||||||
|
|
||||||
|
public RenderUtilityBlock() {
|
||||||
|
super(Properties.create(Material.AIR));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.utility;
|
package com.simibubi.create.foundation.block;
|
||||||
|
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
import net.minecraft.network.NetworkManager;
|
import net.minecraft.network.NetworkManager;
|
||||||
|
@ -6,9 +6,9 @@ import net.minecraft.network.play.server.SUpdateTileEntityPacket;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.tileentity.TileEntityType;
|
import net.minecraft.tileentity.TileEntityType;
|
||||||
|
|
||||||
public abstract class TileEntitySynced extends TileEntity {
|
public abstract class SyncedTileEntity extends TileEntity {
|
||||||
|
|
||||||
public TileEntitySynced(TileEntityType<?> tileEntityTypeIn) {
|
public SyncedTileEntity(TileEntityType<?> tileEntityTypeIn) {
|
||||||
super(tileEntityTypeIn);
|
super(tileEntityTypeIn);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
package com.simibubi.create.gui;
|
package com.simibubi.create.foundation.gui;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.mojang.blaze3d.platform.GlStateManager;
|
import com.mojang.blaze3d.platform.GlStateManager;
|
||||||
import com.simibubi.create.gui.widgets.AbstractSimiWidget;
|
import com.simibubi.create.foundation.gui.widgets.AbstractSimiWidget;
|
||||||
|
|
||||||
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
|
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
|
||||||
import net.minecraft.client.gui.widget.Widget;
|
import net.minecraft.client.gui.widget.Widget;
|
|
@ -1,9 +1,9 @@
|
||||||
package com.simibubi.create.gui;
|
package com.simibubi.create.foundation.gui;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.simibubi.create.gui.widgets.AbstractSimiWidget;
|
import com.simibubi.create.foundation.gui.widgets.AbstractSimiWidget;
|
||||||
|
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
import net.minecraft.client.gui.widget.Widget;
|
import net.minecraft.client.gui.widget.Widget;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.gui;
|
package com.simibubi.create.foundation.gui;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
import net.minecraft.client.gui.screen.Screen;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.gui;
|
package com.simibubi.create.foundation.gui;
|
||||||
|
|
||||||
import com.simibubi.create.Create;
|
import com.simibubi.create.Create;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.gui;
|
package com.simibubi.create.foundation.gui;
|
||||||
|
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package com.simibubi.create.gui;
|
package com.simibubi.create.foundation.gui;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
import com.mojang.blaze3d.platform.GlStateManager;
|
import com.mojang.blaze3d.platform.GlStateManager;
|
||||||
import com.simibubi.create.Create;
|
import com.simibubi.create.Create;
|
||||||
import com.simibubi.create.schematic.tools.Tools;
|
import com.simibubi.create.modules.schematics.client.tools.Tools;
|
||||||
|
|
||||||
import net.minecraft.client.MainWindow;
|
import net.minecraft.client.MainWindow;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.gui.widgets;
|
package com.simibubi.create.foundation.gui.widgets;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
|
@ -1,7 +1,7 @@
|
||||||
package com.simibubi.create.gui.widgets;
|
package com.simibubi.create.foundation.gui.widgets;
|
||||||
|
|
||||||
import com.mojang.blaze3d.platform.GlStateManager;
|
import com.mojang.blaze3d.platform.GlStateManager;
|
||||||
import com.simibubi.create.gui.ScreenResources;
|
import com.simibubi.create.foundation.gui.ScreenResources;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
|
@ -1,7 +1,7 @@
|
||||||
package com.simibubi.create.gui.widgets;
|
package com.simibubi.create.foundation.gui.widgets;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.simibubi.create.gui.ScreenResources;
|
import com.simibubi.create.foundation.gui.ScreenResources;
|
||||||
|
|
||||||
public class Indicator extends AbstractSimiWidget {
|
public class Indicator extends AbstractSimiWidget {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.gui.widgets;
|
package com.simibubi.create.foundation.gui.widgets;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
import net.minecraft.client.gui.FontRenderer;
|
|
@ -1,8 +1,8 @@
|
||||||
package com.simibubi.create.gui.widgets;
|
package com.simibubi.create.foundation.gui.widgets;
|
||||||
|
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
import com.simibubi.create.utility.Keyboard;
|
import com.simibubi.create.foundation.utility.KeyboardHelper;
|
||||||
|
|
||||||
import net.minecraft.util.text.TextFormatting;
|
import net.minecraft.util.text.TextFormatting;
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ public class ScrollInput extends AbstractSimiWidget {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
int priorState = state;
|
int priorState = state;
|
||||||
int step = (int) Math.signum(delta) * (Keyboard.isKeyDown(Keyboard.LSHIFT) ? 5 : 1);
|
int step = (int) Math.signum(delta) * (KeyboardHelper.isKeyDown(KeyboardHelper.LSHIFT) ? 5 : 1);
|
||||||
|
|
||||||
state += step;
|
state += step;
|
||||||
clampState();
|
clampState();
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.gui.widgets;
|
package com.simibubi.create.foundation.gui.widgets;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.networking;
|
package com.simibubi.create.foundation.packet;
|
||||||
|
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.schematic;
|
package com.simibubi.create.foundation.type;
|
||||||
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.simibubi.create.foundation.type;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.world.ServerWorld;
|
||||||
|
|
||||||
|
public class DimensionPos {
|
||||||
|
public ServerWorld world;
|
||||||
|
public BlockPos pos;
|
||||||
|
|
||||||
|
public DimensionPos(ServerPlayerEntity player, BlockPos pos) {
|
||||||
|
this.world = player.getServerWorld();
|
||||||
|
this.pos = pos;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.utility;
|
package com.simibubi.create.foundation.utility;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.utility;
|
package com.simibubi.create.foundation.utility;
|
||||||
|
|
||||||
import org.lwjgl.glfw.GLFW;
|
import org.lwjgl.glfw.GLFW;
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public class Keyboard {
|
public class KeyboardHelper {
|
||||||
|
|
||||||
public static final int PRESS = 1;
|
public static final int PRESS = 1;
|
||||||
public static final int HOLD = 2;
|
public static final int HOLD = 2;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.utility;
|
package com.simibubi.create.foundation.utility;
|
||||||
|
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.utility;
|
package com.simibubi.create.foundation.utility;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.item;
|
package com.simibubi.create.modules.curiosities.item;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -6,7 +6,7 @@ import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
import com.simibubi.create.utility.Keyboard;
|
import com.simibubi.create.foundation.utility.KeyboardHelper;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
|
@ -46,7 +46,7 @@ public class TreeFertilizerItem extends Item {
|
||||||
@Override
|
@Override
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public void addInformation(ItemStack stack, World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) {
|
public void addInformation(ItemStack stack, World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) {
|
||||||
if (Keyboard.isKeyDown(Keyboard.LSHIFT))
|
if (KeyboardHelper.isKeyDown(KeyboardHelper.LSHIFT))
|
||||||
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "Tree won't grow? Try this on it."));
|
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "Tree won't grow? Try this on it."));
|
||||||
else
|
else
|
||||||
tooltip.add(new StringTextComponent(TextFormatting.DARK_GRAY + "< Hold Shift >"));
|
tooltip.add(new StringTextComponent(TextFormatting.DARK_GRAY + "< Hold Shift >"));
|
|
@ -1,6 +1,6 @@
|
||||||
package com.simibubi.create;
|
package com.simibubi.create.modules.schematics;
|
||||||
|
|
||||||
import static com.simibubi.create.ServerSchematicLoader.MAX_PACKET_SIZE;
|
import static com.simibubi.create.modules.schematics.ServerSchematicLoader.MAX_PACKET_SIZE;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
@ -16,9 +16,10 @@ import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.simibubi.create.networking.SchematicUploadPacket;
|
import com.simibubi.create.AllPackets;
|
||||||
import com.simibubi.create.networking.AllPackets;
|
import com.simibubi.create.Create;
|
||||||
import com.simibubi.create.utility.FilesHelper;
|
import com.simibubi.create.foundation.utility.FilesHelper;
|
||||||
|
import com.simibubi.create.modules.schematics.packet.SchematicUploadPacket;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.util.text.StringTextComponent;
|
import net.minecraft.util.text.StringTextComponent;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.schematic;
|
package com.simibubi.create.modules.schematics;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.schematic;
|
package com.simibubi.create.modules.schematics;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -8,6 +8,7 @@ import java.util.Set;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
import com.simibubi.create.foundation.type.Cuboid;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create;
|
package com.simibubi.create.modules.schematics;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
@ -14,10 +14,12 @@ import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
import com.simibubi.create.block.SchematicTableTileEntity;
|
import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.item.BlueprintItem;
|
import com.simibubi.create.Create;
|
||||||
import com.simibubi.create.networking.SchematicUploadPacket.DimensionPos;
|
import com.simibubi.create.foundation.type.DimensionPos;
|
||||||
import com.simibubi.create.utility.FilesHelper;
|
import com.simibubi.create.foundation.utility.FilesHelper;
|
||||||
|
import com.simibubi.create.modules.schematics.block.SchematicTableTileEntity;
|
||||||
|
import com.simibubi.create.modules.schematics.item.BlueprintItem;
|
||||||
|
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
import net.minecraft.entity.player.ServerPlayerEntity;
|
|
@ -1,8 +1,8 @@
|
||||||
package com.simibubi.create.block;
|
package com.simibubi.create.modules.schematics.block;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.simibubi.create.utility.Keyboard;
|
import com.simibubi.create.foundation.utility.KeyboardHelper;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
|
@ -36,7 +36,7 @@ public class CreativeCrateBlock extends Block {
|
||||||
@OnlyIn(value = Dist.CLIENT)
|
@OnlyIn(value = Dist.CLIENT)
|
||||||
public void addInformation(ItemStack stack, IBlockReader worldIn, List<ITextComponent> tooltip,
|
public void addInformation(ItemStack stack, IBlockReader worldIn, List<ITextComponent> tooltip,
|
||||||
ITooltipFlag flagIn) {
|
ITooltipFlag flagIn) {
|
||||||
if (Keyboard.isKeyDown(Keyboard.LSHIFT)) {
|
if (KeyboardHelper.isKeyDown(KeyboardHelper.LSHIFT)) {
|
||||||
tooltip.add(new StringTextComponent(TextFormatting.LIGHT_PURPLE + "Creative Item"));
|
tooltip.add(new StringTextComponent(TextFormatting.LIGHT_PURPLE + "Creative Item"));
|
||||||
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "Grants an attached " + TextFormatting.BLUE + "Schematicannon"));
|
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "Grants an attached " + TextFormatting.BLUE + "Schematicannon"));
|
||||||
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "unlimited access to blocks."));
|
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "unlimited access to blocks."));
|
|
@ -1,8 +1,8 @@
|
||||||
package com.simibubi.create.block;
|
package com.simibubi.create.modules.schematics.block;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.simibubi.create.utility.Keyboard;
|
import com.simibubi.create.foundation.utility.KeyboardHelper;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
|
@ -49,7 +49,7 @@ public class SchematicTableBlock extends HorizontalBlock {
|
||||||
@OnlyIn(value = Dist.CLIENT)
|
@OnlyIn(value = Dist.CLIENT)
|
||||||
public void addInformation(ItemStack stack, IBlockReader worldIn, List<ITextComponent> tooltip,
|
public void addInformation(ItemStack stack, IBlockReader worldIn, List<ITextComponent> tooltip,
|
||||||
ITooltipFlag flagIn) {
|
ITooltipFlag flagIn) {
|
||||||
if (Keyboard.isKeyDown(Keyboard.LSHIFT)) {
|
if (KeyboardHelper.isKeyDown(KeyboardHelper.LSHIFT)) {
|
||||||
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "Writes saved Schematics onto"));
|
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "Writes saved Schematics onto"));
|
||||||
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "an " + TextFormatting.BLUE + "Empty Schematic"));
|
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "an " + TextFormatting.BLUE + "Empty Schematic"));
|
||||||
} else
|
} else
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.block;
|
package com.simibubi.create.modules.schematics.block;
|
||||||
|
|
||||||
import com.simibubi.create.AllContainers;
|
import com.simibubi.create.AllContainers;
|
||||||
import com.simibubi.create.AllItems;
|
import com.simibubi.create.AllItems;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.gui;
|
package com.simibubi.create.modules.schematics.block;
|
||||||
|
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -6,11 +6,12 @@ import java.util.List;
|
||||||
import com.mojang.blaze3d.platform.GlStateManager;
|
import com.mojang.blaze3d.platform.GlStateManager;
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.Create;
|
import com.simibubi.create.Create;
|
||||||
import com.simibubi.create.block.SchematicTableContainer;
|
import com.simibubi.create.foundation.gui.AbstractSimiContainerScreen;
|
||||||
import com.simibubi.create.gui.widgets.Label;
|
import com.simibubi.create.foundation.gui.ScreenResources;
|
||||||
import com.simibubi.create.gui.widgets.SelectionScrollInput;
|
import com.simibubi.create.foundation.gui.widgets.IconButton;
|
||||||
import com.simibubi.create.gui.widgets.ScrollInput;
|
import com.simibubi.create.foundation.gui.widgets.Label;
|
||||||
import com.simibubi.create.gui.widgets.IconButton;
|
import com.simibubi.create.foundation.gui.widgets.ScrollInput;
|
||||||
|
import com.simibubi.create.foundation.gui.widgets.SelectionScrollInput;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.IHasContainer;
|
import net.minecraft.client.gui.IHasContainer;
|
|
@ -1,7 +1,7 @@
|
||||||
package com.simibubi.create.block;
|
package com.simibubi.create.modules.schematics.block;
|
||||||
|
|
||||||
import com.simibubi.create.AllTileEntities;
|
import com.simibubi.create.AllTileEntities;
|
||||||
import com.simibubi.create.utility.TileEntitySynced;
|
import com.simibubi.create.foundation.block.SyncedTileEntity;
|
||||||
|
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.entity.player.PlayerInventory;
|
import net.minecraft.entity.player.PlayerInventory;
|
||||||
|
@ -15,7 +15,7 @@ import net.minecraft.util.text.ITextComponent;
|
||||||
import net.minecraft.util.text.StringTextComponent;
|
import net.minecraft.util.text.StringTextComponent;
|
||||||
import net.minecraftforge.items.ItemStackHandler;
|
import net.minecraftforge.items.ItemStackHandler;
|
||||||
|
|
||||||
public class SchematicTableTileEntity extends TileEntitySynced implements ITickableTileEntity, INamedContainerProvider {
|
public class SchematicTableTileEntity extends SyncedTileEntity implements ITickableTileEntity, INamedContainerProvider {
|
||||||
|
|
||||||
public SchematicTableInventory inventory;
|
public SchematicTableInventory inventory;
|
||||||
public boolean isUploading;
|
public boolean isUploading;
|
|
@ -1,9 +1,9 @@
|
||||||
package com.simibubi.create.block;
|
package com.simibubi.create.modules.schematics.block;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.simibubi.create.AllItems;
|
import com.simibubi.create.AllItems;
|
||||||
import com.simibubi.create.utility.Keyboard;
|
import com.simibubi.create.foundation.utility.KeyboardHelper;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
|
@ -49,7 +49,7 @@ public class SchematicannonBlock extends Block {
|
||||||
@OnlyIn(value = Dist.CLIENT)
|
@OnlyIn(value = Dist.CLIENT)
|
||||||
public void addInformation(ItemStack stack, IBlockReader worldIn, List<ITextComponent> tooltip,
|
public void addInformation(ItemStack stack, IBlockReader worldIn, List<ITextComponent> tooltip,
|
||||||
ITooltipFlag flagIn) {
|
ITooltipFlag flagIn) {
|
||||||
if (Keyboard.isKeyDown(Keyboard.LSHIFT)) {
|
if (KeyboardHelper.isKeyDown(KeyboardHelper.LSHIFT)) {
|
||||||
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "Prints a deployed " + TextFormatting.BLUE + "Schematic"));
|
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "Prints a deployed " + TextFormatting.BLUE + "Schematic"));
|
||||||
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "into the world using blocks from inventories"));
|
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "into the world using blocks from inventories"));
|
||||||
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "placed right next to it."));
|
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "placed right next to it."));
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.block;
|
package com.simibubi.create.modules.schematics.block;
|
||||||
|
|
||||||
import com.simibubi.create.AllContainers;
|
import com.simibubi.create.AllContainers;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.block;
|
package com.simibubi.create.modules.schematics.block;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.gui;
|
package com.simibubi.create.modules.schematics.block;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -7,14 +7,14 @@ import java.util.Vector;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.mojang.blaze3d.platform.GlStateManager;
|
import com.mojang.blaze3d.platform.GlStateManager;
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.block.SchematicannonContainer;
|
import com.simibubi.create.AllPackets;
|
||||||
import com.simibubi.create.block.SchematicannonTileEntity;
|
import com.simibubi.create.foundation.gui.AbstractSimiContainerScreen;
|
||||||
import com.simibubi.create.gui.widgets.Indicator;
|
import com.simibubi.create.foundation.gui.ScreenResources;
|
||||||
import com.simibubi.create.gui.widgets.Indicator.State;
|
import com.simibubi.create.foundation.gui.widgets.IconButton;
|
||||||
import com.simibubi.create.gui.widgets.IconButton;
|
import com.simibubi.create.foundation.gui.widgets.Indicator;
|
||||||
import com.simibubi.create.networking.ConfigureSchematicannonPacket;
|
import com.simibubi.create.foundation.gui.widgets.Indicator.State;
|
||||||
import com.simibubi.create.networking.ConfigureSchematicannonPacket.Option;
|
import com.simibubi.create.modules.schematics.packet.ConfigureSchematicannonPacket;
|
||||||
import com.simibubi.create.networking.AllPackets;
|
import com.simibubi.create.modules.schematics.packet.ConfigureSchematicannonPacket.Option;
|
||||||
|
|
||||||
import net.minecraft.client.gui.widget.Widget;
|
import net.minecraft.client.gui.widget.Widget;
|
||||||
import net.minecraft.client.renderer.RenderHelper;
|
import net.minecraft.client.renderer.RenderHelper;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.block;
|
package com.simibubi.create.modules.schematics.block;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
@ -7,11 +7,11 @@ import java.util.List;
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.AllItems;
|
import com.simibubi.create.AllItems;
|
||||||
import com.simibubi.create.AllTileEntities;
|
import com.simibubi.create.AllTileEntities;
|
||||||
import com.simibubi.create.item.BlueprintItem;
|
import com.simibubi.create.foundation.block.SyncedTileEntity;
|
||||||
import com.simibubi.create.schematic.Cuboid;
|
import com.simibubi.create.foundation.type.Cuboid;
|
||||||
import com.simibubi.create.schematic.MaterialChecklist;
|
import com.simibubi.create.modules.schematics.MaterialChecklist;
|
||||||
import com.simibubi.create.schematic.SchematicWorld;
|
import com.simibubi.create.modules.schematics.SchematicWorld;
|
||||||
import com.simibubi.create.utility.TileEntitySynced;
|
import com.simibubi.create.modules.schematics.item.BlueprintItem;
|
||||||
|
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.block.Blocks;
|
import net.minecraft.block.Blocks;
|
||||||
|
@ -49,7 +49,7 @@ import net.minecraftforge.items.CapabilityItemHandler;
|
||||||
import net.minecraftforge.items.IItemHandler;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
import net.minecraftforge.items.ItemStackHandler;
|
import net.minecraftforge.items.ItemStackHandler;
|
||||||
|
|
||||||
public class SchematicannonTileEntity extends TileEntitySynced implements ITickableTileEntity, INamedContainerProvider {
|
public class SchematicannonTileEntity extends SyncedTileEntity implements ITickableTileEntity, INamedContainerProvider {
|
||||||
|
|
||||||
public static final int NEIGHBOUR_CHECKING = 100;
|
public static final int NEIGHBOUR_CHECKING = 100;
|
||||||
public static final int PLACEMENT_DELAY = 10;
|
public static final int PLACEMENT_DELAY = 10;
|
||||||
|
@ -599,7 +599,9 @@ public class SchematicannonTileEntity extends TileEntitySynced implements ITicka
|
||||||
BlockState toReplace = world.getBlockState(pos);
|
BlockState toReplace = world.getBlockState(pos);
|
||||||
boolean placingAir = state.getBlock() == Blocks.AIR;
|
boolean placingAir = state.getBlock() == Blocks.AIR;
|
||||||
|
|
||||||
if (toReplace.getBlockState() == state)
|
if (toReplace == state)
|
||||||
|
return false;
|
||||||
|
if (toReplace.getBlockHardness(world, pos) == -1)
|
||||||
return false;
|
return false;
|
||||||
if (pos.withinDistance(getPos(), 2f))
|
if (pos.withinDistance(getPos(), 2f))
|
||||||
return false;
|
return false;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.schematic;
|
package com.simibubi.create.modules.schematics.client;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
@ -11,14 +11,14 @@ import org.lwjgl.glfw.GLFW;
|
||||||
|
|
||||||
import com.mojang.blaze3d.platform.GlStateManager;
|
import com.mojang.blaze3d.platform.GlStateManager;
|
||||||
import com.simibubi.create.AllItems;
|
import com.simibubi.create.AllItems;
|
||||||
import com.simibubi.create.gui.ScreenOpener;
|
import com.simibubi.create.AllSpecialTextures;
|
||||||
import com.simibubi.create.gui.TextInputPromptScreen;
|
import com.simibubi.create.foundation.gui.ScreenOpener;
|
||||||
import com.simibubi.create.utility.FilesHelper;
|
import com.simibubi.create.foundation.gui.TextInputPromptScreen;
|
||||||
import com.simibubi.create.utility.Keyboard;
|
import com.simibubi.create.foundation.utility.FilesHelper;
|
||||||
import com.simibubi.create.utility.RaycastHelper;
|
import com.simibubi.create.foundation.utility.KeyboardHelper;
|
||||||
import com.simibubi.create.utility.RaycastHelper.PredicateTraceResult;
|
import com.simibubi.create.foundation.utility.RaycastHelper;
|
||||||
import com.simibubi.create.utility.TessellatorHelper;
|
import com.simibubi.create.foundation.utility.TessellatorHelper;
|
||||||
import com.simibubi.create.utility.TessellatorTextures;
|
import com.simibubi.create.foundation.utility.RaycastHelper.PredicateTraceResult;
|
||||||
|
|
||||||
import net.minecraft.block.Blocks;
|
import net.minecraft.block.Blocks;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
@ -77,7 +77,7 @@ public class BlueprintAndQuillHandler {
|
||||||
return;
|
return;
|
||||||
if (!active())
|
if (!active())
|
||||||
return;
|
return;
|
||||||
if (!Keyboard.isKeyDown(GLFW.GLFW_KEY_LEFT_CONTROL))
|
if (!KeyboardHelper.isKeyDown(GLFW.GLFW_KEY_LEFT_CONTROL))
|
||||||
return;
|
return;
|
||||||
int delta = (int) event.getScrollDelta();
|
int delta = (int) event.getScrollDelta();
|
||||||
if (secondPos == null)
|
if (secondPos == null)
|
||||||
|
@ -111,7 +111,7 @@ public class BlueprintAndQuillHandler {
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public static void onClick(MouseInputEvent event) {
|
public static void onClick(MouseInputEvent event) {
|
||||||
if (event.getAction() != Keyboard.PRESS)
|
if (event.getAction() != KeyboardHelper.PRESS)
|
||||||
return;
|
return;
|
||||||
if (event.getButton() != 1)
|
if (event.getButton() != 1)
|
||||||
return;
|
return;
|
||||||
|
@ -232,7 +232,7 @@ public class BlueprintAndQuillHandler {
|
||||||
|
|
||||||
GlStateManager.enableTexture();
|
GlStateManager.enableTexture();
|
||||||
TessellatorHelper.begin();
|
TessellatorHelper.begin();
|
||||||
TessellatorTextures.SelectedRoom.bind();
|
AllSpecialTextures.Selection.bind();
|
||||||
TessellatorHelper.doubleFace(Tessellator.getInstance().getBuffer(), new BlockPos(faceMin),
|
TessellatorHelper.doubleFace(Tessellator.getInstance().getBuffer(), new BlockPos(faceMin),
|
||||||
new BlockPos(faceMax.subtract(faceMin)), 1 / 16f * selectedFace.getAxisDirection().getOffset(),
|
new BlockPos(faceMax.subtract(faceMin)), 1 / 16f * selectedFace.getAxisDirection().getOffset(),
|
||||||
false, false, false);
|
false, false, false);
|
||||||
|
@ -262,7 +262,7 @@ public class BlueprintAndQuillHandler {
|
||||||
ClientPlayerEntity player = Minecraft.getInstance().player;
|
ClientPlayerEntity player = Minecraft.getInstance().player;
|
||||||
|
|
||||||
selectedPos = null;
|
selectedPos = null;
|
||||||
if (Keyboard.isKeyDown(GLFW.GLFW_KEY_LEFT_CONTROL)) {
|
if (KeyboardHelper.isKeyDown(GLFW.GLFW_KEY_LEFT_CONTROL)) {
|
||||||
selectedPos = new BlockPos(player.getEyePosition(Minecraft.getInstance().getRenderPartialTicks())
|
selectedPos = new BlockPos(player.getEyePosition(Minecraft.getInstance().getRenderPartialTicks())
|
||||||
.add(player.getLookVec().scale(range)));
|
.add(player.getLookVec().scale(range)));
|
||||||
} else {
|
} else {
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.gui;
|
package com.simibubi.create.modules.schematics.client;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -6,10 +6,11 @@ import java.util.List;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.mojang.blaze3d.platform.GlStateManager;
|
import com.mojang.blaze3d.platform.GlStateManager;
|
||||||
import com.simibubi.create.AllItems;
|
import com.simibubi.create.AllItems;
|
||||||
import com.simibubi.create.gui.widgets.Label;
|
import com.simibubi.create.foundation.gui.AbstractSimiScreen;
|
||||||
import com.simibubi.create.gui.widgets.SelectionScrollInput;
|
import com.simibubi.create.foundation.gui.ScreenResources;
|
||||||
import com.simibubi.create.gui.widgets.ScrollInput;
|
import com.simibubi.create.foundation.gui.widgets.Label;
|
||||||
import com.simibubi.create.schematic.BlueprintHandler;
|
import com.simibubi.create.foundation.gui.widgets.ScrollInput;
|
||||||
|
import com.simibubi.create.foundation.gui.widgets.SelectionScrollInput;
|
||||||
|
|
||||||
import net.minecraft.client.gui.widget.TextFieldWidget;
|
import net.minecraft.client.gui.widget.TextFieldWidget;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.schematic;
|
package com.simibubi.create.modules.schematics.client;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
@ -7,16 +7,17 @@ import org.lwjgl.glfw.GLFW;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.AllItems;
|
import com.simibubi.create.AllItems;
|
||||||
|
import com.simibubi.create.AllPackets;
|
||||||
import com.simibubi.create.Create;
|
import com.simibubi.create.Create;
|
||||||
import com.simibubi.create.gui.BlueprintHotbarOverlay;
|
import com.simibubi.create.foundation.gui.ToolSelectionScreen;
|
||||||
import com.simibubi.create.gui.ToolSelectionScreen;
|
import com.simibubi.create.foundation.packet.NbtPacket;
|
||||||
import com.simibubi.create.item.BlueprintItem;
|
import com.simibubi.create.foundation.type.Cuboid;
|
||||||
import com.simibubi.create.networking.NbtPacket;
|
import com.simibubi.create.foundation.utility.KeyboardHelper;
|
||||||
import com.simibubi.create.networking.SchematicPlacePacket;
|
import com.simibubi.create.foundation.utility.TessellatorHelper;
|
||||||
import com.simibubi.create.networking.AllPackets;
|
import com.simibubi.create.modules.schematics.SchematicWorld;
|
||||||
import com.simibubi.create.schematic.tools.Tools;
|
import com.simibubi.create.modules.schematics.client.tools.Tools;
|
||||||
import com.simibubi.create.utility.Keyboard;
|
import com.simibubi.create.modules.schematics.item.BlueprintItem;
|
||||||
import com.simibubi.create.utility.TessellatorHelper;
|
import com.simibubi.create.modules.schematics.packet.SchematicPlacePacket;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.entity.player.ClientPlayerEntity;
|
import net.minecraft.client.entity.player.ClientPlayerEntity;
|
||||||
|
@ -189,7 +190,7 @@ public class BlueprintHandler {
|
||||||
public static void onClick(MouseInputEvent event) {
|
public static void onClick(MouseInputEvent event) {
|
||||||
if (Minecraft.getInstance().currentScreen != null)
|
if (Minecraft.getInstance().currentScreen != null)
|
||||||
return;
|
return;
|
||||||
if (event.getAction() != Keyboard.PRESS)
|
if (event.getAction() != KeyboardHelper.PRESS)
|
||||||
return;
|
return;
|
||||||
if (event.getButton() != 1)
|
if (event.getButton() != 1)
|
||||||
return;
|
return;
|
||||||
|
@ -210,7 +211,7 @@ public class BlueprintHandler {
|
||||||
if (!instance.active)
|
if (!instance.active)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
boolean released = event.getAction() == Keyboard.RELEASE;
|
boolean released = event.getAction() == KeyboardHelper.RELEASE;
|
||||||
|
|
||||||
ToolSelectionScreen toolSelection = instance.selectionScreen;
|
ToolSelectionScreen toolSelection = instance.selectionScreen;
|
||||||
if (released && toolSelection.focused) {
|
if (released && toolSelection.focused) {
|
||||||
|
@ -241,7 +242,7 @@ public class BlueprintHandler {
|
||||||
selectionScreen.cycle((int) delta);
|
selectionScreen.cycle((int) delta);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (Keyboard.isKeyDown(GLFW.GLFW_KEY_LEFT_CONTROL)) {
|
if (KeyboardHelper.isKeyDown(GLFW.GLFW_KEY_LEFT_CONTROL)) {
|
||||||
return currentTool.getTool().handleMouseWheel(delta);
|
return currentTool.getTool().handleMouseWheel(delta);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.simibubi.create.gui;
|
package com.simibubi.create.modules.schematics.client;
|
||||||
|
|
||||||
import com.mojang.blaze3d.platform.GlStateManager;
|
import com.mojang.blaze3d.platform.GlStateManager;
|
||||||
|
import com.simibubi.create.foundation.gui.ScreenResources;
|
||||||
|
|
||||||
import net.minecraft.client.MainWindow;
|
import net.minecraft.client.MainWindow;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.schematic;
|
package com.simibubi.create.modules.schematics.client;
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
@ -9,6 +9,8 @@ import java.util.List;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import com.mojang.blaze3d.platform.GlStateManager;
|
import com.mojang.blaze3d.platform.GlStateManager;
|
||||||
|
import com.simibubi.create.foundation.type.Cuboid;
|
||||||
|
import com.simibubi.create.modules.schematics.SchematicWorld;
|
||||||
|
|
||||||
import net.minecraft.block.BedBlock;
|
import net.minecraft.block.BedBlock;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
|
@ -1,9 +1,9 @@
|
||||||
package com.simibubi.create.schematic.tools;
|
package com.simibubi.create.modules.schematics.client.tools;
|
||||||
|
|
||||||
import org.lwjgl.glfw.GLFW;
|
import org.lwjgl.glfw.GLFW;
|
||||||
|
|
||||||
import com.mojang.blaze3d.platform.GlStateManager;
|
import com.mojang.blaze3d.platform.GlStateManager;
|
||||||
import com.simibubi.create.utility.Keyboard;
|
import com.simibubi.create.foundation.utility.KeyboardHelper;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.WorldRenderer;
|
import net.minecraft.client.renderer.WorldRenderer;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
@ -24,7 +24,7 @@ public class DeployTool extends PlacementToolBase {
|
||||||
selectionRange = (int) blueprint.size.manhattanDistance(BlockPos.ZERO) / 2;
|
selectionRange = (int) blueprint.size.manhattanDistance(BlockPos.ZERO) / 2;
|
||||||
selectionRange = MathHelper.clamp(selectionRange, 1, 100);
|
selectionRange = MathHelper.clamp(selectionRange, 1, 100);
|
||||||
}
|
}
|
||||||
selectIgnoreBlocks = Keyboard.isKeyDown(GLFW.GLFW_KEY_LEFT_CONTROL);
|
selectIgnoreBlocks = KeyboardHelper.isKeyDown(GLFW.GLFW_KEY_LEFT_CONTROL);
|
||||||
|
|
||||||
super.updateSelection();
|
super.updateSelection();
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.schematic.tools;
|
package com.simibubi.create.modules.schematics.client.tools;
|
||||||
|
|
||||||
public class FlipTool extends PlacementToolBase {
|
public class FlipTool extends PlacementToolBase {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.schematic.tools;
|
package com.simibubi.create.modules.schematics.client.tools;
|
||||||
|
|
||||||
public interface ISchematicTool {
|
public interface ISchematicTool {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.schematic.tools;
|
package com.simibubi.create.modules.schematics.client.tools;
|
||||||
|
|
||||||
public class MoveTool extends PlacementToolBase {
|
public class MoveTool extends PlacementToolBase {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.schematic.tools;
|
package com.simibubi.create.modules.schematics.client.tools;
|
||||||
|
|
||||||
public class MoveVerticalTool extends PlacementToolBase {
|
public class MoveVerticalTool extends PlacementToolBase {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.schematic.tools;
|
package com.simibubi.create.modules.schematics.client.tools;
|
||||||
|
|
||||||
public class PlaceTool extends SchematicToolBase {
|
public class PlaceTool extends SchematicToolBase {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.schematic.tools;
|
package com.simibubi.create.modules.schematics.client.tools;
|
||||||
|
|
||||||
public abstract class PlacementToolBase extends SchematicToolBase {
|
public abstract class PlacementToolBase extends SchematicToolBase {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.schematic.tools;
|
package com.simibubi.create.modules.schematics.client.tools;
|
||||||
|
|
||||||
import net.minecraft.util.Rotation;
|
import net.minecraft.util.Rotation;
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
package com.simibubi.create.schematic.tools;
|
package com.simibubi.create.modules.schematics.client.tools;
|
||||||
|
|
||||||
import org.lwjgl.glfw.GLFW;
|
import org.lwjgl.glfw.GLFW;
|
||||||
|
|
||||||
import com.mojang.blaze3d.platform.GlStateManager;
|
import com.mojang.blaze3d.platform.GlStateManager;
|
||||||
import com.simibubi.create.schematic.BlueprintHandler;
|
import com.simibubi.create.foundation.utility.KeyboardHelper;
|
||||||
import com.simibubi.create.utility.Keyboard;
|
import com.simibubi.create.foundation.utility.RaycastHelper;
|
||||||
import com.simibubi.create.utility.RaycastHelper;
|
import com.simibubi.create.foundation.utility.RaycastHelper.PredicateTraceResult;
|
||||||
import com.simibubi.create.utility.RaycastHelper.PredicateTraceResult;
|
import com.simibubi.create.modules.schematics.client.BlueprintHandler;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.entity.player.ClientPlayerEntity;
|
import net.minecraft.client.entity.player.ClientPlayerEntity;
|
||||||
|
@ -97,7 +97,7 @@ public abstract class SchematicToolBase implements ISchematicTool {
|
||||||
WorldRenderer.drawBoundingBox(min.getX() - 1 / 8d, min.getY() + 1 / 16d, min.getZ() - 1 / 8d,
|
WorldRenderer.drawBoundingBox(min.getX() - 1 / 8d, min.getY() + 1 / 16d, min.getZ() - 1 / 8d,
|
||||||
max.getX() + 1 / 8d, max.getY() + 1 / 8d, max.getZ() + 1 / 8d, 1, 1, 1, 1);
|
max.getX() + 1 / 8d, max.getY() + 1 / 8d, max.getZ() + 1 / 8d, 1, 1, 1, 1);
|
||||||
|
|
||||||
if (schematicSelected && renderSelectedFace && Keyboard.isKeyDown(GLFW.GLFW_KEY_LEFT_CONTROL)) {
|
if (schematicSelected && renderSelectedFace && KeyboardHelper.isKeyDown(GLFW.GLFW_KEY_LEFT_CONTROL)) {
|
||||||
Vec3d vec = new Vec3d(selectedFace.getDirectionVec());
|
Vec3d vec = new Vec3d(selectedFace.getDirectionVec());
|
||||||
Vec3d center = new Vec3d(min.add(max)).scale(1 / 2f);
|
Vec3d center = new Vec3d(min.add(max)).scale(1 / 2f);
|
||||||
Vec3d radii = new Vec3d(max.subtract(min)).scale(1 / 2f);
|
Vec3d radii = new Vec3d(max.subtract(min)).scale(1 / 2f);
|
|
@ -1,11 +1,11 @@
|
||||||
package com.simibubi.create.schematic.tools;
|
package com.simibubi.create.modules.schematics.client.tools;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.simibubi.create.gui.ScreenResources;
|
import com.simibubi.create.foundation.gui.ScreenResources;
|
||||||
|
|
||||||
import net.minecraft.util.text.TextFormatting;
|
import net.minecraft.util.text.TextFormatting;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package com.simibubi.create.item;
|
package com.simibubi.create.modules.schematics.item;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.simibubi.create.utility.Keyboard;
|
import com.simibubi.create.foundation.utility.KeyboardHelper;
|
||||||
|
|
||||||
import net.minecraft.client.util.ITooltipFlag;
|
import net.minecraft.client.util.ITooltipFlag;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
@ -20,7 +20,7 @@ public class BlueprintAndQuillItem extends Item {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack stack, World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) {
|
public void addInformation(ItemStack stack, World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) {
|
||||||
if (Keyboard.isKeyDown(Keyboard.LSHIFT)) {
|
if (KeyboardHelper.isKeyDown(KeyboardHelper.LSHIFT)) {
|
||||||
TextFormatting gray = TextFormatting.GRAY;
|
TextFormatting gray = TextFormatting.GRAY;
|
||||||
TextFormatting blue = TextFormatting.BLUE;
|
TextFormatting blue = TextFormatting.BLUE;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.item;
|
package com.simibubi.create.modules.schematics.item;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
@ -10,9 +10,9 @@ import java.util.List;
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
|
|
||||||
import com.simibubi.create.AllItems;
|
import com.simibubi.create.AllItems;
|
||||||
import com.simibubi.create.gui.BlueprintEditScreen;
|
import com.simibubi.create.foundation.gui.ScreenOpener;
|
||||||
import com.simibubi.create.gui.ScreenOpener;
|
import com.simibubi.create.foundation.utility.KeyboardHelper;
|
||||||
import com.simibubi.create.utility.Keyboard;
|
import com.simibubi.create.modules.schematics.client.BlueprintEditScreen;
|
||||||
|
|
||||||
import net.minecraft.client.util.ITooltipFlag;
|
import net.minecraft.client.util.ITooltipFlag;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
@ -67,7 +67,7 @@ public class BlueprintItem extends Item {
|
||||||
@Override
|
@Override
|
||||||
@OnlyIn(value = Dist.CLIENT)
|
@OnlyIn(value = Dist.CLIENT)
|
||||||
public void addInformation(ItemStack stack, World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) {
|
public void addInformation(ItemStack stack, World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) {
|
||||||
if (Keyboard.isKeyDown(Keyboard.LSHIFT)) {
|
if (KeyboardHelper.isKeyDown(KeyboardHelper.LSHIFT)) {
|
||||||
TextFormatting gray = TextFormatting.GRAY;
|
TextFormatting gray = TextFormatting.GRAY;
|
||||||
tooltip.add(new StringTextComponent(gray + "Holds a structure to be printed"));
|
tooltip.add(new StringTextComponent(gray + "Holds a structure to be printed"));
|
||||||
tooltip.add(new StringTextComponent(gray + "by the Schematicannon."));
|
tooltip.add(new StringTextComponent(gray + "by the Schematicannon."));
|
|
@ -1,9 +1,9 @@
|
||||||
package com.simibubi.create.networking;
|
package com.simibubi.create.modules.schematics.packet;
|
||||||
|
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
import com.simibubi.create.block.SchematicannonTileEntity;
|
import com.simibubi.create.modules.schematics.block.SchematicannonTileEntity;
|
||||||
import com.simibubi.create.block.SchematicannonTileEntity.State;
|
import com.simibubi.create.modules.schematics.block.SchematicannonTileEntity.State;
|
||||||
|
|
||||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||||
import net.minecraft.network.PacketBuffer;
|
import net.minecraft.network.PacketBuffer;
|
|
@ -1,8 +1,8 @@
|
||||||
package com.simibubi.create.networking;
|
package com.simibubi.create.modules.schematics.packet;
|
||||||
|
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
import com.simibubi.create.item.BlueprintItem;
|
import com.simibubi.create.modules.schematics.item.BlueprintItem;
|
||||||
|
|
||||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
|
@ -1,14 +1,14 @@
|
||||||
package com.simibubi.create.networking;
|
package com.simibubi.create.modules.schematics.packet;
|
||||||
|
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
import com.simibubi.create.Create;
|
import com.simibubi.create.Create;
|
||||||
import com.simibubi.create.block.SchematicTableContainer;
|
import com.simibubi.create.foundation.type.DimensionPos;
|
||||||
|
import com.simibubi.create.modules.schematics.block.SchematicTableContainer;
|
||||||
|
|
||||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||||
import net.minecraft.network.PacketBuffer;
|
import net.minecraft.network.PacketBuffer;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.ServerWorld;
|
|
||||||
import net.minecraftforge.fml.network.NetworkEvent.Context;
|
import net.minecraftforge.fml.network.NetworkEvent.Context;
|
||||||
|
|
||||||
public class SchematicUploadPacket {
|
public class SchematicUploadPacket {
|
||||||
|
@ -79,14 +79,4 @@ public class SchematicUploadPacket {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class DimensionPos {
|
|
||||||
public ServerWorld world;
|
|
||||||
public BlockPos pos;
|
|
||||||
|
|
||||||
public DimensionPos(ServerPlayerEntity player, BlockPos pos) {
|
|
||||||
this.world = player.getServerWorld();
|
|
||||||
this.pos = pos;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,11 +1,9 @@
|
||||||
package com.simibubi.create.networking;
|
package com.simibubi.create.modules.symmetry;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
import com.simibubi.create.item.SymmetryHandler;
|
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.network.PacketBuffer;
|
import net.minecraft.network.PacketBuffer;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.item;
|
package com.simibubi.create.modules.symmetry;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
@ -6,9 +6,9 @@ import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import com.mojang.blaze3d.platform.GlStateManager;
|
import com.mojang.blaze3d.platform.GlStateManager;
|
||||||
import com.simibubi.create.AllItems;
|
import com.simibubi.create.AllItems;
|
||||||
import com.simibubi.create.item.symmetry.SymmetryElement;
|
import com.simibubi.create.foundation.utility.TessellatorHelper;
|
||||||
import com.simibubi.create.item.symmetry.SymmetryEmptySlot;
|
import com.simibubi.create.modules.symmetry.mirror.EmptyMirror;
|
||||||
import com.simibubi.create.utility.TessellatorHelper;
|
import com.simibubi.create.modules.symmetry.mirror.SymmetryMirror;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.entity.player.ClientPlayerEntity;
|
import net.minecraft.client.entity.player.ClientPlayerEntity;
|
||||||
|
@ -83,8 +83,8 @@ public class SymmetryHandler {
|
||||||
ItemStack stackInSlot = player.inventory.getStackInSlot(i);
|
ItemStack stackInSlot = player.inventory.getStackInSlot(i);
|
||||||
if (stackInSlot != null && AllItems.SYMMETRY_WAND.typeOf(stackInSlot)
|
if (stackInSlot != null && AllItems.SYMMETRY_WAND.typeOf(stackInSlot)
|
||||||
&& SymmetryWandItem.isEnabled(stackInSlot)) {
|
&& SymmetryWandItem.isEnabled(stackInSlot)) {
|
||||||
SymmetryElement mirror = SymmetryWandItem.getMirror(stackInSlot);
|
SymmetryMirror mirror = SymmetryWandItem.getMirror(stackInSlot);
|
||||||
if (mirror instanceof SymmetryEmptySlot)
|
if (mirror instanceof EmptyMirror)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
TessellatorHelper.prepareForDrawing();
|
TessellatorHelper.prepareForDrawing();
|
||||||
|
@ -130,8 +130,8 @@ public class SymmetryHandler {
|
||||||
if (stackInSlot != null && AllItems.SYMMETRY_WAND.typeOf(stackInSlot)
|
if (stackInSlot != null && AllItems.SYMMETRY_WAND.typeOf(stackInSlot)
|
||||||
&& SymmetryWandItem.isEnabled(stackInSlot)) {
|
&& SymmetryWandItem.isEnabled(stackInSlot)) {
|
||||||
|
|
||||||
SymmetryElement mirror = SymmetryWandItem.getMirror(stackInSlot);
|
SymmetryMirror mirror = SymmetryWandItem.getMirror(stackInSlot);
|
||||||
if (mirror instanceof SymmetryEmptySlot)
|
if (mirror instanceof EmptyMirror)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Random r = new Random();
|
Random r = new Random();
|
|
@ -1,19 +1,17 @@
|
||||||
package com.simibubi.create.item;
|
package com.simibubi.create.modules.symmetry;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.simibubi.create.gui.ScreenOpener;
|
import com.simibubi.create.AllPackets;
|
||||||
import com.simibubi.create.gui.SymmetryWandScreen;
|
import com.simibubi.create.foundation.gui.ScreenOpener;
|
||||||
import com.simibubi.create.item.symmetry.SymmetryCrossPlane;
|
import com.simibubi.create.foundation.utility.KeyboardHelper;
|
||||||
import com.simibubi.create.item.symmetry.SymmetryElement;
|
import com.simibubi.create.modules.symmetry.mirror.CrossPlaneMirror;
|
||||||
import com.simibubi.create.item.symmetry.SymmetryEmptySlot;
|
import com.simibubi.create.modules.symmetry.mirror.EmptyMirror;
|
||||||
import com.simibubi.create.item.symmetry.SymmetryPlane;
|
import com.simibubi.create.modules.symmetry.mirror.PlaneMirror;
|
||||||
import com.simibubi.create.networking.SymmetryEffectPacket;
|
import com.simibubi.create.modules.symmetry.mirror.SymmetryMirror;
|
||||||
import com.simibubi.create.utility.Keyboard;
|
|
||||||
import com.simibubi.create.networking.AllPackets;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
|
@ -55,7 +53,7 @@ public class SymmetryWandItem extends Item {
|
||||||
@Override
|
@Override
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public void addInformation(ItemStack stack, World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) {
|
public void addInformation(ItemStack stack, World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) {
|
||||||
if (Keyboard.isKeyDown(Keyboard.LSHIFT)) {
|
if (KeyboardHelper.isKeyDown(KeyboardHelper.LSHIFT)) {
|
||||||
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "Perfectly mirrors your Block placement"));
|
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "Perfectly mirrors your Block placement"));
|
||||||
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "across the configured planes."));
|
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "across the configured planes."));
|
||||||
tooltip.add(new StringTextComponent(""));
|
tooltip.add(new StringTextComponent(""));
|
||||||
|
@ -83,23 +81,23 @@ public class SymmetryWandItem extends Item {
|
||||||
checkNBT(wand);
|
checkNBT(wand);
|
||||||
CompoundNBT compound = wand.getTag().getCompound($SYMMETRY);
|
CompoundNBT compound = wand.getTag().getCompound($SYMMETRY);
|
||||||
pos = pos.offset(context.getFace());
|
pos = pos.offset(context.getFace());
|
||||||
SymmetryElement previousElement = SymmetryElement.fromNBT(compound);
|
SymmetryMirror previousElement = SymmetryMirror.fromNBT(compound);
|
||||||
|
|
||||||
if (player.isSneaking()) {
|
if (player.isSneaking()) {
|
||||||
if (!(previousElement instanceof SymmetryEmptySlot))
|
if (!(previousElement instanceof EmptyMirror))
|
||||||
wand.getTag().putBoolean($ENABLE, !isEnabled(wand));
|
wand.getTag().putBoolean($ENABLE, !isEnabled(wand));
|
||||||
return ActionResultType.SUCCESS;
|
return ActionResultType.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
wand.getTag().putBoolean($ENABLE, true);
|
wand.getTag().putBoolean($ENABLE, true);
|
||||||
Vec3d pos3d = new Vec3d(pos.getX(), pos.getY(), pos.getZ());
|
Vec3d pos3d = new Vec3d(pos.getX(), pos.getY(), pos.getZ());
|
||||||
SymmetryElement newElement = new SymmetryPlane(pos3d);
|
SymmetryMirror newElement = new PlaneMirror(pos3d);
|
||||||
|
|
||||||
if (previousElement instanceof SymmetryEmptySlot) {
|
if (previousElement instanceof EmptyMirror) {
|
||||||
newElement.setOrientation(
|
newElement.setOrientation(
|
||||||
(player.getHorizontalFacing() == Direction.NORTH || player.getHorizontalFacing() == Direction.SOUTH)
|
(player.getHorizontalFacing() == Direction.NORTH || player.getHorizontalFacing() == Direction.SOUTH)
|
||||||
? SymmetryPlane.Align.XY.ordinal()
|
? PlaneMirror.Align.XY.ordinal()
|
||||||
: SymmetryPlane.Align.YZ.ordinal());
|
: PlaneMirror.Align.YZ.ordinal());
|
||||||
newElement.enable = true;
|
newElement.enable = true;
|
||||||
player.sendStatusMessage(new StringTextComponent(TextFormatting.GREEN + "New Plane created"), true);
|
player.sendStatusMessage(new StringTextComponent(TextFormatting.GREEN + "New Plane created"), true);
|
||||||
wand.getTag().putBoolean($ENABLE, true);
|
wand.getTag().putBoolean($ENABLE, true);
|
||||||
|
@ -107,18 +105,18 @@ public class SymmetryWandItem extends Item {
|
||||||
} else {
|
} else {
|
||||||
previousElement.setPosition(pos3d);
|
previousElement.setPosition(pos3d);
|
||||||
|
|
||||||
if (previousElement instanceof SymmetryPlane) {
|
if (previousElement instanceof PlaneMirror) {
|
||||||
previousElement.setOrientation((player.getHorizontalFacing() == Direction.NORTH
|
previousElement.setOrientation((player.getHorizontalFacing() == Direction.NORTH
|
||||||
|| player.getHorizontalFacing() == Direction.SOUTH) ? SymmetryPlane.Align.XY.ordinal()
|
|| player.getHorizontalFacing() == Direction.SOUTH) ? PlaneMirror.Align.XY.ordinal()
|
||||||
: SymmetryPlane.Align.YZ.ordinal());
|
: PlaneMirror.Align.YZ.ordinal());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (previousElement instanceof SymmetryCrossPlane) {
|
if (previousElement instanceof CrossPlaneMirror) {
|
||||||
float rotation = player.getRotationYawHead();
|
float rotation = player.getRotationYawHead();
|
||||||
float abs = Math.abs(rotation % 90);
|
float abs = Math.abs(rotation % 90);
|
||||||
boolean diagonal = abs > 22 && abs < 45 + 22;
|
boolean diagonal = abs > 22 && abs < 45 + 22;
|
||||||
previousElement.setOrientation(
|
previousElement.setOrientation(
|
||||||
diagonal ? SymmetryCrossPlane.Align.D.ordinal() : SymmetryCrossPlane.Align.Y.ordinal());
|
diagonal ? CrossPlaneMirror.Align.D.ordinal() : CrossPlaneMirror.Align.Y.ordinal());
|
||||||
}
|
}
|
||||||
|
|
||||||
newElement = previousElement;
|
newElement = previousElement;
|
||||||
|
@ -150,7 +148,7 @@ public class SymmetryWandItem extends Item {
|
||||||
private static void checkNBT(ItemStack wand) {
|
private static void checkNBT(ItemStack wand) {
|
||||||
if (!wand.hasTag() || !wand.getTag().contains($SYMMETRY)) {
|
if (!wand.hasTag() || !wand.getTag().contains($SYMMETRY)) {
|
||||||
wand.setTag(new CompoundNBT());
|
wand.setTag(new CompoundNBT());
|
||||||
wand.getTag().put($SYMMETRY, new SymmetryEmptySlot(new Vec3d(0, 0, 0)).writeToNbt());
|
wand.getTag().put($SYMMETRY, new EmptyMirror(new Vec3d(0, 0, 0)).writeToNbt());
|
||||||
wand.getTag().putBoolean($ENABLE, false);
|
wand.getTag().putBoolean($ENABLE, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -160,9 +158,9 @@ public class SymmetryWandItem extends Item {
|
||||||
return stack.getTag().getBoolean($ENABLE);
|
return stack.getTag().getBoolean($ENABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SymmetryElement getMirror(ItemStack stack) {
|
public static SymmetryMirror getMirror(ItemStack stack) {
|
||||||
checkNBT(stack);
|
checkNBT(stack);
|
||||||
return SymmetryElement.fromNBT((CompoundNBT) stack.getTag().getCompound($SYMMETRY));
|
return SymmetryMirror.fromNBT((CompoundNBT) stack.getTag().getCompound($SYMMETRY));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void apply(World world, ItemStack wand, PlayerEntity player, BlockPos pos, BlockState block) {
|
public static void apply(World world, ItemStack wand, PlayerEntity player, BlockPos pos, BlockState block) {
|
||||||
|
@ -174,7 +172,7 @@ public class SymmetryWandItem extends Item {
|
||||||
|
|
||||||
Map<BlockPos, BlockState> blockSet = new HashMap<>();
|
Map<BlockPos, BlockState> blockSet = new HashMap<>();
|
||||||
blockSet.put(pos, block);
|
blockSet.put(pos, block);
|
||||||
SymmetryElement symmetry = SymmetryElement.fromNBT((CompoundNBT) wand.getTag().getCompound($SYMMETRY));
|
SymmetryMirror symmetry = SymmetryMirror.fromNBT((CompoundNBT) wand.getTag().getCompound($SYMMETRY));
|
||||||
|
|
||||||
Vec3d mirrorPos = symmetry.getPosition();
|
Vec3d mirrorPos = symmetry.getPosition();
|
||||||
if (mirrorPos.distanceTo(new Vec3d(pos)) > 50)
|
if (mirrorPos.distanceTo(new Vec3d(pos)) > 50)
|
||||||
|
@ -222,7 +220,7 @@ public class SymmetryWandItem extends Item {
|
||||||
|
|
||||||
Map<BlockPos, BlockState> blockSet = new HashMap<>();
|
Map<BlockPos, BlockState> blockSet = new HashMap<>();
|
||||||
blockSet.put(pos, air);
|
blockSet.put(pos, air);
|
||||||
SymmetryElement symmetry = SymmetryElement.fromNBT((CompoundNBT) wand.getTag().getCompound($SYMMETRY));
|
SymmetryMirror symmetry = SymmetryMirror.fromNBT((CompoundNBT) wand.getTag().getCompound($SYMMETRY));
|
||||||
|
|
||||||
Vec3d mirrorPos = symmetry.getPosition();
|
Vec3d mirrorPos = symmetry.getPosition();
|
||||||
if (mirrorPos.distanceTo(new Vec3d(pos)) > 50)
|
if (mirrorPos.distanceTo(new Vec3d(pos)) > 50)
|
|
@ -1,19 +1,20 @@
|
||||||
package com.simibubi.create.gui;
|
package com.simibubi.create.modules.symmetry;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import com.mojang.blaze3d.platform.GlStateManager;
|
import com.mojang.blaze3d.platform.GlStateManager;
|
||||||
import com.simibubi.create.gui.widgets.Label;
|
import com.simibubi.create.AllPackets;
|
||||||
import com.simibubi.create.gui.widgets.SelectionScrollInput;
|
import com.simibubi.create.foundation.gui.AbstractSimiScreen;
|
||||||
import com.simibubi.create.gui.widgets.ScrollInput;
|
import com.simibubi.create.foundation.gui.ScreenResources;
|
||||||
import com.simibubi.create.item.SymmetryWandItem;
|
import com.simibubi.create.foundation.gui.widgets.Label;
|
||||||
import com.simibubi.create.item.symmetry.SymmetryCrossPlane;
|
import com.simibubi.create.foundation.gui.widgets.ScrollInput;
|
||||||
import com.simibubi.create.item.symmetry.SymmetryElement;
|
import com.simibubi.create.foundation.gui.widgets.SelectionScrollInput;
|
||||||
import com.simibubi.create.item.symmetry.SymmetryEmptySlot;
|
import com.simibubi.create.foundation.packet.NbtPacket;
|
||||||
import com.simibubi.create.item.symmetry.SymmetryPlane;
|
import com.simibubi.create.modules.symmetry.mirror.CrossPlaneMirror;
|
||||||
import com.simibubi.create.item.symmetry.SymmetryTriplePlane;
|
import com.simibubi.create.modules.symmetry.mirror.EmptyMirror;
|
||||||
import com.simibubi.create.networking.NbtPacket;
|
import com.simibubi.create.modules.symmetry.mirror.PlaneMirror;
|
||||||
import com.simibubi.create.networking.AllPackets;
|
import com.simibubi.create.modules.symmetry.mirror.SymmetryMirror;
|
||||||
|
import com.simibubi.create.modules.symmetry.mirror.TriplePlaneMirror;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.BufferBuilder;
|
import net.minecraft.client.renderer.BufferBuilder;
|
||||||
import net.minecraft.client.renderer.RenderHelper;
|
import net.minecraft.client.renderer.RenderHelper;
|
||||||
|
@ -35,7 +36,7 @@ public class SymmetryWandScreen extends AbstractSimiScreen {
|
||||||
private ScrollInput areaAlign;
|
private ScrollInput areaAlign;
|
||||||
private Label labelAlign;
|
private Label labelAlign;
|
||||||
|
|
||||||
private SymmetryElement currentElement;
|
private SymmetryMirror currentElement;
|
||||||
private float animationProgress;
|
private float animationProgress;
|
||||||
private ItemStack wand;
|
private ItemStack wand;
|
||||||
|
|
||||||
|
@ -43,8 +44,8 @@ public class SymmetryWandScreen extends AbstractSimiScreen {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
currentElement = SymmetryWandItem.getMirror(wand);
|
currentElement = SymmetryWandItem.getMirror(wand);
|
||||||
if (currentElement instanceof SymmetryEmptySlot) {
|
if (currentElement instanceof EmptyMirror) {
|
||||||
currentElement = new SymmetryPlane(Vec3d.ZERO);
|
currentElement = new PlaneMirror(Vec3d.ZERO);
|
||||||
}
|
}
|
||||||
this.wand = wand;
|
this.wand = wand;
|
||||||
animationProgress = 0;
|
animationProgress = 0;
|
||||||
|
@ -58,22 +59,22 @@ public class SymmetryWandScreen extends AbstractSimiScreen {
|
||||||
labelType = new Label(topLeftX + 122, topLeftY + 15, "").colored(0xFFFFFFFF).withShadow();
|
labelType = new Label(topLeftX + 122, topLeftY + 15, "").colored(0xFFFFFFFF).withShadow();
|
||||||
labelAlign = new Label(topLeftX + 122, topLeftY + 35, "").colored(0xFFFFFFFF).withShadow();
|
labelAlign = new Label(topLeftX + 122, topLeftY + 35, "").colored(0xFFFFFFFF).withShadow();
|
||||||
|
|
||||||
int state = currentElement instanceof SymmetryTriplePlane ? 2
|
int state = currentElement instanceof TriplePlaneMirror ? 2
|
||||||
: currentElement instanceof SymmetryCrossPlane ? 1 : 0;
|
: currentElement instanceof CrossPlaneMirror ? 1 : 0;
|
||||||
areaType = new SelectionScrollInput(topLeftX + 119, topLeftY + 12, 70, 14)
|
areaType = new SelectionScrollInput(topLeftX + 119, topLeftY + 12, 70, 14)
|
||||||
.forOptions(SymmetryElement.TOOLTIP_ELEMENTS).titled("Type of Mirror").writingTo(labelType)
|
.forOptions(SymmetryMirror.TOOLTIP_ELEMENTS).titled("Type of Mirror").writingTo(labelType)
|
||||||
.setState(state);
|
.setState(state);
|
||||||
|
|
||||||
areaType.calling(position -> {
|
areaType.calling(position -> {
|
||||||
switch (position) {
|
switch (position) {
|
||||||
case 0:
|
case 0:
|
||||||
currentElement = new SymmetryPlane(currentElement.getPosition());
|
currentElement = new PlaneMirror(currentElement.getPosition());
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
currentElement = new SymmetryCrossPlane(currentElement.getPosition());
|
currentElement = new CrossPlaneMirror(currentElement.getPosition());
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
currentElement = new SymmetryTriplePlane(currentElement.getPosition());
|
currentElement = new TriplePlaneMirror(currentElement.getPosition());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -91,7 +92,7 @@ public class SymmetryWandScreen extends AbstractSimiScreen {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initAlign(SymmetryElement element) {
|
private void initAlign(SymmetryMirror element) {
|
||||||
if (areaAlign != null) {
|
if (areaAlign != null) {
|
||||||
widgets.remove(areaAlign);
|
widgets.remove(areaAlign);
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
package com.simibubi.create.block.symmetry;
|
package com.simibubi.create.modules.symmetry.block;
|
||||||
|
|
||||||
import com.simibubi.create.item.symmetry.SymmetryCrossPlane;
|
import com.simibubi.create.modules.symmetry.mirror.CrossPlaneMirror;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
|
@ -10,12 +10,12 @@ import net.minecraft.state.StateContainer.Builder;
|
||||||
|
|
||||||
public class CrossPlaneSymmetryBlock extends SymmetryBlock {
|
public class CrossPlaneSymmetryBlock extends SymmetryBlock {
|
||||||
|
|
||||||
public static final EnumProperty<SymmetryCrossPlane.Align> align = EnumProperty.create("align",
|
public static final EnumProperty<CrossPlaneMirror.Align> align = EnumProperty.create("align",
|
||||||
SymmetryCrossPlane.Align.class);
|
CrossPlaneMirror.Align.class);
|
||||||
|
|
||||||
public CrossPlaneSymmetryBlock() {
|
public CrossPlaneSymmetryBlock() {
|
||||||
super(Properties.create(Material.AIR));
|
super(Properties.create(Material.AIR));
|
||||||
this.setDefaultState(getDefaultState().with(align, SymmetryCrossPlane.Align.Y));
|
this.setDefaultState(getDefaultState().with(align, CrossPlaneMirror.Align.Y));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
|
@ -1,6 +1,6 @@
|
||||||
package com.simibubi.create.block.symmetry;
|
package com.simibubi.create.modules.symmetry.block;
|
||||||
|
|
||||||
import com.simibubi.create.item.symmetry.SymmetryPlane;
|
import com.simibubi.create.modules.symmetry.mirror.PlaneMirror;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
|
@ -10,11 +10,11 @@ import net.minecraft.state.StateContainer.Builder;
|
||||||
|
|
||||||
public class PlaneSymmetryBlock extends SymmetryBlock {
|
public class PlaneSymmetryBlock extends SymmetryBlock {
|
||||||
|
|
||||||
public static final EnumProperty<SymmetryPlane.Align> align = EnumProperty.create("align", SymmetryPlane.Align.class);
|
public static final EnumProperty<PlaneMirror.Align> align = EnumProperty.create("align", PlaneMirror.Align.class);
|
||||||
|
|
||||||
public PlaneSymmetryBlock() {
|
public PlaneSymmetryBlock() {
|
||||||
super(Properties.create(Material.AIR));
|
super(Properties.create(Material.AIR));
|
||||||
this.setDefaultState(getDefaultState().with(align, SymmetryPlane.Align.XY));
|
this.setDefaultState(getDefaultState().with(align, PlaneMirror.Align.XY));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.simibubi.create.modules.symmetry.block;
|
||||||
|
|
||||||
|
import com.simibubi.create.foundation.block.IRenderUtilityBlock;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
|
||||||
|
public class SymmetryBlock extends Block implements IRenderUtilityBlock {
|
||||||
|
|
||||||
|
public SymmetryBlock(Properties properties) {
|
||||||
|
super(properties);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.block.symmetry;
|
package com.simibubi.create.modules.symmetry.block;
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.item.symmetry;
|
package com.simibubi.create.modules.symmetry.mirror;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -6,14 +6,14 @@ import java.util.Map;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.block.symmetry.CrossPlaneSymmetryBlock;
|
import com.simibubi.create.modules.symmetry.block.CrossPlaneSymmetryBlock;
|
||||||
|
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.util.IStringSerializable;
|
import net.minecraft.util.IStringSerializable;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
public class SymmetryCrossPlane extends SymmetryElement {
|
public class CrossPlaneMirror extends SymmetryMirror {
|
||||||
|
|
||||||
public static enum Align implements IStringSerializable {
|
public static enum Align implements IStringSerializable {
|
||||||
Y("y"), D("d");
|
Y("y"), D("d");
|
||||||
|
@ -35,7 +35,7 @@ public class SymmetryCrossPlane extends SymmetryElement {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public SymmetryCrossPlane(Vec3d pos) {
|
public CrossPlaneMirror(Vec3d pos) {
|
||||||
super(pos);
|
super(pos);
|
||||||
orientation = Align.Y;
|
orientation = Align.Y;
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.item.symmetry;
|
package com.simibubi.create.modules.symmetry.mirror;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -11,7 +11,7 @@ import net.minecraft.util.IStringSerializable;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
public class SymmetryEmptySlot extends SymmetryElement {
|
public class EmptyMirror extends SymmetryMirror {
|
||||||
|
|
||||||
public static enum Align implements IStringSerializable {
|
public static enum Align implements IStringSerializable {
|
||||||
None("none");
|
None("none");
|
||||||
|
@ -22,7 +22,7 @@ public class SymmetryEmptySlot extends SymmetryElement {
|
||||||
@Override public String toString() { return name; }
|
@Override public String toString() { return name; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public SymmetryEmptySlot(Vec3d pos) {
|
public EmptyMirror(Vec3d pos) {
|
||||||
super(pos);
|
super(pos);
|
||||||
orientation = Align.None;
|
orientation = Align.None;
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.item.symmetry;
|
package com.simibubi.create.modules.symmetry.mirror;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -6,14 +6,14 @@ import java.util.Map;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.block.symmetry.PlaneSymmetryBlock;
|
import com.simibubi.create.modules.symmetry.block.PlaneSymmetryBlock;
|
||||||
|
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.util.IStringSerializable;
|
import net.minecraft.util.IStringSerializable;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
public class SymmetryPlane extends SymmetryElement {
|
public class PlaneMirror extends SymmetryMirror {
|
||||||
|
|
||||||
public static enum Align implements IStringSerializable {
|
public static enum Align implements IStringSerializable {
|
||||||
XY("xy"), YZ("yz");
|
XY("xy"), YZ("yz");
|
||||||
|
@ -35,7 +35,7 @@ public class SymmetryPlane extends SymmetryElement {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public SymmetryPlane(Vec3d pos) {
|
public PlaneMirror(Vec3d pos) {
|
||||||
super(pos);
|
super(pos);
|
||||||
orientation = Align.XY;
|
orientation = Align.XY;
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.item.symmetry;
|
package com.simibubi.create.modules.symmetry.mirror;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -20,7 +20,7 @@ import net.minecraft.util.Mirror;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
public abstract class SymmetryElement {
|
public abstract class SymmetryMirror {
|
||||||
|
|
||||||
public static final String EMPTY = "empty";
|
public static final String EMPTY = "empty";
|
||||||
public static final String PLANE = "plane";
|
public static final String PLANE = "plane";
|
||||||
|
@ -34,7 +34,7 @@ public abstract class SymmetryElement {
|
||||||
protected int orientationIndex;
|
protected int orientationIndex;
|
||||||
public boolean enable;
|
public boolean enable;
|
||||||
|
|
||||||
public SymmetryElement(Vec3d pos) {
|
public SymmetryMirror(Vec3d pos) {
|
||||||
position = pos;
|
position = pos;
|
||||||
enable = true;
|
enable = true;
|
||||||
orientationIndex = 0;
|
orientationIndex = 0;
|
||||||
|
@ -95,23 +95,23 @@ public abstract class SymmetryElement {
|
||||||
return nbt;
|
return nbt;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SymmetryElement fromNBT(CompoundNBT nbt) {
|
public static SymmetryMirror fromNBT(CompoundNBT nbt) {
|
||||||
ListNBT floatList = nbt.getList($POSITION, 5);
|
ListNBT floatList = nbt.getList($POSITION, 5);
|
||||||
Vec3d pos = new Vec3d(floatList.getFloat(0), floatList.getFloat(1), floatList.getFloat(2));
|
Vec3d pos = new Vec3d(floatList.getFloat(0), floatList.getFloat(1), floatList.getFloat(2));
|
||||||
SymmetryElement element;
|
SymmetryMirror element;
|
||||||
|
|
||||||
switch (nbt.getString($TYPE)) {
|
switch (nbt.getString($TYPE)) {
|
||||||
case PLANE:
|
case PLANE:
|
||||||
element = new SymmetryPlane(pos);
|
element = new PlaneMirror(pos);
|
||||||
break;
|
break;
|
||||||
case CROSS_PLANE:
|
case CROSS_PLANE:
|
||||||
element = new SymmetryCrossPlane(pos);
|
element = new CrossPlaneMirror(pos);
|
||||||
break;
|
break;
|
||||||
case TRIPLE_PLANE:
|
case TRIPLE_PLANE:
|
||||||
element = new SymmetryTriplePlane(pos);
|
element = new TriplePlaneMirror(pos);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
element = new SymmetryEmptySlot(pos);
|
element = new EmptyMirror(pos);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.item.symmetry;
|
package com.simibubi.create.modules.symmetry.mirror;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -12,9 +12,9 @@ import net.minecraft.util.IStringSerializable;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
public class SymmetryTriplePlane extends SymmetryElement {
|
public class TriplePlaneMirror extends SymmetryMirror {
|
||||||
|
|
||||||
public SymmetryTriplePlane(Vec3d pos) {
|
public TriplePlaneMirror(Vec3d pos) {
|
||||||
super(pos);
|
super(pos);
|
||||||
orientationIndex = 0;
|
orientationIndex = 0;
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ public class SymmetryTriplePlane extends SymmetryElement {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IStringSerializable getOrientation() {
|
public IStringSerializable getOrientation() {
|
||||||
return SymmetryCrossPlane.Align.Y;
|
return CrossPlaneMirror.Align.Y;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
|
@ -1,5 +0,0 @@
|
||||||
package com.simibubi.create.utility;
|
|
||||||
|
|
||||||
public interface IJustForRendering {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,29 +0,0 @@
|
||||||
package com.simibubi.create.utility;
|
|
||||||
|
|
||||||
import com.simibubi.create.Create;
|
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
|
|
||||||
public enum TessellatorTextures {
|
|
||||||
|
|
||||||
Room("inner.png"),
|
|
||||||
RoomTransparent("inner_transparent.png"),
|
|
||||||
SelectedRoom("inner_selected.png"),
|
|
||||||
SuperSelectedRoom("inner_super_selected.png"),
|
|
||||||
Selection("select.png"),
|
|
||||||
Exporter("exporter.png"),
|
|
||||||
Trim("trim.png");
|
|
||||||
|
|
||||||
private ResourceLocation location;
|
|
||||||
|
|
||||||
private TessellatorTextures(String filename) {
|
|
||||||
location = new ResourceLocation(Create.ID,
|
|
||||||
"textures/block/marker/" + filename);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void bind() {
|
|
||||||
Minecraft.getInstance().getTextureManager().bindTexture(location);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Before Width: | Height: | Size: 258 B |
Before Width: | Height: | Size: 391 B |
Before Width: | Height: | Size: 177 B |
Before Width: | Height: | Size: 249 B |
Before Width: | Height: | Size: 183 B |
Before Width: | Height: | Size: 331 B |
Before Width: | Height: | Size: 243 B |
Before Width: | Height: | Size: 215 B |
Before Width: | Height: | Size: 221 B After Width: | Height: | Size: 221 B |