From d5ec1d6fef4fb70faa02e60b393fceb2e50fe911 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Sat, 16 May 2020 00:13:49 +0200 Subject: [PATCH] Ported Schematic and Quill handler - Updated outlines rendered by the schematic and quill - Removed some now auto-generated leftovers from the asset folder - Fixed Schematic Table screen not rendering the table properly --- .../utility/outliner/AABBOutline.java | 32 ++--- .../utility/outliner/ChasingAABBOutline.java | 6 +- .../foundation/utility/outliner/Outline.java | 33 +++-- .../foundation/utility/outliner/Outliner.java | 52 ++++---- .../contraptions/ChassisRangeDisplay.java | 7 +- .../modules/palettes/AllPaletteBlocks.java | 1 + .../block/SchematicTableScreen.java | 44 ++----- .../client/SchematicAndQuillHandler.java | 115 ++++++++---------- .../schematics/client/SchematicHandler.java | 11 +- .../client/tools/SchematicToolBase.java | 10 +- .../create/blockstates/brass_block.json | 5 - .../create/blockstates/copper_block.json | 12 -- .../assets/create/blockstates/copper_ore.json | 12 -- .../create/blockstates/copper_shingles.json | 12 -- .../assets/create/blockstates/zinc_block.json | 5 - .../assets/create/blockstates/zinc_ore.json | 5 - .../create/models/item/brass_block.json | 3 - .../create/models/item/copper_block.json | 3 - .../assets/create/models/item/copper_ore.json | 3 - .../create/models/item/copper_shingles.json | 3 - .../assets/create/models/item/gabbro.json | 3 - .../create/models/item/gabbro_bricks.json | 3 - .../models/item/gabbro_bricks_stairs.json | 3 - .../models/item/gabbro_bricks_wall.json | 6 - .../create/models/item/gabbro_layers.json | 3 - .../create/models/item/gabbro_slab.json | 3 - .../create/models/item/gabbro_stairs.json | 3 - .../create/models/item/gabbro_wall.json | 6 - .../create/models/item/tiled_glass.json | 3 - .../assets/create/models/item/zinc_block.json | 3 - .../assets/create/models/item/zinc_ore.json | 3 - 31 files changed, 132 insertions(+), 281 deletions(-) delete mode 100644 src/main/resources/assets/create/blockstates/brass_block.json delete mode 100644 src/main/resources/assets/create/blockstates/copper_block.json delete mode 100644 src/main/resources/assets/create/blockstates/copper_ore.json delete mode 100644 src/main/resources/assets/create/blockstates/copper_shingles.json delete mode 100644 src/main/resources/assets/create/blockstates/zinc_block.json delete mode 100644 src/main/resources/assets/create/blockstates/zinc_ore.json delete mode 100644 src/main/resources/assets/create/models/item/brass_block.json delete mode 100644 src/main/resources/assets/create/models/item/copper_block.json delete mode 100644 src/main/resources/assets/create/models/item/copper_ore.json delete mode 100644 src/main/resources/assets/create/models/item/copper_shingles.json delete mode 100644 src/main/resources/assets/create/models/item/gabbro.json delete mode 100644 src/main/resources/assets/create/models/item/gabbro_bricks.json delete mode 100644 src/main/resources/assets/create/models/item/gabbro_bricks_stairs.json delete mode 100644 src/main/resources/assets/create/models/item/gabbro_bricks_wall.json delete mode 100644 src/main/resources/assets/create/models/item/gabbro_layers.json delete mode 100644 src/main/resources/assets/create/models/item/gabbro_slab.json delete mode 100644 src/main/resources/assets/create/models/item/gabbro_stairs.json delete mode 100644 src/main/resources/assets/create/models/item/gabbro_wall.json delete mode 100644 src/main/resources/assets/create/models/item/tiled_glass.json delete mode 100644 src/main/resources/assets/create/models/item/zinc_block.json delete mode 100644 src/main/resources/assets/create/models/item/zinc_ore.json diff --git a/src/main/java/com/simibubi/create/foundation/utility/outliner/AABBOutline.java b/src/main/java/com/simibubi/create/foundation/utility/outliner/AABBOutline.java index 01de71d6e..37c607609 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/outliner/AABBOutline.java +++ b/src/main/java/com/simibubi/create/foundation/utility/outliner/AABBOutline.java @@ -2,8 +2,6 @@ package com.simibubi.create.foundation.utility.outliner; import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.vertex.IVertexBuilder; -import com.simibubi.create.AllSpecialTextures; -import com.simibubi.create.foundation.utility.ColorHelper; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.IRenderTypeBuffer; @@ -17,10 +15,6 @@ import net.minecraft.util.math.Vec3d; public class AABBOutline extends Outline { protected AxisAlignedBB bb; - protected AllSpecialTextures faceTexture; - protected AllSpecialTextures highlightedTexture; - protected Direction highlightedFace; - public boolean disableCull = false; public AABBOutline(AxisAlignedBB bb) { this.bb = bb; @@ -28,22 +22,10 @@ public class AABBOutline extends Outline { @Override public void render(MatrixStack ms, IRenderTypeBuffer buffer) { - Vec3d color = ColorHelper.getRGB(0xFFFFFF); - float alpha = 1f; - renderBB(ms, buffer, bb, color, alpha, !disableCull); + renderBB(ms, buffer, bb); } - public void setTextures(AllSpecialTextures faceTexture, AllSpecialTextures highlightTexture) { - this.faceTexture = faceTexture; - this.highlightedTexture = highlightTexture; - } - - public void highlightFace(Direction face) { - this.highlightedFace = face; - } - - public void renderBB(MatrixStack ms, IRenderTypeBuffer buffer, AxisAlignedBB bb, Vec3d color, float alpha, - boolean doCulling) { + public void renderBB(MatrixStack ms, IRenderTypeBuffer buffer, AxisAlignedBB bb) { Vec3d projectedView = Minecraft.getInstance().gameRenderer.getActiveRenderInfo() .getProjectedView(); boolean inside = bb.contains(projectedView); @@ -89,12 +71,12 @@ public class AABBOutline extends Outline { protected void renderFace(MatrixStack ms, IRenderTypeBuffer buffer, Direction direction, Vec3d p1, Vec3d p2, Vec3d p3, Vec3d p4, boolean noCull) { - - ResourceLocation faceTexture = this.faceTexture.getLocation(); - if (direction == highlightedFace && highlightedTexture != null) - faceTexture = highlightedTexture.getLocation(); - else if (faceTexture == null) + if (!params.faceTexture.isPresent()) return; + + ResourceLocation faceTexture = params.faceTexture.get().getLocation(); + if (direction == params.highlightedFace && params.hightlightedFaceTexture.isPresent()) + faceTexture = params.hightlightedFaceTexture.get().getLocation(); RenderType translucentType = noCull ? RenderType.getEntityTranslucent(faceTexture) : RenderType.getEntityTranslucentCull(faceTexture); diff --git a/src/main/java/com/simibubi/create/foundation/utility/outliner/ChasingAABBOutline.java b/src/main/java/com/simibubi/create/foundation/utility/outliner/ChasingAABBOutline.java index 6e84ba957..253001782 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/outliner/ChasingAABBOutline.java +++ b/src/main/java/com/simibubi/create/foundation/utility/outliner/ChasingAABBOutline.java @@ -1,13 +1,11 @@ package com.simibubi.create.foundation.utility.outliner; import com.mojang.blaze3d.matrix.MatrixStack; -import com.simibubi.create.foundation.utility.ColorHelper; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; public class ChasingAABBOutline extends AABBOutline { @@ -32,10 +30,8 @@ public class ChasingAABBOutline extends AABBOutline { @Override public void render(MatrixStack ms, IRenderTypeBuffer buffer) { - Vec3d color = ColorHelper.getRGB(0xFFFFFF); - float alpha = 1f; renderBB(ms, buffer, interpolateBBs(prevBB, bb, Minecraft.getInstance() - .getRenderPartialTicks()), color, alpha, true); + .getRenderPartialTicks())); } private static AxisAlignedBB interpolateBBs(AxisAlignedBB current, AxisAlignedBB target, float pt) { diff --git a/src/main/java/com/simibubi/create/foundation/utility/outliner/Outline.java b/src/main/java/com/simibubi/create/foundation/utility/outliner/Outline.java index 2ed154916..20a771539 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/outliner/Outline.java +++ b/src/main/java/com/simibubi/create/foundation/utility/outliner/Outline.java @@ -2,6 +2,8 @@ package com.simibubi.create.foundation.utility.outliner; import java.util.Optional; +import javax.annotation.Nullable; + import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.matrix.MatrixStack.Entry; import com.mojang.blaze3d.vertex.IVertexBuilder; @@ -19,7 +21,7 @@ import net.minecraft.util.math.Vec3d; public abstract class Outline { protected OutlineParams params; - + public Outline() { params = new OutlineParams(); } @@ -97,7 +99,7 @@ public abstract class Outline { } public void tick() {} - + public OutlineParams getParams() { return params; } @@ -105,7 +107,9 @@ public abstract class Outline { public static class OutlineParams { Optional faceTexture; Optional hightlightedFaceTexture; + Direction highlightedFace; boolean fadeLineWidth; + boolean disableCull; float alpha; private float lineWidth; int lightMapU, lightMapV; @@ -122,30 +126,41 @@ public abstract class Outline { lightMapU = i >> 16 & '\uffff'; lightMapV = i & '\uffff'; } - + // builder - + public OutlineParams colored(int color) { rgb = ColorHelper.getRGB(color); return this; } - + public OutlineParams lineWidth(float width) { this.lineWidth = width; return this; } - + public OutlineParams withFaceTexture(AllSpecialTextures texture) { this.faceTexture = Optional.of(texture); return this; } - + + public OutlineParams withFaceTextures(AllSpecialTextures texture, AllSpecialTextures highlightTexture) { + this.faceTexture = Optional.of(texture); + this.hightlightedFaceTexture = Optional.of(highlightTexture); + return this; + } + + public OutlineParams highlightFace(@Nullable Direction face) { + highlightedFace = face; + return this; + } + // util - + float getLineWidth() { return fadeLineWidth ? alpha * lineWidth : lineWidth; } - + } } diff --git a/src/main/java/com/simibubi/create/foundation/utility/outliner/Outliner.java b/src/main/java/com/simibubi/create/foundation/utility/outliner/Outliner.java index 124c860d4..614ebf50a 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/outliner/Outliner.java +++ b/src/main/java/com/simibubi/create/foundation/utility/outliner/Outliner.java @@ -3,6 +3,7 @@ package com.simibubi.create.foundation.utility.outliner; import java.util.HashMap; import java.util.HashSet; import java.util.Map; +import java.util.Optional; import java.util.Set; import com.mojang.blaze3d.matrix.MatrixStack; @@ -20,29 +21,29 @@ public class Outliner { // Facade - public OutlineParams showAABB(Object slot, AxisAlignedBB bb, ExpireType type) { - createAABBOutlineIfMissing(slot, bb, type); + public OutlineParams showAABB(Object slot, AxisAlignedBB bb) { + createAABBOutlineIfMissing(slot, bb); ChasingAABBOutline outline = getAndRefreshAABB(slot); outline.prevBB = outline.targetBB = bb; return outline.getParams(); } - public OutlineParams chaseAABB(Object slot, AxisAlignedBB bb, ExpireType type) { - createAABBOutlineIfMissing(slot, bb, type); + public OutlineParams chaseAABB(Object slot, AxisAlignedBB bb) { + createAABBOutlineIfMissing(slot, bb); ChasingAABBOutline outline = getAndRefreshAABB(slot); outline.targetBB = bb; return outline.getParams(); } - public OutlineParams showCluster(Object slot, Iterable selection, ExpireType type) { + public OutlineParams showCluster(Object slot, Iterable selection) { BlockClusterOutline outline = new BlockClusterOutline(selection); - OutlineEntry entry = new OutlineEntry(outline, type); + OutlineEntry entry = new OutlineEntry(outline); outlines.put(slot, entry); return entry.getOutline() .getParams(); } - public void keepCluster(Object slot) { + public void keep(Object slot) { if (outlines.containsKey(slot)) outlines.get(slot).ticksTillRemoval = 1; } @@ -51,12 +52,21 @@ public class Outliner { outlines.remove(slot); } + public Optional edit(Object slot) { + keep(slot); + if (outlines.containsKey(slot)) + return Optional.of(outlines.get(slot) + .getOutline() + .getParams()); + return Optional.empty(); + } + // Utility - private void createAABBOutlineIfMissing(Object slot, AxisAlignedBB bb, ExpireType type) { + private void createAABBOutlineIfMissing(Object slot, AxisAlignedBB bb) { if (!outlines.containsKey(slot)) { ChasingAABBOutline outline = new ChasingAABBOutline(bb); - outlines.put(slot, new OutlineEntry(outline, type)); + outlines.put(slot, new OutlineEntry(outline)); } } @@ -91,11 +101,12 @@ public class Outliner { outlines.forEach((key, entry) -> { Outline outline = entry.getOutline(); outline.params.alpha = 1; - if (entry.type != ExpireType.IMMEDIATE && entry.ticksTillRemoval < 0) { + if (entry.ticksTillRemoval < 0) { int prevTicks = entry.ticksTillRemoval + 1; - float lastAlpha = prevTicks >= 0 ? 1 : 1 + (prevTicks / (float) entry.type.fadeTicks); - float currentAlpha = 1 + (entry.ticksTillRemoval / (float) entry.type.fadeTicks); + float fadeticks = (float) OutlineEntry.fadeTicks; + float lastAlpha = prevTicks >= 0 ? 1 : 1 + (prevTicks / fadeticks); + float currentAlpha = 1 + (entry.ticksTillRemoval / fadeticks); float alpha = MathHelper.lerp(Minecraft.getInstance() .getRenderPartialTicks(), lastAlpha, currentAlpha); @@ -107,30 +118,19 @@ public class Outliner { }); } - public enum ExpireType { - IMMEDIATE(0), FADE(8), FADE_EXPAND(10); - - private int fadeTicks; - - private ExpireType(int fadeTicks) { - this.fadeTicks = fadeTicks; - } - } - private class OutlineEntry { + static final int fadeTicks = 8; private Outline outline; private int ticksTillRemoval; - private ExpireType type; - public OutlineEntry(Outline outline, ExpireType type) { + public OutlineEntry(Outline outline) { this.outline = outline; - this.type = type; ticksTillRemoval = 1; } public boolean isAlive() { - return ticksTillRemoval >= -type.fadeTicks; + return ticksTillRemoval >= -fadeTicks; } public Outline getOutline() { diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/ChassisRangeDisplay.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/ChassisRangeDisplay.java index 5b280b6d5..16c8311bc 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/ChassisRangeDisplay.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/ChassisRangeDisplay.java @@ -13,7 +13,6 @@ import com.simibubi.create.AllItems; import com.simibubi.create.AllKeys; import com.simibubi.create.AllSpecialTextures; import com.simibubi.create.CreateClient; -import com.simibubi.create.foundation.utility.outliner.Outliner.ExpireType; import com.simibubi.create.modules.contraptions.components.contraptions.chassis.ChassisTileEntity; import net.minecraft.client.Minecraft; @@ -36,7 +35,7 @@ public class ChassisRangeDisplay { public Entry(ChassisTileEntity te) { this.te = te; timer = DISPLAY_TIME; - CreateClient.outliner.showCluster(getOutlineKey(), createSelection(te), ExpireType.FADE) + CreateClient.outliner.showCluster(getOutlineKey(), createSelection(te)) .colored(0xFFFFBB) .lineWidth(1 / 16f) .withFaceTexture(AllSpecialTextures.CHECKERED); @@ -97,7 +96,7 @@ public class ChassisRangeDisplay { Entry entry = entries.get(pos); if (tickEntry(entry, hasWrench)) iterator.remove(); - CreateClient.outliner.keepCluster(entry.getOutlineKey()); + CreateClient.outliner.keep(entry.getOutlineKey()); } for (Iterator iterator = groupEntries.iterator(); iterator.hasNext();) { @@ -107,7 +106,7 @@ public class ChassisRangeDisplay { if (group == lastHoveredGroup) lastHoveredGroup = null; } - CreateClient.outliner.keepCluster(group.getOutlineKey()); + CreateClient.outliner.keep(group.getOutlineKey()); } if (!hasWrench) diff --git a/src/main/java/com/simibubi/create/modules/palettes/AllPaletteBlocks.java b/src/main/java/com/simibubi/create/modules/palettes/AllPaletteBlocks.java index 3357858cb..bedbc698c 100644 --- a/src/main/java/com/simibubi/create/modules/palettes/AllPaletteBlocks.java +++ b/src/main/java/com/simibubi/create/modules/palettes/AllPaletteBlocks.java @@ -38,6 +38,7 @@ public class AllPaletteBlocks { public static final BlockEntry TILED_GLASS = REGISTRATE.block("tiled_glass", GlassBlock::new) .initialProperties(() -> Blocks.GLASS) + .addLayer(() -> RenderType::getCutoutMipped) .blockstate(palettesCubeAll()) .simpleItem() .register(); diff --git a/src/main/java/com/simibubi/create/modules/schematics/block/SchematicTableScreen.java b/src/main/java/com/simibubi/create/modules/schematics/block/SchematicTableScreen.java index 304a85c11..ff18fdcf2 100644 --- a/src/main/java/com/simibubi/create/modules/schematics/block/SchematicTableScreen.java +++ b/src/main/java/com/simibubi/create/modules/schematics/block/SchematicTableScreen.java @@ -14,10 +14,12 @@ import com.simibubi.create.AllBlocksNew; import com.simibubi.create.CreateClient; import com.simibubi.create.ScreenResources; import com.simibubi.create.foundation.gui.AbstractSimiContainerScreen; +import com.simibubi.create.foundation.gui.GuiGameElement; import com.simibubi.create.foundation.gui.widgets.IconButton; import com.simibubi.create.foundation.gui.widgets.Label; import com.simibubi.create.foundation.gui.widgets.ScrollInput; import com.simibubi.create.foundation.gui.widgets.SelectionScrollInput; +import com.simibubi.create.foundation.utility.AnimationTickHolder; import com.simibubi.create.foundation.utility.Lang; import com.simibubi.create.modules.schematics.ClientSchematicLoader; @@ -107,17 +109,21 @@ public class SchematicTableScreen extends AbstractSimiContainerScreen particle; - public boolean mouseScrolled(double delta) { if (!isActive()) return false; @@ -58,7 +63,8 @@ public class SchematicAndQuillHandler { AxisAlignedBB bb = new AxisAlignedBB(firstPos, secondPos); Vec3i vec = selectedFace.getDirectionVec(); - Vec3d projectedView = Minecraft.getInstance().gameRenderer.getActiveRenderInfo().getProjectedView(); + Vec3d projectedView = Minecraft.getInstance().gameRenderer.getActiveRenderInfo() + .getProjectedView(); if (bb.contains(projectedView)) delta *= -1; @@ -78,7 +84,7 @@ public class SchematicAndQuillHandler { firstPos = new BlockPos(bb.minX, bb.minY, bb.minZ); secondPos = new BlockPos(bb.maxX, bb.maxY, bb.maxZ); Lang.sendStatus(Minecraft.getInstance().player, "schematicAndQuill.dimensions", (int) bb.getXSize() + 1, - (int) bb.getYSize() + 1, (int) bb.getZSize() + 1); + (int) bb.getYSize() + 1, (int) bb.getZSize() + 1); return true; } @@ -99,7 +105,8 @@ public class SchematicAndQuillHandler { } if (secondPos != null) { - TextInputPromptScreen guiScreenIn = new TextInputPromptScreen(this::saveSchematic, s -> {}); + TextInputPromptScreen guiScreenIn = new TextInputPromptScreen(this::saveSchematic, s -> { + }); guiScreenIn.setTitle(Lang.translate("schematicAndQuill.prompt")); guiScreenIn.setButtonTextConfirm(Lang.translate("action.saveToFile")); guiScreenIn.setButtonTextAbort(Lang.translate("action.discard")); @@ -123,20 +130,17 @@ public class SchematicAndQuillHandler { } public void tick() { - if (!isActive()) { -// if (particle != null) { -// particle.setExpired(); -// particle = null; -// } + if (!isActive()) return; - } ClientPlayerEntity player = Minecraft.getInstance().player; - if (AllKeys.ACTIVATE_TOOL.isPressed()) { - float pt = Minecraft.getInstance().getRenderPartialTicks(); - Vec3d targetVec = player.getEyePosition(pt).add(player.getLookVec().scale(range)); - setCursor(new BlockPos(targetVec)); + float pt = Minecraft.getInstance() + .getRenderPartialTicks(); + Vec3d targetVec = player.getEyePosition(pt) + .add(player.getLookVec() + .scale(range)); + selectedPos = new BlockPos(targetVec); } else { BlockRayTraceResult trace = RaycastHelper.rayTraceRange(player.world, player, 75); @@ -144,57 +148,36 @@ public class SchematicAndQuillHandler { BlockPos hit = trace.getPos(); boolean replaceable = player.world.getBlockState(hit) - .isReplaceable(new BlockItemUseContext(new ItemUseContext(player, Hand.MAIN_HAND, trace))); - if (trace.getFace().getAxis().isVertical() && !replaceable) + .isReplaceable(new BlockItemUseContext(new ItemUseContext(player, Hand.MAIN_HAND, trace))); + if (trace.getFace() + .getAxis() + .isVertical() && !replaceable) hit = hit.offset(trace.getFace()); - setCursor(hit); + selectedPos = hit; } else - setCursor(null); + selectedPos = null; } -// if (particle == null) -// return; -// -// ChasingAABBOutline outline = particle.getOutline(); -// if (particle.isAlive()) -// outline.tick(); + selectedFace = null; + if (secondPos != null) { + AxisAlignedBB bb = new AxisAlignedBB(firstPos, secondPos).expand(1, 1, 1) + .grow(.45f); + Vec3d projectedView = Minecraft.getInstance().gameRenderer.getActiveRenderInfo() + .getProjectedView(); + boolean inside = bb.contains(projectedView); + PredicateTraceResult result = + RaycastHelper.rayTraceUntil(player, 70, pos -> inside ^ bb.contains(VecHelper.getCenterOf(pos))); + selectedFace = result.missed() ? null + : inside ? result.getFacing() + .getOpposite() : result.getFacing(); + } -// if (secondPos == null) { -// selectedFace = null; -// outline.highlightFace(null); -// return; -// } -// -// AxisAlignedBB bb = new AxisAlignedBB(firstPos, secondPos).expand(1, 1, 1).grow(.45f); -// Vec3d projectedView = Minecraft.getInstance().gameRenderer.getActiveRenderInfo().getProjectedView(); -// boolean inside = bb.contains(projectedView); -// -// PredicateTraceResult result = -// RaycastHelper.rayTraceUntil(player, 70, pos -> inside ^ bb.contains(VecHelper.getCenterOf(pos))); -// selectedFace = result.missed() ? null : inside ? result.getFacing().getOpposite() : result.getFacing(); -// outline.highlightFace(AllKeys.ACTIVATE_TOOL.isPressed() ? selectedFace : null); - } - - private void setCursor(BlockPos pos) { - selectedPos = pos; - AxisAlignedBB bb = getCurrentSelectionBox(); - -// if (particle != null && !particle.isAlive()) -// particle = null; -// if (bb == null) { -// if (particle != null) -// particle.setExpired(); -// return; -// } -// -// if (particle == null) { -// ChasingAABBOutline outline = new ChasingAABBOutline(bb); -// outline.setTextures(AllSpecialTextures.CHECKERED, AllSpecialTextures.HIGHLIGHT_CHECKERED); -// particle = OutlineParticle.create(outline); -// } -// -// ChasingAABBOutline outline = particle.getOutline(); -// outline.target(bb); + AxisAlignedBB currentSelectionBox = getCurrentSelectionBox(); + if (currentSelectionBox != null) + outliner().chaseAABB(outlineSlot, currentSelectionBox) + .colored(0xDDDFFF) + .withFaceTextures(AllSpecialTextures.CHECKERED, AllSpecialTextures.HIGHLIGHT_CHECKERED) + .highlightFace(selectedFace); } private AxisAlignedBB getCurrentSelectionBox() { @@ -202,7 +185,7 @@ public class SchematicAndQuillHandler { if (firstPos == null) return selectedPos == null ? null : new AxisAlignedBB(selectedPos); return selectedPos == null ? new AxisAlignedBB(firstPos) - : new AxisAlignedBB(firstPos, selectedPos).expand(1, 1, 1); + : new AxisAlignedBB(firstPos, selectedPos).expand(1, 1, 1); } return new AxisAlignedBB(firstPos, secondPos).expand(1, 1, 1); } @@ -213,14 +196,14 @@ public class SchematicAndQuillHandler { private boolean isPresent() { return Minecraft.getInstance() != null && Minecraft.getInstance().world != null - && Minecraft.getInstance().currentScreen == null; + && Minecraft.getInstance().currentScreen == null; } public void saveSchematic(String string) { Template t = new Template(); MutableBoundingBox bb = new MutableBoundingBox(firstPos, secondPos); t.takeBlocksFromWorld(Minecraft.getInstance().world, new BlockPos(bb.minX, bb.minY, bb.minZ), - new BlockPos(bb.getXSize(), bb.getYSize(), bb.getZSize()), true, Blocks.AIR); + new BlockPos(bb.getXSize(), bb.getYSize(), bb.getZSize()), true, Blocks.AIR); if (string.isEmpty()) string = Lang.translate("schematicAndQuill.fallbackName"); @@ -246,4 +229,8 @@ public class SchematicAndQuillHandler { Lang.sendStatus(Minecraft.getInstance().player, "schematicAndQuill.saved", filepath); } + private Outliner outliner() { + return CreateClient.outliner; + } + } \ No newline at end of file diff --git a/src/main/java/com/simibubi/create/modules/schematics/client/SchematicHandler.java b/src/main/java/com/simibubi/create/modules/schematics/client/SchematicHandler.java index 91c328b9b..b3fe16f86 100644 --- a/src/main/java/com/simibubi/create/modules/schematics/client/SchematicHandler.java +++ b/src/main/java/com/simibubi/create/modules/schematics/client/SchematicHandler.java @@ -34,8 +34,7 @@ public class SchematicHandler { private String displayedSchematic; private SchematicTransformation transformation; - private AxisAlignedBB bounds; // local space - private AABBOutline outline; + private AxisAlignedBB bounds; private boolean deployed; private boolean active; private Tools currentTool; @@ -247,8 +246,8 @@ public class SchematicHandler { BlockPos size = NBTUtil.readBlockPos(tag.getCompound("Bounds")); bounds = new AxisAlignedBB(BlockPos.ZERO, size); - outline = new AABBOutline(bounds); - outline.disableCull = true; +// outline = new AABBOutline(bounds); +// outline.disableCull = true; transformation.init(anchor, settings, bounds); } @@ -275,10 +274,6 @@ public class SchematicHandler { markDirty(); } - public AABBOutline getOutline() { - return outline; - } - public boolean isActive() { return active; } diff --git a/src/main/java/com/simibubi/create/modules/schematics/client/tools/SchematicToolBase.java b/src/main/java/com/simibubi/create/modules/schematics/client/tools/SchematicToolBase.java index e3bea77a0..4f00aa69e 100644 --- a/src/main/java/com/simibubi/create/modules/schematics/client/tools/SchematicToolBase.java +++ b/src/main/java/com/simibubi/create/modules/schematics/client/tools/SchematicToolBase.java @@ -119,11 +119,11 @@ public abstract class SchematicToolBase implements ISchematicTool { if (!schematicHandler.isDeployed()) return; - AABBOutline outline = schematicHandler.getOutline(); +// AABBOutline outline = schematicHandler.getOutline(); if (renderSelectedFace) { - schematicHandler.getOutline().setTextures(null, - AllKeys.ctrlDown() ? AllSpecialTextures.HIGHLIGHT_CHECKERED : AllSpecialTextures.CHECKERED); - outline.highlightFace(selectedFace); +// schematicHandler.getOutline().setTextures(null, +// AllKeys.ctrlDown() ? AllSpecialTextures.HIGHLIGHT_CHECKERED : AllSpecialTextures.CHECKERED); +// outline.highlightFace(selectedFace); } RenderHelper.disableStandardItemLighting(); @@ -131,7 +131,7 @@ public abstract class SchematicToolBase implements ISchematicTool { RenderSystem.enableBlend(); // outline.render(Tessellator.getInstance().getBuffer());TODO RenderSystem.popMatrix(); - outline.setTextures(null, null); +// outline.setTextures(null, null); } diff --git a/src/main/resources/assets/create/blockstates/brass_block.json b/src/main/resources/assets/create/blockstates/brass_block.json deleted file mode 100644 index c5b2d45e1..000000000 --- a/src/main/resources/assets/create/blockstates/brass_block.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "variants": { - "": { "model": "create:block/brass_block" } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/create/blockstates/copper_block.json b/src/main/resources/assets/create/blockstates/copper_block.json deleted file mode 100644 index b7f7903d4..000000000 --- a/src/main/resources/assets/create/blockstates/copper_block.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "variants": { - "oxidization=0": { "model": "create:block/oxidized/copper_block/0" }, - "oxidization=1": { "model": "create:block/oxidized/copper_block/1" }, - "oxidization=2": { "model": "create:block/oxidized/copper_block/2" }, - "oxidization=3": { "model": "create:block/oxidized/copper_block/3" }, - "oxidization=4": { "model": "create:block/oxidized/copper_block/4" }, - "oxidization=5": { "model": "create:block/oxidized/copper_block/5" }, - "oxidization=6": { "model": "create:block/oxidized/copper_block/6" }, - "oxidization=7": { "model": "create:block/oxidized/copper_block/7" } - } -} diff --git a/src/main/resources/assets/create/blockstates/copper_ore.json b/src/main/resources/assets/create/blockstates/copper_ore.json deleted file mode 100644 index 322ba6928..000000000 --- a/src/main/resources/assets/create/blockstates/copper_ore.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "variants": { - "oxidization=0": { "model": "create:block/oxidized/copper_ore/0" }, - "oxidization=1": { "model": "create:block/oxidized/copper_ore/1" }, - "oxidization=2": { "model": "create:block/oxidized/copper_ore/2" }, - "oxidization=3": { "model": "create:block/oxidized/copper_ore/3" }, - "oxidization=4": { "model": "create:block/oxidized/copper_ore/4" }, - "oxidization=5": { "model": "create:block/oxidized/copper_ore/5" }, - "oxidization=6": { "model": "create:block/oxidized/copper_ore/6" }, - "oxidization=7": { "model": "create:block/oxidized/copper_ore/7" } - } -} diff --git a/src/main/resources/assets/create/blockstates/copper_shingles.json b/src/main/resources/assets/create/blockstates/copper_shingles.json deleted file mode 100644 index b0c1bdf97..000000000 --- a/src/main/resources/assets/create/blockstates/copper_shingles.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "variants": { - "oxidization=0": { "model": "create:block/oxidized/copper_shingles/0" }, - "oxidization=1": { "model": "create:block/oxidized/copper_shingles/1" }, - "oxidization=2": { "model": "create:block/oxidized/copper_shingles/2" }, - "oxidization=3": { "model": "create:block/oxidized/copper_shingles/3" }, - "oxidization=4": { "model": "create:block/oxidized/copper_shingles/4" }, - "oxidization=5": { "model": "create:block/oxidized/copper_shingles/5" }, - "oxidization=6": { "model": "create:block/oxidized/copper_shingles/6" }, - "oxidization=7": { "model": "create:block/oxidized/copper_shingles/7" } - } -} diff --git a/src/main/resources/assets/create/blockstates/zinc_block.json b/src/main/resources/assets/create/blockstates/zinc_block.json deleted file mode 100644 index df477d821..000000000 --- a/src/main/resources/assets/create/blockstates/zinc_block.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "variants": { - "": { "model": "create:block/zinc_block" } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/create/blockstates/zinc_ore.json b/src/main/resources/assets/create/blockstates/zinc_ore.json deleted file mode 100644 index 98d8893dd..000000000 --- a/src/main/resources/assets/create/blockstates/zinc_ore.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "variants": { - "": { "model": "create:block/zinc_ore" } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/item/brass_block.json b/src/main/resources/assets/create/models/item/brass_block.json deleted file mode 100644 index 879defa02..000000000 --- a/src/main/resources/assets/create/models/item/brass_block.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "create:block/brass_block" -} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/item/copper_block.json b/src/main/resources/assets/create/models/item/copper_block.json deleted file mode 100644 index a4f2936b5..000000000 --- a/src/main/resources/assets/create/models/item/copper_block.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "create:block/oxidized/copper_block/0" -} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/item/copper_ore.json b/src/main/resources/assets/create/models/item/copper_ore.json deleted file mode 100644 index a3994286e..000000000 --- a/src/main/resources/assets/create/models/item/copper_ore.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "create:block/oxidized/copper_ore/0" -} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/item/copper_shingles.json b/src/main/resources/assets/create/models/item/copper_shingles.json deleted file mode 100644 index ac90ade78..000000000 --- a/src/main/resources/assets/create/models/item/copper_shingles.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "create:block/oxidized/copper_shingles/0" -} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/item/gabbro.json b/src/main/resources/assets/create/models/item/gabbro.json deleted file mode 100644 index 297a63593..000000000 --- a/src/main/resources/assets/create/models/item/gabbro.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "create:block/palettes/gabbro" -} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/item/gabbro_bricks.json b/src/main/resources/assets/create/models/item/gabbro_bricks.json deleted file mode 100644 index 359e0ea52..000000000 --- a/src/main/resources/assets/create/models/item/gabbro_bricks.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "create:block/palettes/gabbro_bricks" -} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/item/gabbro_bricks_stairs.json b/src/main/resources/assets/create/models/item/gabbro_bricks_stairs.json deleted file mode 100644 index 7331dbc77..000000000 --- a/src/main/resources/assets/create/models/item/gabbro_bricks_stairs.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "create:block/palettes/gabbro_bricks_stairs" -} diff --git a/src/main/resources/assets/create/models/item/gabbro_bricks_wall.json b/src/main/resources/assets/create/models/item/gabbro_bricks_wall.json deleted file mode 100644 index 7463ffdf8..000000000 --- a/src/main/resources/assets/create/models/item/gabbro_bricks_wall.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_inventory", - "textures": { - "wall": "create:block/gabbro_bricks" - } -} diff --git a/src/main/resources/assets/create/models/item/gabbro_layers.json b/src/main/resources/assets/create/models/item/gabbro_layers.json deleted file mode 100644 index 588aa8801..000000000 --- a/src/main/resources/assets/create/models/item/gabbro_layers.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "create:block/palettes/gabbro_layers" -} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/item/gabbro_slab.json b/src/main/resources/assets/create/models/item/gabbro_slab.json deleted file mode 100644 index 43c5b4853..000000000 --- a/src/main/resources/assets/create/models/item/gabbro_slab.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "create:block/palettes/gabbro_slab" -} diff --git a/src/main/resources/assets/create/models/item/gabbro_stairs.json b/src/main/resources/assets/create/models/item/gabbro_stairs.json deleted file mode 100644 index 32c811b94..000000000 --- a/src/main/resources/assets/create/models/item/gabbro_stairs.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "create:block/palettes/gabbro_stairs" -} diff --git a/src/main/resources/assets/create/models/item/gabbro_wall.json b/src/main/resources/assets/create/models/item/gabbro_wall.json deleted file mode 100644 index e6e09f396..000000000 --- a/src/main/resources/assets/create/models/item/gabbro_wall.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_inventory", - "textures": { - "wall": "create:block/gabbro" - } -} diff --git a/src/main/resources/assets/create/models/item/tiled_glass.json b/src/main/resources/assets/create/models/item/tiled_glass.json deleted file mode 100644 index 1c7e9b83e..000000000 --- a/src/main/resources/assets/create/models/item/tiled_glass.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "create:block/palettes/tiled_glass" -} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/item/zinc_block.json b/src/main/resources/assets/create/models/item/zinc_block.json deleted file mode 100644 index aa3c620f0..000000000 --- a/src/main/resources/assets/create/models/item/zinc_block.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "create:block/zinc_block" -} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/item/zinc_ore.json b/src/main/resources/assets/create/models/item/zinc_ore.json deleted file mode 100644 index 48433b644..000000000 --- a/src/main/resources/assets/create/models/item/zinc_ore.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "create:block/zinc_ore" -} \ No newline at end of file