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