Meeting notes

- Can now use trapdoors with copycat panels
- Copycat bars are less likely to cause zfighting
- Fixed waterwheels not updating flow score in some edge cases
- Metal Scaffolding no longer zfights with adjacent non-solid blocks
- Boiler status now highlights information about water flow when insufficient
This commit is contained in:
simibubi 2023-03-02 12:43:08 +01:00
parent c4505b657b
commit 00e733e608
14 changed files with 127 additions and 33 deletions

View file

@ -578,7 +578,7 @@ bf2b0310500213ff853c748c236eb5d01f61658e assets/create/blockstates/yellow_toolbo
7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json
b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json
ea8adceca24670f1b5850ccd5c2ac766de590f05 assets/create/lang/en_ud.json
a65e9c868a5da341170e4ddf38405a4d3e8403e8 assets/create/lang/en_us.json
231bf5987635c816220c32ae69f269f9de43fecd 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

@ -1482,6 +1482,8 @@
"create.boiler.heat_dots": "...... ",
"create.boiler.via_one_engine": "via 1 engine",
"create.boiler.via_engines": "via %1$s engines",
"create.boiler.water_input_rate": "Water input rate",
"create.boiler.per_tick": "%1$s per Tick",
"create.elevator_contact.title": "Elevator Contact",
"create.elevator_contact.floor_identifier": "Floor Identifier",

View file

