mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-10 12:33:57 +01:00
Track API
Clean up code a bit
This commit is contained in:
parent
d9ce6ce995
commit
e629d02f50
@ -557,21 +557,15 @@ public class TrackPlacement {
|
|||||||
|
|
||||||
if (!simulate) {
|
if (!simulate) {
|
||||||
BlockState onto = info.getMaterial().getTrackBlock().getDefaultState();
|
BlockState onto = info.getMaterial().getTrackBlock().getDefaultState();
|
||||||
var relevantState = state1;
|
|
||||||
BlockState stateAtPos = level.getBlockState(targetPos1);
|
BlockState stateAtPos = level.getBlockState(targetPos1);
|
||||||
var stateAtPosVar = stateAtPos;
|
level.setBlock(targetPos1, ProperWaterloggedBlock.withWater(level,
|
||||||
// BlockState injectorAllocatedLocal30 = (BlockState)(stateAtPos.getBlock() == state1.getBlock() ? stateAtPos : state1).setValue(TrackBlock.HAS_TE, true);
|
(AllTags.AllBlockTags.TRACKS.matches(stateAtPos) ? stateAtPos : copyProperties(state1, onto))
|
||||||
relevantState = copyProperties(relevantState, onto);
|
.setValue(TrackBlock.HAS_TE, true), targetPos1), 3);
|
||||||
var modifiedBlock = (AllTags.AllBlockTags.TRACKS.matches(stateAtPosVar) ? stateAtPosVar : relevantState).setValue(TrackBlock.HAS_TE, true);
|
|
||||||
level.setBlock(targetPos1, ProperWaterloggedBlock.withWater(level, modifiedBlock, targetPos1), 3);
|
|
||||||
|
|
||||||
relevantState = state2;
|
|
||||||
stateAtPos = level.getBlockState(targetPos2);
|
stateAtPos = level.getBlockState(targetPos2);
|
||||||
stateAtPosVar = stateAtPos;
|
level.setBlock(targetPos2, ProperWaterloggedBlock.withWater(level,
|
||||||
// BlockState injectorAllocatedLocal30 = (BlockState)(stateAtPos.getBlock() == state1.getBlock() ? stateAtPos : state1).setValue(TrackBlock.HAS_TE, true);
|
(AllTags.AllBlockTags.TRACKS.matches(stateAtPos) ? stateAtPos : copyProperties(state2, onto))
|
||||||
relevantState = copyProperties(relevantState, onto);
|
.setValue(TrackBlock.HAS_TE, true), targetPos2), 3);
|
||||||
modifiedBlock = (AllTags.AllBlockTags.TRACKS.matches(stateAtPosVar) ? stateAtPosVar : relevantState).setValue(TrackBlock.HAS_TE, true);
|
|
||||||
level.setBlock(targetPos2, ProperWaterloggedBlock.withWater(level, modifiedBlock, targetPos2), 3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BlockEntity te1 = level.getBlockEntity(targetPos1);
|
BlockEntity te1 = level.getBlockEntity(targetPos1);
|
||||||
|
Loading…
Reference in New Issue
Block a user