-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '1.20_Crabs' of https://github.com/hybridlabs/hybrid-aqu…
…atic into 1.20.1
- Loading branch information
Showing
10 changed files
with
84 additions
and
100 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
20 changes: 0 additions & 20 deletions
20
src/generated/resources/data/minecraft/loot_tables/blocks/dead_fire_coral_fan.json
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
src/generated/resources/data/minecraft/loot_tables/blocks/fire_coral_fan.json
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
src/generated/resources/data/minecraft/loot_tables/blocks/torch.json
This file was deleted.
Oops, something went wrong.
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
48 changes: 48 additions & 0 deletions
48
src/main/kotlin/dev/hybridlabs/aquatic/block/WallGlowstickBlock.kt
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,48 @@ | ||
package dev.hybridlabs.aquatic.block | ||
|
||
import net.minecraft.block.* | ||
import net.minecraft.fluid.FluidState | ||
import net.minecraft.fluid.Fluids | ||
import net.minecraft.item.ItemPlacementContext | ||
import net.minecraft.particle.ParticleTypes.GLOW | ||
import net.minecraft.registry.tag.FluidTags | ||
import net.minecraft.state.StateManager | ||
import net.minecraft.state.property.Properties | ||
import net.minecraft.util.math.BlockPos | ||
import net.minecraft.util.math.Direction | ||
import net.minecraft.world.WorldAccess | ||
import net.minecraft.world.WorldView | ||
|
||
class WallGlowstickBlock(settings: Settings) : WallTorchBlock(settings, GLOW), Waterloggable { | ||
init { | ||
defaultState = stateManager.defaultState.with(Properties.WATERLOGGED, false) | ||
} | ||
|
||
override fun getStateForNeighborUpdate( | ||
state: BlockState, | ||
direction: Direction, | ||
neighborState: BlockState, | ||
world: WorldAccess, | ||
pos: BlockPos, | ||
neighborPos: BlockPos | ||
): BlockState { | ||
if (state.get(Properties.WATERLOGGED)) { | ||
world.scheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world)) | ||
} | ||
|
||
return super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos) | ||
} | ||
|
||
override fun getPlacementState(context: ItemPlacementContext): BlockState? { | ||
val fluidState = context.world.getFluidState(context.blockPos) | ||
return super.getPlacementState(context)?.with(Properties.WATERLOGGED, fluidState == Fluids.WATER.getStill(false)) | ||
} | ||
|
||
override fun getFluidState(state: BlockState): FluidState { | ||
return if (state.get(Properties.WATERLOGGED)) Fluids.WATER.getStill(false) else super.getFluidState(state) | ||
} | ||
|
||
override fun appendProperties(builder: StateManager.Builder<Block, BlockState>) { | ||
super.appendProperties(builder.add(Properties.WATERLOGGED)) | ||
} | ||
} |
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
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