@ -72,6 +72,7 @@ public class WaterWheelBlockEntity extends GeneratingKineticBlockEntity {
public WaterWheelBlockEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) {
super(type, pos, state);
material = Blocks.SPRUCE_PLANKS.defaultBlockState();
setLazyTickRate(60);
}
protected int getSize() {
@ -85,7 +86,8 @@ public class WaterWheelBlockEntity extends GeneratingKineticBlockEntity {
public InteractionResult applyMaterialIfValid(ItemStack stack) {
if (!(stack.getItem()instanceof BlockItem blockItem))
return InteractionResult.PASS;
BlockState material = blockItem.getBlock().defaultBlockState();
BlockState material = blockItem.getBlock()
.defaultBlockState();
if (material == this.material)
return InteractionResult.PASS;
if (!material.is(BlockTags.PLANKS))
@ -106,6 +108,14 @@ public class WaterWheelBlockEntity extends GeneratingKineticBlockEntity {
return axis;
}
@Override
public void lazyTick() {
super.lazyTick();
// Water can change flow direction without notifying neighbours
determineAndApplyFlowScore();
}
public void determineAndApplyFlowScore() {
Vec3 wheelPlane =
Vec3.atLowerCornerOf(new Vec3i(1, 1, 1).subtract(Direction.get(AxisDirection.POSITIVE, getAxis())

View file

@ -171,6 +171,22 @@ public class BoilerData {
tooltip.add(Components.immutableEmpty());
if (attachedEngines > 0 && maxHeatForSize > 0 && maxHeatForWater == 0 && (passiveHeat ? 1 : activeHeat) > 0) {
Lang.translate("boiler.water_input_rate")
.style(ChatFormatting.GRAY)
.forGoggles(tooltip);
Lang.number(waterSupply)
.style(ChatFormatting.BLUE)
.add(Lang.translate("generic.unit.millibuckets"))
.add(Lang.text(" / ")
.style(ChatFormatting.GRAY))
.add(Lang.translate("boiler.per_tick", Lang.number(waterSupplyPerLevel)
.add(Lang.translate("generic.unit.millibuckets")))
.style(ChatFormatting.DARK_GRAY))
.forGoggles(tooltip, 1);
return true;
}
Lang.translate("tooltip.capacityProvided")
.style(ChatFormatting.GRAY)
.forGoggles(tooltip);
@ -250,7 +266,8 @@ public class BoilerData {
}
private MutableComponent bars(int level, ChatFormatting format) {
return Components.literal(Strings.repeat('|', level)).withStyle(format);
return Components.literal(Strings.repeat('|', level))
.withStyle(format);
}
public boolean evaluate(FluidTankBlockEntity controller) {

View file

@ -95,11 +95,14 @@ public abstract class CopycatBlock extends Block implements IBE<CopycatBlockEnti
Direction face = pHit.getDirection();
ItemStack itemInHand = pPlayer.getItemInHand(pHand);
BlockState material = getAcceptedBlockState(pLevel, pPos, itemInHand, face);
BlockState materialIn = getAcceptedBlockState(pLevel, pPos, itemInHand, face);
if (material == null)
if (materialIn != null)
materialIn = prepareMaterial(pLevel, pPos, pState, pPlayer, pHand, pHit, materialIn);
if (materialIn == null)
return InteractionResult.PASS;
BlockState material = materialIn;
return onBlockEntityUse(pLevel, pPos, ufte -> {
if (ufte.getMaterial()
.is(material.getBlock())) {
@ -208,6 +211,11 @@ public abstract class CopycatBlock extends Block implements IBE<CopycatBlockEnti
return false;
}
public BlockState prepareMaterial(Level pLevel, BlockPos pPos, BlockState pState, Player pPlayer,
InteractionHand pHand, BlockHitResult pHit, BlockState material) {
return material;
}
@Override
public void onRemove(BlockState pState, Level pLevel, BlockPos pPos, BlockState pNewState, boolean pIsMoving) {
if (!pState.hasBlockEntity() || pState.getBlock() == pNewState.getBlock())

View file

@ -18,6 +18,7 @@ import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.NbtUtils;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.TrapDoorBlock;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
@ -25,7 +26,8 @@ import net.minecraftforge.client.model.data.IModelData;
import net.minecraftforge.client.model.data.ModelDataMap;
import net.minecraftforge.items.ItemHandlerHelper;
public class CopycatBlockEntity extends SmartBlockEntity implements ISpecialBlockEntityItemRequirement, ITransformableBlockEntity {
public class CopycatBlockEntity extends SmartBlockEntity
implements ISpecialBlockEntityItemRequirement, ITransformableBlockEntity {
private BlockState material;
private ItemStack consumedItem;
@ -71,10 +73,15 @@ public class CopycatBlockEntity extends SmartBlockEntity implements ISpecialBloc
}
public boolean cycleMaterial() {
if (material.hasProperty(BlockStateProperties.FACING))
if (material.hasProperty(TrapDoorBlock.HALF) && material.getOptionalValue(TrapDoorBlock.OPEN)
.orElse(false))
setMaterial(material.cycle(TrapDoorBlock.HALF));
else if (material.hasProperty(BlockStateProperties.FACING))
setMaterial(material.cycle(BlockStateProperties.FACING));
else if (material.hasProperty(BlockStateProperties.HORIZONTAL_FACING))
setMaterial(material.cycle(BlockStateProperties.HORIZONTAL_FACING));
setMaterial(material.setValue(BlockStateProperties.HORIZONTAL_FACING,
material.getValue(BlockStateProperties.HORIZONTAL_FACING)
.getClockWise()));
else if (material.hasProperty(BlockStateProperties.AXIS))
setMaterial(material.cycle(BlockStateProperties.AXIS));
else if (material.hasProperty(BlockStateProperties.HORIZONTAL_AXIS))

View file

@ -12,6 +12,7 @@ import com.simibubi.create.foundation.utility.placement.PlacementOffset;
import net.minecraft.MethodsReturnNonnullByDefault;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.Direction.Axis;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
@ -24,10 +25,12 @@ import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Mirror;
import net.minecraft.world.level.block.Rotation;
import net.minecraft.world.level.block.TrapDoorBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition.Builder;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.DirectionProperty;
import net.minecraft.world.level.block.state.properties.Half;
import net.minecraft.world.level.pathfinder.PathComputationType;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
@ -46,7 +49,26 @@ public class CopycatPanelBlock extends WaterloggedCopycatBlock {
@Override
public boolean isAcceptedRegardless(BlockState material) {
return CopycatSpecialCases.isBarsMaterial(material);
return CopycatSpecialCases.isBarsMaterial(material) || CopycatSpecialCases.isTrapdoorMaterial(material);
}
@Override
public BlockState prepareMaterial(Level pLevel, BlockPos pPos, BlockState pState, Player pPlayer,
InteractionHand pHand, BlockHitResult pHit, BlockState material) {
if (!CopycatSpecialCases.isTrapdoorMaterial(material))
return super.prepareMaterial(pLevel, pPos, pState, pPlayer, pHand, pHit, material);
Direction panelFacing = pState.getValue(FACING);
if (panelFacing == Direction.DOWN)
material = material.setValue(TrapDoorBlock.HALF, Half.TOP);
if (panelFacing.getAxis() == Axis.Y)
return material.setValue(TrapDoorBlock.FACING, pPlayer.getDirection())
.setValue(TrapDoorBlock.OPEN, false);
boolean clickedNearTop = pHit.getLocation().y - .5 > pPos.getY();
return material.setValue(TrapDoorBlock.OPEN, true)
.setValue(TrapDoorBlock.HALF, clickedNearTop ? Half.TOP : Half.BOTTOM)
.setValue(TrapDoorBlock.FACING, panelFacing);
}
@Override

View file

@ -10,6 +10,7 @@ import com.simibubi.create.foundation.model.BakedQuadHelper;
import com.simibubi.create.foundation.utility.Iterate;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.BlockRenderDispatcher;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.resources.model.BakedModel;
import net.minecraft.core.BlockPos;
@ -33,14 +34,18 @@ public class CopycatPanelModel extends CopycatModel {
IModelData wrappedData) {
Direction facing = state.getOptionalValue(CopycatPanelBlock.FACING)
.orElse(Direction.UP);
BlockRenderDispatcher blockRenderer = Minecraft.getInstance()
.getBlockRenderer();
BlockState specialCopycatModelState = null;
if (CopycatSpecialCases.isBarsMaterial(material))
specialCopycatModelState = AllBlocks.COPYCAT_BARS.getDefaultState();
if (CopycatSpecialCases.isTrapdoorMaterial(material))
return blockRenderer.getBlockModel(material)
.getQuads(state, side, rand, wrappedData);
if (specialCopycatModelState != null) {
BakedModel blockModel = Minecraft.getInstance()
.getBlockRenderer()
BakedModel blockModel = blockRenderer
.getBlockModel(specialCopycatModelState.setValue(DirectionalBlock.FACING, facing));
if (blockModel instanceof CopycatModel cm)
return cm.getCroppedQuads(state, side, rand, material, wrappedData);

View file

@ -4,6 +4,7 @@ import com.simibubi.create.content.palettes.GlassPaneBlock;
import net.minecraft.world.level.block.IronBarsBlock;
import net.minecraft.world.level.block.StainedGlassPaneBlock;
import net.minecraft.world.level.block.TrapDoorBlock;
import net.minecraft.world.level.block.state.BlockState;
public class CopycatSpecialCases {
@ -13,4 +14,9 @@ public class CopycatSpecialCases {
&& !(material.getBlock() instanceof StainedGlassPaneBlock);
}
public static boolean isTrapdoorMaterial(BlockState material) {
return material.getBlock() instanceof TrapDoorBlock && material.hasProperty(TrapDoorBlock.HALF)
&& material.hasProperty(TrapDoorBlock.OPEN) && material.hasProperty(TrapDoorBlock.FACING);
}
}

View file

@ -629,6 +629,8 @@
"create.boiler.heat_dots": "...... ",
"create.boiler.via_one_engine": "via 1 engine",
"create.boiler.via_engines": "via %1$s engines",
"create.boiler.water_input_rate": "Water input rate",
"create.boiler.per_tick": "%1$s per Tick",
"create.elevator_contact.title": "Elevator Contact",
"create.elevator_contact.floor_identifier": "Floor Identifier",

View file

@ -7,8 +7,8 @@
},
"elements": [
{
"from": [0, 0, 1],
"to": [16, 16, 1],
"from": [0, 0, 0.95],
"to": [16, 16, 1.05],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [0, 0, 16, 16], "texture": "#edge"},

View file

@ -7,8 +7,8 @@
},
"elements": [
{
"from": [0, 1, 0],
"to": [16, 1, 16],
"from": [0, 0.95, 0],
"to": [16, 1.05, 16],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]},
"faces": {
"up": {"uv": [0, 0, 16, 16], "texture": "#edge"},
@ -16,9 +16,9 @@
}
},
{
"shade": false,
"from": [0, 0, 0],
"to": [16, 2, 16],
"shade": false,
"faces": {
"north": {"uv": [7, 0, 9, 16], "rotation": 90, "texture": "#edge", "cullface": "north"},
"east": {"uv": [7, 0, 9, 16], "rotation": 90, "texture": "#edge", "cullface": "east"},
@ -27,9 +27,9 @@
}
},
{
"shade": false,
"from": [0.05, 1.95, 0.05],
"to": [15.95, 0.05, 15.95],
"shade": false,
"faces": {
"north": {"uv": [9, 0, 7, 16], "rotation": 90, "texture": "#edge", "cullface": "north"},
"east": {"uv": [9, 0, 7, 16], "rotation": 90, "texture": "#edge", "cullface": "east"},

View file

@ -34,13 +34,21 @@
},
{
"name": "inside",
"from": [0, 0, 16],
"to": [16, 16, 0],
"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"}
}
},
{
"name": "inside",
"from": [0, 0, 15.95],
"to": [16, 16, 0.05],
"faces": {
"north": {"uv": [0, 0, 16, 16], "texture": "#inside", "cullface": "south"},
"east": {"uv": [0, 0, 16, 16], "texture": "#inside", "cullface": "east"},
"south": {"uv": [0, 0, 16, 16], "texture": "#inside", "cullface": "north"},
"west": {"uv": [0, 0, 16, 16], "texture": "#inside", "cullface": "west"},
"up": {"uv": [0, 0, 16, 16], "texture": "#top"}
}
}

View file

@ -2,9 +2,9 @@
"credit": "Made with Blockbench",
"textures": {
"inside": "create:block/scaffold/brass_scaffold_inside",
"particle": "create:block/scaffold/brass_scaffold",
"side": "create:block/scaffold/brass_scaffold",
"casing": "create:block/brass_casing",
"particle": "create:block/scaffold/brass_scaffold"
"casing": "create:block/brass_casing"
},
"elements": [
{
@ -33,13 +33,20 @@
},
{
"name": "inside",
"from": [16, 8, 0],
"to": [0, 13.05, 16],
"from": [15.95, 8, 0],
"to": [0.05, 13.05, 16],
"faces": {
"east": {"uv": [16, 3, 0, 8], "texture": "#inside", "cullface": "west"},
"west": {"uv": [16, 3, 0, 8], "texture": "#inside", "cullface": "east"}
}
},
{
"name": "inside",
"from": [16, 8, 0.05],
"to": [0, 13.05, 15.95],
"faces": {
"north": {"uv": [16, 3, 0, 8], "texture": "#inside", "cullface": "north"},
"east": {"uv": [16, 3, 0, 8], "texture": "#inside", "cullface": "west"},
"south": {"uv": [16, 2.95, 0, 7.95], "texture": "#inside", "cullface": "south"},
"west": {"uv": [16, 3, 0, 8], "texture": "#inside", "cullface": "east"}
"south": {"uv": [16, 2.95, 0, 7.95], "texture": "#inside", "cullface": "south"}
}
}
]