Tweak-a-boo

- Fixed z-fighting on the inner top face of scaffolds
- Added a ponder category for recently added/changed blocks
- Nudged a handful of item transforms
- Fixed offset shaft rotation on encased large cogwheels
This commit is contained in:
simibubi 2023-05-07 21:27:05 +02:00
parent cc9a63b982
commit c4209a92ae
19 changed files with 145 additions and 71 deletions

View file

@ -582,7 +582,7 @@ bf2b0310500213ff853c748c236eb5d01f61658e assets/create/blockstates/yellow_toolbo
7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json
b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json
fcaad84ac4ebdb1e6d9301b77245ce855dbde503 assets/create/lang/en_ud.json
988c876b2f101c2b02a27f00090d0d1348c01cc3 assets/create/lang/en_us.json
03146c18c43580d65e41b94f3b9e1b3846768cc5 assets/create/lang/en_us.json
487a511a01b2a4531fb672f917922312db78f958 assets/create/models/block/acacia_window.json
b48060cba1a382f373a05bf0039054053eccf076 assets/create/models/block/acacia_window_pane_noside.json
3066db1bf03cffa1a9c7fbacf47ae586632f4eb3 assets/create/models/block/acacia_window_pane_noside_alt.json

View file

@ -2186,6 +2186,8 @@
"create.ponder.tag.redstone.description": "Components which help with redstone engineering",
"create.ponder.tag.contraption_assembly": "Block Attachment Utility",
"create.ponder.tag.contraption_assembly.description": "Tools and Components used to assemble structures moved as an animated Contraption",
"create.ponder.tag.recently_updated": "Recently Updated",
"create.ponder.tag.recently_updated.description": "Components that have been added or changed significantly in the latest versions of Create",
"create.ponder.tag.fluids": "Fluid Manipulators",
"create.ponder.tag.fluids.description": "Components which help relaying and making use of Fluids",
"create.ponder.tag.decoration": "Aesthetics",

View file

