From e84c6d3abe228c6673218e21503ec57081d49d62 Mon Sep 17 00:00:00 2001 From: JozsefA Date: Fri, 19 Feb 2021 15:00:28 -0800 Subject: [PATCH 1/8] tweak max origin distance to avoid z-fighting at relatively high coordinates. remove unnecessary state changes. --- .../simibubi/create/foundation/render/KineticRenderer.java | 2 +- .../foundation/render/backend/FastRenderDispatcher.java | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main/java/com/simibubi/create/foundation/render/KineticRenderer.java b/src/main/java/com/simibubi/create/foundation/render/KineticRenderer.java index 58e1746f2..8517b7d03 100644 --- a/src/main/java/com/simibubi/create/foundation/render/KineticRenderer.java +++ b/src/main/java/com/simibubi/create/foundation/render/KineticRenderer.java @@ -18,7 +18,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; public class KineticRenderer extends InstancedTileRenderer { - public static int MAX_ORIGIN_DISTANCE = 1000; + public static int MAX_ORIGIN_DISTANCE = 100; public BlockPos originCoordinate = BlockPos.ZERO; diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/FastRenderDispatcher.java b/src/main/java/com/simibubi/create/foundation/render/backend/FastRenderDispatcher.java index 17f504ab8..7038c4a78 100644 --- a/src/main/java/com/simibubi/create/foundation/render/backend/FastRenderDispatcher.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/FastRenderDispatcher.java @@ -73,12 +73,7 @@ public class FastRenderDispatcher { layer.startDrawing(); - RenderSystem.enableDepthTest(); - RenderSystem.enableCull(); - GL11.glCullFace(GL11.GL_BACK); CreateClient.kineticRenderer.render(layer, viewProjection, cameraX, cameraY, cameraZ); - RenderSystem.disableCull(); - //RenderSystem.disableDepthTest(); layer.endDrawing(); } From 6542f2f08731cb85bb9ea33706d2e35328a545f0 Mon Sep 17 00:00:00 2001 From: grimmauld Date: Sat, 20 Feb 2021 17:58:16 +0100 Subject: [PATCH 2/8] Some cleanup --- .../foundation/advancement/AllTriggers.java | 14 ++++---- .../advancement/RegistryTrigger.java | 6 ++-- .../StringSerializableTrigger.java | 32 ++++++++++--------- 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/src/main/java/com/simibubi/create/foundation/advancement/AllTriggers.java b/src/main/java/com/simibubi/create/foundation/advancement/AllTriggers.java index 51ae96434..4f16caa6e 100644 --- a/src/main/java/com/simibubi/create/foundation/advancement/AllTriggers.java +++ b/src/main/java/com/simibubi/create/foundation/advancement/AllTriggers.java @@ -13,16 +13,17 @@ import net.minecraft.fluid.Fluid; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.registries.ForgeRegistries; public class AllTriggers { private static final List> triggers = new LinkedList<>(); - public static RegistryTrigger INFINITE_FLUID = add(new RegistryTrigger<>("infinite_fluid", Fluid.class)); - public static RegistryTrigger BRACKET_APPLY_TRIGGER = add(new RegistryTrigger<>("bracket_apply", Block.class)); - public static EnumTrigger FAN_PROCESSING = add(new EnumTrigger<>("fan_processing", InWorldProcessing.Type.class)); + public static final RegistryTrigger INFINITE_FLUID = add(new RegistryTrigger<>("infinite_fluid", ForgeRegistries.FLUIDS)); + public static final RegistryTrigger BRACKET_APPLY_TRIGGER = add(new RegistryTrigger<>("bracket_apply", ForgeRegistries.BLOCKS)); + public static final EnumTrigger FAN_PROCESSING = add(new EnumTrigger<>("fan_processing", InWorldProcessing.Type.class)); - public static SimpleTrigger + public static final SimpleTrigger ROTATION = simple("rotation"), OVERSTRESSED = simple("overstressed"), SHIFTING_GEARS = simple("shifting_gears"), @@ -99,9 +100,6 @@ public class AllTriggers { } public static List getPlayersInRange(World world, BlockPos pos, int range) { - List players = - world.getEntitiesWithinAABB(ServerPlayerEntity.class, new AxisAlignedBB(pos).grow(range)); - return players; + return world.getEntitiesWithinAABB(ServerPlayerEntity.class, new AxisAlignedBB(pos).grow(range)); } - } diff --git a/src/main/java/com/simibubi/create/foundation/advancement/RegistryTrigger.java b/src/main/java/com/simibubi/create/foundation/advancement/RegistryTrigger.java index 0a70e87b0..9a57c528e 100644 --- a/src/main/java/com/simibubi/create/foundation/advancement/RegistryTrigger.java +++ b/src/main/java/com/simibubi/create/foundation/advancement/RegistryTrigger.java @@ -4,7 +4,6 @@ import mcp.MethodsReturnNonnullByDefault; import net.minecraft.util.ResourceLocation; import net.minecraftforge.registries.IForgeRegistry; import net.minecraftforge.registries.IForgeRegistryEntry; -import net.minecraftforge.registries.RegistryManager; import javax.annotation.Nullable; import javax.annotation.ParametersAreNonnullByDefault; @@ -14,15 +13,14 @@ import javax.annotation.ParametersAreNonnullByDefault; public class RegistryTrigger> extends StringSerializableTrigger { private final IForgeRegistry registry; - public RegistryTrigger(String id, Class registryType) { + public RegistryTrigger(String id, IForgeRegistry registry) { super(id); - this.registry = RegistryManager.ACTIVE.getRegistry(registryType); + this.registry = registry; } @Nullable @Override protected T getValue(String key) { - return registry.getValue(new ResourceLocation(key)); } diff --git a/src/main/java/com/simibubi/create/foundation/advancement/StringSerializableTrigger.java b/src/main/java/com/simibubi/create/foundation/advancement/StringSerializableTrigger.java index ae6f4d83d..fa2ca7a03 100644 --- a/src/main/java/com/simibubi/create/foundation/advancement/StringSerializableTrigger.java +++ b/src/main/java/com/simibubi/create/foundation/advancement/StringSerializableTrigger.java @@ -10,7 +10,6 @@ import javax.annotation.ParametersAreNonnullByDefault; import java.util.Collections; import java.util.List; import java.util.Set; -import java.util.function.BiConsumer; import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.StreamSupport; @@ -18,7 +17,12 @@ import java.util.stream.StreamSupport; @MethodsReturnNonnullByDefault @ParametersAreNonnullByDefault public abstract class StringSerializableTrigger extends CriterionTriggerBase> { - public StringSerializableTrigger(String id) { + + protected String getJsonKey() { + return "accepted_entries"; + } + + protected StringSerializableTrigger(String id) { super(id); } @@ -32,32 +36,30 @@ public abstract class StringSerializableTrigger extends CriterionTriggerBase< } public ITriggerable constructTriggerFor(@Nullable T entry) { - BiConsumer trigger = this::trigger; - return player -> trigger.accept(player, entry); + return player -> trigger(player, entry); } @Override public Instance deserializeInstance(JsonObject json, JsonDeserializationContext context) { - if (json.has("accepted_entries")) { - JsonArray elements = json.getAsJsonArray("accepted_entries"); + if (json.has(getJsonKey())) { + JsonArray elements = json.getAsJsonArray(getJsonKey()); return new Instance<>(this, StreamSupport.stream(elements.spliterator(), false).map(JsonElement::getAsString) - .map(rl -> { - T entry = getValue(rl); + .map(key -> { + T entry = getValue(key); if (entry == null) - throw new JsonSyntaxException("Unknown entry '" + rl + "'"); + throw new JsonSyntaxException("Unknown entry '" + key + "'"); return entry; }).collect(Collectors.toSet())); } - - return forEntries((T) null); + return new Instance<>(this, null); } @Nullable - abstract protected T getValue(String key); + protected abstract T getValue(String key); @Nullable - abstract protected String getKey(T value); + protected abstract String getKey(T value); public static class Instance extends CriterionTriggerBase.Instance { @@ -84,7 +86,7 @@ public abstract class StringSerializableTrigger extends CriterionTriggerBase< JsonArray elements = new JsonArray(); if (entries == null) { - jsonobject.add("accepted_entries", elements); + jsonobject.add(trigger.getJsonKey(), elements); return jsonobject; } @@ -96,7 +98,7 @@ public abstract class StringSerializableTrigger extends CriterionTriggerBase< elements.add(key); } - jsonobject.add("accepted_entries", elements); + jsonobject.add(trigger.getJsonKey(), elements); return jsonobject; } } From b5f9cbc4b39a69f8abf3ef442c38f1b635aa1c2d Mon Sep 17 00:00:00 2001 From: JozsefA Date: Sat, 20 Feb 2021 15:22:07 -0800 Subject: [PATCH 3/8] improve compatibility layer. --- .../foundation/render/backend/Backend.java | 47 ++-------- .../render/backend/gl/GlBuffer.java | 8 +- .../render/backend/gl/GlVertexArray.java | 9 +- .../backend/gl/versioned/DrawInstanced.java | 54 ++++++++++++ .../backend/gl/versioned/GlFunctions.java | 85 +++++++++++++++++++ .../backend/gl/versioned/GlVersioned.java | 10 ++- .../backend/gl/versioned/InstancedArrays.java | 43 ++++++++++ .../gl/versioned/VertexArrayObject.java | 77 +++++++++++++++++ .../backend/instancing/InstancedModel.java | 7 +- 9 files changed, 289 insertions(+), 51 deletions(-) create mode 100644 src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/DrawInstanced.java create mode 100644 src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/GlFunctions.java create mode 100644 src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/InstancedArrays.java create mode 100644 src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/VertexArrayObject.java diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/Backend.java b/src/main/java/com/simibubi/create/foundation/render/backend/Backend.java index 6a416b187..858d54572 100644 --- a/src/main/java/com/simibubi/create/foundation/render/backend/Backend.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/Backend.java @@ -11,6 +11,7 @@ import java.util.Map; import java.util.function.Consumer; import java.util.function.Predicate; +import com.simibubi.create.foundation.render.backend.gl.versioned.GlFunctions; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.lwjgl.opengl.GL; @@ -44,16 +45,12 @@ public class Backend { private static boolean enabled; public static GLCapabilities capabilities; - private static MapBuffer mapBuffer; + public static GlFunctions functions; public Backend() { throw new IllegalStateException(); } - public static void mapBuffer(int target, int offset, int length, Consumer upload) { - mapBuffer.mapBuffer(target, offset, length, upload); - } - /** * Register a shader program. TODO: replace with forge registry? */ @@ -71,47 +68,21 @@ public class Backend { return (P) programs.get(spec); } - /** - * Get the most compatible version of a specific OpenGL feature by iterating over enum constants in order. - * - * @param clazz The class of the versioning enum. - * @param The type of the versioning enum. - * @return The first defined enum variant to return true. - */ - public static & GlVersioned> V getLatest(Class clazz) { - return getLatest(clazz, capabilities); - } - - /** - * Get the most compatible version of a specific OpenGL feature by iterating over enum constants in order. - * - * @param clazz The class of the versioning enum. - * @param caps The current system's supported features. - * @param The type of the versioning enum. - * @return The first defined enum variant to return true. - */ - public static & GlVersioned> V getLatest(Class clazz, GLCapabilities caps) { - V[] constants = clazz.getEnumConstants(); - V last = constants[constants.length - 1]; - if (!last.supported(caps)) { - throw new IllegalStateException(""); - } - - return Arrays.stream(constants).filter(it -> it.supported(caps)).findFirst().orElse(last); + public static boolean available() { + return canUseVBOs(); } public static boolean canUseInstancing() { - return enabled && gl33(); + return enabled && + functions.vertexArrayObjectsSupported() && + functions.drawInstancedSupported() && + functions.instancedArraysSupported(); } public static boolean canUseVBOs() { return enabled && gl20(); } - public static boolean available() { - return enabled && gl20(); - } - public static boolean gl33() { return capabilities.OpenGL33; } @@ -136,7 +107,7 @@ public class Backend { private static void onResourceManagerReload(IResourceManager manager, Predicate predicate) { if (predicate.test(VanillaResourceType.SHADERS)) { capabilities = GL.createCapabilities(); - mapBuffer = getLatest(MapBuffer.class); + functions = new GlFunctions(capabilities); OptifineHandler.refresh(); refresh(); diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlBuffer.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlBuffer.java index 42a72736b..8420dab87 100644 --- a/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlBuffer.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlBuffer.java @@ -3,9 +3,9 @@ package com.simibubi.create.foundation.render.backend.gl; import java.nio.ByteBuffer; import java.util.function.Consumer; -import org.lwjgl.opengl.GL20; - import com.simibubi.create.foundation.render.backend.Backend; +import com.simibubi.create.foundation.render.backend.gl.versioned.GlFunctions; +import org.lwjgl.opengl.GL20; public class GlBuffer extends GlObject { @@ -35,11 +35,11 @@ public class GlBuffer extends GlObject { } public void map(int length, Consumer upload) { - Backend.mapBuffer(bufferType, 0, length, upload); + Backend.functions.mapBuffer(bufferType, 0, length, upload); } public void map(int offset, int length, Consumer upload) { - Backend.mapBuffer(bufferType, offset, length, upload); + Backend.functions.mapBuffer(bufferType, offset, length, upload); } protected void deleteInternal(int handle) { diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlVertexArray.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlVertexArray.java index 33ff7461b..cf6229f6e 100644 --- a/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlVertexArray.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlVertexArray.java @@ -2,19 +2,20 @@ package com.simibubi.create.foundation.render.backend.gl; import java.util.function.Consumer; +import com.simibubi.create.foundation.render.backend.Backend; import org.lwjgl.opengl.GL30; public class GlVertexArray extends GlObject { public GlVertexArray() { - setHandle(GL30.glGenVertexArrays()); + setHandle(Backend.functions.genVertexArrays()); } public void bind() { - GL30.glBindVertexArray(handle()); + Backend.functions.bindVertexArray(handle()); } public void unbind() { - GL30.glBindVertexArray(0); + Backend.functions.bindVertexArray(0); } public void with(Consumer action) { @@ -24,6 +25,6 @@ public class GlVertexArray extends GlObject { } protected void deleteInternal(int handle) { - GL30.glDeleteVertexArrays(handle); + Backend.functions.deleteVertexArrays(handle); } } diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/DrawInstanced.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/DrawInstanced.java new file mode 100644 index 000000000..4c206581d --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/DrawInstanced.java @@ -0,0 +1,54 @@ +package com.simibubi.create.foundation.render.backend.gl.versioned; + +import org.lwjgl.opengl.*; + +public enum DrawInstanced implements GlVersioned { + GL31_DRAW_INSTANCED { + @Override + public boolean supported(GLCapabilities caps) { + return caps.OpenGL31; + } + + @Override + public void drawArraysInstanced(int mode, int first, int count, int primcount) { + GL31.glDrawArraysInstanced(mode, first, count, primcount); + } + }, + ARB_DRAW_INSTANCED { + @Override + public boolean supported(GLCapabilities caps) { + return caps.GL_ARB_draw_instanced; + } + + @Override + public void drawArraysInstanced(int mode, int first, int count, int primcount) { + ARBDrawInstanced.glDrawArraysInstancedARB(mode, first, count, primcount); + } + }, + EXT_DRAW_INSTANCED { + @Override + public boolean supported(GLCapabilities caps) { + return caps.GL_EXT_draw_instanced; + } + + @Override + public void drawArraysInstanced(int mode, int first, int count, int primcount) { + EXTDrawInstanced.glDrawArraysInstancedEXT(mode, first, count, primcount); + } + }, + UNSUPPORTED { + @Override + public boolean supported(GLCapabilities caps) { + return true; + } + + @Override + public void drawArraysInstanced(int mode, int first, int count, int primcount) { + throw new UnsupportedOperationException(); + } + } + + ; + + public abstract void drawArraysInstanced(int mode, int first, int count, int primcount); +} diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/GlFunctions.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/GlFunctions.java new file mode 100644 index 000000000..1345661fc --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/GlFunctions.java @@ -0,0 +1,85 @@ +package com.simibubi.create.foundation.render.backend.gl.versioned; + +import org.lwjgl.opengl.GLCapabilities; + +import java.nio.ByteBuffer; +import java.util.Arrays; +import java.util.function.Consumer; + +/** + * An instance of this class stores information + * about what OpenGL features are available. + * + * Each field stores an enum variant that provides access to the + * most appropriate version of a feature for the current system. + */ +public class GlFunctions { + public final MapBuffer mapBuffer; + + public final VertexArrayObject vertexArrayObject; + public final InstancedArrays instancedArrays; + public final DrawInstanced drawInstanced; + + public GlFunctions(GLCapabilities caps) { + mapBuffer = getLatest(MapBuffer.class, caps); + + vertexArrayObject = getLatest(VertexArrayObject.class, caps); + instancedArrays = getLatest(InstancedArrays.class, caps); + drawInstanced = getLatest(DrawInstanced.class, caps); + } + + public void mapBuffer(int target, int offset, int length, Consumer upload) { + mapBuffer.mapBuffer(target, offset, length, upload); + } + + public void vertexAttribDivisor(int index, int divisor) { + instancedArrays.vertexAttribDivisor(index, divisor); + } + + public void drawArraysInstanced(int mode, int first, int count, int primcount) { + drawInstanced.drawArraysInstanced(mode, first, count, primcount); + } + + public int genVertexArrays() { + return vertexArrayObject.genVertexArrays(); + } + + public void deleteVertexArrays(int array) { + vertexArrayObject.deleteVertexArrays(array); + } + + public void bindVertexArray(int array) { + vertexArrayObject.bindVertexArray(array); + } + + public boolean vertexArrayObjectsSupported() { + return vertexArrayObject != VertexArrayObject.UNSUPPORTED; + } + + public boolean instancedArraysSupported() { + return instancedArrays != InstancedArrays.UNSUPPORTED; + } + + public boolean drawInstancedSupported() { + return drawInstanced != DrawInstanced.UNSUPPORTED; + } + + /** + * Get the most compatible version of a specific OpenGL feature by iterating over enum constants in order. + * + * @param clazz The class of the versioning enum. + * @param caps The current system's supported features. + * @param The type of the versioning enum. + * @return The first defined enum variant to return true. + */ + public static & GlVersioned> V getLatest(Class clazz, GLCapabilities caps) { + V[] constants = clazz.getEnumConstants(); + V last = constants[constants.length - 1]; + if (!last.supported(caps)) { + throw new IllegalStateException(""); + } + + return Arrays.stream(constants).filter(it -> it.supported(caps)).findFirst().get(); + } +} + diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/GlVersioned.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/GlVersioned.java index 53d929ea0..6f456c802 100644 --- a/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/GlVersioned.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/GlVersioned.java @@ -2,7 +2,15 @@ package com.simibubi.create.foundation.render.backend.gl.versioned; import org.lwjgl.opengl.GLCapabilities; - +/** + * This interface should be implemented by enums such that the + * last defined variant always returns true. + */ public interface GlVersioned { + /** + * Queries whether this variant is supported by the current system. + * @param caps The {@link GLCapabilities} reported by the current system. + * @return true if this variant is supported, or if this is the last defined variant. + */ boolean supported(GLCapabilities caps); } diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/InstancedArrays.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/InstancedArrays.java new file mode 100644 index 000000000..1c000a37d --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/InstancedArrays.java @@ -0,0 +1,43 @@ +package com.simibubi.create.foundation.render.backend.gl.versioned; + +import org.lwjgl.opengl.*; + +public enum InstancedArrays implements GlVersioned { + GL33_INSTANCED_ARRAYS { + @Override + public boolean supported(GLCapabilities caps) { + return caps.OpenGL33; + } + + @Override + public void vertexAttribDivisor(int index, int divisor) { + GL33.glVertexAttribDivisor(index, divisor); + } + }, + ARB_INSTANCED_ARRAYS { + @Override + public boolean supported(GLCapabilities caps) { + return caps.GL_ARB_instanced_arrays; + } + + @Override + public void vertexAttribDivisor(int index, int divisor) { + ARBInstancedArrays.glVertexAttribDivisorARB(index, divisor); + } + }, + UNSUPPORTED { + @Override + public boolean supported(GLCapabilities caps) { + return true; + } + + @Override + public void vertexAttribDivisor(int index, int divisor) { + throw new UnsupportedOperationException(); + } + } + + ; + + public abstract void vertexAttribDivisor(int index, int divisor); +} diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/VertexArrayObject.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/VertexArrayObject.java new file mode 100644 index 000000000..58b9f0fc8 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/VertexArrayObject.java @@ -0,0 +1,77 @@ +package com.simibubi.create.foundation.render.backend.gl.versioned; + +import org.lwjgl.opengl.*; + +public enum VertexArrayObject implements GlVersioned { + GL30_VAO { + @Override + public boolean supported(GLCapabilities caps) { + return caps.OpenGL30; + } + + @Override + public int genVertexArrays() { + return GL30.glGenVertexArrays(); + } + + @Override + public void bindVertexArray(int array) { + GL30.glBindVertexArray(array); + } + + @Override + public void deleteVertexArrays(int array) { + GL30.glDeleteVertexArrays(array); + } + }, + ARB_VAO { + @Override + public boolean supported(GLCapabilities caps) { + return caps.GL_ARB_vertex_array_object; + } + + @Override + public int genVertexArrays() { + return ARBVertexArrayObject.glGenVertexArrays(); + } + + @Override + public void bindVertexArray(int array) { + ARBVertexArrayObject.glBindVertexArray(array); + } + + @Override + public void deleteVertexArrays(int array) { + ARBVertexArrayObject.glDeleteVertexArrays(array); + } + }, + UNSUPPORTED { + @Override + public boolean supported(GLCapabilities caps) { + return true; + } + + @Override + public int genVertexArrays() { + throw new UnsupportedOperationException(); + } + + @Override + public void bindVertexArray(int array) { + throw new UnsupportedOperationException(); + } + + @Override + public void deleteVertexArrays(int array) { + throw new UnsupportedOperationException(); + } + } + + ; + + public abstract int genVertexArrays(); + + public abstract void bindVertexArray(int array); + + public abstract void deleteVertexArrays(int array); +} diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/instancing/InstancedModel.java b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/InstancedModel.java index b18cffcc4..3b092c919 100644 --- a/src/main/java/com/simibubi/create/foundation/render/backend/instancing/InstancedModel.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/InstancedModel.java @@ -5,11 +5,10 @@ import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.function.Consumer; +import com.simibubi.create.foundation.render.backend.Backend; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL15; import org.lwjgl.opengl.GL20; -import org.lwjgl.opengl.GL31; -import org.lwjgl.opengl.GL33; import com.simibubi.create.foundation.render.RenderMath; import com.simibubi.create.foundation.render.backend.BufferedModel; @@ -116,7 +115,7 @@ public abstract class InstancedModel extends BufferedMod protected void doRender() { vao.with(vao -> { renderSetup(); - GL31.glDrawArraysInstanced(GL11.GL_QUADS, 0, vertexCount, glInstanceCount); + Backend.functions.drawArraysInstanced(GL11.GL_QUADS, 0, vertexCount, glInstanceCount); }); } @@ -163,7 +162,7 @@ public abstract class InstancedModel extends BufferedMod instanceFormat.vertexAttribPointers(staticAttributes); for (int i = 0; i < instanceFormat.getShaderAttributeCount(); i++) { - GL33.glVertexAttribDivisor(i + staticAttributes, 1); + Backend.functions.vertexAttribDivisor(i + staticAttributes, 1); } }); From 46daa3f699a65b681b7690870bbb91e8ea4424f8 Mon Sep 17 00:00:00 2001 From: zelophed Date: Sun, 21 Feb 2021 18:12:19 +0100 Subject: [PATCH 4/8] composting, but fancy - add the composter as a mechanical arm interaction point --- .../mechanicalArm/ArmInteractionPoint.java | 106 ++++++++++-------- 1 file changed, 57 insertions(+), 49 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmInteractionPoint.java b/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmInteractionPoint.java index 7b4643ef0..563bd51cc 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmInteractionPoint.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmInteractionPoint.java @@ -1,9 +1,5 @@ package com.simibubi.create.content.logistics.block.mechanicalArm; -import java.util.function.Supplier; - -import javax.annotation.Nullable; - import com.google.common.collect.ImmutableMap; import com.mojang.blaze3d.matrix.MatrixStack; import com.simibubi.create.AllBlockPartials; @@ -25,10 +21,10 @@ import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringBe import com.simibubi.create.foundation.tileEntity.behaviour.inventory.InvManipulationBehaviour; import com.simibubi.create.foundation.utility.NBTHelper; import com.simibubi.create.foundation.utility.VecHelper; - import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.block.ComposterBlock; import net.minecraft.block.JukeboxBlock; -import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.MusicDiscItem; @@ -50,10 +46,14 @@ import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemHandlerHelper; +import net.minecraftforge.items.wrapper.InvWrapper; + +import javax.annotation.Nullable; +import java.util.function.Supplier; public abstract class ArmInteractionPoint { - static enum Mode { + enum Mode { DEPOSIT, TAKE } @@ -65,20 +65,21 @@ public abstract class ArmInteractionPoint { private ArmAngleTarget cachedAngles; private static ImmutableMap> POINTS = - ImmutableMap.>builder() - .put(new Saw(), Saw::new) - .put(new Belt(), Belt::new) - .put(new Depot(), Depot::new) - .put(new Chute(), Chute::new) - .put(new Basin(), Basin::new) - .put(new Funnel(), Funnel::new) - .put(new Jukebox(), Jukebox::new) - .put(new Crafter(), Crafter::new) - .put(new Deployer(), Deployer::new) - .put(new Millstone(), Millstone::new) - .put(new BlazeBurner(), BlazeBurner::new) - .put(new CrushingWheels(), CrushingWheels::new) - .build(); + ImmutableMap.>builder() + .put(new Saw(), Saw::new) + .put(new Belt(), Belt::new) + .put(new Depot(), Depot::new) + .put(new Chute(), Chute::new) + .put(new Basin(), Basin::new) + .put(new Funnel(), Funnel::new) + .put(new Jukebox(), Jukebox::new) + .put(new Crafter(), Crafter::new) + .put(new Deployer(), Deployer::new) + .put(new Composter(), Composter::new) + .put(new Millstone(), Millstone::new) + .put(new BlazeBurner(), BlazeBurner::new) + .put(new CrushingWheels(), CrushingWheels::new) + .build(); public ArmInteractionPoint() { cachedHandler = LazyOptional.empty(); @@ -118,8 +119,8 @@ public abstract class ArmInteractionPoint { ArmAngleTarget getTargetAngles(BlockPos armPos, boolean ceiling) { if (cachedAngles == null) - cachedAngles = - new ArmAngleTarget(armPos, getInteractionPositionVector(), getInteractionDirection(), ceiling); + cachedAngles = new ArmAngleTarget(armPos, getInteractionPositionVector(), getInteractionDirection(), ceiling); + return cachedAngles; } @@ -166,8 +167,7 @@ public abstract class ArmInteractionPoint { for (ArmInteractionPoint armInteractionPoint : POINTS.keySet()) if (armInteractionPoint.isValid(world, pos, state)) - point = POINTS.get(armInteractionPoint) - .get(); + point = POINTS.get(armInteractionPoint).get(); if (point != null) { point.state = state; @@ -222,7 +222,7 @@ public abstract class ArmInteractionPoint { @Override boolean isValid(IBlockReader reader, BlockPos pos, BlockState state) { return AllBlocks.MECHANICAL_SAW.has(state) && state.get(SawBlock.FACING) == Direction.UP - && ((KineticTileEntity) reader.getTileEntity(pos)).getSpeed() != 0; + && ((KineticTileEntity) reader.getTileEntity(pos)).getSpeed() != 0; } } @@ -245,6 +245,25 @@ public abstract class ArmInteractionPoint { } + static class Composter extends TopFaceArmInteractionPoint { + + @Override + Vec3d getInteractionPositionVector() { + return new Vec3d(pos).add(.5f, 13 / 16f, .5f); + } + + @Override + boolean isValid(IBlockReader reader, BlockPos pos, BlockState state) { + return Blocks.COMPOSTER.equals(state.getBlock()); + } + + @Nullable + @Override + IItemHandler getHandler(World world) { + return new InvWrapper(((ComposterBlock) Blocks.COMPOSTER).createInventory(world.getBlockState(pos), world, pos)); + } + } + static class Deployer extends ArmInteractionPoint { @Override @@ -254,14 +273,12 @@ public abstract class ArmInteractionPoint { @Override Direction getInteractionDirection() { - return state.get(DeployerBlock.FACING) - .getOpposite(); + return state.get(DeployerBlock.FACING).getOpposite(); } @Override Vec3d getInteractionPositionVector() { - return super.getInteractionPositionVector() - .add(new Vec3d(getInteractionDirection().getDirectionVec()).scale(.65f)); + return super.getInteractionPositionVector().add(new Vec3d(getInteractionDirection().getDirectionVec()).scale(.65f)); } } @@ -281,15 +298,13 @@ public abstract class ArmInteractionPoint { @Override ItemStack insert(World world, ItemStack stack, boolean simulate) { ItemStack input = stack.copy(); - if (!BlazeBurnerBlock.tryInsert(state, world, pos, input, false, true) - .getResult() - .isEmpty()) { + if (!BlazeBurnerBlock.tryInsert(state, world, pos, input, false, true).getResult().isEmpty()) { return stack; } ActionResult res = BlazeBurnerBlock.tryInsert(state, world, pos, input, false, simulate); return res.getType() == ActionResultType.SUCCESS - ? ItemHandlerHelper.copyStackWithSize(stack, stack.getCount() - 1) - : stack; + ? ItemHandlerHelper.copyStackWithSize(stack, stack.getCount() - 1) + : stack; } @Override @@ -306,8 +321,7 @@ public abstract class ArmInteractionPoint { @Override Direction getInteractionDirection() { - return state.get(MechanicalCrafterBlock.HORIZONTAL_FACING) - .getOpposite(); + return state.get(MechanicalCrafterBlock.HORIZONTAL_FACING).getOpposite(); } @Override @@ -325,8 +339,7 @@ public abstract class ArmInteractionPoint { @Override Vec3d getInteractionPositionVector() { - return super.getInteractionPositionVector() - .add(new Vec3d(getInteractionDirection().getDirectionVec()).scale(.5f)); + return super.getInteractionPositionVector().add(new Vec3d(getInteractionDirection().getDirectionVec()).scale(.5f)); } } @@ -361,8 +374,7 @@ public abstract class ArmInteractionPoint { return stack; JukeboxBlock jukeboxBlock = (JukeboxBlock) state.getBlock(); JukeboxTileEntity jukeboxTE = (JukeboxTileEntity) tileEntity; - if (!jukeboxTE.getRecord() - .isEmpty()) + if (!jukeboxTE.getRecord().isEmpty()) return stack; if (!(stack.getItem() instanceof MusicDiscItem)) return stack; @@ -370,7 +382,7 @@ public abstract class ArmInteractionPoint { ItemStack toInsert = remainder.split(1); if (!simulate && !world.isRemote) { jukeboxBlock.insertRecord(world, pos, state, toInsert); - world.playEvent((PlayerEntity) null, 1010, pos, Item.getIdFromItem(toInsert.getItem())); + world.playEvent(null, 1010, pos, Item.getIdFromItem(toInsert.getItem())); AllTriggers.triggerForNearbyPlayers(AllTriggers.MUSICAL_ARM, world, pos, 10); } return remainder; @@ -401,8 +413,7 @@ public abstract class ArmInteractionPoint { @Override boolean isValid(IBlockReader reader, BlockPos pos, BlockState state) { - return AllBlocks.BELT.has(state) && !(reader.getBlockState(pos.up()) - .getBlock() instanceof BeltTunnelBlock); + return AllBlocks.BELT.has(state) && !(reader.getBlockState(pos.up()).getBlock() instanceof BeltTunnelBlock); } } @@ -418,9 +429,7 @@ public abstract class ArmInteractionPoint { @Override Vec3d getInteractionPositionVector() { - return VecHelper.getCenterOf(pos) - .add(new Vec3d(FunnelBlock.getFunnelFacing(state) - .getDirectionVec()).scale(-.15f)); + return VecHelper.getCenterOf(pos).add(new Vec3d(FunnelBlock.getFunnelFacing(state).getDirectionVec()).scale(-.15f)); } @Override @@ -435,8 +444,7 @@ public abstract class ArmInteractionPoint { @Override Direction getInteractionDirection() { - return FunnelBlock.getFunnelFacing(state) - .getOpposite(); + return FunnelBlock.getFunnelFacing(state).getOpposite(); } @Override From e3915792b18d6961a5035d886ca019d9e7dfddf5 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Sun, 21 Feb 2021 22:29:46 +0100 Subject: [PATCH 5/8] Back to Directional - New vertical funnel models by @Kryppers --- src/generated/resources/.cache/cache | 46 ++-- .../create/blockstates/andesite_funnel.json | 196 +++++----------- .../create/blockstates/brass_funnel.json | 196 +++++----------- .../andesite_funnel_ceiling_pull_powered.json | 11 - .../block/andesite_funnel_ceiling_push.json | 11 - .../andesite_funnel_ceiling_push_powered.json | 11 - .../block/andesite_funnel_floor_pull.json | 11 - .../block/andesite_funnel_floor_push.json | 11 - .../andesite_funnel_floor_push_powered.json | 11 - ...n => andesite_funnel_horizontal_pull.json} | 6 +- ...esite_funnel_horizontal_pull_powered.json} | 6 +- ...n => andesite_funnel_horizontal_push.json} | 6 +- ...esite_funnel_horizontal_push_powered.json} | 6 +- .../block/andesite_funnel_vertical_pull.json | 13 ++ ...andesite_funnel_vertical_pull_powered.json | 13 ++ .../block/andesite_funnel_vertical_push.json | 13 ++ ...andesite_funnel_vertical_push_powered.json | 13 ++ .../block/andesite_funnel_wall_pull.json | 11 - .../andesite_funnel_wall_pull_powered.json | 11 - .../block/brass_funnel_ceiling_pull.json | 11 - .../brass_funnel_ceiling_pull_powered.json | 11 - .../brass_funnel_ceiling_push_powered.json | 11 - .../models/block/brass_funnel_floor_pull.json | 11 - .../models/block/brass_funnel_floor_push.json | 11 - .../brass_funnel_floor_push_powered.json | 11 - ...json => brass_funnel_horizontal_pull.json} | 6 +- ...brass_funnel_horizontal_pull_powered.json} | 6 +- ...json => brass_funnel_horizontal_push.json} | 6 +- ...brass_funnel_horizontal_push_powered.json} | 6 +- .../block/brass_funnel_vertical_pull.json | 13 ++ .../brass_funnel_vertical_pull_powered.json | 13 ++ .../block/brass_funnel_vertical_push.json | 13 ++ .../brass_funnel_vertical_push_powered.json | 13 ++ .../block/brass_funnel_wall_pull_powered.json | 11 - .../models/block/brass_funnel_wall_push.json | 11 - .../data/create/advancements/aesthetics.json | 4 +- .../java/com/simibubi/create/AllBlocks.java | 12 +- .../java/com/simibubi/create/AllShapes.java | 2 +- .../AbstractDirectionalFunnelBlock.java | 40 ++++ .../block/funnel/AbstractFunnelBlock.java | 16 +- .../funnel/AbstractHorizontalFunnelBlock.java | 40 ++++ .../block/funnel/AndesiteFunnelBlock.java | 2 +- .../block/funnel/BeltFunnelBlock.java | 4 +- .../block/funnel/BrassFunnelBlock.java | 2 +- .../logistics/block/funnel/FunnelBlock.java | 41 +--- .../funnel/FunnelFilterSlotPositioning.java | 65 ++---- .../block/funnel/FunnelGenerator.java | 80 +++++++ .../logistics/block/funnel/FunnelItem.java | 7 +- .../block/funnel/FunnelTileEntity.java | 3 +- .../foundation/data/BuilderTransformers.java | 39 ---- .../models/block/funnel/block_ceiling.json | 134 ----------- .../block/funnel/block_ceiling_old.json | 147 ------------ .../models/block/funnel/block_floor.json | 134 ----------- ...{block_wall.json => block_horizontal.json} | 0 .../models/block/funnel/block_vertical.json | 212 ++++++++++++++++++ 55 files changed, 689 insertions(+), 1061 deletions(-) delete mode 100644 src/generated/resources/assets/create/models/block/andesite_funnel_ceiling_pull_powered.json delete mode 100644 src/generated/resources/assets/create/models/block/andesite_funnel_ceiling_push.json delete mode 100644 src/generated/resources/assets/create/models/block/andesite_funnel_ceiling_push_powered.json delete mode 100644 src/generated/resources/assets/create/models/block/andesite_funnel_floor_pull.json delete mode 100644 src/generated/resources/assets/create/models/block/andesite_funnel_floor_push.json delete mode 100644 src/generated/resources/assets/create/models/block/andesite_funnel_floor_push_powered.json rename src/generated/resources/assets/create/models/block/{andesite_funnel_ceiling_pull.json => andesite_funnel_horizontal_pull.json} (60%) rename src/generated/resources/assets/create/models/block/{andesite_funnel_floor_pull_powered.json => andesite_funnel_horizontal_pull_powered.json} (60%) rename src/generated/resources/assets/create/models/block/{andesite_funnel_wall_push.json => andesite_funnel_horizontal_push.json} (60%) rename src/generated/resources/assets/create/models/block/{andesite_funnel_wall_push_powered.json => andesite_funnel_horizontal_push_powered.json} (60%) create mode 100644 src/generated/resources/assets/create/models/block/andesite_funnel_vertical_pull.json create mode 100644 src/generated/resources/assets/create/models/block/andesite_funnel_vertical_pull_powered.json create mode 100644 src/generated/resources/assets/create/models/block/andesite_funnel_vertical_push.json create mode 100644 src/generated/resources/assets/create/models/block/andesite_funnel_vertical_push_powered.json delete mode 100644 src/generated/resources/assets/create/models/block/andesite_funnel_wall_pull.json delete mode 100644 src/generated/resources/assets/create/models/block/andesite_funnel_wall_pull_powered.json delete mode 100644 src/generated/resources/assets/create/models/block/brass_funnel_ceiling_pull.json delete mode 100644 src/generated/resources/assets/create/models/block/brass_funnel_ceiling_pull_powered.json delete mode 100644 src/generated/resources/assets/create/models/block/brass_funnel_ceiling_push_powered.json delete mode 100644 src/generated/resources/assets/create/models/block/brass_funnel_floor_pull.json delete mode 100644 src/generated/resources/assets/create/models/block/brass_funnel_floor_push.json delete mode 100644 src/generated/resources/assets/create/models/block/brass_funnel_floor_push_powered.json rename src/generated/resources/assets/create/models/block/{brass_funnel_wall_pull.json => brass_funnel_horizontal_pull.json} (60%) rename src/generated/resources/assets/create/models/block/{brass_funnel_floor_pull_powered.json => brass_funnel_horizontal_pull_powered.json} (60%) rename src/generated/resources/assets/create/models/block/{brass_funnel_ceiling_push.json => brass_funnel_horizontal_push.json} (60%) rename src/generated/resources/assets/create/models/block/{brass_funnel_wall_push_powered.json => brass_funnel_horizontal_push_powered.json} (60%) create mode 100644 src/generated/resources/assets/create/models/block/brass_funnel_vertical_pull.json create mode 100644 src/generated/resources/assets/create/models/block/brass_funnel_vertical_pull_powered.json create mode 100644 src/generated/resources/assets/create/models/block/brass_funnel_vertical_push.json create mode 100644 src/generated/resources/assets/create/models/block/brass_funnel_vertical_push_powered.json delete mode 100644 src/generated/resources/assets/create/models/block/brass_funnel_wall_pull_powered.json delete mode 100644 src/generated/resources/assets/create/models/block/brass_funnel_wall_push.json create mode 100644 src/main/java/com/simibubi/create/content/logistics/block/funnel/AbstractDirectionalFunnelBlock.java create mode 100644 src/main/java/com/simibubi/create/content/logistics/block/funnel/AbstractHorizontalFunnelBlock.java create mode 100644 src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelGenerator.java delete mode 100644 src/main/resources/assets/create/models/block/funnel/block_ceiling.json delete mode 100644 src/main/resources/assets/create/models/block/funnel/block_ceiling_old.json delete mode 100644 src/main/resources/assets/create/models/block/funnel/block_floor.json rename src/main/resources/assets/create/models/block/funnel/{block_wall.json => block_horizontal.json} (100%) create mode 100644 src/main/resources/assets/create/models/block/funnel/block_vertical.json diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 046c32d3a..08899d979 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -16,7 +16,7 @@ a579c40c43dc2174afb66f42d00d0c4a0efaaeee assets/create/blockstates/andesite_bric 96b5284693da168ab8e0809d86515b5f1a7e763f assets/create/blockstates/andesite_cobblestone_stairs.json 82bd82270aff7d51e9239680ef4dd7b5c899ceb0 assets/create/blockstates/andesite_cobblestone_wall.json 9639b901ffdd2ecccab5575c5c9e6c7b5c901e02 assets/create/blockstates/andesite_encased_shaft.json -7187eba21a32e6954261cc71008ec1834a2e8af7 assets/create/blockstates/andesite_funnel.json +53cf4cfd94db1f44e9865b9fe5db383d01a12671 assets/create/blockstates/andesite_funnel.json 398922758a6219544e5b85c91c9cf8a543b437e5 assets/create/blockstates/andesite_pillar.json 1d2d8081581e07d9be4b382aede4f2de4401cc6b assets/create/blockstates/andesite_tunnel.json e555e3c2b2d3f01440e48db4ba88f7e00fd99b6f assets/create/blockstates/basin.json @@ -34,7 +34,7 @@ ee1299a15fca849eb42bf81507f85a54c167bbfe assets/create/blockstates/brass_belt_fu 8b1dd00adcc7e74c5a9feed069e2610b15a338cb assets/create/blockstates/brass_block.json b8dd6e505943e06706d0718ece620ab3cf943650 assets/create/blockstates/brass_casing.json 288bad07593a8a2c8efaf44bba0ffb0011d36cd3 assets/create/blockstates/brass_encased_shaft.json -8b5e88dea4e10ba3c74f0f161e49fed31a376ea1 assets/create/blockstates/brass_funnel.json +adfbd6cc5e44a0f431180aedbe65a19428299d8e assets/create/blockstates/brass_funnel.json 672eedcd3520c6d39603449165a23be9c612c620 assets/create/blockstates/brass_tunnel.json 11ebdd9bd0815833e62ec1bea03a4cdd86ce00f3 assets/create/blockstates/brown_sail.json e81608346d43406ee72cae0f78b8bcfb37ba2d75 assets/create/blockstates/brown_seat.json @@ -461,18 +461,14 @@ ad255a62a5f54b578db06e89fd7160001f905675 assets/create/models/block/andesite_cob a033fbac3129bba9211c6c4a0e16c905643afa39 assets/create/models/block/andesite_cobblestone_stairs_outer.json 1c574ee47aeb6fcb305bfc95dd131e153b795a0e assets/create/models/block/andesite_cobblestone_wall_post.json 0ed983628e8868f77301bea1111570d3631f24fb assets/create/models/block/andesite_cobblestone_wall_side.json -7d5faceb2a8d67acddd39625da6d5853f07ea8bd assets/create/models/block/andesite_funnel_ceiling_pull.json -82393ded7287660d16549e321317dfe4488cc81d assets/create/models/block/andesite_funnel_ceiling_pull_powered.json -40d7adae3b5eecd8ed08445b2d7f43d7a0684837 assets/create/models/block/andesite_funnel_ceiling_push.json -940cace1d38fef0d5d88a391b0ba8cf690b38a44 assets/create/models/block/andesite_funnel_ceiling_push_powered.json -c77c660ea142419e93754c9702445c269dbcd0cc assets/create/models/block/andesite_funnel_floor_pull.json -16d402c764364254a704a13736bd68455edc28ba assets/create/models/block/andesite_funnel_floor_pull_powered.json -6a809d0e0e53b845b587276444cb7b64a1e15e81 assets/create/models/block/andesite_funnel_floor_push.json -6eac3e4f593e4182f5c216a900136a62ea953fb5 assets/create/models/block/andesite_funnel_floor_push_powered.json -cc187c98c62b47f5bdb6e5187f52d3d927486376 assets/create/models/block/andesite_funnel_wall_pull.json -525cf080df53a428d1321d25c2021b5f3b80a4e6 assets/create/models/block/andesite_funnel_wall_pull_powered.json -78fcd6a91a84f5824e3e0006609b6f01760238d4 assets/create/models/block/andesite_funnel_wall_push.json -6c48d1a0b8cb007a6eddaa9b2f6cb8a98334d34e assets/create/models/block/andesite_funnel_wall_push_powered.json +8d4e4a7c6ad6d45c7aa7ca3105a025511571ff26 assets/create/models/block/andesite_funnel_horizontal_pull.json +9841d6a09a09bf4d5d6a39bdc4904d86b3a825f8 assets/create/models/block/andesite_funnel_horizontal_pull_powered.json +86d5df6e365d9b2e9682f0839f61058360828ba2 assets/create/models/block/andesite_funnel_horizontal_push.json +50af1ff6ce9af162d4e438f21952c7215608dc8e assets/create/models/block/andesite_funnel_horizontal_push_powered.json +618d6ca90addb5913c72789f6188c957afa503f3 assets/create/models/block/andesite_funnel_vertical_pull.json +45365708fa75e2cd3d0702fb0e4960861ada27ab assets/create/models/block/andesite_funnel_vertical_pull_powered.json +53bdeba42894242088e8f7e7734a101fa998d0e4 assets/create/models/block/andesite_funnel_vertical_push.json +3e88fa45e22868dae92a014e589585d37eb465ad assets/create/models/block/andesite_funnel_vertical_push_powered.json b1d0bb538fc8285b7d3fd77a977d78a104b83b62 assets/create/models/block/andesite_pillar.json aaf2e4259bcfcedd3400e9acb2d64c0cf06f7fb1 assets/create/models/block/andesite_tunnel/cross.json 75f628178fa21a2bd301eea8d1cebf7e94f7d5cc assets/create/models/block/andesite_tunnel/straight.json @@ -513,18 +509,14 @@ dfc6250e28e12ff193a45891978ec50c406fc0c2 assets/create/models/block/brass_belt_f 97410a12b7c1461f88fb633f26ff566a0636b627 assets/create/models/block/brass_belt_funnel__retracted.json 71d0ad31d89d4ea3f243c6003b17f57fd168c933 assets/create/models/block/brass_block.json 166a5c053a81e6aadc24509ed24dc144a7255969 assets/create/models/block/brass_casing.json -f5f689dc8be53e560878d3dde7b6eda6b3bf28e3 assets/create/models/block/brass_funnel_ceiling_pull.json -142a56e522c74268d0b418985eb3fd285e371295 assets/create/models/block/brass_funnel_ceiling_pull_powered.json -e583d701961b68223778d28edc0e2686c1a5c5df assets/create/models/block/brass_funnel_ceiling_push.json -ccb2b596c3f190c26fdec06dd2b53ac3e59b1ff2 assets/create/models/block/brass_funnel_ceiling_push_powered.json -7f541d8235326fea3ecb370c4cf2913867f439ad assets/create/models/block/brass_funnel_floor_pull.json -5277d7c614991a5bce0e9234c4094f02c6d201c2 assets/create/models/block/brass_funnel_floor_pull_powered.json -1831d87b5a9784c12cecefbb9d3173c29f4ddc87 assets/create/models/block/brass_funnel_floor_push.json -6aee078641719086c9a98ebd1c0d0d61cd4d33a9 assets/create/models/block/brass_funnel_floor_push_powered.json -aa86ddeeb41aea5bd85dd488d932fbc913828b1f assets/create/models/block/brass_funnel_wall_pull.json -161b420ee4f41d436177e20314dcbe61ecec53a8 assets/create/models/block/brass_funnel_wall_pull_powered.json -24362e71ca3a6d0f2dbf129909eceb8b3937a66b assets/create/models/block/brass_funnel_wall_push.json -76cdebba3116be88926d9640917e579377ef3134 assets/create/models/block/brass_funnel_wall_push_powered.json +f7fd1f49857eca94e4135e65c85127510d666e4f assets/create/models/block/brass_funnel_horizontal_pull.json +45a23298ad03fd3b5dc2757dcd7edc18b8cce222 assets/create/models/block/brass_funnel_horizontal_pull_powered.json +a9fc7210d44b47202438668f11b31099e82c9ebd assets/create/models/block/brass_funnel_horizontal_push.json +4049bf503ec2ee22412c59e05299de20319b0dc6 assets/create/models/block/brass_funnel_horizontal_push_powered.json +320e377a4380ac637bff2e0535f229c52d886437 assets/create/models/block/brass_funnel_vertical_pull.json +28c2f8ca6403f98b82e3a0eadb608a41490cc96f assets/create/models/block/brass_funnel_vertical_pull_powered.json +c4c46d47854c9a6cf8f410006a35bbc8e599f0d5 assets/create/models/block/brass_funnel_vertical_push.json +fd6f6607a4742fa87dfe1768927a29dc4975ce7a assets/create/models/block/brass_funnel_vertical_push_powered.json 520087db8d479c66f85f3483af813fb668f27503 assets/create/models/block/brass_tunnel/cross.json 347ed67bf3426e323354e2d959fc9563dc7eeecd assets/create/models/block/brass_tunnel/straight.json a959e03ca339badb49fe58ba53d86a84352e91f3 assets/create/models/block/brass_tunnel/t_left.json @@ -1587,7 +1579,7 @@ d080b1b25e5bc8baf5aee68691b08c7f12ece3b0 assets/create/models/item/windmill_bear 9f9455ccb5fc9e3cbfce73862b46078346a522a5 assets/create/models/item/zinc_nugget.json b1689617190c05ef34bd18456b0c7ae09bb3210f assets/create/models/item/zinc_ore.json e76041b7ae829fdd7dc0524f6ca4d2f89fca51bb assets/create/sounds.json -0f1b4b980afba9bf2caf583b88e261bba8b10313 data/create/advancements/aesthetics.json +5d0cc4c0255dc241e61c173b31ddca70c88d08e4 data/create/advancements/aesthetics.json 187921fa131b06721bfaf63f2623a28c141aae9a data/create/advancements/andesite_alloy.json 0ea2db7173b5be28b289ea7c9a6a0cf5805c60c7 data/create/advancements/andesite_casing.json 356f4855a2a6c65be3fb51d7d1aabf2ca6034d42 data/create/advancements/arm_blaze_burner.json diff --git a/src/generated/resources/assets/create/blockstates/andesite_funnel.json b/src/generated/resources/assets/create/blockstates/andesite_funnel.json index 0161a1706..7330405c1 100644 --- a/src/generated/resources/assets/create/blockstates/andesite_funnel.json +++ b/src/generated/resources/assets/create/blockstates/andesite_funnel.json @@ -1,183 +1,99 @@ { "variants": { - "extracting=false,face=floor,facing=north,powered=false": { - "model": "create:block/andesite_funnel_floor_pull" - }, - "extracting=true,face=floor,facing=north,powered=false": { - "model": "create:block/andesite_funnel_floor_push" - }, - "extracting=false,face=wall,facing=north,powered=false": { - "model": "create:block/andesite_funnel_wall_pull" - }, - "extracting=true,face=wall,facing=north,powered=false": { - "model": "create:block/andesite_funnel_wall_push" - }, - "extracting=false,face=ceiling,facing=north,powered=false": { - "model": "create:block/andesite_funnel_ceiling_pull" - }, - "extracting=true,face=ceiling,facing=north,powered=false": { - "model": "create:block/andesite_funnel_ceiling_push" - }, - "extracting=false,face=floor,facing=south,powered=false": { - "model": "create:block/andesite_funnel_floor_pull", + "extracting=false,facing=down,powered=false": { + "model": "create:block/andesite_funnel_vertical_pull", + "x": 180, "y": 180 }, - "extracting=true,face=floor,facing=south,powered=false": { - "model": "create:block/andesite_funnel_floor_push", + "extracting=true,facing=down,powered=false": { + "model": "create:block/andesite_funnel_vertical_push", + "x": 180, "y": 180 }, - "extracting=false,face=wall,facing=south,powered=false": { - "model": "create:block/andesite_funnel_wall_pull", + "extracting=false,facing=up,powered=false": { + "model": "create:block/andesite_funnel_vertical_pull", "y": 180 }, - "extracting=true,face=wall,facing=south,powered=false": { - "model": "create:block/andesite_funnel_wall_push", + "extracting=true,facing=up,powered=false": { + "model": "create:block/andesite_funnel_vertical_push", "y": 180 }, - "extracting=false,face=ceiling,facing=south,powered=false": { - "model": "create:block/andesite_funnel_ceiling_pull", + "extracting=false,facing=north,powered=false": { + "model": "create:block/andesite_funnel_horizontal_pull" + }, + "extracting=true,facing=north,powered=false": { + "model": "create:block/andesite_funnel_horizontal_push" + }, + "extracting=false,facing=south,powered=false": { + "model": "create:block/andesite_funnel_horizontal_pull", "y": 180 }, - "extracting=true,face=ceiling,facing=south,powered=false": { - "model": "create:block/andesite_funnel_ceiling_push", + "extracting=true,facing=south,powered=false": { + "model": "create:block/andesite_funnel_horizontal_push", "y": 180 }, - "extracting=false,face=floor,facing=west,powered=false": { - "model": "create:block/andesite_funnel_floor_pull", + "extracting=false,facing=west,powered=false": { + "model": "create:block/andesite_funnel_horizontal_pull", "y": 270 }, - "extracting=true,face=floor,facing=west,powered=false": { - "model": "create:block/andesite_funnel_floor_push", + "extracting=true,facing=west,powered=false": { + "model": "create:block/andesite_funnel_horizontal_push", "y": 270 }, - "extracting=false,face=wall,facing=west,powered=false": { - "model": "create:block/andesite_funnel_wall_pull", - "y": 270 - }, - "extracting=true,face=wall,facing=west,powered=false": { - "model": "create:block/andesite_funnel_wall_push", - "y": 270 - }, - "extracting=false,face=ceiling,facing=west,powered=false": { - "model": "create:block/andesite_funnel_ceiling_pull", - "y": 270 - }, - "extracting=true,face=ceiling,facing=west,powered=false": { - "model": "create:block/andesite_funnel_ceiling_push", - "y": 270 - }, - "extracting=false,face=floor,facing=east,powered=false": { - "model": "create:block/andesite_funnel_floor_pull", + "extracting=false,facing=east,powered=false": { + "model": "create:block/andesite_funnel_horizontal_pull", "y": 90 }, - "extracting=true,face=floor,facing=east,powered=false": { - "model": "create:block/andesite_funnel_floor_push", + "extracting=true,facing=east,powered=false": { + "model": "create:block/andesite_funnel_horizontal_push", "y": 90 }, - "extracting=false,face=wall,facing=east,powered=false": { - "model": "create:block/andesite_funnel_wall_pull", - "y": 90 - }, - "extracting=true,face=wall,facing=east,powered=false": { - "model": "create:block/andesite_funnel_wall_push", - "y": 90 - }, - "extracting=false,face=ceiling,facing=east,powered=false": { - "model": "create:block/andesite_funnel_ceiling_pull", - "y": 90 - }, - "extracting=true,face=ceiling,facing=east,powered=false": { - "model": "create:block/andesite_funnel_ceiling_push", - "y": 90 - }, - "extracting=false,face=floor,facing=north,powered=true": { - "model": "create:block/andesite_funnel_floor_pull_powered" - }, - "extracting=true,face=floor,facing=north,powered=true": { - "model": "create:block/andesite_funnel_floor_push_powered" - }, - "extracting=false,face=wall,facing=north,powered=true": { - "model": "create:block/andesite_funnel_wall_pull_powered" - }, - "extracting=true,face=wall,facing=north,powered=true": { - "model": "create:block/andesite_funnel_wall_push_powered" - }, - "extracting=false,face=ceiling,facing=north,powered=true": { - "model": "create:block/andesite_funnel_ceiling_pull_powered" - }, - "extracting=true,face=ceiling,facing=north,powered=true": { - "model": "create:block/andesite_funnel_ceiling_push_powered" - }, - "extracting=false,face=floor,facing=south,powered=true": { - "model": "create:block/andesite_funnel_floor_pull_powered", + "extracting=false,facing=down,powered=true": { + "model": "create:block/andesite_funnel_vertical_pull_powered", + "x": 180, "y": 180 }, - "extracting=true,face=floor,facing=south,powered=true": { - "model": "create:block/andesite_funnel_floor_push_powered", + "extracting=true,facing=down,powered=true": { + "model": "create:block/andesite_funnel_vertical_push_powered", + "x": 180, "y": 180 }, - "extracting=false,face=wall,facing=south,powered=true": { - "model": "create:block/andesite_funnel_wall_pull_powered", + "extracting=false,facing=up,powered=true": { + "model": "create:block/andesite_funnel_vertical_pull_powered", "y": 180 }, - "extracting=true,face=wall,facing=south,powered=true": { - "model": "create:block/andesite_funnel_wall_push_powered", + "extracting=true,facing=up,powered=true": { + "model": "create:block/andesite_funnel_vertical_push_powered", "y": 180 }, - "extracting=false,face=ceiling,facing=south,powered=true": { - "model": "create:block/andesite_funnel_ceiling_pull_powered", + "extracting=false,facing=north,powered=true": { + "model": "create:block/andesite_funnel_horizontal_pull_powered" + }, + "extracting=true,facing=north,powered=true": { + "model": "create:block/andesite_funnel_horizontal_push_powered" + }, + "extracting=false,facing=south,powered=true": { + "model": "create:block/andesite_funnel_horizontal_pull_powered", "y": 180 }, - "extracting=true,face=ceiling,facing=south,powered=true": { - "model": "create:block/andesite_funnel_ceiling_push_powered", + "extracting=true,facing=south,powered=true": { + "model": "create:block/andesite_funnel_horizontal_push_powered", "y": 180 }, - "extracting=false,face=floor,facing=west,powered=true": { - "model": "create:block/andesite_funnel_floor_pull_powered", + "extracting=false,facing=west,powered=true": { + "model": "create:block/andesite_funnel_horizontal_pull_powered", "y": 270 }, - "extracting=true,face=floor,facing=west,powered=true": { - "model": "create:block/andesite_funnel_floor_push_powered", + "extracting=true,facing=west,powered=true": { + "model": "create:block/andesite_funnel_horizontal_push_powered", "y": 270 }, - "extracting=false,face=wall,facing=west,powered=true": { - "model": "create:block/andesite_funnel_wall_pull_powered", - "y": 270 - }, - "extracting=true,face=wall,facing=west,powered=true": { - "model": "create:block/andesite_funnel_wall_push_powered", - "y": 270 - }, - "extracting=false,face=ceiling,facing=west,powered=true": { - "model": "create:block/andesite_funnel_ceiling_pull_powered", - "y": 270 - }, - "extracting=true,face=ceiling,facing=west,powered=true": { - "model": "create:block/andesite_funnel_ceiling_push_powered", - "y": 270 - }, - "extracting=false,face=floor,facing=east,powered=true": { - "model": "create:block/andesite_funnel_floor_pull_powered", + "extracting=false,facing=east,powered=true": { + "model": "create:block/andesite_funnel_horizontal_pull_powered", "y": 90 }, - "extracting=true,face=floor,facing=east,powered=true": { - "model": "create:block/andesite_funnel_floor_push_powered", - "y": 90 - }, - "extracting=false,face=wall,facing=east,powered=true": { - "model": "create:block/andesite_funnel_wall_pull_powered", - "y": 90 - }, - "extracting=true,face=wall,facing=east,powered=true": { - "model": "create:block/andesite_funnel_wall_push_powered", - "y": 90 - }, - "extracting=false,face=ceiling,facing=east,powered=true": { - "model": "create:block/andesite_funnel_ceiling_pull_powered", - "y": 90 - }, - "extracting=true,face=ceiling,facing=east,powered=true": { - "model": "create:block/andesite_funnel_ceiling_push_powered", + "extracting=true,facing=east,powered=true": { + "model": "create:block/andesite_funnel_horizontal_push_powered", "y": 90 } } diff --git a/src/generated/resources/assets/create/blockstates/brass_funnel.json b/src/generated/resources/assets/create/blockstates/brass_funnel.json index 7458dae7c..19a543d73 100644 --- a/src/generated/resources/assets/create/blockstates/brass_funnel.json +++ b/src/generated/resources/assets/create/blockstates/brass_funnel.json @@ -1,183 +1,99 @@ { "variants": { - "extracting=false,face=floor,facing=north,powered=false": { - "model": "create:block/brass_funnel_floor_pull" - }, - "extracting=true,face=floor,facing=north,powered=false": { - "model": "create:block/brass_funnel_floor_push" - }, - "extracting=false,face=wall,facing=north,powered=false": { - "model": "create:block/brass_funnel_wall_pull" - }, - "extracting=true,face=wall,facing=north,powered=false": { - "model": "create:block/brass_funnel_wall_push" - }, - "extracting=false,face=ceiling,facing=north,powered=false": { - "model": "create:block/brass_funnel_ceiling_pull" - }, - "extracting=true,face=ceiling,facing=north,powered=false": { - "model": "create:block/brass_funnel_ceiling_push" - }, - "extracting=false,face=floor,facing=south,powered=false": { - "model": "create:block/brass_funnel_floor_pull", + "extracting=false,facing=down,powered=false": { + "model": "create:block/brass_funnel_vertical_pull", + "x": 180, "y": 180 }, - "extracting=true,face=floor,facing=south,powered=false": { - "model": "create:block/brass_funnel_floor_push", + "extracting=true,facing=down,powered=false": { + "model": "create:block/brass_funnel_vertical_push", + "x": 180, "y": 180 }, - "extracting=false,face=wall,facing=south,powered=false": { - "model": "create:block/brass_funnel_wall_pull", + "extracting=false,facing=up,powered=false": { + "model": "create:block/brass_funnel_vertical_pull", "y": 180 }, - "extracting=true,face=wall,facing=south,powered=false": { - "model": "create:block/brass_funnel_wall_push", + "extracting=true,facing=up,powered=false": { + "model": "create:block/brass_funnel_vertical_push", "y": 180 }, - "extracting=false,face=ceiling,facing=south,powered=false": { - "model": "create:block/brass_funnel_ceiling_pull", + "extracting=false,facing=north,powered=false": { + "model": "create:block/brass_funnel_horizontal_pull" + }, + "extracting=true,facing=north,powered=false": { + "model": "create:block/brass_funnel_horizontal_push" + }, + "extracting=false,facing=south,powered=false": { + "model": "create:block/brass_funnel_horizontal_pull", "y": 180 }, - "extracting=true,face=ceiling,facing=south,powered=false": { - "model": "create:block/brass_funnel_ceiling_push", + "extracting=true,facing=south,powered=false": { + "model": "create:block/brass_funnel_horizontal_push", "y": 180 }, - "extracting=false,face=floor,facing=west,powered=false": { - "model": "create:block/brass_funnel_floor_pull", + "extracting=false,facing=west,powered=false": { + "model": "create:block/brass_funnel_horizontal_pull", "y": 270 }, - "extracting=true,face=floor,facing=west,powered=false": { - "model": "create:block/brass_funnel_floor_push", + "extracting=true,facing=west,powered=false": { + "model": "create:block/brass_funnel_horizontal_push", "y": 270 }, - "extracting=false,face=wall,facing=west,powered=false": { - "model": "create:block/brass_funnel_wall_pull", - "y": 270 - }, - "extracting=true,face=wall,facing=west,powered=false": { - "model": "create:block/brass_funnel_wall_push", - "y": 270 - }, - "extracting=false,face=ceiling,facing=west,powered=false": { - "model": "create:block/brass_funnel_ceiling_pull", - "y": 270 - }, - "extracting=true,face=ceiling,facing=west,powered=false": { - "model": "create:block/brass_funnel_ceiling_push", - "y": 270 - }, - "extracting=false,face=floor,facing=east,powered=false": { - "model": "create:block/brass_funnel_floor_pull", + "extracting=false,facing=east,powered=false": { + "model": "create:block/brass_funnel_horizontal_pull", "y": 90 }, - "extracting=true,face=floor,facing=east,powered=false": { - "model": "create:block/brass_funnel_floor_push", + "extracting=true,facing=east,powered=false": { + "model": "create:block/brass_funnel_horizontal_push", "y": 90 }, - "extracting=false,face=wall,facing=east,powered=false": { - "model": "create:block/brass_funnel_wall_pull", - "y": 90 - }, - "extracting=true,face=wall,facing=east,powered=false": { - "model": "create:block/brass_funnel_wall_push", - "y": 90 - }, - "extracting=false,face=ceiling,facing=east,powered=false": { - "model": "create:block/brass_funnel_ceiling_pull", - "y": 90 - }, - "extracting=true,face=ceiling,facing=east,powered=false": { - "model": "create:block/brass_funnel_ceiling_push", - "y": 90 - }, - "extracting=false,face=floor,facing=north,powered=true": { - "model": "create:block/brass_funnel_floor_pull_powered" - }, - "extracting=true,face=floor,facing=north,powered=true": { - "model": "create:block/brass_funnel_floor_push_powered" - }, - "extracting=false,face=wall,facing=north,powered=true": { - "model": "create:block/brass_funnel_wall_pull_powered" - }, - "extracting=true,face=wall,facing=north,powered=true": { - "model": "create:block/brass_funnel_wall_push_powered" - }, - "extracting=false,face=ceiling,facing=north,powered=true": { - "model": "create:block/brass_funnel_ceiling_pull_powered" - }, - "extracting=true,face=ceiling,facing=north,powered=true": { - "model": "create:block/brass_funnel_ceiling_push_powered" - }, - "extracting=false,face=floor,facing=south,powered=true": { - "model": "create:block/brass_funnel_floor_pull_powered", + "extracting=false,facing=down,powered=true": { + "model": "create:block/brass_funnel_vertical_pull_powered", + "x": 180, "y": 180 }, - "extracting=true,face=floor,facing=south,powered=true": { - "model": "create:block/brass_funnel_floor_push_powered", + "extracting=true,facing=down,powered=true": { + "model": "create:block/brass_funnel_vertical_push_powered", + "x": 180, "y": 180 }, - "extracting=false,face=wall,facing=south,powered=true": { - "model": "create:block/brass_funnel_wall_pull_powered", + "extracting=false,facing=up,powered=true": { + "model": "create:block/brass_funnel_vertical_pull_powered", "y": 180 }, - "extracting=true,face=wall,facing=south,powered=true": { - "model": "create:block/brass_funnel_wall_push_powered", + "extracting=true,facing=up,powered=true": { + "model": "create:block/brass_funnel_vertical_push_powered", "y": 180 }, - "extracting=false,face=ceiling,facing=south,powered=true": { - "model": "create:block/brass_funnel_ceiling_pull_powered", + "extracting=false,facing=north,powered=true": { + "model": "create:block/brass_funnel_horizontal_pull_powered" + }, + "extracting=true,facing=north,powered=true": { + "model": "create:block/brass_funnel_horizontal_push_powered" + }, + "extracting=false,facing=south,powered=true": { + "model": "create:block/brass_funnel_horizontal_pull_powered", "y": 180 }, - "extracting=true,face=ceiling,facing=south,powered=true": { - "model": "create:block/brass_funnel_ceiling_push_powered", + "extracting=true,facing=south,powered=true": { + "model": "create:block/brass_funnel_horizontal_push_powered", "y": 180 }, - "extracting=false,face=floor,facing=west,powered=true": { - "model": "create:block/brass_funnel_floor_pull_powered", + "extracting=false,facing=west,powered=true": { + "model": "create:block/brass_funnel_horizontal_pull_powered", "y": 270 }, - "extracting=true,face=floor,facing=west,powered=true": { - "model": "create:block/brass_funnel_floor_push_powered", + "extracting=true,facing=west,powered=true": { + "model": "create:block/brass_funnel_horizontal_push_powered", "y": 270 }, - "extracting=false,face=wall,facing=west,powered=true": { - "model": "create:block/brass_funnel_wall_pull_powered", - "y": 270 - }, - "extracting=true,face=wall,facing=west,powered=true": { - "model": "create:block/brass_funnel_wall_push_powered", - "y": 270 - }, - "extracting=false,face=ceiling,facing=west,powered=true": { - "model": "create:block/brass_funnel_ceiling_pull_powered", - "y": 270 - }, - "extracting=true,face=ceiling,facing=west,powered=true": { - "model": "create:block/brass_funnel_ceiling_push_powered", - "y": 270 - }, - "extracting=false,face=floor,facing=east,powered=true": { - "model": "create:block/brass_funnel_floor_pull_powered", + "extracting=false,facing=east,powered=true": { + "model": "create:block/brass_funnel_horizontal_pull_powered", "y": 90 }, - "extracting=true,face=floor,facing=east,powered=true": { - "model": "create:block/brass_funnel_floor_push_powered", - "y": 90 - }, - "extracting=false,face=wall,facing=east,powered=true": { - "model": "create:block/brass_funnel_wall_pull_powered", - "y": 90 - }, - "extracting=true,face=wall,facing=east,powered=true": { - "model": "create:block/brass_funnel_wall_push_powered", - "y": 90 - }, - "extracting=false,face=ceiling,facing=east,powered=true": { - "model": "create:block/brass_funnel_ceiling_pull_powered", - "y": 90 - }, - "extracting=true,face=ceiling,facing=east,powered=true": { - "model": "create:block/brass_funnel_ceiling_push_powered", + "extracting=true,facing=east,powered=true": { + "model": "create:block/brass_funnel_horizontal_push_powered", "y": 90 } } diff --git a/src/generated/resources/assets/create/models/block/andesite_funnel_ceiling_pull_powered.json b/src/generated/resources/assets/create/models/block/andesite_funnel_ceiling_pull_powered.json deleted file mode 100644 index f66c6e8f3..000000000 --- a/src/generated/resources/assets/create/models/block/andesite_funnel_ceiling_pull_powered.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "parent": "create:block/funnel/block_ceiling", - "textures": { - "particle": "create:block/andesite_casing", - "7": "create:block/andesite_funnel_plating", - "6": "create:block/andesite_funnel_powered", - "5": "create:block/andesite_funnel_tall_powered", - "2_2": "create:block/andesite_funnel_pull", - "3": "create:block/andesite_funnel_back" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/andesite_funnel_ceiling_push.json b/src/generated/resources/assets/create/models/block/andesite_funnel_ceiling_push.json deleted file mode 100644 index 8217c6b7a..000000000 --- a/src/generated/resources/assets/create/models/block/andesite_funnel_ceiling_push.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "parent": "create:block/funnel/block_ceiling", - "textures": { - "particle": "create:block/andesite_casing", - "7": "create:block/andesite_funnel_plating", - "6": "create:block/andesite_funnel", - "5": "create:block/andesite_funnel_tall", - "2_2": "create:block/andesite_funnel_push", - "3": "create:block/andesite_funnel_back" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/andesite_funnel_ceiling_push_powered.json b/src/generated/resources/assets/create/models/block/andesite_funnel_ceiling_push_powered.json deleted file mode 100644 index ff4df0493..000000000 --- a/src/generated/resources/assets/create/models/block/andesite_funnel_ceiling_push_powered.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "parent": "create:block/funnel/block_ceiling", - "textures": { - "particle": "create:block/andesite_casing", - "7": "create:block/andesite_funnel_plating", - "6": "create:block/andesite_funnel_powered", - "5": "create:block/andesite_funnel_tall_powered", - "2_2": "create:block/andesite_funnel_push", - "3": "create:block/andesite_funnel_back" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/andesite_funnel_floor_pull.json b/src/generated/resources/assets/create/models/block/andesite_funnel_floor_pull.json deleted file mode 100644 index 6079531b3..000000000 --- a/src/generated/resources/assets/create/models/block/andesite_funnel_floor_pull.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "parent": "create:block/funnel/block_floor", - "textures": { - "particle": "create:block/andesite_casing", - "7": "create:block/andesite_funnel_plating", - "6": "create:block/andesite_funnel", - "5": "create:block/andesite_funnel_tall", - "2_2": "create:block/andesite_funnel_pull", - "3": "create:block/andesite_funnel_back" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/andesite_funnel_floor_push.json b/src/generated/resources/assets/create/models/block/andesite_funnel_floor_push.json deleted file mode 100644 index 21b19aa78..000000000 --- a/src/generated/resources/assets/create/models/block/andesite_funnel_floor_push.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "parent": "create:block/funnel/block_floor", - "textures": { - "particle": "create:block/andesite_casing", - "7": "create:block/andesite_funnel_plating", - "6": "create:block/andesite_funnel", - "5": "create:block/andesite_funnel_tall", - "2_2": "create:block/andesite_funnel_push", - "3": "create:block/andesite_funnel_back" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/andesite_funnel_floor_push_powered.json b/src/generated/resources/assets/create/models/block/andesite_funnel_floor_push_powered.json deleted file mode 100644 index 8a8f6a8de..000000000 --- a/src/generated/resources/assets/create/models/block/andesite_funnel_floor_push_powered.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "parent": "create:block/funnel/block_floor", - "textures": { - "particle": "create:block/andesite_casing", - "7": "create:block/andesite_funnel_plating", - "6": "create:block/andesite_funnel_powered", - "5": "create:block/andesite_funnel_tall_powered", - "2_2": "create:block/andesite_funnel_push", - "3": "create:block/andesite_funnel_back" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/andesite_funnel_ceiling_pull.json b/src/generated/resources/assets/create/models/block/andesite_funnel_horizontal_pull.json similarity index 60% rename from src/generated/resources/assets/create/models/block/andesite_funnel_ceiling_pull.json rename to src/generated/resources/assets/create/models/block/andesite_funnel_horizontal_pull.json index bdbb2623f..4ca78f3ab 100644 --- a/src/generated/resources/assets/create/models/block/andesite_funnel_ceiling_pull.json +++ b/src/generated/resources/assets/create/models/block/andesite_funnel_horizontal_pull.json @@ -1,11 +1,11 @@ { - "parent": "create:block/funnel/block_ceiling", + "parent": "create:block/funnel/block_horizontal", "textures": { "particle": "create:block/andesite_casing", "7": "create:block/andesite_funnel_plating", - "6": "create:block/andesite_funnel", "5": "create:block/andesite_funnel_tall", "2_2": "create:block/andesite_funnel_pull", - "3": "create:block/andesite_funnel_back" + "3": "create:block/andesite_funnel_back", + "6": "create:block/andesite_funnel" } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/andesite_funnel_floor_pull_powered.json b/src/generated/resources/assets/create/models/block/andesite_funnel_horizontal_pull_powered.json similarity index 60% rename from src/generated/resources/assets/create/models/block/andesite_funnel_floor_pull_powered.json rename to src/generated/resources/assets/create/models/block/andesite_funnel_horizontal_pull_powered.json index 5ac3f88c7..f30214bd6 100644 --- a/src/generated/resources/assets/create/models/block/andesite_funnel_floor_pull_powered.json +++ b/src/generated/resources/assets/create/models/block/andesite_funnel_horizontal_pull_powered.json @@ -1,11 +1,11 @@ { - "parent": "create:block/funnel/block_floor", + "parent": "create:block/funnel/block_horizontal", "textures": { "particle": "create:block/andesite_casing", "7": "create:block/andesite_funnel_plating", - "6": "create:block/andesite_funnel_powered", "5": "create:block/andesite_funnel_tall_powered", "2_2": "create:block/andesite_funnel_pull", - "3": "create:block/andesite_funnel_back" + "3": "create:block/andesite_funnel_back", + "6": "create:block/andesite_funnel_powered" } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/andesite_funnel_wall_push.json b/src/generated/resources/assets/create/models/block/andesite_funnel_horizontal_push.json similarity index 60% rename from src/generated/resources/assets/create/models/block/andesite_funnel_wall_push.json rename to src/generated/resources/assets/create/models/block/andesite_funnel_horizontal_push.json index 4b56f936a..090a3e964 100644 --- a/src/generated/resources/assets/create/models/block/andesite_funnel_wall_push.json +++ b/src/generated/resources/assets/create/models/block/andesite_funnel_horizontal_push.json @@ -1,11 +1,11 @@ { - "parent": "create:block/funnel/block_wall", + "parent": "create:block/funnel/block_horizontal", "textures": { "particle": "create:block/andesite_casing", "7": "create:block/andesite_funnel_plating", - "6": "create:block/andesite_funnel", "5": "create:block/andesite_funnel_tall", "2_2": "create:block/andesite_funnel_push", - "3": "create:block/andesite_funnel_back" + "3": "create:block/andesite_funnel_back", + "6": "create:block/andesite_funnel" } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/andesite_funnel_wall_push_powered.json b/src/generated/resources/assets/create/models/block/andesite_funnel_horizontal_push_powered.json similarity index 60% rename from src/generated/resources/assets/create/models/block/andesite_funnel_wall_push_powered.json rename to src/generated/resources/assets/create/models/block/andesite_funnel_horizontal_push_powered.json index b9f6af0dc..3907df971 100644 --- a/src/generated/resources/assets/create/models/block/andesite_funnel_wall_push_powered.json +++ b/src/generated/resources/assets/create/models/block/andesite_funnel_horizontal_push_powered.json @@ -1,11 +1,11 @@ { - "parent": "create:block/funnel/block_wall", + "parent": "create:block/funnel/block_horizontal", "textures": { "particle": "create:block/andesite_casing", "7": "create:block/andesite_funnel_plating", - "6": "create:block/andesite_funnel_powered", "5": "create:block/andesite_funnel_tall_powered", "2_2": "create:block/andesite_funnel_push", - "3": "create:block/andesite_funnel_back" + "3": "create:block/andesite_funnel_back", + "6": "create:block/andesite_funnel_powered" } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/andesite_funnel_vertical_pull.json b/src/generated/resources/assets/create/models/block/andesite_funnel_vertical_pull.json new file mode 100644 index 000000000..02736f668 --- /dev/null +++ b/src/generated/resources/assets/create/models/block/andesite_funnel_vertical_pull.json @@ -0,0 +1,13 @@ +{ + "parent": "create:block/funnel/block_vertical", + "textures": { + "particle": "create:block/andesite_casing", + "7": "create:block/andesite_funnel_plating", + "5": "create:block/andesite_funnel_tall", + "2_2": "create:block/andesite_funnel_pull", + "3": "create:block/andesite_funnel_back", + "8": "create:block/andesite_casing", + "9": "create:block/andesite_funnel_slope", + "10": "create:block/funnel_open" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/andesite_funnel_vertical_pull_powered.json b/src/generated/resources/assets/create/models/block/andesite_funnel_vertical_pull_powered.json new file mode 100644 index 000000000..7752f5d86 --- /dev/null +++ b/src/generated/resources/assets/create/models/block/andesite_funnel_vertical_pull_powered.json @@ -0,0 +1,13 @@ +{ + "parent": "create:block/funnel/block_vertical", + "textures": { + "particle": "create:block/andesite_casing", + "7": "create:block/andesite_funnel_plating", + "5": "create:block/andesite_funnel_tall_powered", + "2_2": "create:block/andesite_funnel_pull", + "3": "create:block/andesite_funnel_back", + "8": "create:block/andesite_casing", + "9": "create:block/andesite_funnel_slope", + "10": "create:block/funnel_closed" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/andesite_funnel_vertical_push.json b/src/generated/resources/assets/create/models/block/andesite_funnel_vertical_push.json new file mode 100644 index 000000000..acbd75ff3 --- /dev/null +++ b/src/generated/resources/assets/create/models/block/andesite_funnel_vertical_push.json @@ -0,0 +1,13 @@ +{ + "parent": "create:block/funnel/block_vertical", + "textures": { + "particle": "create:block/andesite_casing", + "7": "create:block/andesite_funnel_plating", + "5": "create:block/andesite_funnel_tall", + "2_2": "create:block/andesite_funnel_push", + "3": "create:block/andesite_funnel_back", + "8": "create:block/andesite_casing", + "9": "create:block/andesite_funnel_slope", + "10": "create:block/funnel_open" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/andesite_funnel_vertical_push_powered.json b/src/generated/resources/assets/create/models/block/andesite_funnel_vertical_push_powered.json new file mode 100644 index 000000000..6bbc397da --- /dev/null +++ b/src/generated/resources/assets/create/models/block/andesite_funnel_vertical_push_powered.json @@ -0,0 +1,13 @@ +{ + "parent": "create:block/funnel/block_vertical", + "textures": { + "particle": "create:block/andesite_casing", + "7": "create:block/andesite_funnel_plating", + "5": "create:block/andesite_funnel_tall_powered", + "2_2": "create:block/andesite_funnel_push", + "3": "create:block/andesite_funnel_back", + "8": "create:block/andesite_casing", + "9": "create:block/andesite_funnel_slope", + "10": "create:block/funnel_closed" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/andesite_funnel_wall_pull.json b/src/generated/resources/assets/create/models/block/andesite_funnel_wall_pull.json deleted file mode 100644 index e8343d682..000000000 --- a/src/generated/resources/assets/create/models/block/andesite_funnel_wall_pull.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "parent": "create:block/funnel/block_wall", - "textures": { - "particle": "create:block/andesite_casing", - "7": "create:block/andesite_funnel_plating", - "6": "create:block/andesite_funnel", - "5": "create:block/andesite_funnel_tall", - "2_2": "create:block/andesite_funnel_pull", - "3": "create:block/andesite_funnel_back" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/andesite_funnel_wall_pull_powered.json b/src/generated/resources/assets/create/models/block/andesite_funnel_wall_pull_powered.json deleted file mode 100644 index e71c4c17c..000000000 --- a/src/generated/resources/assets/create/models/block/andesite_funnel_wall_pull_powered.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "parent": "create:block/funnel/block_wall", - "textures": { - "particle": "create:block/andesite_casing", - "7": "create:block/andesite_funnel_plating", - "6": "create:block/andesite_funnel_powered", - "5": "create:block/andesite_funnel_tall_powered", - "2_2": "create:block/andesite_funnel_pull", - "3": "create:block/andesite_funnel_back" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/brass_funnel_ceiling_pull.json b/src/generated/resources/assets/create/models/block/brass_funnel_ceiling_pull.json deleted file mode 100644 index 04fb853ba..000000000 --- a/src/generated/resources/assets/create/models/block/brass_funnel_ceiling_pull.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "parent": "create:block/funnel/block_ceiling", - "textures": { - "particle": "create:block/brass_casing", - "7": "create:block/brass_funnel_plating", - "6": "create:block/brass_funnel", - "5": "create:block/brass_funnel_tall", - "2_2": "create:block/brass_funnel_pull", - "3": "create:block/brass_funnel_back" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/brass_funnel_ceiling_pull_powered.json b/src/generated/resources/assets/create/models/block/brass_funnel_ceiling_pull_powered.json deleted file mode 100644 index 4a0c7c1d2..000000000 --- a/src/generated/resources/assets/create/models/block/brass_funnel_ceiling_pull_powered.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "parent": "create:block/funnel/block_ceiling", - "textures": { - "particle": "create:block/brass_casing", - "7": "create:block/brass_funnel_plating", - "6": "create:block/brass_funnel_powered", - "5": "create:block/brass_funnel_tall_powered", - "2_2": "create:block/brass_funnel_pull", - "3": "create:block/brass_funnel_back" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/brass_funnel_ceiling_push_powered.json b/src/generated/resources/assets/create/models/block/brass_funnel_ceiling_push_powered.json deleted file mode 100644 index e4b8a8e16..000000000 --- a/src/generated/resources/assets/create/models/block/brass_funnel_ceiling_push_powered.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "parent": "create:block/funnel/block_ceiling", - "textures": { - "particle": "create:block/brass_casing", - "7": "create:block/brass_funnel_plating", - "6": "create:block/brass_funnel_powered", - "5": "create:block/brass_funnel_tall_powered", - "2_2": "create:block/brass_funnel_push", - "3": "create:block/brass_funnel_back" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/brass_funnel_floor_pull.json b/src/generated/resources/assets/create/models/block/brass_funnel_floor_pull.json deleted file mode 100644 index 02c4f8743..000000000 --- a/src/generated/resources/assets/create/models/block/brass_funnel_floor_pull.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "parent": "create:block/funnel/block_floor", - "textures": { - "particle": "create:block/brass_casing", - "7": "create:block/brass_funnel_plating", - "6": "create:block/brass_funnel", - "5": "create:block/brass_funnel_tall", - "2_2": "create:block/brass_funnel_pull", - "3": "create:block/brass_funnel_back" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/brass_funnel_floor_push.json b/src/generated/resources/assets/create/models/block/brass_funnel_floor_push.json deleted file mode 100644 index 642f3480b..000000000 --- a/src/generated/resources/assets/create/models/block/brass_funnel_floor_push.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "parent": "create:block/funnel/block_floor", - "textures": { - "particle": "create:block/brass_casing", - "7": "create:block/brass_funnel_plating", - "6": "create:block/brass_funnel", - "5": "create:block/brass_funnel_tall", - "2_2": "create:block/brass_funnel_push", - "3": "create:block/brass_funnel_back" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/brass_funnel_floor_push_powered.json b/src/generated/resources/assets/create/models/block/brass_funnel_floor_push_powered.json deleted file mode 100644 index 1e1c45148..000000000 --- a/src/generated/resources/assets/create/models/block/brass_funnel_floor_push_powered.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "parent": "create:block/funnel/block_floor", - "textures": { - "particle": "create:block/brass_casing", - "7": "create:block/brass_funnel_plating", - "6": "create:block/brass_funnel_powered", - "5": "create:block/brass_funnel_tall_powered", - "2_2": "create:block/brass_funnel_push", - "3": "create:block/brass_funnel_back" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/brass_funnel_wall_pull.json b/src/generated/resources/assets/create/models/block/brass_funnel_horizontal_pull.json similarity index 60% rename from src/generated/resources/assets/create/models/block/brass_funnel_wall_pull.json rename to src/generated/resources/assets/create/models/block/brass_funnel_horizontal_pull.json index 9b0bae0f1..a971472b4 100644 --- a/src/generated/resources/assets/create/models/block/brass_funnel_wall_pull.json +++ b/src/generated/resources/assets/create/models/block/brass_funnel_horizontal_pull.json @@ -1,11 +1,11 @@ { - "parent": "create:block/funnel/block_wall", + "parent": "create:block/funnel/block_horizontal", "textures": { "particle": "create:block/brass_casing", "7": "create:block/brass_funnel_plating", - "6": "create:block/brass_funnel", "5": "create:block/brass_funnel_tall", "2_2": "create:block/brass_funnel_pull", - "3": "create:block/brass_funnel_back" + "3": "create:block/brass_funnel_back", + "6": "create:block/brass_funnel" } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/brass_funnel_floor_pull_powered.json b/src/generated/resources/assets/create/models/block/brass_funnel_horizontal_pull_powered.json similarity index 60% rename from src/generated/resources/assets/create/models/block/brass_funnel_floor_pull_powered.json rename to src/generated/resources/assets/create/models/block/brass_funnel_horizontal_pull_powered.json index c16f1f997..38c8a7e7a 100644 --- a/src/generated/resources/assets/create/models/block/brass_funnel_floor_pull_powered.json +++ b/src/generated/resources/assets/create/models/block/brass_funnel_horizontal_pull_powered.json @@ -1,11 +1,11 @@ { - "parent": "create:block/funnel/block_floor", + "parent": "create:block/funnel/block_horizontal", "textures": { "particle": "create:block/brass_casing", "7": "create:block/brass_funnel_plating", - "6": "create:block/brass_funnel_powered", "5": "create:block/brass_funnel_tall_powered", "2_2": "create:block/brass_funnel_pull", - "3": "create:block/brass_funnel_back" + "3": "create:block/brass_funnel_back", + "6": "create:block/brass_funnel_powered" } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/brass_funnel_ceiling_push.json b/src/generated/resources/assets/create/models/block/brass_funnel_horizontal_push.json similarity index 60% rename from src/generated/resources/assets/create/models/block/brass_funnel_ceiling_push.json rename to src/generated/resources/assets/create/models/block/brass_funnel_horizontal_push.json index c1595bbd8..85321b031 100644 --- a/src/generated/resources/assets/create/models/block/brass_funnel_ceiling_push.json +++ b/src/generated/resources/assets/create/models/block/brass_funnel_horizontal_push.json @@ -1,11 +1,11 @@ { - "parent": "create:block/funnel/block_ceiling", + "parent": "create:block/funnel/block_horizontal", "textures": { "particle": "create:block/brass_casing", "7": "create:block/brass_funnel_plating", - "6": "create:block/brass_funnel", "5": "create:block/brass_funnel_tall", "2_2": "create:block/brass_funnel_push", - "3": "create:block/brass_funnel_back" + "3": "create:block/brass_funnel_back", + "6": "create:block/brass_funnel" } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/brass_funnel_wall_push_powered.json b/src/generated/resources/assets/create/models/block/brass_funnel_horizontal_push_powered.json similarity index 60% rename from src/generated/resources/assets/create/models/block/brass_funnel_wall_push_powered.json rename to src/generated/resources/assets/create/models/block/brass_funnel_horizontal_push_powered.json index 1a27b7333..83a796536 100644 --- a/src/generated/resources/assets/create/models/block/brass_funnel_wall_push_powered.json +++ b/src/generated/resources/assets/create/models/block/brass_funnel_horizontal_push_powered.json @@ -1,11 +1,11 @@ { - "parent": "create:block/funnel/block_wall", + "parent": "create:block/funnel/block_horizontal", "textures": { "particle": "create:block/brass_casing", "7": "create:block/brass_funnel_plating", - "6": "create:block/brass_funnel_powered", "5": "create:block/brass_funnel_tall_powered", "2_2": "create:block/brass_funnel_push", - "3": "create:block/brass_funnel_back" + "3": "create:block/brass_funnel_back", + "6": "create:block/brass_funnel_powered" } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/brass_funnel_vertical_pull.json b/src/generated/resources/assets/create/models/block/brass_funnel_vertical_pull.json new file mode 100644 index 000000000..d2a1c6159 --- /dev/null +++ b/src/generated/resources/assets/create/models/block/brass_funnel_vertical_pull.json @@ -0,0 +1,13 @@ +{ + "parent": "create:block/funnel/block_vertical", + "textures": { + "particle": "create:block/brass_casing", + "7": "create:block/brass_funnel_plating", + "5": "create:block/brass_funnel_tall", + "2_2": "create:block/brass_funnel_pull", + "3": "create:block/brass_funnel_back", + "8": "create:block/brass_casing", + "9": "create:block/brass_funnel_slope", + "10": "create:block/funnel_open" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/brass_funnel_vertical_pull_powered.json b/src/generated/resources/assets/create/models/block/brass_funnel_vertical_pull_powered.json new file mode 100644 index 000000000..e319cf39d --- /dev/null +++ b/src/generated/resources/assets/create/models/block/brass_funnel_vertical_pull_powered.json @@ -0,0 +1,13 @@ +{ + "parent": "create:block/funnel/block_vertical", + "textures": { + "particle": "create:block/brass_casing", + "7": "create:block/brass_funnel_plating", + "5": "create:block/brass_funnel_tall_powered", + "2_2": "create:block/brass_funnel_pull", + "3": "create:block/brass_funnel_back", + "8": "create:block/brass_casing", + "9": "create:block/brass_funnel_slope", + "10": "create:block/funnel_closed" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/brass_funnel_vertical_push.json b/src/generated/resources/assets/create/models/block/brass_funnel_vertical_push.json new file mode 100644 index 000000000..f95cdf391 --- /dev/null +++ b/src/generated/resources/assets/create/models/block/brass_funnel_vertical_push.json @@ -0,0 +1,13 @@ +{ + "parent": "create:block/funnel/block_vertical", + "textures": { + "particle": "create:block/brass_casing", + "7": "create:block/brass_funnel_plating", + "5": "create:block/brass_funnel_tall", + "2_2": "create:block/brass_funnel_push", + "3": "create:block/brass_funnel_back", + "8": "create:block/brass_casing", + "9": "create:block/brass_funnel_slope", + "10": "create:block/funnel_open" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/brass_funnel_vertical_push_powered.json b/src/generated/resources/assets/create/models/block/brass_funnel_vertical_push_powered.json new file mode 100644 index 000000000..45ac7f48f --- /dev/null +++ b/src/generated/resources/assets/create/models/block/brass_funnel_vertical_push_powered.json @@ -0,0 +1,13 @@ +{ + "parent": "create:block/funnel/block_vertical", + "textures": { + "particle": "create:block/brass_casing", + "7": "create:block/brass_funnel_plating", + "5": "create:block/brass_funnel_tall_powered", + "2_2": "create:block/brass_funnel_push", + "3": "create:block/brass_funnel_back", + "8": "create:block/brass_casing", + "9": "create:block/brass_funnel_slope", + "10": "create:block/funnel_closed" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/brass_funnel_wall_pull_powered.json b/src/generated/resources/assets/create/models/block/brass_funnel_wall_pull_powered.json deleted file mode 100644 index 03dc68716..000000000 --- a/src/generated/resources/assets/create/models/block/brass_funnel_wall_pull_powered.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "parent": "create:block/funnel/block_wall", - "textures": { - "particle": "create:block/brass_casing", - "7": "create:block/brass_funnel_plating", - "6": "create:block/brass_funnel_powered", - "5": "create:block/brass_funnel_tall_powered", - "2_2": "create:block/brass_funnel_pull", - "3": "create:block/brass_funnel_back" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/block/brass_funnel_wall_push.json b/src/generated/resources/assets/create/models/block/brass_funnel_wall_push.json deleted file mode 100644 index f2f3bd158..000000000 --- a/src/generated/resources/assets/create/models/block/brass_funnel_wall_push.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "parent": "create:block/funnel/block_wall", - "textures": { - "particle": "create:block/brass_casing", - "7": "create:block/brass_funnel_plating", - "6": "create:block/brass_funnel", - "5": "create:block/brass_funnel_tall", - "2_2": "create:block/brass_funnel_push", - "3": "create:block/brass_funnel_back" - } -} \ No newline at end of file diff --git a/src/generated/resources/data/create/advancements/aesthetics.json b/src/generated/resources/data/create/advancements/aesthetics.json index d723cbe38..59a86f429 100644 --- a/src/generated/resources/data/create/advancements/aesthetics.json +++ b/src/generated/resources/data/create/advancements/aesthetics.json @@ -28,8 +28,8 @@ "trigger": "create:bracket_apply", "conditions": { "accepted_entries": [ - "create:cogwheel", - "create:large_cogwheel" + "create:large_cogwheel", + "create:cogwheel" ] } }, diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java index 1c89a813d..aea45c42e 100644 --- a/src/main/java/com/simibubi/create/AllBlocks.java +++ b/src/main/java/com/simibubi/create/AllBlocks.java @@ -133,6 +133,8 @@ import com.simibubi.create.content.logistics.block.funnel.AndesiteFunnelBlock; import com.simibubi.create.content.logistics.block.funnel.BeltFunnelBlock; import com.simibubi.create.content.logistics.block.funnel.BeltFunnelGenerator; import com.simibubi.create.content.logistics.block.funnel.BrassFunnelBlock; +import com.simibubi.create.content.logistics.block.funnel.FunnelGenerator; +import com.simibubi.create.content.logistics.block.funnel.FunnelItem; import com.simibubi.create.content.logistics.block.funnel.FunnelMovementBehaviour; import com.simibubi.create.content.logistics.block.inventories.AdjustableCrateBlock; import com.simibubi.create.content.logistics.block.inventories.CreativeCrateBlock; @@ -1081,7 +1083,10 @@ public class AllBlocks { .initialProperties(SharedProperties::stone) .tag(AllBlockTags.SAFE_NBT.tag) .onRegister(addMovementBehaviour(FunnelMovementBehaviour.andesite())) - .transform(BuilderTransformers.funnel("andesite", Create.asResource("block/andesite_casing"))) + .blockstate(new FunnelGenerator("andesite")::generate) + .item(FunnelItem::new) + .model(FunnelGenerator.itemModel("andesite")) + .build() .register(); public static final BlockEntry ANDESITE_BELT_FUNNEL = @@ -1097,7 +1102,10 @@ public class AllBlocks { .initialProperties(SharedProperties::softMetal) .tag(AllBlockTags.SAFE_NBT.tag) .onRegister(addMovementBehaviour(FunnelMovementBehaviour.brass())) - .transform(BuilderTransformers.funnel("brass", Create.asResource("block/brass_casing"))) + .blockstate(new FunnelGenerator("brass")::generate) + .item(FunnelItem::new) + .model(FunnelGenerator.itemModel("brass")) + .build() .register(); public static final BlockEntry BRASS_BELT_FUNNEL = diff --git a/src/main/java/com/simibubi/create/AllShapes.java b/src/main/java/com/simibubi/create/AllShapes.java index 44322d22c..e7442c5b8 100644 --- a/src/main/java/com/simibubi/create/AllShapes.java +++ b/src/main/java/com/simibubi/create/AllShapes.java @@ -78,7 +78,7 @@ public class AllShapes { .add(0.1, 1, 10, 15.9, 5, 14) .add(0.1, -3, 11, 15.9, 1, 15) .forHorizontal(NORTH), - FUNNEL = shape(2, 2, 14, 14, 14, 18).add(1, 8, 12, 15, 15, 14) + FUNNEL_WALL = shape(2, 2, 14, 14, 14, 18).add(1, 8, 12, 15, 15, 14) .add(0.1, 13, 7, 15.9, 15, 11) .add(0.1, 9, 8, 15.9, 13, 12) .add(0.1, 5, 9, 15.9, 9, 13) diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/AbstractDirectionalFunnelBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/AbstractDirectionalFunnelBlock.java new file mode 100644 index 000000000..43dd71869 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/AbstractDirectionalFunnelBlock.java @@ -0,0 +1,40 @@ +package com.simibubi.create.content.logistics.block.funnel; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.state.DirectionProperty; +import net.minecraft.state.StateContainer.Builder; +import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.util.Direction; +import net.minecraft.util.Mirror; +import net.minecraft.util.Rotation; + +public class AbstractDirectionalFunnelBlock extends AbstractFunnelBlock { + + public static final DirectionProperty FACING = BlockStateProperties.FACING; + + protected AbstractDirectionalFunnelBlock(Properties p_i48377_1_) { + super(p_i48377_1_); + } + + @Override + protected void fillStateContainer(Builder builder) { + super.fillStateContainer(builder.add(FACING)); + } + + @Override + protected Direction getFacing(BlockState state) { + return state.get(FACING); + } + + @Override + public BlockState rotate(BlockState state, Rotation rot) { + return state.with(FACING, rot.rotate(state.get(FACING))); + } + + @Override + public BlockState mirror(BlockState state, Mirror mirrorIn) { + return state.rotate(mirrorIn.toRotation(state.get(FACING))); + } + +} diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/AbstractFunnelBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/AbstractFunnelBlock.java index 758ee2417..1b7ec9b39 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/funnel/AbstractFunnelBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/AbstractFunnelBlock.java @@ -12,7 +12,6 @@ import com.simibubi.create.foundation.utility.BlockHelper; import net.minecraft.block.Block; import net.minecraft.block.BlockState; -import net.minecraft.block.HorizontalBlock; import net.minecraft.client.particle.ParticleManager; import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.ItemStack; @@ -28,7 +27,7 @@ import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -public abstract class AbstractFunnelBlock extends HorizontalBlock implements ITE, IWrenchable { +public abstract class AbstractFunnelBlock extends Block implements ITE, IWrenchable { public static final BooleanProperty POWERED = BlockStateProperties.POWERED; @@ -39,16 +38,13 @@ public abstract class AbstractFunnelBlock extends HorizontalBlock implements ITE @Override public BlockState getStateForPlacement(BlockItemUseContext context) { - Direction facing = context.getPlacementHorizontalFacing() - .getOpposite(); - return getDefaultState().with(HORIZONTAL_FACING, facing) - .with(POWERED, context.getWorld() - .isBlockPowered(context.getPos())); + return getDefaultState().with(POWERED, context.getWorld() + .isBlockPowered(context.getPos())); } @Override protected void fillStateContainer(Builder builder) { - super.fillStateContainer(builder.add(POWERED, HORIZONTAL_FACING)); + super.fillStateContainer(builder.add(POWERED)); } @Override @@ -120,9 +116,7 @@ public abstract class AbstractFunnelBlock extends HorizontalBlock implements ITE return ((AbstractFunnelBlock) state.getBlock()).getFacing(state); } - protected Direction getFacing(BlockState state) { - return state.get(BlockStateProperties.HORIZONTAL_FACING); - } + protected abstract Direction getFacing(BlockState state); @Override public void onReplaced(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/AbstractHorizontalFunnelBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/AbstractHorizontalFunnelBlock.java new file mode 100644 index 000000000..87b2f1321 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/AbstractHorizontalFunnelBlock.java @@ -0,0 +1,40 @@ +package com.simibubi.create.content.logistics.block.funnel; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.state.DirectionProperty; +import net.minecraft.state.StateContainer.Builder; +import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.util.Direction; +import net.minecraft.util.Mirror; +import net.minecraft.util.Rotation; + +public abstract class AbstractHorizontalFunnelBlock extends AbstractFunnelBlock { + + public static final DirectionProperty HORIZONTAL_FACING = BlockStateProperties.HORIZONTAL_FACING; + + protected AbstractHorizontalFunnelBlock(Properties p_i48377_1_) { + super(p_i48377_1_); + } + + @Override + protected void fillStateContainer(Builder builder) { + super.fillStateContainer(builder.add(HORIZONTAL_FACING)); + } + + @Override + protected Direction getFacing(BlockState state) { + return state.get(HORIZONTAL_FACING); + } + + @Override + public BlockState rotate(BlockState p_185499_1_, Rotation p_185499_2_) { + return p_185499_1_.with(HORIZONTAL_FACING, p_185499_2_.rotate(p_185499_1_.get(HORIZONTAL_FACING))); + } + + @Override + public BlockState mirror(BlockState p_185471_1_, Mirror p_185471_2_) { + return p_185471_1_.rotate(p_185471_2_.toRotation(p_185471_1_.get(HORIZONTAL_FACING))); + } + +} diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/AndesiteFunnelBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/AndesiteFunnelBlock.java index 6db0b2b2f..2dc92c421 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/funnel/AndesiteFunnelBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/AndesiteFunnelBlock.java @@ -15,7 +15,7 @@ public class AndesiteFunnelBlock extends FunnelBlock { @Override public BlockState getEquivalentBeltFunnel(IBlockReader world, BlockPos pos, BlockState state) { - Direction facing = state.get(HORIZONTAL_FACING); + Direction facing = getFunnelFacing(state); return AllBlocks.ANDESITE_BELT_FUNNEL.getDefaultState() .with(BeltFunnelBlock.HORIZONTAL_FACING, facing) .with(POWERED, state.get(POWERED)); diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/BeltFunnelBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/BeltFunnelBlock.java index 40c6de55a..e387d64ba 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/funnel/BeltFunnelBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/BeltFunnelBlock.java @@ -35,7 +35,7 @@ import net.minecraft.world.IWorld; import net.minecraft.world.IWorldReader; import net.minecraft.world.World; -public class BeltFunnelBlock extends AbstractFunnelBlock implements ISpecialBlockItemRequirement { +public class BeltFunnelBlock extends AbstractHorizontalFunnelBlock implements ISpecialBlockItemRequirement { private BlockEntry parent; public static final IProperty SHAPE = EnumProperty.create("shape", Shape.class); @@ -124,7 +124,7 @@ public class BeltFunnelBlock extends AbstractFunnelBlock implements ISpecialBloc parentState = parentState.with(POWERED, true); if (state.get(SHAPE) == Shape.PUSHING) parentState = parentState.with(FunnelBlock.EXTRACTING, true); - return parentState.with(FunnelBlock.HORIZONTAL_FACING, state.get(HORIZONTAL_FACING)); + return parentState.with(FunnelBlock.FACING, state.get(HORIZONTAL_FACING)); } Shape updatedShape = getShapeForPosition(world, pos, state.get(HORIZONTAL_FACING), state.get(SHAPE) == Shape.PUSHING); diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/BrassFunnelBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/BrassFunnelBlock.java index 290c44154..e44c2aa4d 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/funnel/BrassFunnelBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/BrassFunnelBlock.java @@ -15,7 +15,7 @@ public class BrassFunnelBlock extends FunnelBlock { @Override public BlockState getEquivalentBeltFunnel(IBlockReader world, BlockPos pos, BlockState state) { - Direction facing = state.get(HORIZONTAL_FACING); + Direction facing = getFacing(state); return AllBlocks.BRASS_BELT_FUNNEL.getDefaultState() .with(BeltFunnelBlock.HORIZONTAL_FACING, facing) .with(POWERED, state.get(POWERED)); diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelBlock.java index 6f7da7985..c7cc47dab 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelBlock.java @@ -14,10 +14,7 @@ import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemUseContext; import net.minecraft.state.BooleanProperty; -import net.minecraft.state.EnumProperty; import net.minecraft.state.StateContainer.Builder; -import net.minecraft.state.properties.AttachFace; -import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; import net.minecraft.util.Direction.AxisDirection; @@ -31,15 +28,13 @@ import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorld; import net.minecraft.world.World; -public abstract class FunnelBlock extends AbstractFunnelBlock { +public abstract class FunnelBlock extends AbstractDirectionalFunnelBlock { - public static final EnumProperty FACE = BlockStateProperties.FACE; public static final BooleanProperty EXTRACTING = BooleanProperty.create("extracting"); public FunnelBlock(Properties p_i48415_1_) { super(p_i48415_1_); - setDefaultState(getDefaultState().with(FACE, AttachFace.WALL) - .with(EXTRACTING, false)); + setDefaultState(getDefaultState().with(EXTRACTING, false)); } public abstract BlockState getEquivalentBeltFunnel(IBlockReader world, BlockPos pos, BlockState state); @@ -53,13 +48,7 @@ public abstract class FunnelBlock extends AbstractFunnelBlock { state = state.with(EXTRACTING, !sneak); for (Direction direction : context.getNearestLookingDirections()) { - BlockState blockstate; - if (direction.getAxis() == Direction.Axis.Y) - blockstate = state.with(FACE, direction == Direction.UP ? AttachFace.CEILING : AttachFace.FLOOR) - .with(HORIZONTAL_FACING, context.getPlacementHorizontalFacing()); - else - blockstate = state.with(FACE, AttachFace.WALL) - .with(HORIZONTAL_FACING, direction.getOpposite()); + BlockState blockstate = state.with(FACING, direction.getOpposite()); if (blockstate.isValidPosition(context.getWorld(), context.getPos())) return blockstate.with(POWERED, state.get(POWERED)); } @@ -69,7 +58,7 @@ public abstract class FunnelBlock extends AbstractFunnelBlock { @Override protected void fillStateContainer(Builder builder) { - super.fillStateContainer(builder.add(FACE, EXTRACTING)); + super.fillStateContainer(builder.add(EXTRACTING)); } @Override @@ -137,26 +126,17 @@ public abstract class FunnelBlock extends AbstractFunnelBlock { return !state.get(POWERED) && !state.get(EXTRACTING); } - @Override - protected Direction getFacing(BlockState state) { - if (state.get(FACE) == AttachFace.CEILING) - return Direction.DOWN; - if (state.get(FACE) == AttachFace.FLOOR) - return Direction.UP; - return super.getFacing(state); - } - @Override public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext context) { - AttachFace attachFace = state.get(FACE); - return attachFace == AttachFace.CEILING ? AllShapes.FUNNEL_CEILING - : attachFace == AttachFace.FLOOR ? AllShapes.FUNNEL_FLOOR - : AllShapes.FUNNEL.get(state.get(HORIZONTAL_FACING)); + Direction facing = state.get(FACING); + return facing == Direction.DOWN ? AllShapes.FUNNEL_CEILING + : facing == Direction.UP ? AllShapes.FUNNEL_FLOOR : AllShapes.FUNNEL_WALL.get(facing); } @Override public VoxelShape getCollisionShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext context) { - if (context.getEntity() instanceof ItemEntity && state.get(FACE) == AttachFace.WALL) + if (context.getEntity() instanceof ItemEntity && getFacing(state).getAxis() + .isHorizontal()) return AllShapes.FUNNEL_COLLISION.get(getFacing(state)); return getShape(state, world, pos, context); } @@ -164,7 +144,8 @@ public abstract class FunnelBlock extends AbstractFunnelBlock { @Override public BlockState updatePostPlacement(BlockState state, Direction direction, BlockState p_196271_3_, IWorld world, BlockPos pos, BlockPos p_196271_6_) { - if (state.get(FACE) != AttachFace.WALL || direction != Direction.DOWN) + if (getFacing(state).getAxis() + .isVertical() || direction != Direction.DOWN) return state; BlockState equivalentFunnel = getEquivalentBeltFunnel(null, null, state); if (BeltFunnelBlock.isOnValidBelt(equivalentFunnel, world, pos)) diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelFilterSlotPositioning.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelFilterSlotPositioning.java index 450de2cc3..2a74b63e2 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelFilterSlotPositioning.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelFilterSlotPositioning.java @@ -8,7 +8,6 @@ import com.simibubi.create.foundation.utility.MatrixStacker; import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.block.BlockState; -import net.minecraft.state.properties.AttachFace; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.math.Vec3d; @@ -36,50 +35,24 @@ public class FunnelFilterSlotPositioning extends ValueBoxTransform.Sided { } } - if (state.getBlock() instanceof FunnelBlock) { - if (state.get(FunnelBlock.FACE) == AttachFace.WALL) - return VecHelper.rotateCentered(VecHelper.voxelSpace(8, 12.1, 8.7f), horizontalAngle, Axis.Y); - Vec3d southLocation = VecHelper.voxelSpace(8, funnelFacing == Direction.DOWN ? 6.5f : 9.5f, 13f); - return VecHelper.rotateCentered(southLocation, - AngleHelper.horizontalAngle(state.get(AbstractFunnelBlock.HORIZONTAL_FACING)), Axis.Y); + if (!funnelFacing.getAxis() + .isHorizontal()) { + Vec3d southLocation = VecHelper.voxelSpace(8, funnelFacing == Direction.DOWN ? 14 : 2, 15.5f); + return VecHelper.rotateCentered(southLocation, horizontalAngle, Axis.Y); } - - return Vec3d.ZERO; - -// if (!funnelFacing.getAxis() -// .isHorizontal()) { -// Vec3d southLocation = VecHelper.voxelSpace(8, funnelFacing == Direction.DOWN ? 3 : 13, 15.5f); -// return VecHelper.rotateCentered(southLocation, horizontalAngle, Axis.Y); -// } -// -// Direction verticalDirection = DirectionHelper.rotateAround(getSide(), funnelFacing.rotateY() -// .getAxis()); -// if (funnelFacing.getAxis() == Axis.Z) -// verticalDirection = verticalDirection.getOpposite(); -// float yRot = -AngleHelper.horizontalAngle(verticalDirection) + 180; -// float xRot = -90; -// boolean alongX = funnelFacing.getAxis() == Axis.X; -// float zRotLast = alongX ^ funnelFacing.getAxisDirection() == AxisDirection.POSITIVE ? 180 : 0; -// -// Vec3d vec = VecHelper.voxelSpace(8, 13, .5f); -// vec = vec.subtract(.5, .5, .5); -// vec = VecHelper.rotate(vec, zRotLast, Axis.Z); -// vec = VecHelper.rotate(vec, yRot, Axis.Y); -// vec = VecHelper.rotate(vec, alongX ? 0 : xRot, Axis.X); -// vec = VecHelper.rotate(vec, alongX ? xRot : 0, Axis.Z); -// vec = vec.add(.5, .5, .5); -// return vec; + + return VecHelper.rotateCentered(VecHelper.voxelSpace(8, 12.1, 8.7f), horizontalAngle, Axis.Y); } @Override protected void rotate(BlockState state, MatrixStack ms) { Direction facing = FunnelBlock.getFunnelFacing(state); -// if (facing.getAxis() -// .isVertical()) { -// super.rotate(state, ms); -// return; -// } + if (facing.getAxis() + .isVertical()) { + super.rotate(state, ms); + return; + } boolean isBeltFunnel = state.getBlock() instanceof BeltFunnelBlock; if (isBeltFunnel && state.get(BeltFunnelBlock.SHAPE) != Shape.EXTENDED) { @@ -92,15 +65,13 @@ public class FunnelFilterSlotPositioning extends ValueBoxTransform.Sided { } if (state.getBlock() instanceof FunnelBlock) { - if (state.get(FunnelBlock.FACE) == AttachFace.WALL) { - super.rotate(state, ms); - MatrixStacker.of(ms) - .rotateX(-22.5f); - return; - } + super.rotate(state, ms); + MatrixStacker.of(ms) + .rotateX(-22.5f); + return; } - float yRot = AngleHelper.horizontalAngle(state.get(AbstractFunnelBlock.HORIZONTAL_FACING)) + float yRot = AngleHelper.horizontalAngle(AbstractFunnelBlock.getFunnelFacing(state)) + (facing == Direction.DOWN ? 180 : 0); MatrixStacker.of(ms) .rotateY(yRot) @@ -113,6 +84,10 @@ public class FunnelFilterSlotPositioning extends ValueBoxTransform.Sided { if (facing == null) return false; + if (facing.getAxis() + .isVertical()) + return direction.getAxis() + .isHorizontal(); if (state.getBlock() instanceof BeltFunnelBlock && state.get(BeltFunnelBlock.SHAPE) == Shape.EXTENDED) return direction == Direction.UP; return direction == facing; diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelGenerator.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelGenerator.java new file mode 100644 index 000000000..5c5fc8bd1 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelGenerator.java @@ -0,0 +1,80 @@ +package com.simibubi.create.content.logistics.block.funnel; + +import com.simibubi.create.Create; +import com.simibubi.create.foundation.data.SpecialBlockStateGen; +import com.tterrag.registrate.providers.DataGenContext; +import com.tterrag.registrate.providers.RegistrateBlockstateProvider; +import com.tterrag.registrate.providers.RegistrateItemModelProvider; +import com.tterrag.registrate.util.nullness.NonNullBiConsumer; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.item.Item; +import net.minecraft.util.Direction; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.model.generators.BlockModelBuilder; +import net.minecraftforge.client.model.generators.ModelFile; + +public class FunnelGenerator extends SpecialBlockStateGen { + + private String type; + private ResourceLocation particleTexture; + + public FunnelGenerator(String type) { + this.type = type; + this.particleTexture = Create.asResource("block/" + type + "_casing"); + } + + @Override + protected int getXRotation(BlockState state) { + return state.get(FunnelBlock.FACING) == Direction.DOWN ? 180 : 0; + } + + @Override + protected int getYRotation(BlockState state) { + return horizontalAngle(state.get(FunnelBlock.FACING)) + 180; + } + + @Override + public ModelFile getModel(DataGenContext c, RegistrateBlockstateProvider p, + BlockState s) { + String powered = s.get(FunnelBlock.POWERED) ? "_powered" : ""; + String closed = s.get(FunnelBlock.POWERED) ? "_closed" : "_open"; + String extracting = s.get(FunnelBlock.EXTRACTING) ? "_push" : "_pull"; + Direction facing = s.get(FunnelBlock.FACING); + boolean horizontal = facing.getAxis() + .isHorizontal(); + String parent = horizontal ? "horizontal" : "vertical"; + + BlockModelBuilder model = p.models() + .withExistingParent("block/" + type + "_funnel_" + parent + extracting + powered, + p.modLoc("block/funnel/block_" + parent)) + .texture("particle", particleTexture) + .texture("7", p.modLoc("block/" + type + "_funnel_plating")) + .texture("5", p.modLoc("block/" + type + "_funnel_tall" + powered)) + .texture("2_2", p.modLoc("block/" + type + "_funnel" + extracting)) + .texture("3", p.modLoc("block/" + type + "_funnel_back")); + + if (horizontal) + return model.texture("6", p.modLoc("block/" + type + "_funnel" + powered)); + + return model.texture("8", particleTexture) + .texture("9", p.modLoc("block/" + type + "_funnel_slope")) + .texture("10", p.modLoc("block/funnel" + closed)); + } + + public static NonNullBiConsumer, RegistrateItemModelProvider> itemModel( + String type) { + ResourceLocation particleTexture = Create.asResource("block/" + type + "_casing"); + return (c, p) -> { + p.withExistingParent("item/" + type + "_funnel", p.modLoc("block/funnel/item")) + .texture("particle", particleTexture) + .texture("7", p.modLoc("block/" + type + "_funnel_plating")) + .texture("2", p.modLoc("block/" + type + "_funnel_neutral")) + .texture("6", p.modLoc("block/" + type + "_funnel")) + .texture("5", p.modLoc("block/" + type + "_funnel_tall")) + .texture("3", p.modLoc("block/" + type + "_funnel_back")); + }; + } + +} diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelItem.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelItem.java index c7a0a6357..f127a2b3c 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelItem.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelItem.java @@ -6,7 +6,6 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.item.BlockItem; import net.minecraft.item.BlockItemUseContext; -import net.minecraft.state.properties.AttachFace; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; @@ -38,10 +37,12 @@ public class FunnelItem extends BlockItem { return state; if (!(state.getBlock() instanceof FunnelBlock)) return state; - if (state.get(FunnelBlock.FACE) != AttachFace.WALL) + if (state.get(FunnelBlock.FACING) + .getAxis() + .isVertical()) return state; - Direction direction = state.get(FunnelBlock.HORIZONTAL_FACING); + Direction direction = state.get(FunnelBlock.FACING); FunnelBlock block = (FunnelBlock) getBlock(); Block beltFunnelBlock = block.getEquivalentBeltFunnel(world, pos, state) .getBlock(); diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelTileEntity.java index 0a820f5eb..a25b196cb 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelTileEntity.java @@ -26,7 +26,6 @@ import net.minecraft.block.BlockState; import net.minecraft.entity.item.ItemEntity; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; -import net.minecraft.state.properties.AttachFace; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; @@ -259,7 +258,7 @@ public class FunnelTileEntity extends SmartTileEntity implements IHaveHoveringIn return false; if (!(blockState.getBlock() instanceof FunnelBlock)) return false; - return blockState.get(FunnelBlock.FACE) == AttachFace.FLOOR; + return FunnelBlock.getFunnelFacing(blockState) == Direction.UP; } private boolean supportsFiltering() { diff --git a/src/main/java/com/simibubi/create/foundation/data/BuilderTransformers.java b/src/main/java/com/simibubi/create/foundation/data/BuilderTransformers.java index 1947517c1..3eec801c2 100644 --- a/src/main/java/com/simibubi/create/foundation/data/BuilderTransformers.java +++ b/src/main/java/com/simibubi/create/foundation/data/BuilderTransformers.java @@ -6,7 +6,6 @@ import static com.simibubi.create.foundation.data.CreateRegistrate.connectedText import java.util.HashMap; import java.util.Map; -import java.util.function.Function; import javax.annotation.Nullable; @@ -22,8 +21,6 @@ import com.simibubi.create.content.contraptions.relays.encased.EncasedShaftBlock import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelBlock; import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelBlock.Shape; import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelItem; -import com.simibubi.create.content.logistics.block.funnel.FunnelBlock; -import com.simibubi.create.content.logistics.block.funnel.FunnelItem; import com.simibubi.create.content.logistics.block.inventories.CrateBlock; import com.simibubi.create.foundation.block.connected.CTSpriteShiftEntry; import com.simibubi.create.foundation.config.StressConfigDefaults; @@ -32,7 +29,6 @@ import com.tterrag.registrate.builders.BlockBuilder; import com.tterrag.registrate.util.nullness.NonNullUnaryOperator; import net.minecraft.block.Block; -import net.minecraft.block.BlockState; import net.minecraft.client.renderer.RenderType; import net.minecraft.item.DyeColor; import net.minecraft.item.Item; @@ -99,41 +95,6 @@ public class BuilderTransformers { .simpleItem(); } - public static NonNullUnaryOperator> funnel(String type, - ResourceLocation particleTexture) { - return b -> { - return b.blockstate((c, p) -> { - Function model = s -> { - String powered = s.get(FunnelBlock.POWERED) ? "_powered" : ""; - String extracting = s.get(FunnelBlock.EXTRACTING) ? "_push" : "_pull"; - String face = s.get(FunnelBlock.FACE) - .getName(); - return p.models() - .withExistingParent("block/" + type + "_funnel_" + face + extracting + powered, - p.modLoc("block/funnel/block_" + face)) - .texture("particle", particleTexture) - .texture("7", p.modLoc("block/" + type + "_funnel_plating")) - .texture("6", p.modLoc("block/" + type + "_funnel" + powered)) - .texture("5", p.modLoc("block/" + type + "_funnel_tall" + powered)) - .texture("2_2", p.modLoc("block/" + type + "_funnel" + extracting)) - .texture("3", p.modLoc("block/" + type + "_funnel_back")); - }; - p.horizontalFaceBlock(c.get(), model); - }) - .item(FunnelItem::new) - .model((c, p) -> { - p.withExistingParent("item/" + type + "_funnel", p.modLoc("block/funnel/item")) - .texture("particle", particleTexture) - .texture("7", p.modLoc("block/" + type + "_funnel_plating")) - .texture("2", p.modLoc("block/" + type + "_funnel_neutral")) - .texture("6", p.modLoc("block/" + type + "_funnel")) - .texture("5", p.modLoc("block/" + type + "_funnel_tall")) - .texture("3", p.modLoc("block/" + type + "_funnel_back")); - }) - .build(); - }; - } - public static NonNullUnaryOperator> beltTunnel( String type, ResourceLocation particleTexture) { return b -> b.initialProperties(SharedProperties::stone) diff --git a/src/main/resources/assets/create/models/block/funnel/block_ceiling.json b/src/main/resources/assets/create/models/block/funnel/block_ceiling.json deleted file mode 100644 index 5a70211b5..000000000 --- a/src/main/resources/assets/create/models/block/funnel/block_ceiling.json +++ /dev/null @@ -1,134 +0,0 @@ -{ - "credit": "Made with Blockbench", - "parent": "block/block", - "textures": { - "3": "create:block/brass_funnel_back", - "5": "create:block/brass_funnel_tall", - "6": "create:block/brass_funnel", - "7": "create:block/brass_funnel_plating", - "2_2": "create:block/brass_funnel_pull" - }, - "elements": [ - { - "name": "LeftWall", - "from": [14, 6, 0], - "to": [16.05, 12, 16], - "rotation": {"angle": 0, "axis": "x", "origin": [8, 12, 2]}, - "faces": { - "north": {"uv": [14, 0, 16, 6], "rotation": 180, "texture": "#2_2"}, - "east": {"uv": [0, 0, 16, 6], "rotation": 180, "texture": "#2_2"}, - "south": {"uv": [0, 0, 2, 6], "rotation": 180, "texture": "#2_2"}, - "west": {"uv": [0, 12, 16, 6], "texture": "#2_2"}, - "up": {"uv": [15, 0, 16, 8], "texture": "#7"}, - "down": {"uv": [0, 0, 1, 8], "rotation": 180, "texture": "#7"} - } - }, - { - "name": "LeftWall", - "from": [-0.05, 6, 0], - "to": [2, 12, 16], - "rotation": {"angle": 0, "axis": "x", "origin": [8, 12, 2]}, - "faces": { - "north": {"uv": [2, 0, 0, 6], "texture": "#2_2"}, - "east": {"uv": [0, 6, 16, 12], "rotation": 180, "texture": "#2_2"}, - "south": {"uv": [14, 0, 16, 6], "rotation": 180, "texture": "#2_2"}, - "west": {"uv": [0, 6, 16, 0], "texture": "#2_2"}, - "up": {"uv": [8, 0, 9, 8], "texture": "#7"}, - "down": {"uv": [7, 0, 8, 8], "rotation": 180, "texture": "#7"} - } - }, - { - "name": "Top", - "from": [2, 6, 0], - "to": [14, 12, 6], - "rotation": {"angle": 0, "axis": "x", "origin": [8, 12, 2]}, - "faces": { - "north": {"uv": [2, 0, 14, 6], "rotation": 180, "texture": "#2_2"}, - "south": {"uv": [9, 13, 15, 16], "rotation": 180, "texture": "#7"}, - "up": {"uv": [9, 0, 15, 3], "texture": "#7"}, - "down": {"uv": [1, 0, 7, 3], "rotation": 180, "texture": "#7"} - } - }, - { - "name": "Top", - "from": [2, 6, 14], - "to": [14, 12, 16], - "rotation": {"angle": 0, "axis": "x", "origin": [8, 12, 18]}, - "faces": { - "north": {"uv": [15, 13, 9, 16], "rotation": 180, "texture": "#7"}, - "south": {"uv": [14, 0, 2, 6], "rotation": 180, "texture": "#2_2"}, - "up": {"uv": [9, 3, 15, 0], "texture": "#7"}, - "down": {"uv": [0.5, 12.5, 7.5, 11.5], "texture": "#7"} - } - }, - { - "name": "Top", - "from": [2, 7, 6], - "to": [14, 8, 15], - "rotation": {"angle": 0, "axis": "x", "origin": [8, 12, 2]}, - "faces": { - "down": {"uv": [0, 9, 6, 13.5], "rotation": 180, "texture": "#3"} - } - }, - { - "from": [1, 11, 1], - "to": [15, 14, 15], - "rotation": {"angle": 0, "axis": "y", "origin": [9, 21, 10]}, - "faces": { - "north": {"uv": [9, 6.5, 16, 8], "rotation": 180, "texture": "#3"}, - "east": {"uv": [9, 6.5, 16, 8], "rotation": 180, "texture": "#3"}, - "south": {"uv": [9, 6.5, 16, 8], "rotation": 180, "texture": "#3"}, - "west": {"uv": [9, 6.5, 16, 8], "rotation": 180, "texture": "#3"}, - "up": {"uv": [0, 0, 6, 6], "rotation": 90, "texture": "#3"} - } - }, - { - "name": "Back", - "from": [2.1, 14, 2.05], - "to": [13.9, 18.1, 14.1], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 6, 24.1]}, - "faces": { - "north": {"uv": [0, 0, 12, 4], "rotation": 180, "texture": "#6"}, - "east": {"uv": [0, 0, 12, 4], "rotation": 180, "texture": "#6"}, - "south": {"uv": [0, 0, 12, 4], "rotation": 180, "texture": "#6"}, - "west": {"uv": [0, 0, 12, 4], "rotation": 180, "texture": "#6"}, - "up": {"uv": [6, 8, 12, 14], "texture": "#3"} - } - }, - { - "name": "Back", - "from": [2.1, 11.9, 2.05], - "to": [13.9, 14, 13.1], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 22, 24.1]}, - "faces": { - "north": {"uv": [0, 1.5, 6, 0.5], "rotation": 180, "texture": "#6"}, - "east": {"uv": [2.5, 0.5, 8, 1.5], "texture": "#5"}, - "west": {"uv": [2.5, 1.5, 8, 0.5], "rotation": 180, "texture": "#5"} - } - } - ], - "groups": [ - { - "name": "block_retracted", - "origin": [8, 8, 8], - "children": [ - { - "name": "BeltFunnel", - "origin": [9, -4, 8], - "children": [ - { - "name": "FrontSection", - "origin": [9, -4, 8], - "children": [0, 1, 2, 3, 4, 5] - }, - { - "name": "Base", - "origin": [9, -4, 8], - "children": [6, 7] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/funnel/block_ceiling_old.json b/src/main/resources/assets/create/models/block/funnel/block_ceiling_old.json deleted file mode 100644 index d5fd6b599..000000000 --- a/src/main/resources/assets/create/models/block/funnel/block_ceiling_old.json +++ /dev/null @@ -1,147 +0,0 @@ -{ - "credit": "Made with Blockbench", - "parent": "block/block", - "textures": { - "3": "create:block/brass_funnel_back", - "5": "create:block/brass_funnel_tall", - "6": "create:block/brass_funnel", - "7": "create:block/brass_funnel_plating", - "2_2": "create:block/brass_funnel_pull" - }, - "elements": [ - { - "name": "LeftWall", - "from": [14, 6, -2], - "to": [16.05, 12, 14], - "rotation": {"angle": -22.5, "axis": "x", "origin": [8, 12, 0]}, - "faces": { - "north": {"uv": [0, 0, 2, 6], "texture": "#2_2"}, - "east": {"uv": [0, 0, 16, 6], "rotation": 180, "texture": "#2_2"}, - "south": {"uv": [14, 0, 16, 6], "texture": "#2_2"}, - "west": {"uv": [0, 12, 16, 6], "texture": "#2_2"}, - "up": {"uv": [15, 0, 16, 8], "texture": "#7"}, - "down": {"uv": [0, 0, 1, 8], "rotation": 180, "texture": "#7"} - } - }, - { - "name": "LeftWall", - "from": [-0.05, 6, -2], - "to": [2, 12, 14], - "rotation": {"angle": -22.5, "axis": "x", "origin": [8, 12, 0]}, - "faces": { - "north": {"uv": [16, 0, 14, 6], "rotation": 180, "texture": "#2_2"}, - "east": {"uv": [0, 6, 16, 12], "rotation": 180, "texture": "#2_2"}, - "south": {"uv": [0, 0, 2, 6], "texture": "#2_2"}, - "west": {"uv": [0, 6, 16, 0], "texture": "#2_2"}, - "up": {"uv": [8, 0, 9, 8], "texture": "#7"}, - "down": {"uv": [7, 0, 8, 8], "rotation": 180, "texture": "#7"} - } - }, - { - "name": "Top", - "from": [2, 6, -2], - "to": [14, 12, 4], - "rotation": {"angle": -22.5, "axis": "x", "origin": [8, 12, 0]}, - "faces": { - "north": {"uv": [2, 0, 14, 6], "rotation": 180, "texture": "#2_2"}, - "south": {"uv": [9, 13, 15, 16], "rotation": 180, "texture": "#7"}, - "up": {"uv": [9, 0, 15, 3], "texture": "#7"}, - "down": {"uv": [1, 0, 7, 3], "rotation": 180, "texture": "#7"} - } - }, - { - "name": "Top", - "from": [2, 7, 4], - "to": [14, 8, 13], - "rotation": {"angle": -22.5, "axis": "x", "origin": [8, 12, 0]}, - "faces": { - "down": {"uv": [0, 9, 6, 13.5], "rotation": 180, "texture": "#3"} - } - }, - { - "name": "Top", - "from": [0.05, 12, 14], - "to": [15.95, 15.95, 16], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 17, 2]}, - "faces": { - "north": {"uv": [8, 11, 16, 13], "rotation": 180, "texture": "#7"}, - "east": {"uv": [16, 11, 15, 13], "texture": "#7"}, - "south": {"uv": [8, 11, 16, 13], "rotation": 180, "texture": "#7"}, - "west": {"uv": [9, 11, 8, 13], "texture": "#7"}, - "up": {"uv": [0, 13.5, 8, 14.5], "texture": "#7"}, - "down": {"uv": [0, 11.5, 8, 12.5], "texture": "#7"} - } - }, - { - "name": "Top", - "from": [0, 14, 13.1], - "to": [16, 16, 14], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 17, 1.1]}, - "faces": { - "east": {"uv": [6, 13, 5, 13.5], "rotation": 270, "texture": "#7"}, - "south": {"uv": [0, 13.5, 8, 14.5], "rotation": 180, "texture": "#7"}, - "west": {"uv": [7, 13, 6, 13.5], "rotation": 270, "texture": "#7"}, - "up": {"uv": [0, 13, 8, 13.5], "texture": "#7"} - } - }, - { - "from": [1, 11, 0], - "to": [15, 14, 7], - "rotation": {"angle": 0, "axis": "y", "origin": [9, 21, 9]}, - "faces": { - "north": {"uv": [6.5, 0, 8, 6], "rotation": 270, "texture": "#3"}, - "east": {"uv": [1, 6.5, 4.5, 8], "rotation": 180, "texture": "#3"}, - "west": {"uv": [1, 6, 4.5, 7.5], "texture": "#3"}, - "up": {"uv": [8, 0, 11.5, 6], "rotation": 90, "texture": "#3"} - } - }, - { - "name": "Back", - "from": [2.1, 14, 1.05], - "to": [13.9, 18.1, 13.1], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 6, 23.1]}, - "faces": { - "north": {"uv": [0, 0, 12, 4], "rotation": 180, "texture": "#6"}, - "east": {"uv": [0, 0, 12, 4], "rotation": 180, "texture": "#6"}, - "south": {"uv": [0, 0, 12, 4], "rotation": 180, "texture": "#6"}, - "west": {"uv": [0, 0, 12, 4], "rotation": 180, "texture": "#6"}, - "up": {"uv": [6, 8, 12, 14], "texture": "#3"} - } - }, - { - "name": "Back", - "from": [2.1, 11.9, 1.05], - "to": [13.9, 14, 12.1], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 22, 23.1]}, - "faces": { - "north": {"uv": [0, 1.5, 6, 0.5], "rotation": 180, "texture": "#6"}, - "east": {"uv": [2.5, 0.5, 8, 1.5], "texture": "#5"}, - "west": {"uv": [2.5, 1.5, 8, 0.5], "rotation": 180, "texture": "#5"} - } - } - ], - "groups": [ - { - "name": "block_retracted", - "origin": [8, 8, 8], - "children": [ - { - "name": "BeltFunnel", - "origin": [9, -4, 8], - "children": [ - { - "name": "FrontSection", - "origin": [9, -4, 8], - "children": [0, 1, 2, 3, 4, 5, 6] - }, - { - "name": "Base", - "origin": [9, -4, 8], - "children": [7, 8] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/funnel/block_floor.json b/src/main/resources/assets/create/models/block/funnel/block_floor.json deleted file mode 100644 index ecd156783..000000000 --- a/src/main/resources/assets/create/models/block/funnel/block_floor.json +++ /dev/null @@ -1,134 +0,0 @@ -{ - "credit": "Made with Blockbench", - "parent": "block/block", - "textures": { - "3": "create:block/brass_funnel_back", - "5": "create:block/brass_funnel_tall", - "6": "create:block/brass_funnel", - "7": "create:block/brass_funnel_plating", - "2_2": "create:block/brass_funnel_pull" - }, - "elements": [ - { - "name": "LeftWall", - "from": [-0.05, 4, 0], - "to": [2, 10, 16], - "rotation": {"angle": 0, "axis": "x", "origin": [8, 4, 2]}, - "faces": { - "north": {"uv": [14, 0, 16, 6], "texture": "#2_2"}, - "east": {"uv": [0, 12, 16, 6], "rotation": 180, "texture": "#2_2"}, - "south": {"uv": [0, 0, 2, 6], "texture": "#2_2"}, - "west": {"uv": [0, 0, 16, 6], "texture": "#2_2"}, - "up": {"uv": [0, 0, 1, 8], "texture": "#7"}, - "down": {"uv": [15, 0, 16, 8], "rotation": 180, "texture": "#7"} - } - }, - { - "name": "LeftWall", - "from": [14, 4, 0], - "to": [16.05, 10, 16], - "rotation": {"angle": 0, "axis": "x", "origin": [8, 4, 2]}, - "faces": { - "north": {"uv": [2, 0, 0, 6], "rotation": 180, "texture": "#2_2"}, - "east": {"uv": [0, 6, 16, 0], "rotation": 180, "texture": "#2_2"}, - "south": {"uv": [14, 0, 16, 6], "texture": "#2_2"}, - "west": {"uv": [0, 6, 16, 12], "texture": "#2_2"}, - "up": {"uv": [7, 0, 8, 8], "texture": "#7"}, - "down": {"uv": [8, 0, 9, 8], "rotation": 180, "texture": "#7"} - } - }, - { - "name": "Top", - "from": [2, 4, 0], - "to": [14, 10, 6], - "rotation": {"angle": 0, "axis": "x", "origin": [8, 4, 2]}, - "faces": { - "north": {"uv": [2, 0, 14, 6], "texture": "#2_2"}, - "south": {"uv": [9, 13, 15, 16], "texture": "#7"}, - "up": {"uv": [1, 0, 7, 3], "texture": "#7"}, - "down": {"uv": [9, 0, 15, 3], "rotation": 180, "texture": "#7"} - } - }, - { - "name": "Top", - "from": [2, 4, 14], - "to": [14, 10, 16], - "rotation": {"angle": 0, "axis": "x", "origin": [8, 4, 18]}, - "faces": { - "north": {"uv": [15, 13, 9, 16], "texture": "#7"}, - "south": {"uv": [14, 0, 2, 6], "texture": "#2_2"}, - "up": {"uv": [0.5, 12.5, 7.5, 11.5], "rotation": 180, "texture": "#7"}, - "down": {"uv": [9, 3, 15, 0], "rotation": 180, "texture": "#7"} - } - }, - { - "name": "Top", - "from": [2, 8, 6], - "to": [14, 9, 15], - "rotation": {"angle": 0, "axis": "x", "origin": [8, 4, 2]}, - "faces": { - "up": {"uv": [0, 9, 6, 13.5], "texture": "#3"} - } - }, - { - "from": [1, 2, 1], - "to": [15, 5, 15], - "rotation": {"angle": 0, "axis": "y", "origin": [7, -5, 10]}, - "faces": { - "north": {"uv": [9, 6.5, 16, 8], "texture": "#3"}, - "east": {"uv": [9, 6.5, 16, 8], "texture": "#3"}, - "south": {"uv": [9, 6.5, 16, 8], "texture": "#3"}, - "west": {"uv": [9, 6.5, 16, 8], "texture": "#3"}, - "down": {"uv": [0, 0, 6, 6], "rotation": 270, "texture": "#3"} - } - }, - { - "name": "Back", - "from": [2.1, -2.1, 2.05], - "to": [13.9, 2, 14.1], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 10, 24.1]}, - "faces": { - "north": {"uv": [0, 0, 12, 4], "texture": "#6"}, - "east": {"uv": [0, 0, 12, 4], "texture": "#6"}, - "south": {"uv": [0, 0, 12, 4], "texture": "#6"}, - "west": {"uv": [0, 0, 12, 4], "texture": "#6"}, - "down": {"uv": [6, 8, 12, 14], "rotation": 180, "texture": "#3"} - } - }, - { - "name": "Back", - "from": [2.1, 2, 2.05], - "to": [13.9, 4.1, 13.1], - "rotation": {"angle": 0, "axis": "y", "origin": [8, -6, 24.1]}, - "faces": { - "north": {"uv": [0, 1.5, 6, 0.5], "texture": "#6"}, - "east": {"uv": [2.5, 1.5, 8, 0.5], "texture": "#5"}, - "west": {"uv": [2.5, 0.5, 8, 1.5], "rotation": 180, "texture": "#5"} - } - } - ], - "groups": [ - { - "name": "block_retracted", - "origin": [8, 8, 8], - "children": [ - { - "name": "BeltFunnel", - "origin": [9, -4, 8], - "children": [ - { - "name": "FrontSection", - "origin": [9, -4, 8], - "children": [0, 1, 2, 3, 4, 5] - }, - { - "name": "Base", - "origin": [9, -4, 8], - "children": [6, 7] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/funnel/block_wall.json b/src/main/resources/assets/create/models/block/funnel/block_horizontal.json similarity index 100% rename from src/main/resources/assets/create/models/block/funnel/block_wall.json rename to src/main/resources/assets/create/models/block/funnel/block_horizontal.json diff --git a/src/main/resources/assets/create/models/block/funnel/block_vertical.json b/src/main/resources/assets/create/models/block/funnel/block_vertical.json new file mode 100644 index 000000000..9af30934a --- /dev/null +++ b/src/main/resources/assets/create/models/block/funnel/block_vertical.json @@ -0,0 +1,212 @@ +{ + "credit": "Made with Blockbench", + "parent": "block/block", + "textures": { + "3": "create:block/brass_funnel_back", + "5": "create:block/brass_funnel_tall", + "7": "create:block/brass_funnel_plating", + "8": "create:block/brass_storage_block", + "9": "create:block/brass_funnel_slope", + "10": "create:block/funnel_closed", + "2_2": "create:block/brass_funnel_pull" + }, + "elements": [ + { + "name": "LeftWall", + "from": [0, 4, 0], + "to": [2, 10, 16], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 4, 2]}, + "faces": { + "north": {"uv": [14, 0, 16, 6], "texture": "#2_2"}, + "south": {"uv": [0, 0, 2, 6], "texture": "#2_2"}, + "west": {"uv": [0, 0, 16, 6], "texture": "#2_2"}, + "up": {"uv": [0, 0, 2, 16], "texture": "#8"}, + "down": {"uv": [0, 0, 16, 2], "rotation": 270, "texture": "#8"} + } + }, + { + "name": "LeftWall", + "from": [14, 4, 0], + "to": [16, 10, 16], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 4, 2]}, + "faces": { + "north": {"uv": [2, 0, 0, 6], "rotation": 180, "texture": "#2_2"}, + "east": {"uv": [0, 6, 16, 0], "rotation": 180, "texture": "#2_2"}, + "south": {"uv": [14, 0, 16, 6], "texture": "#2_2"}, + "up": {"uv": [14, 0, 16, 16], "texture": "#8"}, + "down": {"uv": [0, 14, 16, 16], "rotation": 270, "texture": "#8"} + } + }, + { + "name": "Top", + "from": [2, 4, 0], + "to": [14, 10, 2], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 4, 2]}, + "faces": { + "north": {"uv": [2, 0, 14, 6], "texture": "#2_2"}, + "up": {"uv": [2, 0, 14, 2], "texture": "#8"}, + "down": {"uv": [0, 2, 2, 14], "rotation": 270, "texture": "#8"} + } + }, + { + "name": "Top", + "from": [2, 4, 14], + "to": [14, 10, 16], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 4, 18]}, + "faces": { + "south": {"uv": [14, 0, 2, 6], "texture": "#2_2"}, + "up": {"uv": [2, 16, 14, 14], "rotation": 180, "texture": "#8"}, + "down": {"uv": [14, 14, 16, 2], "rotation": 270, "texture": "#8"} + } + }, + { + "from": [1, 1, 1], + "to": [15, 4, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [7, -6, 10]}, + "faces": { + "north": {"uv": [1, 0, 15, 3], "texture": "#5"}, + "east": {"uv": [1, 0, 15, 3], "texture": "#5"}, + "south": {"uv": [1, 0, 15, 3], "texture": "#5"}, + "west": {"uv": [1, 0, 15, 3], "texture": "#5"}, + "down": {"uv": [2, 2, 14, 14], "rotation": 270, "texture": "#8"} + } + }, + { + "from": [1, 5, 2], + "to": [2, 10, 14], + "rotation": {"angle": 22.5, "axis": "z", "origin": [2, 10, 8]}, + "faces": { + "east": {"uv": [2, 2, 14, 7], "texture": "#9"} + } + }, + { + "from": [14, 5, 2], + "to": [15, 10, 14], + "rotation": {"angle": -22.5, "axis": "z", "origin": [14, 10, 8]}, + "faces": { + "west": {"uv": [2, 2, 14, 7], "texture": "#9"} + } + }, + { + "from": [2, 5, 14], + "to": [14, 10, 15], + "rotation": {"angle": 22.5, "axis": "x", "origin": [8, 10, 14]}, + "faces": { + "north": {"uv": [2, 2, 14, 7], "texture": "#9"} + } + }, + { + "from": [2, 5, 1], + "to": [14, 10, 2], + "rotation": {"angle": -22.5, "axis": "x", "origin": [8, 10, 2]}, + "faces": { + "south": {"uv": [2, 2, 14, 7], "texture": "#9"} + } + }, + { + "from": [3, 5, 3], + "to": [13, 6, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [11, 13, 11]}, + "faces": { + "up": {"uv": [3, 3, 13, 13], "texture": "#10"} + } + }, + { + "name": "Back", + "from": [1.95, -1.95, 1.95], + "to": [14.05, 2, 14.05], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 0.025, 8]}, + "faces": { + "north": {"uv": [2, 12, 14, 16], "texture": "#9"}, + "east": {"uv": [2, 12, 14, 16], "texture": "#9"}, + "south": {"uv": [2, 12, 14, 16], "texture": "#9"}, + "west": {"uv": [2, 12, 14, 16], "texture": "#9"}, + "down": {"uv": [6, 8, 12, 14], "rotation": 180, "texture": "#3"} + } + }, + { + "name": "Back", + "from": [2.1, 2, 2.05], + "to": [13.9, 4.1, 13.1], + "rotation": {"angle": 0, "axis": "y", "origin": [8, -6, 24.1]}, + "faces": { + "east": {"uv": [2.5, 1.5, 8, 0.5], "texture": "#5"}, + "west": {"uv": [2.5, 0.5, 8, 1.5], "rotation": 180, "texture": "#5"} + } + }, + { + "from": [5.05, -0.95, 0.05], + "to": [10.95, 4, 2], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]}, + "faces": { + "north": {"uv": [2.5, 0.5, 5.5, 3], "texture": "#7"}, + "east": {"uv": [4.5, 0.5, 5.5, 3], "texture": "#7"}, + "west": {"uv": [2.5, 0.5, 3.5, 3], "texture": "#7"}, + "down": {"uv": [2.5, 11.5, 5.5, 12.5], "texture": "#7"} + } + }, + { + "from": [5.05, -0.95, 14], + "to": [10.95, 4, 15.95], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]}, + "faces": { + "east": {"uv": [2.5, 0.5, 3.5, 3], "texture": "#7"}, + "south": {"uv": [2.5, 0.5, 5.5, 3], "texture": "#7"}, + "west": {"uv": [4.5, 0.5, 5.5, 3], "texture": "#7"}, + "down": {"uv": [2.5, 11.5, 5.5, 12.5], "rotation": 180, "texture": "#7"} + } + }, + { + "from": [14, -0.95, 5.05], + "to": [15.95, 4, 10.95], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]}, + "faces": { + "north": {"uv": [2.5, 0.5, 3.5, 3], "texture": "#7"}, + "east": {"uv": [2.5, 0.5, 5.5, 3], "texture": "#7"}, + "south": {"uv": [4.5, 0.5, 5.5, 3], "texture": "#7"}, + "down": {"uv": [2.5, 11.5, 5.5, 12.5], "rotation": 270, "texture": "#7"} + } + }, + { + "from": [0.05, -0.95, 5.05], + "to": [2, 4, 10.95], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]}, + "faces": { + "north": {"uv": [4.5, 0.5, 5.5, 3], "texture": "#7"}, + "south": {"uv": [2.5, 0.5, 3.5, 3], "texture": "#7"}, + "west": {"uv": [2.5, 0.5, 5.5, 3], "texture": "#7"}, + "down": {"uv": [2.5, 11.5, 5.5, 12.5], "rotation": 90, "texture": "#7"} + } + } + ], + "display": {}, + "groups": [ + { + "name": "block_retracted", + "origin": [8, 8, 8], + "children": [ + { + "name": "BeltFunnel", + "origin": [9, -4, 8], + "children": [ + { + "name": "FrontSection", + "origin": [9, -4, 8], + "children": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + }, + { + "name": "Base", + "origin": [9, -4, 8], + "children": [10, 11] + } + ] + } + ] + }, + { + "name": "Item Filter", + "origin": [8, 0, 8], + "children": [12, 13, 14, 15] + } + ] +} \ No newline at end of file From fe1c32de053acd9d4db694e4500980e21e2c4cc0 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Sun, 21 Feb 2021 23:01:57 +0100 Subject: [PATCH 6/8] Cheese control - Windmill bearings now have a configurable minimum of sail blocks --- src/generated/resources/.cache/cache | 28 +++++++++---------- .../resources/assets/create/lang/en_us.json | 5 ++-- .../assets/create/lang/unfinished/de_de.json | 7 +++-- .../assets/create/lang/unfinished/es_es.json | 3 +- .../assets/create/lang/unfinished/es_mx.json | 7 +++-- .../assets/create/lang/unfinished/fr_fr.json | 7 +++-- .../assets/create/lang/unfinished/it_it.json | 7 +++-- .../assets/create/lang/unfinished/ja_jp.json | 7 +++-- .../assets/create/lang/unfinished/ko_kr.json | 7 +++-- .../assets/create/lang/unfinished/nl_nl.json | 7 +++-- .../assets/create/lang/unfinished/pt_br.json | 7 +++-- .../assets/create/lang/unfinished/ru_ru.json | 7 +++-- .../assets/create/lang/unfinished/zh_cn.json | 7 +++-- .../assets/create/lang/unfinished/zh_tw.json | 7 +++-- .../data/create/advancements/aesthetics.json | 4 +-- .../structureMovement/AssemblyException.java | 28 +++++++++---------- .../IDisplayAssemblyExceptions.java | 14 ++++++++-- .../bearing/BearingContraption.java | 7 +++-- .../piston/MechanicalPistonTileEntity.java | 2 -- .../create/foundation/config/CKinetics.java | 2 ++ .../assets/create/lang/default/messages.json | 5 ++-- 21 files changed, 99 insertions(+), 76 deletions(-) diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 08899d979..463f09ef7 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -401,19 +401,19 @@ a3a11524cd3515fc01d905767b4b7ea782adaf03 assets/create/blockstates/yellow_seat.j 7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json e3f618c5b622d21880de858678d1802cbf65e615 assets/create/lang/en_ud.json -d4de8202db6564f9721a2e474887c68f7c5068da assets/create/lang/en_us.json -754261b27332b6b86beb7dd74d198135258d2df5 assets/create/lang/unfinished/de_de.json -7ba1c8441fe5a7e3f7fb0d65e11cd3110240de63 assets/create/lang/unfinished/es_es.json -7df992f108dc7d8edb9441b34f345ae9efe43034 assets/create/lang/unfinished/es_mx.json -fbd9288a92b89426756125efce282574df429e62 assets/create/lang/unfinished/fr_fr.json -b22f28b5870c04ff9f88734f5b7a4011dc0e7ece assets/create/lang/unfinished/it_it.json -da01154bb27017c21e996aecb262802fd2c8e0b8 assets/create/lang/unfinished/ja_jp.json -ddaf68fe2fdfd6036760c6fa27d84ede6873394e assets/create/lang/unfinished/ko_kr.json -a1b57248fe1704b9814d1913396c27de33c369c5 assets/create/lang/unfinished/nl_nl.json -9c7d6adae21bb1ba8151c6715acf9e041873d5e4 assets/create/lang/unfinished/pt_br.json -a8f552e8b0fd2742182d478fc72351aa631d5dfd assets/create/lang/unfinished/ru_ru.json -795111b16a8ebb3833c91c984480338bd8cfc9c5 assets/create/lang/unfinished/zh_cn.json -e7ecf88ea70d47bac0739710a728cb7cc210c8bd assets/create/lang/unfinished/zh_tw.json +c562d23527d2f3ac9fa0be10c7fa1bc58f632abc assets/create/lang/en_us.json +8766f1728b3ba4542104e8f87c8b9d1f1741fdeb assets/create/lang/unfinished/de_de.json +3e1f0a8effb4b8541849d5b51576a7531219e914 assets/create/lang/unfinished/es_es.json +cee3455d04453c86d0709ccdc9d347f430edb08e assets/create/lang/unfinished/es_mx.json +1e9d2907c968ab5afb55d72fb934a7d7ed3407b5 assets/create/lang/unfinished/fr_fr.json +eefeacfbd97714d845b78f75cb003d2fb1e3c260 assets/create/lang/unfinished/it_it.json +677008605916984e2063dc6f5d8f7528f2b0b44a assets/create/lang/unfinished/ja_jp.json +397b88e9ad3500d78c08b27f6f11df8b094571fa assets/create/lang/unfinished/ko_kr.json +767605e14edabd5df33a2ef1afbdb84ddd804418 assets/create/lang/unfinished/nl_nl.json +8f0dcab1ffe40d31a1f5823e619648fb01127507 assets/create/lang/unfinished/pt_br.json +c4836701cc764a49529b923c8ab390f1b292e7c2 assets/create/lang/unfinished/ru_ru.json +a179807fb6a649bc9ce4214bbf5192931117bb3c assets/create/lang/unfinished/zh_cn.json +be64b2635e5599b43b4615e333a26d09cfa3baec assets/create/lang/unfinished/zh_tw.json 846200eb548d3bfa2e77b41039de159b4b6cfb45 assets/create/models/block/acacia_window.json 1930fa3a3c98d53dd19e4ee7f55bc27fd47aa281 assets/create/models/block/acacia_window_pane_noside.json 1763ea2c9b981d187f5031ba608f3d5d3be3986a assets/create/models/block/acacia_window_pane_noside_alt.json @@ -1579,7 +1579,7 @@ d080b1b25e5bc8baf5aee68691b08c7f12ece3b0 assets/create/models/item/windmill_bear 9f9455ccb5fc9e3cbfce73862b46078346a522a5 assets/create/models/item/zinc_nugget.json b1689617190c05ef34bd18456b0c7ae09bb3210f assets/create/models/item/zinc_ore.json e76041b7ae829fdd7dc0524f6ca4d2f89fca51bb assets/create/sounds.json -5d0cc4c0255dc241e61c173b31ddca70c88d08e4 data/create/advancements/aesthetics.json +0f1b4b980afba9bf2caf583b88e261bba8b10313 data/create/advancements/aesthetics.json 187921fa131b06721bfaf63f2623a28c141aae9a data/create/advancements/andesite_alloy.json 0ea2db7173b5be28b289ea7c9a6a0cf5805c60c7 data/create/advancements/andesite_casing.json 356f4855a2a6c65be3fb51d7d1aabf2ca6034d42 data/create/advancements/arm_blaze_burner.json diff --git a/src/generated/resources/assets/create/lang/en_us.json b/src/generated/resources/assets/create/lang/en_us.json index b3003acb5..018ae8c5a 100644 --- a/src/generated/resources/assets/create/lang/en_us.json +++ b/src/generated/resources/assets/create/lang/en_us.json @@ -824,11 +824,12 @@ "create.gui.goggles.at_current_speed": "at current speed", "create.gui.goggles.pole_length": "Pole Length:", "create.gui.assembly.exception": "This Contraption was unable to assemble:", - "create.gui.assembly.exception.unmovableBlock": "Unmovable Block (%4$s) at [%1$s %2$s %3$s]", - "create.gui.assembly.exception.chunkNotLoaded": "The Block at [%1$s %2$s %3$s] was not in a loaded chunk", + "create.gui.assembly.exception.unmovableBlock": "Unmovable Block (%4$s) at [%1$s,%2$s,%3$s]", + "create.gui.assembly.exception.chunkNotLoaded": "The Block at [%1$s,%2$s,%3$s] was not in a loaded chunk", "create.gui.assembly.exception.structureTooLarge": "There are too many Blocks included in the contraption.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.tooManyPistonPoles": "There are too many extension Poles attached to this Piston.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.noPistonPoles": "The Piston is missing some extension Poles", + "create.gui.assembly.exception.not_enough_sails": "Attached structure does not include enough sail-like blocks: %1$s\nA minimum of %2$s are required", "create.gui.gauge.info_header": "Gauge Information:", "create.gui.speedometer.title": "Rotation Speed", "create.gui.stressometer.title": "Network Stress", diff --git a/src/generated/resources/assets/create/lang/unfinished/de_de.json b/src/generated/resources/assets/create/lang/unfinished/de_de.json index 7f34e79e5..7c7c5d275 100644 --- a/src/generated/resources/assets/create/lang/unfinished/de_de.json +++ b/src/generated/resources/assets/create/lang/unfinished/de_de.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 969", + "_": "Missing Localizations: 970", "_": "->------------------------] Game Elements [------------------------<-", @@ -825,11 +825,12 @@ "create.gui.goggles.at_current_speed": "UNLOCALIZED: at current speed", "create.gui.goggles.pole_length": "UNLOCALIZED: Pole Length:", "create.gui.assembly.exception": "UNLOCALIZED: This Contraption was unable to assemble:", - "create.gui.assembly.exception.unmovableBlock": "UNLOCALIZED: Unmovable Block (%4$s) at [%1$s %2$s %3$s]", - "create.gui.assembly.exception.chunkNotLoaded": "UNLOCALIZED: The Block at [%1$s %2$s %3$s] was not in a loaded chunk", + "create.gui.assembly.exception.unmovableBlock": "UNLOCALIZED: Unmovable Block (%4$s) at [%1$s,%2$s,%3$s]", + "create.gui.assembly.exception.chunkNotLoaded": "UNLOCALIZED: The Block at [%1$s,%2$s,%3$s] was not in a loaded chunk", "create.gui.assembly.exception.structureTooLarge": "UNLOCALIZED: There are too many Blocks included in the contraption.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.tooManyPistonPoles": "UNLOCALIZED: There are too many extension Poles attached to this Piston.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.noPistonPoles": "UNLOCALIZED: The Piston is missing some extension Poles", + "create.gui.assembly.exception.not_enough_sails": "UNLOCALIZED: Attached structure does not include enough sail-like blocks: %1$s\nA minimum of %2$s are required", "create.gui.gauge.info_header": "UNLOCALIZED: Gauge Information:", "create.gui.speedometer.title": "UNLOCALIZED: Rotation Speed", "create.gui.stressometer.title": "UNLOCALIZED: Network Stress", diff --git a/src/generated/resources/assets/create/lang/unfinished/es_es.json b/src/generated/resources/assets/create/lang/unfinished/es_es.json index 86d845459..eda73db1d 100644 --- a/src/generated/resources/assets/create/lang/unfinished/es_es.json +++ b/src/generated/resources/assets/create/lang/unfinished/es_es.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 11", + "_": "Missing Localizations: 12", "_": "->------------------------] Game Elements [------------------------<-", @@ -830,6 +830,7 @@ "create.gui.assembly.exception.structureTooLarge": "Hay demasiados bloques incluídos en el artilugio.\nEl máximo configurado es: %1$s", "create.gui.assembly.exception.tooManyPistonPoles": "Hay demasiadas Pértigas de extensión conectadas a este Pistón.\nEl máximo configurado es: %1$s", "create.gui.assembly.exception.noPistonPoles": "Faltan pértigas de extensión para el Pistón", + "create.gui.assembly.exception.not_enough_sails": "UNLOCALIZED: Attached structure does not include enough sail-like blocks: %1$s\nA minimum of %2$s are required", "create.gui.gauge.info_header": "Información sobre el medidor:", "create.gui.speedometer.title": "Velocidad de rotación", "create.gui.stressometer.title": "Estrés de la red", diff --git a/src/generated/resources/assets/create/lang/unfinished/es_mx.json b/src/generated/resources/assets/create/lang/unfinished/es_mx.json index 009a7b1cf..dcf01e843 100644 --- a/src/generated/resources/assets/create/lang/unfinished/es_mx.json +++ b/src/generated/resources/assets/create/lang/unfinished/es_mx.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 899", + "_": "Missing Localizations: 900", "_": "->------------------------] Game Elements [------------------------<-", @@ -825,11 +825,12 @@ "create.gui.goggles.at_current_speed": "UNLOCALIZED: at current speed", "create.gui.goggles.pole_length": "UNLOCALIZED: Pole Length:", "create.gui.assembly.exception": "UNLOCALIZED: This Contraption was unable to assemble:", - "create.gui.assembly.exception.unmovableBlock": "UNLOCALIZED: Unmovable Block (%4$s) at [%1$s %2$s %3$s]", - "create.gui.assembly.exception.chunkNotLoaded": "UNLOCALIZED: The Block at [%1$s %2$s %3$s] was not in a loaded chunk", + "create.gui.assembly.exception.unmovableBlock": "UNLOCALIZED: Unmovable Block (%4$s) at [%1$s,%2$s,%3$s]", + "create.gui.assembly.exception.chunkNotLoaded": "UNLOCALIZED: The Block at [%1$s,%2$s,%3$s] was not in a loaded chunk", "create.gui.assembly.exception.structureTooLarge": "UNLOCALIZED: There are too many Blocks included in the contraption.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.tooManyPistonPoles": "UNLOCALIZED: There are too many extension Poles attached to this Piston.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.noPistonPoles": "UNLOCALIZED: The Piston is missing some extension Poles", + "create.gui.assembly.exception.not_enough_sails": "UNLOCALIZED: Attached structure does not include enough sail-like blocks: %1$s\nA minimum of %2$s are required", "create.gui.gauge.info_header": "UNLOCALIZED: Gauge Information:", "create.gui.speedometer.title": "UNLOCALIZED: Rotation Speed", "create.gui.stressometer.title": "UNLOCALIZED: Network Stress", diff --git a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json index 2116543a7..4b55b1452 100644 --- a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json +++ b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 681", + "_": "Missing Localizations: 682", "_": "->------------------------] Game Elements [------------------------<-", @@ -825,11 +825,12 @@ "create.gui.goggles.at_current_speed": "À la vitesse actuelle", "create.gui.goggles.pole_length": "Longueur de la barre", "create.gui.assembly.exception": "UNLOCALIZED: This Contraption was unable to assemble:", - "create.gui.assembly.exception.unmovableBlock": "UNLOCALIZED: Unmovable Block (%4$s) at [%1$s %2$s %3$s]", - "create.gui.assembly.exception.chunkNotLoaded": "UNLOCALIZED: The Block at [%1$s %2$s %3$s] was not in a loaded chunk", + "create.gui.assembly.exception.unmovableBlock": "UNLOCALIZED: Unmovable Block (%4$s) at [%1$s,%2$s,%3$s]", + "create.gui.assembly.exception.chunkNotLoaded": "UNLOCALIZED: The Block at [%1$s,%2$s,%3$s] was not in a loaded chunk", "create.gui.assembly.exception.structureTooLarge": "UNLOCALIZED: There are too many Blocks included in the contraption.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.tooManyPistonPoles": "UNLOCALIZED: There are too many extension Poles attached to this Piston.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.noPistonPoles": "UNLOCALIZED: The Piston is missing some extension Poles", + "create.gui.assembly.exception.not_enough_sails": "UNLOCALIZED: Attached structure does not include enough sail-like blocks: %1$s\nA minimum of %2$s are required", "create.gui.gauge.info_header": "Informations sur la jauge:", "create.gui.speedometer.title": "Vitesse de rotation", "create.gui.stressometer.title": "Stress du réseau", diff --git a/src/generated/resources/assets/create/lang/unfinished/it_it.json b/src/generated/resources/assets/create/lang/unfinished/it_it.json index 6df82e369..26691dd55 100644 --- a/src/generated/resources/assets/create/lang/unfinished/it_it.json +++ b/src/generated/resources/assets/create/lang/unfinished/it_it.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 16", + "_": "Missing Localizations: 17", "_": "->------------------------] Game Elements [------------------------<-", @@ -825,11 +825,12 @@ "create.gui.goggles.at_current_speed": "Alla velocità attuale", "create.gui.goggles.pole_length": "Lunghezza palo:", "create.gui.assembly.exception": "UNLOCALIZED: This Contraption was unable to assemble:", - "create.gui.assembly.exception.unmovableBlock": "UNLOCALIZED: Unmovable Block (%4$s) at [%1$s %2$s %3$s]", - "create.gui.assembly.exception.chunkNotLoaded": "UNLOCALIZED: The Block at [%1$s %2$s %3$s] was not in a loaded chunk", + "create.gui.assembly.exception.unmovableBlock": "UNLOCALIZED: Unmovable Block (%4$s) at [%1$s,%2$s,%3$s]", + "create.gui.assembly.exception.chunkNotLoaded": "UNLOCALIZED: The Block at [%1$s,%2$s,%3$s] was not in a loaded chunk", "create.gui.assembly.exception.structureTooLarge": "UNLOCALIZED: There are too many Blocks included in the contraption.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.tooManyPistonPoles": "UNLOCALIZED: There are too many extension Poles attached to this Piston.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.noPistonPoles": "UNLOCALIZED: The Piston is missing some extension Poles", + "create.gui.assembly.exception.not_enough_sails": "UNLOCALIZED: Attached structure does not include enough sail-like blocks: %1$s\nA minimum of %2$s are required", "create.gui.gauge.info_header": "Informazioni sul calibro:", "create.gui.speedometer.title": "Velocità di rotazione", "create.gui.stressometer.title": "Stress della rete", diff --git a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json index 6ee30f977..944c6577c 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json +++ b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 23", + "_": "Missing Localizations: 24", "_": "->------------------------] Game Elements [------------------------<-", @@ -825,11 +825,12 @@ "create.gui.goggles.at_current_speed": "現在の速度", "create.gui.goggles.pole_length": "ポールの長さ:", "create.gui.assembly.exception": "UNLOCALIZED: This Contraption was unable to assemble:", - "create.gui.assembly.exception.unmovableBlock": "UNLOCALIZED: Unmovable Block (%4$s) at [%1$s %2$s %3$s]", - "create.gui.assembly.exception.chunkNotLoaded": "UNLOCALIZED: The Block at [%1$s %2$s %3$s] was not in a loaded chunk", + "create.gui.assembly.exception.unmovableBlock": "UNLOCALIZED: Unmovable Block (%4$s) at [%1$s,%2$s,%3$s]", + "create.gui.assembly.exception.chunkNotLoaded": "UNLOCALIZED: The Block at [%1$s,%2$s,%3$s] was not in a loaded chunk", "create.gui.assembly.exception.structureTooLarge": "UNLOCALIZED: There are too many Blocks included in the contraption.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.tooManyPistonPoles": "UNLOCALIZED: There are too many extension Poles attached to this Piston.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.noPistonPoles": "UNLOCALIZED: The Piston is missing some extension Poles", + "create.gui.assembly.exception.not_enough_sails": "UNLOCALIZED: Attached structure does not include enough sail-like blocks: %1$s\nA minimum of %2$s are required", "create.gui.gauge.info_header": "計器の情報:", "create.gui.speedometer.title": "回転速度", "create.gui.stressometer.title": "ネットワークの応力", diff --git a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json index 9b1cd4c97..a85e949d8 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json +++ b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 70", + "_": "Missing Localizations: 71", "_": "->------------------------] Game Elements [------------------------<-", @@ -825,11 +825,12 @@ "create.gui.goggles.at_current_speed": "현재 에너지량", "create.gui.goggles.pole_length": "UNLOCALIZED: Pole Length:", "create.gui.assembly.exception": "UNLOCALIZED: This Contraption was unable to assemble:", - "create.gui.assembly.exception.unmovableBlock": "UNLOCALIZED: Unmovable Block (%4$s) at [%1$s %2$s %3$s]", - "create.gui.assembly.exception.chunkNotLoaded": "UNLOCALIZED: The Block at [%1$s %2$s %3$s] was not in a loaded chunk", + "create.gui.assembly.exception.unmovableBlock": "UNLOCALIZED: Unmovable Block (%4$s) at [%1$s,%2$s,%3$s]", + "create.gui.assembly.exception.chunkNotLoaded": "UNLOCALIZED: The Block at [%1$s,%2$s,%3$s] was not in a loaded chunk", "create.gui.assembly.exception.structureTooLarge": "UNLOCALIZED: There are too many Blocks included in the contraption.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.tooManyPistonPoles": "UNLOCALIZED: There are too many extension Poles attached to this Piston.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.noPistonPoles": "UNLOCALIZED: The Piston is missing some extension Poles", + "create.gui.assembly.exception.not_enough_sails": "UNLOCALIZED: Attached structure does not include enough sail-like blocks: %1$s\nA minimum of %2$s are required", "create.gui.gauge.info_header": "게이지 정보:", "create.gui.speedometer.title": "회전 속도", "create.gui.stressometer.title": "네트워크 부하", diff --git a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json index 7a8f2be49..81bdb6aec 100644 --- a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json +++ b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1168", + "_": "Missing Localizations: 1169", "_": "->------------------------] Game Elements [------------------------<-", @@ -825,11 +825,12 @@ "create.gui.goggles.at_current_speed": "UNLOCALIZED: at current speed", "create.gui.goggles.pole_length": "UNLOCALIZED: Pole Length:", "create.gui.assembly.exception": "UNLOCALIZED: This Contraption was unable to assemble:", - "create.gui.assembly.exception.unmovableBlock": "UNLOCALIZED: Unmovable Block (%4$s) at [%1$s %2$s %3$s]", - "create.gui.assembly.exception.chunkNotLoaded": "UNLOCALIZED: The Block at [%1$s %2$s %3$s] was not in a loaded chunk", + "create.gui.assembly.exception.unmovableBlock": "UNLOCALIZED: Unmovable Block (%4$s) at [%1$s,%2$s,%3$s]", + "create.gui.assembly.exception.chunkNotLoaded": "UNLOCALIZED: The Block at [%1$s,%2$s,%3$s] was not in a loaded chunk", "create.gui.assembly.exception.structureTooLarge": "UNLOCALIZED: There are too many Blocks included in the contraption.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.tooManyPistonPoles": "UNLOCALIZED: There are too many extension Poles attached to this Piston.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.noPistonPoles": "UNLOCALIZED: The Piston is missing some extension Poles", + "create.gui.assembly.exception.not_enough_sails": "UNLOCALIZED: Attached structure does not include enough sail-like blocks: %1$s\nA minimum of %2$s are required", "create.gui.gauge.info_header": "UNLOCALIZED: Gauge Information:", "create.gui.speedometer.title": "UNLOCALIZED: Rotation Speed", "create.gui.stressometer.title": "UNLOCALIZED: Network Stress", diff --git a/src/generated/resources/assets/create/lang/unfinished/pt_br.json b/src/generated/resources/assets/create/lang/unfinished/pt_br.json index 07b2008c1..05dab7dd4 100644 --- a/src/generated/resources/assets/create/lang/unfinished/pt_br.json +++ b/src/generated/resources/assets/create/lang/unfinished/pt_br.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1234", + "_": "Missing Localizations: 1235", "_": "->------------------------] Game Elements [------------------------<-", @@ -825,11 +825,12 @@ "create.gui.goggles.at_current_speed": "UNLOCALIZED: at current speed", "create.gui.goggles.pole_length": "UNLOCALIZED: Pole Length:", "create.gui.assembly.exception": "UNLOCALIZED: This Contraption was unable to assemble:", - "create.gui.assembly.exception.unmovableBlock": "UNLOCALIZED: Unmovable Block (%4$s) at [%1$s %2$s %3$s]", - "create.gui.assembly.exception.chunkNotLoaded": "UNLOCALIZED: The Block at [%1$s %2$s %3$s] was not in a loaded chunk", + "create.gui.assembly.exception.unmovableBlock": "UNLOCALIZED: Unmovable Block (%4$s) at [%1$s,%2$s,%3$s]", + "create.gui.assembly.exception.chunkNotLoaded": "UNLOCALIZED: The Block at [%1$s,%2$s,%3$s] was not in a loaded chunk", "create.gui.assembly.exception.structureTooLarge": "UNLOCALIZED: There are too many Blocks included in the contraption.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.tooManyPistonPoles": "UNLOCALIZED: There are too many extension Poles attached to this Piston.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.noPistonPoles": "UNLOCALIZED: The Piston is missing some extension Poles", + "create.gui.assembly.exception.not_enough_sails": "UNLOCALIZED: Attached structure does not include enough sail-like blocks: %1$s\nA minimum of %2$s are required", "create.gui.gauge.info_header": "UNLOCALIZED: Gauge Information:", "create.gui.speedometer.title": "UNLOCALIZED: Rotation Speed", "create.gui.stressometer.title": "UNLOCALIZED: Network Stress", diff --git a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json index 8b9dca7e1..11847d2f5 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json +++ b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 20", + "_": "Missing Localizations: 21", "_": "->------------------------] Game Elements [------------------------<-", @@ -825,11 +825,12 @@ "create.gui.goggles.at_current_speed": "На текущей скорости", "create.gui.goggles.pole_length": "Длина поршня", "create.gui.assembly.exception": "UNLOCALIZED: This Contraption was unable to assemble:", - "create.gui.assembly.exception.unmovableBlock": "UNLOCALIZED: Unmovable Block (%4$s) at [%1$s %2$s %3$s]", - "create.gui.assembly.exception.chunkNotLoaded": "UNLOCALIZED: The Block at [%1$s %2$s %3$s] was not in a loaded chunk", + "create.gui.assembly.exception.unmovableBlock": "UNLOCALIZED: Unmovable Block (%4$s) at [%1$s,%2$s,%3$s]", + "create.gui.assembly.exception.chunkNotLoaded": "UNLOCALIZED: The Block at [%1$s,%2$s,%3$s] was not in a loaded chunk", "create.gui.assembly.exception.structureTooLarge": "UNLOCALIZED: There are too many Blocks included in the contraption.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.tooManyPistonPoles": "UNLOCALIZED: There are too many extension Poles attached to this Piston.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.noPistonPoles": "UNLOCALIZED: The Piston is missing some extension Poles", + "create.gui.assembly.exception.not_enough_sails": "UNLOCALIZED: Attached structure does not include enough sail-like blocks: %1$s\nA minimum of %2$s are required", "create.gui.gauge.info_header": "Калибровочная информация:", "create.gui.speedometer.title": "Скорость вращения", "create.gui.stressometer.title": "Сетевой момент", diff --git a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json index f93e00348..f43795167 100644 --- a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json +++ b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 18", + "_": "Missing Localizations: 19", "_": "->------------------------] Game Elements [------------------------<-", @@ -825,11 +825,12 @@ "create.gui.goggles.at_current_speed": "当前速度应力值", "create.gui.goggles.pole_length": "活塞杆长度:", "create.gui.assembly.exception": "UNLOCALIZED: This Contraption was unable to assemble:", - "create.gui.assembly.exception.unmovableBlock": "UNLOCALIZED: Unmovable Block (%4$s) at [%1$s %2$s %3$s]", - "create.gui.assembly.exception.chunkNotLoaded": "UNLOCALIZED: The Block at [%1$s %2$s %3$s] was not in a loaded chunk", + "create.gui.assembly.exception.unmovableBlock": "UNLOCALIZED: Unmovable Block (%4$s) at [%1$s,%2$s,%3$s]", + "create.gui.assembly.exception.chunkNotLoaded": "UNLOCALIZED: The Block at [%1$s,%2$s,%3$s] was not in a loaded chunk", "create.gui.assembly.exception.structureTooLarge": "UNLOCALIZED: There are too many Blocks included in the contraption.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.tooManyPistonPoles": "UNLOCALIZED: There are too many extension Poles attached to this Piston.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.noPistonPoles": "UNLOCALIZED: The Piston is missing some extension Poles", + "create.gui.assembly.exception.not_enough_sails": "UNLOCALIZED: Attached structure does not include enough sail-like blocks: %1$s\nA minimum of %2$s are required", "create.gui.gauge.info_header": "仪表信息:", "create.gui.speedometer.title": "旋转速度", "create.gui.stressometer.title": "网络应力", diff --git a/src/generated/resources/assets/create/lang/unfinished/zh_tw.json b/src/generated/resources/assets/create/lang/unfinished/zh_tw.json index c113fca25..525b6b7e0 100644 --- a/src/generated/resources/assets/create/lang/unfinished/zh_tw.json +++ b/src/generated/resources/assets/create/lang/unfinished/zh_tw.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 23", + "_": "Missing Localizations: 24", "_": "->------------------------] Game Elements [------------------------<-", @@ -825,11 +825,12 @@ "create.gui.goggles.at_current_speed": "現在速度動能值", "create.gui.goggles.pole_length": "UNLOCALIZED: Pole Length:", "create.gui.assembly.exception": "UNLOCALIZED: This Contraption was unable to assemble:", - "create.gui.assembly.exception.unmovableBlock": "UNLOCALIZED: Unmovable Block (%4$s) at [%1$s %2$s %3$s]", - "create.gui.assembly.exception.chunkNotLoaded": "UNLOCALIZED: The Block at [%1$s %2$s %3$s] was not in a loaded chunk", + "create.gui.assembly.exception.unmovableBlock": "UNLOCALIZED: Unmovable Block (%4$s) at [%1$s,%2$s,%3$s]", + "create.gui.assembly.exception.chunkNotLoaded": "UNLOCALIZED: The Block at [%1$s,%2$s,%3$s] was not in a loaded chunk", "create.gui.assembly.exception.structureTooLarge": "UNLOCALIZED: There are too many Blocks included in the contraption.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.tooManyPistonPoles": "UNLOCALIZED: There are too many extension Poles attached to this Piston.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.noPistonPoles": "UNLOCALIZED: The Piston is missing some extension Poles", + "create.gui.assembly.exception.not_enough_sails": "UNLOCALIZED: Attached structure does not include enough sail-like blocks: %1$s\nA minimum of %2$s are required", "create.gui.gauge.info_header": "儀表訊息:", "create.gui.speedometer.title": "旋轉速度", "create.gui.stressometer.title": "網路動能", diff --git a/src/generated/resources/data/create/advancements/aesthetics.json b/src/generated/resources/data/create/advancements/aesthetics.json index 59a86f429..d723cbe38 100644 --- a/src/generated/resources/data/create/advancements/aesthetics.json +++ b/src/generated/resources/data/create/advancements/aesthetics.json @@ -28,8 +28,8 @@ "trigger": "create:bracket_apply", "conditions": { "accepted_entries": [ - "create:large_cogwheel", - "create:cogwheel" + "create:cogwheel", + "create:large_cogwheel" ] } }, diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AssemblyException.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AssemblyException.java index d4f38a469..bfd3d66c0 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AssemblyException.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AssemblyException.java @@ -9,7 +9,7 @@ import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TranslationTextComponent; public class AssemblyException extends Exception { - + private static final long serialVersionUID = 1L; public final ITextComponent component; private BlockPos position = null; @@ -21,7 +21,8 @@ public class AssemblyException extends Exception { CompoundNBT nbt = new CompoundNBT(); nbt.putString("Component", ITextComponent.Serializer.toJson(exception.component)); if (exception.hasPosition()) - nbt.putLong("Position", exception.getPosition().toLong()); + nbt.putLong("Position", exception.getPosition() + .toLong()); compound.put("LastException", nbt); } @@ -48,38 +49,35 @@ public class AssemblyException extends Exception { } public static AssemblyException unmovableBlock(BlockPos pos, BlockState state) { - AssemblyException e = new AssemblyException("unmovableBlock", - pos.getX(), - pos.getY(), - pos.getZ(), - new TranslationTextComponent(state.getBlock().getTranslationKey())); + AssemblyException e = new AssemblyException("unmovableBlock", pos.getX(), pos.getY(), pos.getZ(), + new TranslationTextComponent(state.getBlock() + .getTranslationKey())); e.position = pos; return e; } public static AssemblyException unloadedChunk(BlockPos pos) { - AssemblyException e = new AssemblyException("chunkNotLoaded", - pos.getX(), - pos.getY(), - pos.getZ()); + AssemblyException e = new AssemblyException("chunkNotLoaded", pos.getX(), pos.getY(), pos.getZ()); e.position = pos; return e; } public static AssemblyException structureTooLarge() { - return new AssemblyException("structureTooLarge", - AllConfigs.SERVER.kinetics.maxBlocksMoved.get()); + return new AssemblyException("structureTooLarge", AllConfigs.SERVER.kinetics.maxBlocksMoved.get()); } public static AssemblyException tooManyPistonPoles() { - return new AssemblyException("tooManyPistonPoles", - AllConfigs.SERVER.kinetics.maxPistonPoles.get()); + return new AssemblyException("tooManyPistonPoles", AllConfigs.SERVER.kinetics.maxPistonPoles.get()); } public static AssemblyException noPistonPoles() { return new AssemblyException("noPistonPoles"); } + public static AssemblyException notEnoughSails(int sails) { + return new AssemblyException("not_enough_sails", sails, AllConfigs.SERVER.kinetics.minimumWindmillSails.get()); + } + public String getFormattedText() { return component.getFormattedText(); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/IDisplayAssemblyExceptions.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/IDisplayAssemblyExceptions.java index 1a34952ef..ad4b711a6 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/IDisplayAssemblyExceptions.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/IDisplayAssemblyExceptions.java @@ -1,9 +1,12 @@ package com.simibubi.create.content.contraptions.components.structureMovement; +import static net.minecraft.util.text.TextFormatting.GRAY; + import java.util.Arrays; import java.util.List; import com.simibubi.create.content.contraptions.goggles.IHaveGoggleInformation; +import com.simibubi.create.foundation.item.TooltipHelper; import com.simibubi.create.foundation.utility.Lang; import net.minecraft.util.text.TextFormatting; @@ -18,9 +21,16 @@ public interface IDisplayAssemblyExceptions { if (!tooltip.isEmpty()) tooltip.add(""); + String spacing = IHaveGoggleInformation.spacing; tooltip.add(IHaveGoggleInformation.spacing + TextFormatting.GOLD + Lang.translate("gui.assembly.exception")); - String text = e.getFormattedText(); - Arrays.stream(text.split("\n")).forEach(l -> tooltip.add(IHaveGoggleInformation.spacing + TextFormatting.GRAY + l)); + + Arrays.stream(e.getFormattedText() + .split("\n")) + .forEach(l -> { + List cutString = TooltipHelper.cutString(spacing + l, GRAY, TextFormatting.WHITE); + for (int i = 0; i < cutString.size(); i++) + tooltip.add((i == 0 ? "" : spacing) + cutString.get(i)); + }); return true; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingContraption.java index 7b1fc465f..3c2edd2d2 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingContraption.java @@ -7,6 +7,7 @@ import com.simibubi.create.content.contraptions.components.structureMovement.Ass import com.simibubi.create.content.contraptions.components.structureMovement.Contraption; import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter; import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionType; +import com.simibubi.create.foundation.config.AllConfigs; import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.TileEntity; @@ -21,7 +22,7 @@ public class BearingContraption extends Contraption { protected int sailBlocks; protected Direction facing; - + private boolean isWindmill; public BearingContraption() {} @@ -38,8 +39,8 @@ public class BearingContraption extends Contraption { return false; startMoving(world); expandBoundsAroundAxis(facing.getAxis()); - if (isWindmill && sailBlocks == 0) - return false; + if (isWindmill && sailBlocks < AllConfigs.SERVER.kinetics.minimumWindmillSails.get()) + throw AssemblyException.notEnoughSails(sailBlocks); if (blocks.isEmpty()) return false; return true; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonTileEntity.java index e64ed67e8..bb8c2ff7e 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonTileEntity.java @@ -46,8 +46,6 @@ public class MechanicalPistonTileEntity extends LinearActuatorTileEntity { if (!(world.getBlockState(pos) .getBlock() instanceof MechanicalPistonBlock)) return; - if (getMovementSpeed() == 0) - return; Direction direction = getBlockState().get(BlockStateProperties.FACING); diff --git a/src/main/java/com/simibubi/create/foundation/config/CKinetics.java b/src/main/java/com/simibubi/create/foundation/config/CKinetics.java index c218f4006..a38e7945c 100644 --- a/src/main/java/com/simibubi/create/foundation/config/CKinetics.java +++ b/src/main/java/com/simibubi/create/foundation/config/CKinetics.java @@ -14,6 +14,7 @@ public class CKinetics extends ConfigBase { e(DeployerAggroSetting.CREEPERS, "ignoreDeployerAttacks", Comments.ignoreDeployerAttacks); public ConfigInt kineticValidationFrequency = i(60, 5, "kineticValidationFrequency", Comments.kineticValidationFrequency); public ConfigFloat crankHungerMultiplier = f(.01f, 0, 1, "crankHungerMultiplier", Comments.crankHungerMultiplier); + public ConfigInt minimumWindmillSails = i(8, 0, "minimumWindmillSails", Comments.minimumWindmillSails); public ConfigGroup fan = group(1, "encasedFan", "Encased Fan"); public ConfigInt fanPushDistance = i(20, 5, "fanPushDistance", Comments.fanPushDistance); @@ -79,6 +80,7 @@ public class CKinetics extends ConfigBase { static String furnaceEngineSpeed = "Base rotation speed for the furnace engine generator"; static String disableStress = "Disable the Stress mechanic altogether."; static String kineticValidationFrequency = "Game ticks between Kinetic Blocks checking whether their source is still valid."; + static String minimumWindmillSails = "Amount of sail-type blocks required for a windmill to assemble successfully."; } public static enum DeployerAggroSetting { diff --git a/src/main/resources/assets/create/lang/default/messages.json b/src/main/resources/assets/create/lang/default/messages.json index deb8aed43..c4dbf9458 100644 --- a/src/main/resources/assets/create/lang/default/messages.json +++ b/src/main/resources/assets/create/lang/default/messages.json @@ -174,11 +174,12 @@ "create.gui.goggles.pole_length": "Pole Length:", "create.gui.assembly.exception": "This Contraption was unable to assemble:", - "create.gui.assembly.exception.unmovableBlock": "Unmovable Block (%4$s) at [%1$s %2$s %3$s]", - "create.gui.assembly.exception.chunkNotLoaded": "The Block at [%1$s %2$s %3$s] was not in a loaded chunk", + "create.gui.assembly.exception.unmovableBlock": "Unmovable Block (%4$s) at [%1$s,%2$s,%3$s]", + "create.gui.assembly.exception.chunkNotLoaded": "The Block at [%1$s,%2$s,%3$s] was not in a loaded chunk", "create.gui.assembly.exception.structureTooLarge": "There are too many Blocks included in the contraption.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.tooManyPistonPoles": "There are too many extension Poles attached to this Piston.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.noPistonPoles": "The Piston is missing some extension Poles", + "create.gui.assembly.exception.not_enough_sails": "Attached structure does not include enough sail-like blocks: %1$s\nA minimum of %2$s are required", "create.gui.gauge.info_header": "Gauge Information:", "create.gui.speedometer.title": "Rotation Speed", From 5da1a6462254a717434c7f8cd5fb14f0f11f9594 Mon Sep 17 00:00:00 2001 From: zelophed Date: Mon, 22 Feb 2021 03:20:09 +0100 Subject: [PATCH 7/8] utility commands --- .../foundation/command/AllCommands.java | 83 ++++++++--- .../command/ConfigureConfigCommand.java | 45 ++++++ .../command/ConfigureConfigPacket.java | 49 +++++-- .../foundation/command/CouplingCommand.java | 136 ++++++++++++++++++ .../foundation/command/FlySpeedCommand.java | 64 +++++++++ .../command/ToggleDebugCommand.java | 38 ++--- .../ToggleExperimentalRenderingCommand.java | 36 ++--- 7 files changed, 367 insertions(+), 84 deletions(-) create mode 100644 src/main/java/com/simibubi/create/foundation/command/ConfigureConfigCommand.java create mode 100644 src/main/java/com/simibubi/create/foundation/command/CouplingCommand.java create mode 100644 src/main/java/com/simibubi/create/foundation/command/FlySpeedCommand.java diff --git a/src/main/java/com/simibubi/create/foundation/command/AllCommands.java b/src/main/java/com/simibubi/create/foundation/command/AllCommands.java index 657535b79..760fe23c3 100644 --- a/src/main/java/com/simibubi/create/foundation/command/AllCommands.java +++ b/src/main/java/com/simibubi/create/foundation/command/AllCommands.java @@ -1,44 +1,87 @@ package com.simibubi.create.foundation.command; -import java.util.Collections; -import java.util.function.Predicate; - import com.mojang.brigadier.CommandDispatcher; +import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.tree.CommandNode; import com.mojang.brigadier.tree.LiteralCommandNode; - import net.minecraft.command.CommandSource; import net.minecraft.command.Commands; import net.minecraft.entity.player.PlayerEntity; +import java.util.Collections; +import java.util.function.Predicate; + public class AllCommands { public static Predicate sourceIsPlayer = (cs) -> cs.getEntity() instanceof PlayerEntity; public static void register(CommandDispatcher dispatcher) { - LiteralCommandNode createRoot = dispatcher.register(Commands.literal("create") - //general purpose - .then(ToggleDebugCommand.register()) - .then(OverlayConfigCommand.register()) - .then(FixLightingCommand.register()) - .then(ReplaceInCommandBlocksCommand.register()) - .then(HighlightCommand.register()) - .then(ToggleExperimentalRenderingCommand.register()) + LiteralCommandNode util = buildUtilityCommands(); - //dev-util - //Comment out for release - .then(ClearBufferCacheCommand.register()) - .then(ChunkUtilCommand.register()) - //.then(KillTPSCommand.register()) + LiteralCommandNode createRoot = dispatcher.register(Commands.literal("create") + .requires(cs -> cs.hasPermissionLevel(0)) + //general purpose + .then(new ToggleExperimentalRenderingCommand().register()) + .then(new ToggleDebugCommand().register()) + .then(OverlayConfigCommand.register()) + .then(FixLightingCommand.register()) + .then(HighlightCommand.register()) + .then(CouplingCommand.register()) + + //utility + .then(util) ); + createRoot.addChild(buildRedirect("u", util)); + CommandNode c = dispatcher.findNode(Collections.singleton("c")); if (c != null) return; - dispatcher.register(Commands.literal("c") - .redirect(createRoot) - ); + dispatcher.getRoot().addChild(buildRedirect("c", createRoot)); + + } + + + private static LiteralCommandNode buildUtilityCommands() { + + return Commands.literal("util") + .then(FlySpeedCommand.register()) + .then(ReplaceInCommandBlocksCommand.register()) + .then(ClearBufferCacheCommand.register()) + .then(ChunkUtilCommand.register()) + //.then(KillTPSCommand.register()) + .build(); + + } + + /** + * ***** + * https://github.com/VelocityPowered/Velocity/blob/8abc9c80a69158ebae0121fda78b55c865c0abad/proxy/src/main/java/com/velocitypowered/proxy/util/BrigadierUtils.java#L38 + * ***** + *

+ * Returns a literal node that redirects its execution to + * the given destination node. + * + * @param alias the command alias + * @param destination the destination node + * + * @return the built node + */ + public static LiteralCommandNode buildRedirect(final String alias, final LiteralCommandNode destination) { + // Redirects only work for nodes with children, but break the top argument-less command. + // Manually adding the root command after setting the redirect doesn't fix it. + // See https://github.com/Mojang/brigadier/issues/46). Manually clone the node instead. + LiteralArgumentBuilder builder = LiteralArgumentBuilder + .literal(alias) + .requires(destination.getRequirement()) + .forward( + destination.getRedirect(), destination.getRedirectModifier(), destination.isFork()) + .executes(destination.getCommand()); + for (CommandNode child : destination.getChildren()) { + builder.then(child); + } + return builder.build(); } } diff --git a/src/main/java/com/simibubi/create/foundation/command/ConfigureConfigCommand.java b/src/main/java/com/simibubi/create/foundation/command/ConfigureConfigCommand.java new file mode 100644 index 000000000..7937764cb --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/command/ConfigureConfigCommand.java @@ -0,0 +1,45 @@ +package com.simibubi.create.foundation.command; + +import com.mojang.brigadier.Command; +import com.mojang.brigadier.builder.ArgumentBuilder; +import net.minecraft.command.CommandSource; +import net.minecraft.command.Commands; +import net.minecraft.entity.player.ServerPlayerEntity; + +public abstract class ConfigureConfigCommand { + + protected final String commandLiteral; + + ConfigureConfigCommand(String commandLiteral) { + this.commandLiteral = commandLiteral; + } + + ArgumentBuilder register() { + return Commands.literal(this.commandLiteral) + .requires(cs -> cs.hasPermissionLevel(0)) + .then(Commands.literal("on") + .executes(ctx -> { + ServerPlayerEntity player = ctx.getSource().asPlayer(); + sendPacket(player, String.valueOf(true)); + + return Command.SINGLE_SUCCESS; + }) + ) + .then(Commands.literal("off") + .executes(ctx -> { + ServerPlayerEntity player = ctx.getSource().asPlayer(); + sendPacket(player, String.valueOf(false)); + + return Command.SINGLE_SUCCESS; + }) + ) + .executes(ctx -> { + ServerPlayerEntity player = ctx.getSource().asPlayer(); + sendPacket(player, "info"); + + return Command.SINGLE_SUCCESS; + }); + } + + protected abstract void sendPacket(ServerPlayerEntity player, String option); +} diff --git a/src/main/java/com/simibubi/create/foundation/command/ConfigureConfigPacket.java b/src/main/java/com/simibubi/create/foundation/command/ConfigureConfigPacket.java index a8d174725..692933155 100644 --- a/src/main/java/com/simibubi/create/foundation/command/ConfigureConfigPacket.java +++ b/src/main/java/com/simibubi/create/foundation/command/ConfigureConfigPacket.java @@ -1,23 +1,25 @@ package com.simibubi.create.foundation.command; -import java.util.function.Consumer; -import java.util.function.Supplier; - -import org.apache.logging.log4j.LogManager; - import com.simibubi.create.content.contraptions.goggles.GoggleConfigScreen; import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.gui.ScreenOpener; import com.simibubi.create.foundation.networking.SimplePacketBase; import com.simibubi.create.foundation.render.backend.FastRenderDispatcher; - import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.player.ClientPlayerEntity; import net.minecraft.network.PacketBuffer; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.TextFormatting; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.common.ForgeConfig; import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.network.NetworkEvent; +import org.apache.logging.log4j.LogManager; + +import java.util.function.Consumer; +import java.util.function.Supplier; public class ConfigureConfigPacket extends SimplePacketBase { @@ -79,23 +81,44 @@ public class ConfigureConfigPacket extends SimplePacketBase { @OnlyIn(Dist.CLIENT) private static void rainbowDebug(String value) { + ClientPlayerEntity player = Minecraft.getInstance().player; + if (player == null || "".equals(value)) return; + + if (value.equals("info")) { + ITextComponent text = new StringTextComponent("Rainbow Debug Utility is currently: ").appendSibling(boolToText(AllConfigs.CLIENT.rainbowDebug.get())); + player.sendStatusMessage(text, false); + return; + } + AllConfigs.CLIENT.rainbowDebug.set(Boolean.parseBoolean(value)); + ITextComponent text = boolToText(AllConfigs.CLIENT.rainbowDebug.get()).appendSibling(new StringTextComponent(" Rainbow Debug Utility").applyTextStyle(TextFormatting.WHITE)); + player.sendStatusMessage(text, false); } @OnlyIn(Dist.CLIENT) private static void experimentalRendering(String value) { - if (!"".equals(value)) { - AllConfigs.CLIENT.experimentalRendering.set(Boolean.parseBoolean(value)); + ClientPlayerEntity player = Minecraft.getInstance().player; + if (player == null || "".equals(value)) return; + + if (value.equals("info")) { + ITextComponent text = new StringTextComponent("Experimental Rendering is currently: ").appendSibling(boolToText(AllConfigs.CLIENT.experimentalRendering.get())); + player.sendStatusMessage(text, false); + return; } + + AllConfigs.CLIENT.experimentalRendering.set(Boolean.parseBoolean(value)); + ITextComponent text = boolToText(AllConfigs.CLIENT.experimentalRendering.get()).appendSibling(new StringTextComponent(" Experimental Rendering").applyTextStyle(TextFormatting.WHITE)); + player.sendStatusMessage(text, false); + FastRenderDispatcher.refresh(); } - + @OnlyIn(Dist.CLIENT) private static void overlayReset(String value) { AllConfigs.CLIENT.overlayOffsetX.set(0); AllConfigs.CLIENT.overlayOffsetY.set(0); } - + @OnlyIn(Dist.CLIENT) private static void overlayScreen(String value) { ScreenOpener.open(new GoggleConfigScreen()); @@ -106,5 +129,11 @@ public class ConfigureConfigPacket extends SimplePacketBase { ForgeConfig.CLIENT.experimentalForgeLightPipelineEnabled.set(true); Minecraft.getInstance().worldRenderer.loadRenderers(); } + + private static ITextComponent boolToText(boolean b) { + return b + ? new StringTextComponent("enabled").applyTextStyle(TextFormatting.DARK_GREEN) + : new StringTextComponent("disabled").applyTextStyle(TextFormatting.RED); + } } } diff --git a/src/main/java/com/simibubi/create/foundation/command/CouplingCommand.java b/src/main/java/com/simibubi/create/foundation/command/CouplingCommand.java new file mode 100644 index 000000000..8e4512956 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/command/CouplingCommand.java @@ -0,0 +1,136 @@ +package com.simibubi.create.foundation.command; + +import com.mojang.brigadier.Command; +import com.mojang.brigadier.builder.ArgumentBuilder; +import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; +import com.simibubi.create.content.contraptions.components.structureMovement.train.CouplingHandler; +import com.simibubi.create.content.contraptions.components.structureMovement.train.capability.CapabilityMinecartController; +import com.simibubi.create.content.contraptions.components.structureMovement.train.capability.MinecartController; +import com.simibubi.create.foundation.utility.Iterate; +import net.minecraft.command.CommandSource; +import net.minecraft.command.Commands; +import net.minecraft.command.arguments.EntityArgument; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.minecart.AbstractMinecartEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.util.text.StringTextComponent; +import net.minecraftforge.common.util.LazyOptional; + +import java.util.UUID; + +public class CouplingCommand { + + public static final SimpleCommandExceptionType ONLY_MINECARTS_ALLOWED = new SimpleCommandExceptionType(new StringTextComponent("Only Minecarts can be coupled")); + public static final SimpleCommandExceptionType SAME_DIMENSION = new SimpleCommandExceptionType(new StringTextComponent("Minecarts have to be in the same Dimension")); + + public static ArgumentBuilder register() { + + return Commands.literal("coupling") + .requires(cs -> cs.hasPermissionLevel(2)) + .then(Commands.literal("add") + .then(Commands.argument("cart1", EntityArgument.entity()) + .then(Commands.argument("cart2", EntityArgument.entity()) + .executes(ctx -> { + Entity cart1 = EntityArgument.getEntity(ctx, "cart1"); + if (!(cart1 instanceof AbstractMinecartEntity)) + throw ONLY_MINECARTS_ALLOWED.create(); + + Entity cart2 = EntityArgument.getEntity(ctx, "cart2"); + if (!(cart2 instanceof AbstractMinecartEntity)) + throw ONLY_MINECARTS_ALLOWED.create(); + + if (!cart1.getEntityWorld().equals(cart2.getEntityWorld())) + throw SAME_DIMENSION.create(); + + Entity source = ctx.getSource().getEntity(); + + CouplingHandler.tryToCoupleCarts(source instanceof PlayerEntity ? (PlayerEntity) source : null, cart1.getEntityWorld(), cart1.getEntityId(), cart2.getEntityId()); + + return Command.SINGLE_SUCCESS; + }) + ) + ) + ) + .then(Commands.literal("remove") + .then(Commands.argument("cart1", EntityArgument.entity()) + .then(Commands.argument("cart2", EntityArgument.entity()) + .executes(ctx -> { + Entity cart1 = EntityArgument.getEntity(ctx, "cart1"); + if (!(cart1 instanceof AbstractMinecartEntity)) + throw ONLY_MINECARTS_ALLOWED.create(); + + Entity cart2 = EntityArgument.getEntity(ctx, "cart2"); + if (!(cart2 instanceof AbstractMinecartEntity)) + throw ONLY_MINECARTS_ALLOWED.create(); + + LazyOptional cart1Capability = cart1.getCapability(CapabilityMinecartController.MINECART_CONTROLLER_CAPABILITY); + if (!cart1Capability.isPresent()) { + ctx.getSource().sendFeedback(new StringTextComponent("Minecart has no Couplings Attached"), true); + return 0; + } + + MinecartController cart1Controller = cart1Capability.orElse(null); + + int cart1Couplings = (cart1Controller.isConnectedToCoupling() ? 1 : 0) + (cart1Controller.isLeadingCoupling() ? 1 : 0); + if (cart1Couplings == 0) { + ctx.getSource().sendFeedback(new StringTextComponent("Minecart has no Couplings Attached"), true); + return 0; + } + + for (boolean bool : Iterate.trueAndFalse) { + UUID coupledCart = cart1Controller.getCoupledCart(bool); + if (coupledCart == null) + continue; + + if (coupledCart != cart2.getUniqueID()) + continue; + + MinecartController cart2Controller = CapabilityMinecartController.getIfPresent(cart1.getEntityWorld(), coupledCart); + if (cart2Controller == null) + return 0; + + cart1Controller.removeConnection(bool); + cart2Controller.removeConnection(!bool); + return Command.SINGLE_SUCCESS; + } + + ctx.getSource().sendFeedback(new StringTextComponent("The specified Carts are not coupled"), true); + + return 0; + }) + ) + ) + ) + .then(Commands.literal("removeAll") + .then(Commands.argument("cart", EntityArgument.entity()) + .executes(ctx -> { + Entity cart = EntityArgument.getEntity(ctx, "cart"); + if (!(cart instanceof AbstractMinecartEntity)) + throw ONLY_MINECARTS_ALLOWED.create(); + + LazyOptional capability = cart.getCapability(CapabilityMinecartController.MINECART_CONTROLLER_CAPABILITY); + if (!capability.isPresent()) { + ctx.getSource().sendFeedback(new StringTextComponent("Minecart has no Couplings Attached"), true); + return 0; + } + + MinecartController controller = capability.orElse(null); + + int couplings = (controller.isConnectedToCoupling() ? 1 : 0) + (controller.isLeadingCoupling() ? 1 : 0); + if (couplings == 0) { + ctx.getSource().sendFeedback(new StringTextComponent("Minecart has no Couplings Attached"), true); + return 0; + } + + controller.decouple(); + + ctx.getSource().sendFeedback(new StringTextComponent("Removed " + couplings + " couplings from the Minecart"), true); + + return couplings; + }) + ) + ); + + } + +} diff --git a/src/main/java/com/simibubi/create/foundation/command/FlySpeedCommand.java b/src/main/java/com/simibubi/create/foundation/command/FlySpeedCommand.java new file mode 100644 index 000000000..f34c689d2 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/command/FlySpeedCommand.java @@ -0,0 +1,64 @@ +package com.simibubi.create.foundation.command; + +import com.mojang.brigadier.Command; +import com.mojang.brigadier.arguments.FloatArgumentType; +import com.mojang.brigadier.builder.ArgumentBuilder; +import com.mojang.brigadier.context.CommandContext; +import net.minecraft.command.CommandSource; +import net.minecraft.command.Commands; +import net.minecraft.command.arguments.EntityArgument; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.network.play.server.SPlayerAbilitiesPacket; +import net.minecraft.util.text.StringTextComponent; + +public class FlySpeedCommand { + + public static ArgumentBuilder register() { + return Commands.literal("flySpeed") + .requires(cs -> cs.hasPermissionLevel(2)) + .then(Commands.argument("speed", FloatArgumentType.floatArg(0)) + .then(Commands.argument("target", EntityArgument.player()) + .executes(ctx -> sendFlySpeedUpdate( + ctx, + EntityArgument.getPlayer(ctx, "target"), + FloatArgumentType.getFloat(ctx, "speed") + ) + ) + ) + .executes(ctx -> sendFlySpeedUpdate( + ctx, + ctx.getSource().asPlayer(), + FloatArgumentType.getFloat(ctx, "speed") + ) + ) + ) + .then(Commands.literal("reset") + .then(Commands.argument("target", EntityArgument.player()) + .executes(ctx -> sendFlySpeedUpdate( + ctx, + EntityArgument.getPlayer(ctx, "target"), + 0.05f + ) + ) + ) + .executes(ctx -> sendFlySpeedUpdate( + ctx, + ctx.getSource().asPlayer(), + 0.05f + ) + ) + + ); + } + + private static int sendFlySpeedUpdate(CommandContext ctx, ServerPlayerEntity player, float speed) { + SPlayerAbilitiesPacket packet = new SPlayerAbilitiesPacket(player.abilities); + packet.setFlySpeed(speed); + player.connection.sendPacket(packet); + + ctx.getSource().sendFeedback(new StringTextComponent("Temporarily set " + player.getName().getFormattedText() + "'s Flying Speed to: " + speed), true); + + return Command.SINGLE_SUCCESS; + } + +} diff --git a/src/main/java/com/simibubi/create/foundation/command/ToggleDebugCommand.java b/src/main/java/com/simibubi/create/foundation/command/ToggleDebugCommand.java index 918d3dc7c..d8953c8f1 100644 --- a/src/main/java/com/simibubi/create/foundation/command/ToggleDebugCommand.java +++ b/src/main/java/com/simibubi/create/foundation/command/ToggleDebugCommand.java @@ -1,38 +1,20 @@ package com.simibubi.create.foundation.command; -import com.mojang.brigadier.Command; -import com.mojang.brigadier.arguments.BoolArgumentType; -import com.mojang.brigadier.builder.ArgumentBuilder; import com.simibubi.create.foundation.networking.AllPackets; - -import net.minecraft.command.CommandSource; -import net.minecraft.command.Commands; import net.minecraft.entity.player.ServerPlayerEntity; -import net.minecraft.util.text.StringTextComponent; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.network.PacketDistributor; -public class ToggleDebugCommand { +public class ToggleDebugCommand extends ConfigureConfigCommand { - static ArgumentBuilder register() { - return Commands.literal("toggleDebug") - .requires(cs -> cs.hasPermissionLevel(0)) - .then(Commands.argument("value", BoolArgumentType.bool()) - .executes(ctx -> { - boolean value = BoolArgumentType.getBool(ctx, "value"); - //DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> AllConfigs.CLIENT.rainbowDebug.set(value)); - DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> ConfigureConfigPacket.Actions.rainbowDebug.performAction(String.valueOf(value))); + public ToggleDebugCommand() { + super("rainbowDebug"); + } - DistExecutor.unsafeRunWhenOn(Dist.DEDICATED_SERVER, () -> () -> - AllPackets.channel.send( - PacketDistributor.PLAYER.with(() -> (ServerPlayerEntity) ctx.getSource().getEntity()), - new ConfigureConfigPacket(ConfigureConfigPacket.Actions.rainbowDebug.name(), String.valueOf(value)))); - - ctx.getSource().sendFeedback(new StringTextComponent((value ? "enabled" : "disabled") + " rainbow debug"), true); - - return Command.SINGLE_SUCCESS; - }) - ); + @Override + protected void sendPacket(ServerPlayerEntity player, String option) { + AllPackets.channel.send( + PacketDistributor.PLAYER.with(() -> player), + new ConfigureConfigPacket(ConfigureConfigPacket.Actions.rainbowDebug.name(), option) + ); } } diff --git a/src/main/java/com/simibubi/create/foundation/command/ToggleExperimentalRenderingCommand.java b/src/main/java/com/simibubi/create/foundation/command/ToggleExperimentalRenderingCommand.java index 25970ac7a..e80862f33 100644 --- a/src/main/java/com/simibubi/create/foundation/command/ToggleExperimentalRenderingCommand.java +++ b/src/main/java/com/simibubi/create/foundation/command/ToggleExperimentalRenderingCommand.java @@ -1,36 +1,20 @@ package com.simibubi.create.foundation.command; -import com.mojang.brigadier.arguments.BoolArgumentType; -import com.mojang.brigadier.builder.ArgumentBuilder; import com.simibubi.create.foundation.networking.AllPackets; - -import net.minecraft.command.CommandSource; -import net.minecraft.command.Commands; import net.minecraft.entity.player.ServerPlayerEntity; -import net.minecraft.util.text.StringTextComponent; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.network.PacketDistributor; -public class ToggleExperimentalRenderingCommand { +public class ToggleExperimentalRenderingCommand extends ConfigureConfigCommand { - static ArgumentBuilder register() { - return Commands.literal("experimentalRendering") - .requires(cs -> cs.hasPermissionLevel(0)) - .then(Commands.argument("value", BoolArgumentType.bool()) - .executes(ctx -> { - boolean value = BoolArgumentType.getBool(ctx, "value"); - //DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> AllConfigs.CLIENT.rainbowDebug.set(value)); - DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> ConfigureConfigPacket.Actions.experimentalRendering.performAction(String.valueOf(value))); + public ToggleExperimentalRenderingCommand() { + super("experimentalRendering"); + } - DistExecutor.unsafeRunWhenOn(Dist.DEDICATED_SERVER, () -> () -> - AllPackets.channel.send( - PacketDistributor.PLAYER.with(() -> (ServerPlayerEntity) ctx.getSource().getEntity()), - new ConfigureConfigPacket(ConfigureConfigPacket.Actions.experimentalRendering.name(), String.valueOf(value)))); - - ctx.getSource().sendFeedback(new StringTextComponent((value ? "enabled" : "disabled") + " experimental rendering"), true); - - return 1; - })); + @Override + protected void sendPacket(ServerPlayerEntity player, String option) { + AllPackets.channel.send( + PacketDistributor.PLAYER.with(() -> player), + new ConfigureConfigPacket(ConfigureConfigPacket.Actions.experimentalRendering.name(), option) + ); } } From bac4be17286e2eb03b154b8fafa713aa7101e911 Mon Sep 17 00:00:00 2001 From: JozsefA Date: Mon, 22 Feb 2021 11:25:38 -0800 Subject: [PATCH 8/8] Superglue no longer gums up spawn packets --- .../components/structureMovement/Contraption.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java index 3e363d2d3..e783d6436 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java @@ -712,16 +712,15 @@ public abstract class Contraption { } ListNBT superglueNBT = new ListNBT(); - for (Pair glueEntry : superglue) { - CompoundNBT c = new CompoundNBT(); - c.put("Pos", NBTUtil.writeBlockPos(glueEntry.getKey())); - c.putByte("Direction", (byte) glueEntry.getValue() - .getIndex()); - superglueNBT.add(c); - } - ListNBT storageNBT = new ListNBT(); if (!spawnPacket) { + for (Pair glueEntry : superglue) { + CompoundNBT c = new CompoundNBT(); + c.put("Pos", NBTUtil.writeBlockPos(glueEntry.getKey())); + c.putByte("Direction", (byte) glueEntry.getValue().getIndex()); + superglueNBT.add(c); + } + for (BlockPos pos : storage.keySet()) { CompoundNBT c = new CompoundNBT(); MountedStorage mountedStorage = storage.get(pos);