mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-14 14:34:16 +01:00
Filtality
- Implement new filter sprites by vectorwing - Raised lower limits of block breaking speed on contraptions
This commit is contained in:
parent
e8fd97b36c
commit
61dc173311
@ -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.MovementBehaviour;
|
||||||
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
|
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.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 com.simibubi.create.foundation.utility.BlockHelper;
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
@ -219,7 +221,12 @@ public class BlockBreakingMovementBehaviour implements MovementBehaviour {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected float getBlockBreakingSpeed(MovementContext context) {
|
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) {
|
protected boolean shouldDestroyStartBlock(BlockState stateToBreak) {
|
||||||
|
@ -97,7 +97,7 @@ public class RollerMovementBehaviour extends BlockBreakingMovementBehaviour {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected float getBlockBreakingSpeed(MovementContext context) {
|
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
|
@Override
|
||||||
|
@ -77,8 +77,8 @@ public abstract class AbstractFilterScreen<F extends AbstractFilterMenu> extends
|
|||||||
drawCenteredString(ms, font, title, x + (background.width - 8) / 2, y + 3, 0xFFFFFF);
|
drawCenteredString(ms, font, title, x + (background.width - 8) / 2, y + 3, 0xFFFFFF);
|
||||||
|
|
||||||
GuiGameElement.of(menu.contentHolder)
|
GuiGameElement.of(menu.contentHolder)
|
||||||
.<GuiGameElement.GuiRenderBuilder>at(x + background.width, y + background.height - 56, -200)
|
.<GuiGameElement.GuiRenderBuilder>at(x + background.width + 8, y + background.height - 52, -200)
|
||||||
.scale(5)
|
.scale(4)
|
||||||
.render(ms);
|
.render(ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,8 +117,6 @@ public class ValueBox extends ChasingAABBOutline {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AllIcons getOutline() {
|
public AllIcons getOutline() {
|
||||||
if (stack.getItem() instanceof FilterItem)
|
|
||||||
return AllIcons.VALUE_BOX_HOVER_8PX;
|
|
||||||
if (!stack.isEmpty())
|
if (!stack.isEmpty())
|
||||||
return AllIcons.VALUE_BOX_HOVER_6PX;
|
return AllIcons.VALUE_BOX_HOVER_6PX;
|
||||||
return super.getOutline();
|
return super.getOutline();
|
||||||
|
@ -4,7 +4,6 @@ import com.jozufozu.flywheel.util.transform.TransformStack;
|
|||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import com.mojang.math.Matrix3f;
|
import com.mojang.math.Matrix3f;
|
||||||
import com.simibubi.create.content.contraptions.relays.elementary.AbstractSimpleShaftBlock;
|
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.Minecraft;
|
||||||
import net.minecraft.client.renderer.MultiBufferSource;
|
import net.minecraft.client.renderer.MultiBufferSource;
|
||||||
@ -30,8 +29,7 @@ public class ValueBoxRenderer {
|
|||||||
.getItemRenderer();
|
.getItemRenderer();
|
||||||
BakedModel modelWithOverrides = itemRenderer.getModel(filter, null, null, 0);
|
BakedModel modelWithOverrides = itemRenderer.getModel(filter, null, null, 0);
|
||||||
boolean blockItem = modelWithOverrides.isGui3d() && !(modelWithOverrides instanceof ItemMultiLayerBakedModel);
|
boolean blockItem = modelWithOverrides.isGui3d() && !(modelWithOverrides instanceof ItemMultiLayerBakedModel);
|
||||||
boolean filterItem = filter.getItem() instanceof FilterItem;
|
float scale = (!blockItem ? .5f : 1f) + 1 / 64f;
|
||||||
float scale = (!blockItem && !filterItem ? .5f : 1f) + 1 / 64f;
|
|
||||||
float zOffset = (!blockItem ? -.15f : 0) + customZOffset(filter.getItem());
|
float zOffset = (!blockItem ? -.15f : 0) + customZOffset(filter.getItem());
|
||||||
ms.scale(scale, scale, scale);
|
ms.scale(scale, scale, scale);
|
||||||
ms.translate(0, 0, zOffset);
|
ms.translate(0, 0, zOffset);
|
||||||
@ -80,8 +78,6 @@ public class ValueBoxRenderer {
|
|||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
private static float customZOffset(Item item) {
|
private static float customZOffset(Item item) {
|
||||||
float nudge = -.1f;
|
float nudge = -.1f;
|
||||||
if (item instanceof FilterItem)
|
|
||||||
return -nudge / 2;
|
|
||||||
if (item instanceof BlockItem) {
|
if (item instanceof BlockItem) {
|
||||||
Block block = ((BlockItem) item).getBlock();
|
Block block = ((BlockItem) item).getBlock();
|
||||||
if (block instanceof AbstractSimpleShaftBlock)
|
if (block instanceof AbstractSimpleShaftBlock)
|
||||||
|
@ -4,33 +4,5 @@
|
|||||||
"textures": {
|
"textures": {
|
||||||
"particle": "create:item/andesite_filter",
|
"particle": "create:item/andesite_filter",
|
||||||
"layer0": "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 |
Loading…
Reference in New Issue
Block a user