@ -24,8 +24,8 @@ public class BracketedKineticBlockEntityRenderer extends KineticBlockEntityRende
}
@Override
protected void renderSafe(BracketedKineticBlockEntity be, float partialTicks, PoseStack ms, MultiBufferSource buffer,
int light, int overlay) {
protected void renderSafe(BracketedKineticBlockEntity be, float partialTicks, PoseStack ms,
MultiBufferSource buffer, int light, int overlay) {
if (Backend.canUseInstancing(be.getLevel()))
return;
@ -39,17 +39,12 @@ public class BracketedKineticBlockEntityRenderer extends KineticBlockEntityRende
// mesh properly
Axis axis = getRotationAxisOf(be);
BlockPos pos = be.getBlockPos();
Direction facing = Direction.fromAxisAndDirection(axis, AxisDirection.POSITIVE);
renderRotatingBuffer(be,
CachedBufferer.partialFacingVertical(AllPartialModels.SHAFTLESS_LARGE_COGWHEEL, be.getBlockState(), facing),
ms, buffer.getBuffer(RenderType.solid()), light);
float offset = getShaftAngleOffset(axis, pos);
float time = AnimationTickHolder.getRenderTime(be.getLevel());
float angle = ((time * be.getSpeed() * 3f / 10 + offset) % 360) / 180 * (float) Math.PI;
float angle = getAngleForLargeCogShaft(be, axis);
SuperByteBuffer shaft =
CachedBufferer.partialFacingVertical(AllPartialModels.COGWHEEL_SHAFT, be.getBlockState(), facing);
kineticRotationTransform(shaft, be, axis, angle, light);
@ -57,6 +52,14 @@ public class BracketedKineticBlockEntityRenderer extends KineticBlockEntityRende
}
public static float getAngleForLargeCogShaft(SimpleKineticBlockEntity be, Axis axis) {
BlockPos pos = be.getBlockPos();
float offset = getShaftAngleOffset(axis, pos);
float time = AnimationTickHolder.getRenderTime(be.getLevel());
float angle = ((time * be.getSpeed() * 3f / 10 + offset) % 360) / 180 * (float) Math.PI;
return angle;
}
public static float getShaftAngleOffset(Axis axis, BlockPos pos) {
float offset = 0;
double d = (((axis == Axis.X) ? 0 : pos.getX()) + ((axis == Axis.Y) ? 0 : pos.getY())

View file

@ -14,6 +14,7 @@ import com.simibubi.create.content.contraptions.base.IRotate;
import com.simibubi.create.content.contraptions.base.KineticBlockEntity;
import com.simibubi.create.content.contraptions.base.KineticBlockEntityInstance;
import com.simibubi.create.content.contraptions.base.flwdata.RotatingData;
import com.simibubi.create.content.contraptions.relays.elementary.BracketedKineticBlockEntityRenderer;
import com.simibubi.create.foundation.utility.Iterate;
import net.minecraft.core.Direction;
@ -60,6 +61,8 @@ public class EncasedCogInstance extends KineticBlockEntityInstance<KineticBlockE
continue;
RotatingData data = setup(getRotatingMaterial().getModel(AllPartialModels.SHAFT_HALF, blockState, d)
.createInstance());
if (large)
data.setRotationOffset(BracketedKineticBlockEntityRenderer.getShaftAngleOffset(axis, pos));
if (d.getAxisDirection() == AxisDirection.POSITIVE)
rotatingTopShaft = Optional.of(data);
else

View file

@ -5,6 +5,7 @@ import com.mojang.blaze3d.vertex.PoseStack;
import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.base.IRotate;
import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer;
import com.simibubi.create.content.contraptions.relays.elementary.BracketedKineticBlockEntityRenderer;
import com.simibubi.create.content.contraptions.relays.elementary.SimpleKineticBlockEntity;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
@ -13,7 +14,9 @@ import com.simibubi.create.foundation.utility.Iterate;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.Direction.Axis;
import net.minecraft.core.Direction.AxisDirection;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
@ -48,11 +51,17 @@ public class EncasedCogRenderer extends KineticBlockEntityRenderer<SimpleKinetic
return;
IRotate def = (IRotate) block;
Axis axis = getRotationAxisOf(be);
BlockPos pos = be.getBlockPos();
float angle = large ? BracketedKineticBlockEntityRenderer.getAngleForLargeCogShaft(be, axis)
: getAngleForTe(be, pos, axis);
for (Direction d : Iterate.directionsInAxis(getRotationAxisOf(be))) {
if (!def.hasShaftTowards(be.getLevel(), be.getBlockPos(), blockState, d))
continue;
renderRotatingBuffer(be, CachedBufferer.partialFacing(AllPartialModels.SHAFT_HALF, be.getBlockState(), d),
ms, buffer.getBuffer(RenderType.solid()), light);
SuperByteBuffer shaft = CachedBufferer.partialFacing(AllPartialModels.SHAFT_HALF, be.getBlockState(), d);
kineticRotationTransform(shaft, be, axis, angle, light);
shaft.renderInto(ms, buffer.getBuffer(RenderType.solid()));
}
}

View file

@ -147,7 +147,8 @@ public class FilteringBehaviour extends BlockEntityBehaviour implements ValueSet
if (!filter.isEmpty() && !predicate.test(filter))
return false;
this.filter = filter;
count = Math.min(count, stack.getMaxStackSize());
if (!upTo)
count = Math.min(count, stack.getMaxStackSize());
callback.accept(filter);
blockEntity.setChanged();
blockEntity.sendData();

View file

@ -79,6 +79,11 @@ public class PonderTag implements ScreenElement {
.defaultLang("Railway Equipment", "Components used in the construction or management of Train Contraptions")
.addToIndex(),
RECENTLY_UPDATED = create("recently_updated").item(AllBlocks.CLIPBOARD.get())
.defaultLang("Recent Changes",
"Components that have been added or changed significantly in the latest versions of Create")
.addToIndex(),
DISPLAY_SOURCES = create("display_sources").item(AllBlocks.DISPLAY_LINK.get(), true, false)
.item(AllBlocks.DISPLAY_LINK.get(), false, true)
.defaultLang("Sources for Display Links",
@ -166,8 +171,8 @@ public class PonderTag implements ScreenElement {
ms.scale(0.25f, 0.25f, 1);
GuiComponent.blit(ms, 0, 0, 0, 0, 0, 64, 64, 64, 64);
} else if (!itemIcon.isEmpty()) {
ms.translate(-4, -4, 0);
ms.scale(1.5f, 1.5f, 1.5f);
ms.translate(-2, -2, 0);
ms.scale(1.25f, 1.25f, 1.25f);
GuiGameElement.of(itemIcon)
.render(ms);
}

View file

@ -368,6 +368,19 @@ public class PonderIndex {
public static void registerTags() {
// Add items to tags here
PonderRegistry.TAGS.forTag(PonderTag.RECENTLY_UPDATED)
.add(AllBlocks.WATER_WHEEL)
.add(AllBlocks.LARGE_WATER_WHEEL)
.add(AllBlocks.ELEVATOR_PULLEY)
.add(AllBlocks.CONTRAPTION_CONTROLS)
.add(AllBlocks.MECHANICAL_ROLLER)
.add(AllBlocks.MECHANICAL_PUMP)
.add(AllBlocks.SMART_OBSERVER)
.add(AllBlocks.THRESHOLD_SWITCH)
.add(AllItems.NETHERITE_BACKTANK)
.add(AllBlocks.COPYCAT_PANEL)
.add(AllBlocks.COPYCAT_STEP);
PonderRegistry.TAGS.forTag(PonderTag.KINETIC_RELAYS)
.add(AllBlocks.SHAFT)
.add(AllBlocks.COGWHEEL)

View file

@ -21,28 +21,30 @@
},
{
"name": "Side",
"from": [13.875, 0.062, 1.125],
"to": [17.875, 13.937, 14.875],
"from": [-2.05, -0.05, 0.95],
"to": [2, 14.05, 15.05],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [1, 14.875, 5, 1], "texture": "#6"},
"east": {"uv": [1, 15, 15, 1], "rotation": 180, "texture": "#6"},
"south": {"uv": [11, 14.875, 15, 1], "texture": "#6"},
"west": {"uv": [1, 1, 15, 15], "rotation": 90, "texture": "#translation_chassis_side"},
"up": {"uv": [1, 5, 14.75, 1], "rotation": 270, "texture": "#6"},
"down": {"uv": [1, 15, 14.75, 11], "rotation": 90, "texture": "#6"}
"north": {"uv": [11, 15, 15, 1], "texture": "#6"},
"east": {"uv": [1, 15, 15, 1], "rotation": 90, "texture": "#translation_chassis_side"},
"south": {"uv": [1, 15, 5, 1], "texture": "#6"},
"west": {"uv": [1, 15, 15, 1], "rotation": 180, "texture": "#6"},
"up": {"uv": [15, 5, 1, 1], "rotation": 90, "texture": "#6"},
"down": {"uv": [1, 15, 15, 11], "rotation": 270, "texture": "#6"}
}
},
{
"name": "Side",
"from": [-1.875, 0.062, 1.125],
"to": [2.125, 13.937, 14.875],
"from": [14, -0.05, 0.95],
"to": [18.05, 14.05, 15.05],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [11, 14.875, 15, 1], "texture": "#6"},
"east": {"uv": [1, 15, 15, 1], "rotation": 90, "texture": "#translation_chassis_side"},
"south": {"uv": [1, 14.875, 5, 1], "texture": "#6"},
"west": {"uv": [1, 15, 15, 1], "rotation": 180, "texture": "#6"},
"up": {"uv": [1, 5, 14.75, 1], "rotation": 90, "texture": "#6"},
"down": {"uv": [1, 15, 14.75, 11], "rotation": 270, "texture": "#6"}
"north": {"uv": [15, 15, 11, 1], "texture": "#6"},
"east": {"uv": [15, 15, 1, 1], "rotation": 180, "texture": "#6"},
"south": {"uv": [5, 15, 1, 1], "texture": "#6"},
"west": {"uv": [1, 1, 15, 15], "rotation": 90, "texture": "#translation_chassis_side"},
"up": {"uv": [15, 1, 1, 5], "rotation": 90, "texture": "#6"},
"down": {"uv": [1, 11, 15, 15], "rotation": 270, "texture": "#6"}
}
},
{
@ -50,9 +52,9 @@
"to": [16, 16, 16],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 23, 8]},
"faces": {
"north": {"uv": [0, 0, 16, 4], "texture": "#translation_chassis_side"},
"north": {"uv": [0, 0, 16, 4], "texture": "#5"},
"east": {"uv": [0, 0, 16, 4], "texture": "#5"},
"south": {"uv": [0, 0, 16, 4], "texture": "#translation_chassis_side"},
"south": {"uv": [0, 0, 16, 4], "texture": "#5"},
"west": {"uv": [0, 0, 16, 4], "texture": "#5"},
"up": {"uv": [0, 0, 16, 16], "texture": "#4"},
"down": {"uv": [0, 0, 16, 16], "texture": "#translation_chassis_side"}

View file

@ -1,32 +1,36 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (https://mrcrayfish.com/tools?id=mc)",
"textures": {
"translation_chassis_side": "create:block/cart_assembler_side"
},
"elements": [
{
"name": "Top",
"from": [ 0, 12, 0 ],
"to": [ 16, 16, 16 ],
"faces": {
"north": { "texture": "#translation_chassis_side", "uv": [ 0, 0, 16, 4 ] },
"east": { "texture": "#translation_chassis_side", "uv": [ 0, 0, 4, 16 ], "rotation": 90 },
"south": { "texture": "#translation_chassis_side", "uv": [ 0, 0, 16, 4 ] },
"west": { "texture": "#translation_chassis_side", "uv": [ 12, 0, 16, 16 ], "rotation": 270 },
"up": { "texture": "#translation_chassis_side", "uv": [ 0, 0, 16, 16 ] },
"down": { "texture": "#translation_chassis_side", "uv": [ 0, 0, 16, 16 ] }
}
},
{
"name": "Inner",
"from": [ 4, 4, 4 ],
"to": [ 12, 12, 12 ],
"faces": {
"north": { "texture": "#translation_chassis_side", "uv": [ 4, 8, 12, 16 ] },
"east": { "texture": "#translation_chassis_side", "uv": [ 4, 8, 12, 16 ] },
"south": { "texture": "#translation_chassis_side", "uv": [ 4, 8, 12, 16 ] },
"west": { "texture": "#translation_chassis_side", "uv": [ 4, 8, 12, 16 ] }
}
}
]
"credit": "Model generated using MrCrayfish's Model Creator (https://mrcrayfish.com/tools?id=mc)",
"textures": {
"1": "create:block/linear_chassis_side",
"4": "create:block/andesite_casing",
"5": "create:block/secondary_linear_chassis_side",
"6": "create:block/andesite_block",
"particle": "create:block/linear_chassis_side"
},
"elements": [
{
"name": "Top",
"from": [1, 12, 1],
"to": [15, 16, 15],
"faces": {
"north": {"uv": [1, 12, 15, 16], "texture": "#1"},
"east": {"uv": [1, 12, 15, 16], "texture": "#1"},
"south": {"uv": [1, 12, 15, 16], "texture": "#1"},
"west": {"uv": [1, 12, 15, 16], "texture": "#1"},
"up": {"uv": [1, 1, 15, 15], "texture": "#6"},
"down": {"uv": [1, 1, 15, 15], "texture": "#4"}
}
},
{
"name": "Inner",
"from": [4, 4, 4],
"to": [12, 12, 12],
"faces": {
"north": {"uv": [4, 8, 12, 16], "texture": "#5"},
"east": {"uv": [4, 8, 12, 16], "texture": "#5"},
"south": {"uv": [4, 8, 12, 16], "texture": "#5"},
"west": {"uv": [4, 8, 12, 16], "texture": "#5"}
}
}
]
}

View file

@ -118,6 +118,7 @@
"translation": [0, 8.5, -2.25]
},
"fixed": {
"translation": [0, 0, -1.75],
"scale": [0.5, 0.5, 0.5]
}
}

