-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
44 changed files
with
1,598 additions
and
5,340 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5,253 changes: 307 additions & 4,946 deletions
5,253
common/src/generated/resources/.cache/7568cfb1ba927d76bbe88ce5981c1ed7cd0b00e8
Large diffs are not rendered by default.
Oops, something went wrong.
237 changes: 20 additions & 217 deletions
237
common/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
common/src/generated/resources/.cache/a9daecb7d1078a8792baf5a468992ef06279aca3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// 1.19.2 2023-04-25T20:02:00.079877845 Steam 'n Rails's lang merger | ||
35e6ba72d79b51d2919958faa4ca27ef261eeef4 assets/railways/lang/en_us.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...src/main/java/com/railwayteam/railways/content/conductor/IConductorHoldingFakePlayer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.railwayteam.railways.content.conductor; | ||
|
||
import org.jetbrains.annotations.Nullable; | ||
|
||
public interface IConductorHoldingFakePlayer { | ||
@Nullable ConductorEntity getConductor(); | ||
} |
127 changes: 127 additions & 0 deletions
127
...on/src/main/java/com/railwayteam/railways/content/smokestack/AbstractSmokeStackBlock.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
package com.railwayteam.railways.content.smokestack; | ||
|
||
import com.railwayteam.railways.util.ShapeWrapper; | ||
import com.simibubi.create.AllTags; | ||
import com.simibubi.create.content.equipment.wrench.IWrenchable; | ||
import com.simibubi.create.foundation.block.IBE; | ||
import com.simibubi.create.foundation.block.ProperWaterloggedBlock; | ||
import com.simibubi.create.foundation.blockEntity.SmartBlockEntity; | ||
import net.minecraft.MethodsReturnNonnullByDefault; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.core.Direction; | ||
import net.minecraft.world.InteractionHand; | ||
import net.minecraft.world.InteractionResult; | ||
import net.minecraft.world.entity.player.Player; | ||
import net.minecraft.world.item.context.BlockPlaceContext; | ||
import net.minecraft.world.level.BlockGetter; | ||
import net.minecraft.world.level.Level; | ||
import net.minecraft.world.level.LevelAccessor; | ||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import net.minecraft.world.level.block.state.StateDefinition; | ||
import net.minecraft.world.level.block.state.properties.BlockStateProperties; | ||
import net.minecraft.world.level.block.state.properties.BooleanProperty; | ||
import net.minecraft.world.level.material.FluidState; | ||
import net.minecraft.world.level.material.Fluids; | ||
import net.minecraft.world.phys.BlockHitResult; | ||
import net.minecraft.world.phys.shapes.CollisionContext; | ||
import net.minecraft.world.phys.shapes.VoxelShape; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import javax.annotation.ParametersAreNonnullByDefault; | ||
|
||
@MethodsReturnNonnullByDefault | ||
@ParametersAreNonnullByDefault | ||
public abstract class AbstractSmokeStackBlock<T extends SmartBlockEntity> extends Block implements ProperWaterloggedBlock, IWrenchable, IBE<T> { | ||
|
||
public static final BooleanProperty ENABLED = BlockStateProperties.ENABLED; | ||
public static final BooleanProperty POWERED = BlockStateProperties.POWERED; | ||
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; | ||
|
||
protected final ShapeWrapper shape; | ||
|
||
public AbstractSmokeStackBlock(Properties properties, ShapeWrapper shape) { | ||
super(properties); | ||
this.registerDefaultState(this.makeDefaultState()); | ||
this.shape = shape; | ||
} | ||
|
||
@Override | ||
@SuppressWarnings("deprecation") | ||
public VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) { | ||
return shape.get(); | ||
} | ||
|
||
protected BlockState makeDefaultState() { | ||
return this.defaultBlockState() | ||
.setValue(ENABLED, true) | ||
.setValue(POWERED, false) | ||
.setValue(WATERLOGGED, false); | ||
} | ||
|
||
@Override | ||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) { | ||
super.createBlockStateDefinition(builder); | ||
builder.add(ENABLED).add(POWERED).add(WATERLOGGED); | ||
} | ||
|
||
@Override | ||
@SuppressWarnings("deprecation") | ||
public @NotNull FluidState getFluidState(BlockState state) { | ||
return fluidState(state); | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public BlockState getStateForPlacement(BlockPlaceContext context) { | ||
BlockState blockstate = this.defaultBlockState(); | ||
FluidState fluidstate = context.getLevel().getFluidState(context.getClickedPos()); | ||
|
||
if (context.getLevel().hasNeighborSignal(context.getClickedPos())) { | ||
blockstate = blockstate.setValue(ENABLED, false).setValue(POWERED, true); | ||
} | ||
|
||
return blockstate.setValue(WATERLOGGED, fluidstate.getType() == Fluids.WATER); | ||
} | ||
|
||
@Override | ||
@SuppressWarnings("deprecation") | ||
public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor level, BlockPos currentPos, BlockPos neighborPos) { | ||
updateWater(level, state, currentPos); | ||
return state; | ||
} | ||
|
||
@Override | ||
public InteractionResult use(BlockState pState, Level pLevel, BlockPos pPos, Player pPlayer, InteractionHand pHand, | ||
BlockHitResult pHit) { | ||
if (AllTags.AllItemTags.WRENCH.matches(pPlayer.getItemInHand(pHand))) { | ||
return super.use(pState, pLevel, pPos, pPlayer, pHand, pHit); | ||
} | ||
pState = pState.cycle(ENABLED); | ||
pLevel.setBlock(pPos, pState, 2); | ||
if (pState.getValue(WATERLOGGED)) | ||
pLevel.scheduleTick(pPos, Fluids.WATER, Fluids.WATER.getTickDelay(pLevel)); | ||
return InteractionResult.sidedSuccess(pLevel.isClientSide); | ||
} | ||
|
||
@Override | ||
@SuppressWarnings("deprecation") | ||
public void neighborChanged(BlockState state, Level level, BlockPos pos, Block block, BlockPos fromPos, boolean isMoving) { | ||
super.neighborChanged(state, level, pos, block, fromPos, isMoving); | ||
if (!level.isClientSide) { | ||
boolean powered = level.hasNeighborSignal(pos); | ||
boolean shouldBeEnabled = !powered; | ||
if (powered != state.getValue(POWERED)) { | ||
if (state.getValue(ENABLED) != shouldBeEnabled) { | ||
state = state.setValue(ENABLED, shouldBeEnabled); | ||
} | ||
|
||
level.setBlock(pos, state.setValue(POWERED, powered), 2); | ||
if (state.getValue(WATERLOGGED)) { | ||
level.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(level)); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.