Skip to content

Commit

Permalink
Same fixes as 1.20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
MysticKoko committed Apr 19, 2024
1 parent 39811c5 commit bd8a367
Show file tree
Hide file tree
Showing 30 changed files with 283 additions and 133 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ loader_version=0.15.9
fabric_kotlin_version=1.10.19+kotlin.1.9.23

# Mod Properties
mod_version=1.3.1
mod_version=1.3.2
maven_group=dev.hybridlabs
archives_base_name=hybrid-aquatic

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
"block.hybrid-aquatic.tiger_shark_plushie": "Tiger Shark Plushie",
"block.hybrid-aquatic.tube_sponge": "Tube Sponge",
"block.hybrid-aquatic.whale_shark_plushie": "Whale Shark Plushie",
"block.minecraft.air": "Wall Glowstick",
"effect.hybrid-aquatic.bleeding": "Bleeding",
"effect.hybrid-aquatic.clarity": "Clarity",
"effect.hybrid-aquatic.thalassophobia": "Thalassophobia",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"entries": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"entries": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"entries": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"entries": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"entries": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"entries": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"entries": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"entries": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"entries": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"entries": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"entries": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"entries": [
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"replace": false,
"values": [
"hybrid-aquatic:lophelia_coral_block",
"hybrid-aquatic:dead_lophelia_coral_block",
"hybrid-aquatic:thorn_coral_block",
"hybrid-aquatic:dead_thorn_coral_block"
]
}
40 changes: 14 additions & 26 deletions src/main/kotlin/dev/hybridlabs/aquatic/block/GlowstickBlock.kt
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
package dev.hybridlabs.aquatic.block

import net.minecraft.block.*
import net.minecraft.block.Block
import net.minecraft.block.BlockState
import net.minecraft.block.TorchBlock
import net.minecraft.block.Waterloggable
import net.minecraft.fluid.FluidState
import net.minecraft.fluid.Fluids
import net.minecraft.item.ItemPlacementContext
import net.minecraft.particle.ParticleTypes.GLOW
import net.minecraft.particle.ParticleTypes.SMOKE
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.util.shape.VoxelShape
import net.minecraft.world.BlockView
import net.minecraft.world.WorldAccess

class GlowstickBlock(settings: Settings) : TorchBlock(GLOW, settings), Waterloggable {
Expand All @@ -32,36 +31,25 @@ class GlowstickBlock(settings: Settings) : TorchBlock(GLOW, settings), Waterlogg
world.scheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world))
}

return if (!canPlaceAt(state, world, pos)) {
Blocks.AIR.defaultState
} else super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos)
return super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos)
}

override fun getPlacementState(ctx: ItemPlacementContext): BlockState? {
val fluidState = ctx.world.getFluidState(ctx.blockPos)
return if (fluidState.isIn(FluidTags.WATER)) defaultState.with(
Properties.WATERLOGGED, ctx.world.getFluidState(ctx.blockPos).isOf(
Fluids.WATER)) else null
}

override fun getOutlineShape(
state: BlockState?,
world: BlockView?,
pos: BlockPos?,
context: ShapeContext?
): VoxelShape {
return SHAPE
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 getRenderType(state: BlockState): BlockRenderType {
return BlockRenderType.MODEL
}

override fun appendProperties(builder: StateManager.Builder<Block, BlockState>) {
builder.add(Properties.WATERLOGGED)
}

companion object {
fun luminance(state: BlockState): Int {
return if (state.get(Properties.WATERLOGGED)) 14 else 0
}
}
}
Loading

0 comments on commit bd8a367

Please sign in to comment.