View file

@ -124,6 +124,7 @@
"translation": [0, 8.5, -2.25]
},
"fixed": {
"translation": [0, 0, -1.75],
"scale": [0.5, 0.5, 0.5]
}
}

View file

@ -5,8 +5,8 @@
"5": "create:block/creative_casing",
"6": "create:block/creative_motor",
"7": "create:block/flap_display_front",
"1_1": "create:block/axis_top",
"particle": "create:block/creative_casing",
"1_1": "create:block/axis_top",
"1_0": "create:block/axis"
},
"elements": [
@ -176,6 +176,10 @@
"gui": {
"rotation": [30, 45, 0],
"scale": [0.625, 0.625, 0.625]
},
"fixed": {
"rotation": [0, -90, 0],
"scale": [0.5, 0.5, 0.5]
}
},
"groups": [

View file

@ -17,7 +17,7 @@
"fixed": {
"rotation": [ 90, 0, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 0.4, 0.4, 0.4 ]
"scale":[ 0.2, 0.2, 0.2 ]
},
"thirdperson_righthand": {
"rotation": [75, 45, 0],

View file

@ -71,14 +71,34 @@
}
],
"display": {
"thirdperson_righthand": {
"rotation": [75, 45, 0],
"translation": [0, 2.5, 0],
"scale": [0.375, 0.375, 0.375]
},
"thirdperson_lefthand": {
"rotation": [75, 45, 0],
"translation": [0, 2.5, 0],
"scale": [0.375, 0.375, 0.375]
},
"firstperson_righthand": {
"rotation": [0, 45, 0],
"scale": [0.4, 0.4, 0.4]
},
"firstperson_lefthand": {
"rotation": [0, 225, 0],
"scale": [0.4, 0.4, 0.4]
},
"ground": {
"translation": [0, 3, 0],
"scale": [0.25, 0.25, 0.25]
},
"gui": {
"rotation": [30, 45, 0],
"rotation": [30, 225, 0],
"translation": [0, 2.5, 0],
"scale": [0.625, 0.625, 0.625]
},
"fixed": {
"rotation": [270, 0, 0],
"translation": [0, 0, -3],
"scale": [0.5, 0.5, 0.5]
}
}

