Filtality

- Implement new filter sprites by vectorwing
- Raised lower limits of block breaking speed on contraptions
This commit is contained in:
simibubi 2023-03-15 15:47:31 +01:00
parent e8fd97b36c
commit 61dc173311
8 changed files with 12 additions and 39 deletions

View File

@ -4,6 +4,8 @@ import com.simibubi.create.content.contraptions.components.structureMovement.Abs
import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
import com.simibubi.create.content.contraptions.components.structureMovement.OrientedContraptionEntity;
import com.simibubi.create.content.contraptions.components.structureMovement.mounted.MountedContraption;
import com.simibubi.create.content.logistics.trains.entity.CarriageContraption;
import com.simibubi.create.foundation.utility.BlockHelper;
import net.minecraft.core.BlockPos;
@ -219,7 +221,12 @@ public class BlockBreakingMovementBehaviour implements MovementBehaviour {
}
protected float getBlockBreakingSpeed(MovementContext context) {
return Mth.clamp(Math.abs(context.getAnimationSpeed()) / 500f, 1 / 128f, 16f);
float lowerLimit = 1 / 128f;
if (context.contraption instanceof MountedContraption)
lowerLimit = 1f;
if (context.contraption instanceof CarriageContraption)
lowerLimit = 4f;
return Mth.clamp(Math.abs(context.getAnimationSpeed()) / 500f, lowerLimit, 16f);
}
protected boolean shouldDestroyStartBlock(BlockState stateToBreak) {

View File

@ -97,7 +97,7 @@ public class RollerMovementBehaviour extends BlockBreakingMovementBehaviour {
@Override
protected float getBlockBreakingSpeed(MovementContext context) {
return Mth.clamp(super.getBlockBreakingSpeed(context) * 4, 1 / 128f, 16f);
return Mth.clamp(super.getBlockBreakingSpeed(context) * 1.5f, 1 / 128f, 16f);
}
@Override

View File

@ -77,8 +77,8 @@ public abstract class AbstractFilterScreen<F extends AbstractFilterMenu> extends
drawCenteredString(ms, font, title, x + (background.width - 8) / 2, y + 3, 0xFFFFFF);
GuiGameElement.of(menu.contentHolder)
.<GuiGameElement.GuiRenderBuilder>at(x + background.width, y + background.height - 56, -200)
.scale(5)
.<GuiGameElement.GuiRenderBuilder>at(x + background.width + 8, y + background.height - 52, -200)
.scale(4)
.render(ms);
}

View File

@ -117,8 +117,6 @@ public class ValueBox extends ChasingAABBOutline {
@Override
public AllIcons getOutline() {
if (stack.getItem() instanceof FilterItem)
return AllIcons.VALUE_BOX_HOVER_8PX;
if (!stack.isEmpty())
return AllIcons.VALUE_BOX_HOVER_6PX;
return super.getOutline();

View File

@ -4,7 +4,6 @@ import com.jozufozu.flywheel.util.transform.TransformStack;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.math.Matrix3f;
import com.simibubi.create.content.contraptions.relays.elementary.AbstractSimpleShaftBlock;
import com.simibubi.create.content.logistics.item.filter.FilterItem;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.MultiBufferSource;
@ -30,8 +29,7 @@ public class ValueBoxRenderer {
.getItemRenderer();
BakedModel modelWithOverrides = itemRenderer.getModel(filter, null, null, 0);
boolean blockItem = modelWithOverrides.isGui3d() && !(modelWithOverrides instanceof ItemMultiLayerBakedModel);
boolean filterItem = filter.getItem() instanceof FilterItem;
float scale = (!blockItem && !filterItem ? .5f : 1f) + 1 / 64f;
float scale = (!blockItem ? .5f : 1f) + 1 / 64f;
float zOffset = (!blockItem ? -.15f : 0) + customZOffset(filter.getItem());
ms.scale(scale, scale, scale);
ms.translate(0, 0, zOffset);
@ -80,8 +78,6 @@ public class ValueBoxRenderer {
@SuppressWarnings("deprecation")
private static float customZOffset(Item item) {
float nudge = -.1f;
if (item instanceof FilterItem)
return -nudge / 2;
if (item instanceof BlockItem) {
Block block = ((BlockItem) item).getBlock();
if (block instanceof AbstractSimpleShaftBlock)

View File

@ -4,33 +4,5 @@
"textures": {
"particle": "create:item/andesite_filter",
"layer0": "create:item/andesite_filter"
},
"display": {
"thirdperson_righthand": {
"translation": [0, 1.5, 1],
"scale": [0.55, 0.55, 0.55]
},
"thirdperson_lefthand": {
"translation": [0, 1.5, 1],
"scale": [0.55, 0.55, 0.55]
},
"firstperson_righthand": {
"rotation": [0, -90, 25],
"translation": [1.13, 3.2, 2.88],
"scale": [0.68, 0.68, 0.68]
},
"firstperson_lefthand": {
"rotation": [0, -90, 25],
"translation": [1.13, 3.2, 2.88],
"scale": [0.68, 0.68, 0.68]
},
"gui": {
"rotation": [30, 135, 0],
"scale": [1.5, 1.5, 1.5]
},
"fixed": {
"rotation": [0, 180, 0],
"scale": [2, 2, 2]
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 221 B

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 279 B