mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-01-27 21:38:05 +01:00
TweaksTM
- Moved redstone link filter slots - Adjusted placement assist for deployers & saws
This commit is contained in:
parent
f2556d75e6
commit
f5ba751e6a
7 changed files with 29 additions and 32 deletions
|
@ -10,7 +10,6 @@ import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.AllItems;
|
import com.simibubi.create.AllItems;
|
||||||
import com.simibubi.create.AllShapes;
|
import com.simibubi.create.AllShapes;
|
||||||
import com.simibubi.create.content.contraptions.base.DirectionalAxisKineticBlock;
|
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.content.contraptions.components.AssemblyOperatorUseContext;
|
||||||
import com.simibubi.create.foundation.block.IBE;
|
import com.simibubi.create.foundation.block.IBE;
|
||||||
import com.simibubi.create.foundation.utility.placement.IPlacementHelper;
|
import com.simibubi.create.foundation.utility.placement.IPlacementHelper;
|
||||||
|
@ -185,8 +184,10 @@ public class DeployerBlock extends DirectionalAxisKineticBlock implements IBE<De
|
||||||
@Override
|
@Override
|
||||||
public PlacementOffset getOffset(Player player, Level world, BlockState state, BlockPos pos,
|
public PlacementOffset getOffset(Player player, Level world, BlockState state, BlockPos pos,
|
||||||
BlockHitResult ray) {
|
BlockHitResult ray) {
|
||||||
List<Direction> directions = IPlacementHelper.orderedByDistanceOnlyAxis(pos, ray.getLocation(),
|
List<Direction> directions = IPlacementHelper.orderedByDistanceExceptAxis(pos, ray.getLocation(),
|
||||||
((KineticBlock) state.getBlock()).getRotationAxis(state), dir -> world.getBlockState(pos.relative(dir))
|
state.getValue(FACING)
|
||||||
|
.getAxis(),
|
||||||
|
dir -> world.getBlockState(pos.relative(dir))
|
||||||
.getMaterial()
|
.getMaterial()
|
||||||
.isReplaceable());
|
.isReplaceable());
|
||||||
|
|
||||||
|
@ -198,6 +199,7 @@ public class DeployerBlock extends DirectionalAxisKineticBlock implements IBE<De
|
||||||
.setValue(AXIS_ALONG_FIRST_COORDINATE, state.getValue(AXIS_ALONG_FIRST_COORDINATE)));
|
.setValue(AXIS_ALONG_FIRST_COORDINATE, state.getValue(AXIS_ALONG_FIRST_COORDINATE)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -231,20 +231,14 @@ public class SawBlock extends DirectionalAxisKineticBlock implements IBE<SawBloc
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Predicate<BlockState> getStatePredicate() {
|
public Predicate<BlockState> getStatePredicate() {
|
||||||
return state -> AllBlocks.MECHANICAL_SAW.has(state) && state.getValue(FACING)
|
return state -> AllBlocks.MECHANICAL_SAW.has(state);
|
||||||
.getAxis() != Axis.Y;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PlacementOffset getOffset(Player player, Level world, BlockState state, BlockPos pos,
|
public PlacementOffset getOffset(Player player, Level world, BlockState state, BlockPos pos,
|
||||||
BlockHitResult ray) {
|
BlockHitResult ray) {
|
||||||
if (state.getValue(FACING)
|
List<Direction> directions = IPlacementHelper.orderedByDistanceExceptAxis(pos, ray.getLocation(),
|
||||||
.getAxis() == Axis.Y)
|
|
||||||
return PlacementOffset.fail();
|
|
||||||
|
|
||||||
List<Direction> directions = IPlacementHelper.orderedByDistanceOnlyAxis(pos, ray.getLocation(),
|
|
||||||
state.getValue(FACING)
|
state.getValue(FACING)
|
||||||
.getClockWise()
|
|
||||||
.getAxis(),
|
.getAxis(),
|
||||||
dir -> world.getBlockState(pos.relative(dir))
|
dir -> world.getBlockState(pos.relative(dir))
|
||||||
.getMaterial()
|
.getMaterial()
|
||||||
|
@ -255,10 +249,11 @@ public class SawBlock extends DirectionalAxisKineticBlock implements IBE<SawBloc
|
||||||
else {
|
else {
|
||||||
return PlacementOffset.success(pos.relative(directions.get(0)),
|
return PlacementOffset.success(pos.relative(directions.get(0)),
|
||||||
s -> s.setValue(FACING, state.getValue(FACING))
|
s -> s.setValue(FACING, state.getValue(FACING))
|
||||||
.setValue(AXIS_ALONG_FIRST_COORDINATE, state.getValue(AXIS_ALONG_FIRST_COORDINATE))
|
.setValue(AXIS_ALONG_FIRST_COORDINATE, state.getValue(AXIS_ALONG_FIRST_COORDINATE))
|
||||||
.setValue(FLIPPED, state.getValue(FLIPPED)));
|
.setValue(FLIPPED, state.getValue(FLIPPED)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,11 +23,11 @@ public class RedstoneLinkFrequencySlot extends ValueBoxTransform.Dual {
|
||||||
@Override
|
@Override
|
||||||
protected Vec3 getLocalOffset(BlockState state) {
|
protected Vec3 getLocalOffset(BlockState state) {
|
||||||
Direction facing = state.getValue(RedstoneLinkBlock.FACING);
|
Direction facing = state.getValue(RedstoneLinkBlock.FACING);
|
||||||
Vec3 location = vertical;
|
Vec3 location = VecHelper.voxelSpace(8f, 3.01f, 5.5f);
|
||||||
|
|
||||||
if (facing.getAxis()
|
if (facing.getAxis()
|
||||||
.isHorizontal()) {
|
.isHorizontal()) {
|
||||||
location = horizontal;
|
location = VecHelper.voxelSpace(8f, 5.5f, 3.01f);
|
||||||
if (isFirst())
|
if (isFirst())
|
||||||
location = location.add(0, 5 / 16f, 0);
|
location = location.add(0, 5 / 16f, 0);
|
||||||
return rotateHorizontally(state, location);
|
return rotateHorizontally(state, location);
|
||||||
|
@ -52,7 +52,7 @@ public class RedstoneLinkFrequencySlot extends ValueBoxTransform.Dual {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected float getScale() {
|
protected float getScale() {
|
||||||
return .5f;
|
return .4975f;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,8 +57,8 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"from": [6.1, 2.5, 3.6],
|
"from": [6, 2.5, 3.5],
|
||||||
"to": [9.9, 3.5, 7.4],
|
"to": [10, 3.5, 7.5],
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},
|
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},
|
||||||
"east": {"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],
|
"from": [6, 2.5, 8.5],
|
||||||
"to": [9.9, 3.5, 12.4],
|
"to": [10, 3.5, 12.5],
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},
|
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},
|
||||||
"east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},
|
"east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},
|
||||||
|
|
|
@ -57,8 +57,8 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"from": [6.1, 2.5, 3.6],
|
"from": [6, 2.5, 3.5],
|
||||||
"to": [9.9, 3.5, 7.4],
|
"to": [10, 3.5, 7.5],
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},
|
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},
|
||||||
"east": {"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],
|
"from": [6, 2.5, 8.5],
|
||||||
"to": [9.9, 3.5, 12.4],
|
"to": [10, 3.5, 12.5],
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},
|
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},
|
||||||
"east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},
|
"east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},
|
||||||
|
|
|
@ -48,8 +48,8 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"from": [6.1, 2.5, 3.6],
|
"from": [6, 2.5, 3.5],
|
||||||
"to": [9.9, 3.5, 7.4],
|
"to": [10, 3.5, 7.5],
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},
|
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},
|
||||||
"east": {"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],
|
"from": [6, 2.5, 8.5],
|
||||||
"to": [9.9, 3.5, 12.4],
|
"to": [10, 3.5, 12.5],
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},
|
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},
|
||||||
"east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},
|
"east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge"},
|
||||||
|
|
|
@ -48,8 +48,8 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"from": [6.1, 2.5, 3.6],
|
"from": [6, 2.5, 3.5],
|
||||||
"to": [9.9, 3.5, 7.4],
|
"to": [10, 3.5, 7.5],
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},
|
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},
|
||||||
"east": {"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],
|
"from": [6, 2.5, 8.5],
|
||||||
"to": [9.9, 3.5, 12.4],
|
"to": [10, 3.5, 12.5],
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},
|
"north": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},
|
||||||
"east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},
|
"east": {"uv": [11, 2, 13, 2.5], "texture": "#redstone_bridge_side"},
|
||||||
|
|
Loading…
Reference in a new issue