View file

@ -32,14 +32,21 @@
"up": {"uv": [0, 0, 16, 16], "texture": "#top"}
}
},
{
"name": "inner_top",
"from": [0, 15.9, 0],
"to": [16, 16, 16],
"faces": {
"down": {"uv": [0, 0, 16, 16], "texture": "#top"}
}
},
{
"name": "inside",
"from": [0.05, 0, 16],
"to": [15.95, 16, 0],
"faces": {
"east": {"uv": [0, 0, 16, 16], "texture": "#inside", "cullface": "east"},
"west": {"uv": [0, 0, 16, 16], "texture": "#inside", "cullface": "west"},
"up": {"uv": [0, 0, 16, 16], "texture": "#top"}
"west": {"uv": [0, 0, 16, 16], "texture": "#inside", "cullface": "west"}
}
},
{
@ -48,8 +55,7 @@
"to": [16, 16, 0.05],
"faces": {
"north": {"uv": [0, 0, 16, 16], "texture": "#inside", "cullface": "south"},
"south": {"uv": [0, 0, 16, 16], "texture": "#inside", "cullface": "north"},
"up": {"uv": [0, 0, 16, 16], "texture": "#top"}
"south": {"uv": [0, 0, 16, 16], "texture": "#inside", "cullface": "north"}
}
}
]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 B

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 443 B

After

Width:  |  Height:  |  Size: 520 B