Skip to content

Commit 3fb4abd

Browse files
committed
+ visuals
1 parent cd94e57 commit 3fb4abd

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/main/java/org/infernalstudios/infernalexp/block/ModBlocks.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public static void register() {
6969

7070

7171
public static final Block LUMINOUS_FUNGUS = ModRegistry.ofBlock("luminous_fungus",
72-
new LuminousFungusBlock(FabricBlockSettings.copyOf(Blocks.WARPED_FUNGUS).luminance(10).ticksRandomly()))
72+
new LuminousFungusBlock(FabricBlockSettings.copyOf(Blocks.WARPED_FUNGUS)
73+
.luminance(a -> a.get(LuminousFungusBlock.IS_LIT) ? 15 : 0).ticksRandomly()))
7374
.drop().cutout().build();
7475
}

src/main/java/org/infernalstudios/infernalexp/block/custom/LuminousFungusBlock.java

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import net.minecraft.block.Block;
44
import net.minecraft.block.BlockState;
55
import net.minecraft.block.PlantBlock;
6+
import net.minecraft.block.ShapeContext;
67
import net.minecraft.entity.Entity;
78
import net.minecraft.entity.LivingEntity;
89
import net.minecraft.entity.effect.StatusEffectInstance;
@@ -13,11 +14,13 @@
1314
import net.minecraft.util.math.BlockPos;
1415
import net.minecraft.util.math.Direction;
1516
import net.minecraft.util.math.random.Random;
17+
import net.minecraft.util.shape.VoxelShape;
1618
import net.minecraft.world.BlockView;
1719
import net.minecraft.world.World;
1820

1921
public class LuminousFungusBlock extends PlantBlock {
2022
public static final BooleanProperty IS_LIT = BooleanProperty.of("is_lit");
23+
public static final VoxelShape BOX = Block.createCuboidShape(4, 0, 4, 12, 8, 12);
2124

2225
public LuminousFungusBlock(Settings settings) {
2326
super(settings);
@@ -34,6 +37,11 @@ protected boolean canPlantOnTop(BlockState floor, BlockView world, BlockPos pos)
3437
return floor.isSideSolidFullSquare(world, pos, Direction.UP);
3538
}
3639

40+
@Override
41+
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
42+
return BOX;
43+
}
44+
3745
@Override
3846
public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) {
3947
super.onEntityCollision(state, world, pos, entity);

0 commit comments

Comments
 (0)