- Moved redstone link filter slots
- Adjusted placement assist for deployers & saws
This commit is contained in:
simibubi 2023-04-23 01:14:37 +02:00
parent f2556d75e6
commit f5ba751e6a
7 changed files with 29 additions and 32 deletions

View file

@ -10,7 +10,6 @@ import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllItems;
import com.simibubi.create.AllShapes;
import com.simibubi.create.content.contraptions.base.DirectionalAxisKineticBlock;
import com.simibubi.create.content.contraptions.base.KineticBlock;
import com.simibubi.create.content.contraptions.components.AssemblyOperatorUseContext;
import com.simibubi.create.foundation.block.IBE;
import com.simibubi.create.foundation.utility.placement.IPlacementHelper;
@ -185,8 +184,10 @@ public class DeployerBlock extends DirectionalAxisKineticBlock implements IBE<De
@Override
public PlacementOffset getOffset(Player player, Level world, BlockState state, BlockPos pos,
BlockHitResult ray) {
List<Direction> directions = IPlacementHelper.orderedByDistanceOnlyAxis(pos, ray.getLocation(),
((KineticBlock) state.getBlock()).getRotationAxis(state), dir -> world.getBlockState(pos.relative(dir))
List<Direction> directions = IPlacementHelper.orderedByDistanceExceptAxis(pos, ray.getLocation(),
state.getValue(FACING)
.getAxis(),
dir -> world.getBlockState(pos.relative(dir))
.getMaterial()
.isReplaceable());
@ -198,6 +199,7 @@ public class DeployerBlock extends DirectionalAxisKineticBlock implements IBE<De
.setValue(AXIS_ALONG_FIRST_COORDINATE, state.getValue(AXIS_ALONG_FIRST_COORDINATE)));
}
}
}
}

View file

@ -231,20 +231,14 @@ public class SawBlock extends DirectionalAxisKineticBlock implements IBE<SawBloc
@Override
public Predicate<BlockState> getStatePredicate() {
return state -> AllBlocks.MECHANICAL_SAW.has(state) && state.getValue(FACING)
.getAxis() != Axis.Y;
return state -> AllBlocks.MECHANICAL_SAW.has(state);
}
@Override
public PlacementOffset getOffset(Player player, Level world, BlockState state, BlockPos pos,
BlockHitResult ray) {
if (state.getValue(FACING)
.getAxis() == Axis.Y)
return PlacementOffset.fail();
List<Direction> directions = IPlacementHelper.orderedByDistanceOnlyAxis(pos, ray.getLocation(),
List<Direction> directions = IPlacementHelper.orderedByDistanceExceptAxis(pos, ray.getLocation(),
state.getValue(FACING)
.getClockWise()
.getAxis(),
dir -> world.getBlockState(pos.relative(dir))
.getMaterial()
@ -255,10 +249,11 @@ public class SawBlock extends DirectionalAxisKineticBlock implements IBE<SawBloc
else {
return PlacementOffset.success(pos.relative(directions.get(0)),
s -> s.setValue(FACING, state.getValue(FACING))
.setValue(AXIS_ALONG_FIRST_COORDINATE, state.getValue(AXIS_ALONG_FIRST_COORDINATE))
.setValue(FLIPPED, state.getValue(FLIPPED)));
.setValue(AXIS_ALONG_FIRST_COORDINATE, state.getValue(AXIS_ALONG_FIRST_COORDINATE))
.setValue(FLIPPED, state.getValue(FLIPPED)));
}
}
}
}

View file

@ -23,11 +23,11 @@ public class RedstoneLinkFrequencySlot extends ValueBoxTransform.Dual {
@Override
protected Vec3 getLocalOffset(BlockState state) {
Direction facing = state.getValue(RedstoneLinkBlock.FACING);
Vec3 location = vertical;
Vec3 location = VecHelper.voxelSpace(8f, 3.01f, 5.5f);
if (facing.getAxis()
.isHorizontal()) {
location = horizontal;
location = VecHelper.voxelSpace(8f, 5.5f, 3.01f);
if (isFirst())
location = location.add(0, 5 / 16f, 0);
return rotateHorizontally(state, location);
@ -52,7 +52,7 @@ public class RedstoneLinkFrequencySlot extends ValueBoxTransform.Dual {
@Override
protected float getScale() {
return .5f;
return .4975f;
}
}

View file

@ -57,8 +57,8 @@
}
},
{
"from": [6.1, 2.5, 3.6],
"to": [9.9, 3.5, 7.4],
"from": [6, 2.5, 3.5],
"to": [10, 3.5, 7.5],
"faces": {
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},
"east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},
@ -68,8 +68,8 @@
}
},
{
"from": [6.1, 2.5, 8.6],
"to": [9.9, 3.5, 12.4],
"from": [6, 2.5, 8.5],
"to": [10, 3.5, 12.5],
"faces": {
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},
"east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},

View file

@ -57,8 +57,8 @@
}
},
{
"from": [6.1, 2.5, 3.6],
"to": [9.9, 3.5, 7.4],
"from": [6, 2.5, 3.5],
"to": [10, 3.5, 7.5],
"faces": {
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},
"east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},
@ -68,8 +68,8 @@
}
},
{
"from": [6.1, 2.5, 8.6],
"to": [9.9, 3.5, 12.4],
"from": [6, 2.5, 8.5],
"to": [10, 3.5, 12.5],
"faces": {
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},
"east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},

View file

@ -48,8 +48,8 @@
}
},
{
"from": [6.1, 2.5, 3.6],
"to": [9.9, 3.5, 7.4],
"from": [6, 2.5, 3.5],
"to": [10, 3.5, 7.5],
"faces": {
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},
"east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},
@ -59,8 +59,8 @@
}
},
{
"from": [6.1, 2.5, 8.6],
"to": [9.9, 3.5, 12.4],
"from": [6, 2.5, 8.5],
"to": [10, 3.5, 12.5],
"faces": {
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},
"east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},

View file

@ -48,8 +48,8 @@
}
},
{
"from": [6.1, 2.5, 3.6],
"to": [9.9, 3.5, 7.4],
"from": [6, 2.5, 3.5],
"to": [10, 3.5, 7.5],
"faces": {
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},
"east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},
@ -59,8 +59,8 @@
}
},
{
"from": [6.1, 2.5, 8.6],
"to": [9.9, 3.5, 12.4],
"from": [6, 2.5, 8.5],
"to": [10, 3.5, 12.5],
"faces": {
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},
"east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},