-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
230 changed files
with
2,866 additions
and
1,117 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
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package net.ludocrypt.backrooms.biome; | ||
|
||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
import net.ludocrypt.backrooms.Backrooms; | ||
import net.ludocrypt.backrooms.features.LevelsFeatureInit; | ||
import net.ludocrypt.backrooms.features.decorators.Level2RoomDecorator; | ||
import net.minecraft.block.BlockState; | ||
import net.minecraft.world.biome.Biome; | ||
import net.minecraft.world.gen.GenerationStep; | ||
import net.minecraft.world.gen.decorator.Decorator; | ||
import net.minecraft.world.gen.decorator.DecoratorConfig; | ||
import net.minecraft.world.gen.decorator.NopeDecoratorConfig; | ||
import net.minecraft.world.gen.feature.FeatureConfig; | ||
import net.minecraft.world.gen.surfacebuilder.SurfaceBuilder; | ||
|
||
public class Level2 extends Biome { | ||
protected static final BlockState WALL = Backrooms.WALL.getDefaultState(); | ||
public static final Decorator<NopeDecoratorConfig> LEVEL2PLACER = new Level2RoomDecorator(NopeDecoratorConfig::deserialize); | ||
|
||
public Level2() { | ||
|
||
super(new Biome.Settings().configureSurfaceBuilder(SurfaceBuilder.NOPE, SurfaceBuilder.AIR_CONFIG) | ||
.precipitation(Biome.Precipitation.NONE).category(Biome.Category.NONE).depth(0F).scale(0F) | ||
.temperature(5.0F).downfall(0F).waterColor(69).waterFogColor(69).parent((String) null)); | ||
|
||
this.addFeature(GenerationStep.Feature.LOCAL_MODIFICATIONS, | ||
LevelsFeatureInit.LEVEL2ROOM.configure(FeatureConfig.DEFAULT) | ||
.createDecoratedFeature(LEVEL2PLACER.configure(DecoratorConfig.DEFAULT))); | ||
} | ||
|
||
@Environment(EnvType.CLIENT) | ||
public int getGrassColorAt(double p_225528_1_, double p_225528_3_) { | ||
return 226217111; | ||
} | ||
|
||
@Environment(EnvType.CLIENT) | ||
public int getFoliageColor() { | ||
return 226217111; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/net/ludocrypt/backrooms/blocks/Checkered_Block.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,14 @@ | ||
package net.ludocrypt.backrooms.blocks; | ||
|
||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; | ||
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.block.Material; | ||
import net.minecraft.sound.BlockSoundGroup; | ||
|
||
public class Checkered_Block extends Block { | ||
public Checkered_Block() { | ||
super(FabricBlockSettings.of(Material.STONE).breakByTool(FabricToolTags.PICKAXES).sounds(BlockSoundGroup.STONE) | ||
.hardness(6).resistance(6)); | ||
} | ||
} |
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 net.ludocrypt.backrooms.blocks; | ||
|
||
import java.util.Random; | ||
|
||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; | ||
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags; | ||
import net.ludocrypt.backrooms.Backrooms; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.block.BlockState; | ||
import net.minecraft.block.ConnectingBlock; | ||
import net.minecraft.block.Material; | ||
import net.minecraft.entity.EntityContext; | ||
import net.minecraft.item.ItemPlacementContext; | ||
import net.minecraft.particle.ParticleTypes; | ||
import net.minecraft.sound.BlockSoundGroup; | ||
import net.minecraft.state.StateManager; | ||
import net.minecraft.state.property.BooleanProperty; | ||
import net.minecraft.state.property.Property; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.util.math.Direction; | ||
import net.minecraft.util.shape.VoxelShape; | ||
import net.minecraft.util.shape.VoxelShapes; | ||
import net.minecraft.world.BlockView; | ||
import net.minecraft.world.IWorld; | ||
import net.minecraft.world.World; | ||
|
||
public class Pipe extends Block { | ||
|
||
public static final BooleanProperty UP = BooleanProperty.of("up"); | ||
public static final BooleanProperty DOWN = BooleanProperty.of("down"); | ||
public static final BooleanProperty EAST = BooleanProperty.of("east"); | ||
public static final BooleanProperty WEST = BooleanProperty.of("west"); | ||
public static final BooleanProperty NORTH = BooleanProperty.of("north"); | ||
public static final BooleanProperty SOUTH = BooleanProperty.of("south"); | ||
public static final VoxelShape MIDDLESHAPE = Block.createCuboidShape(4.0D, 4.0D, 4.0D, 12.0D, 12.0D, 12.0D); | ||
public static final VoxelShape UPSHAPE = Block.createCuboidShape(4.0D, 12.0D, 4.0D, 12.0D, 16.0D, 12.0D); | ||
public static final VoxelShape DOWNSHAPE = Block.createCuboidShape(4.0D, 0.0D, 4.0D, 12.0D, 4.0D, 12.0D); | ||
public static final VoxelShape EASTSHAPE = Block.createCuboidShape(12.0D, 4.0D, 4.0D, 16.0D, 12.0D, 12.0D); | ||
public static final VoxelShape WESTSHAPE = Block.createCuboidShape(0.0D, 4.0D, 4.0D, 4.0D, 12.0D, 12.0D); | ||
public static final VoxelShape NORTHSHAPE = Block.createCuboidShape(4.0D, 4.0D, 0.0D, 12.0D, 12.0D, 4.0D); | ||
public static final VoxelShape SOUTHSHAPE = Block.createCuboidShape(4.0D, 4.0D, 12.0D, 12.0D, 12.0D, 16.0D); | ||
|
||
public Pipe() { | ||
super(FabricBlockSettings.of(Material.STONE).breakByTool(FabricToolTags.PICKAXES).sounds(BlockSoundGroup.STONE) | ||
.hardness(6).resistance(6).lightLevel(5)); | ||
setDefaultState(getStateManager().getDefaultState().with(UP, false).with(DOWN, false).with(EAST, false) | ||
.with(WEST, false).with(NORTH, false).with(SOUTH, false)); | ||
} | ||
|
||
@Override | ||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) { | ||
VoxelShape up = UPSHAPE; | ||
VoxelShape down = DOWNSHAPE; | ||
VoxelShape east = EASTSHAPE; | ||
VoxelShape west = WESTSHAPE; | ||
VoxelShape north = NORTHSHAPE; | ||
VoxelShape south = SOUTHSHAPE; | ||
if (!state.get(UP)) { | ||
up = MIDDLESHAPE; | ||
} | ||
if (!state.get(DOWN)) { | ||
down = MIDDLESHAPE; | ||
} | ||
if (!state.get(EAST)) { | ||
east = MIDDLESHAPE; | ||
} | ||
if (!state.get(WEST)) { | ||
west = MIDDLESHAPE; | ||
} | ||
if (!state.get(NORTH)) { | ||
north = MIDDLESHAPE; | ||
} | ||
if (!state.get(SOUTH)) { | ||
south = MIDDLESHAPE; | ||
} | ||
VoxelShape alltogether = VoxelShapes.union(up, down, east, west, north, south); | ||
return alltogether; | ||
} | ||
|
||
@Override | ||
protected void appendProperties(StateManager.Builder<Block, BlockState> stateManager) { | ||
stateManager.add(UP, DOWN, EAST, WEST, NORTH, SOUTH); | ||
} | ||
|
||
@Override | ||
@Environment(EnvType.CLIENT) | ||
public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random) { | ||
super.randomDisplayTick(state, world, pos, random); | ||
if (random.nextInt(2) == 0) { | ||
world.addParticle(ParticleTypes.MYCELIUM, (double) pos.getX() + (double) random.nextFloat(), | ||
(double) pos.getY() + (double) random.nextFloat(), | ||
(double) pos.getZ() + (double) random.nextFloat(), 1.0D, -1.0D, 1.0D); | ||
} | ||
if (random.nextInt(10) == 0) { | ||
world.addParticle(ParticleTypes.DRIPPING_WATER, (double) pos.getX() + (random.nextDouble() / 4) + 0.5, | ||
(double) pos.getY() + 0.18, (double) pos.getZ() + (random.nextDouble() / 4) + 0.5, 0.0D, 0.0D, 0.0D); | ||
} | ||
} | ||
|
||
public BlockState withConnectionProperties(BlockView view, BlockPos pos) { | ||
Block block = view.getBlockState(pos.down()).getBlock(); | ||
Block block2 = view.getBlockState(pos.up()).getBlock(); | ||
Block block3 = view.getBlockState(pos.north()).getBlock(); | ||
Block block4 = view.getBlockState(pos.east()).getBlock(); | ||
Block block5 = view.getBlockState(pos.south()).getBlock(); | ||
Block block6 = view.getBlockState(pos.west()).getBlock(); | ||
return (BlockState) ((BlockState) ((BlockState) ((BlockState) ((BlockState) ((BlockState) this.getDefaultState() | ||
.with(DOWN, block == Backrooms.PIPE)).with(UP, block2 == Backrooms.PIPE)).with(NORTH, | ||
block3 == Backrooms.PIPE)).with(EAST, block4 == Backrooms.PIPE)).with(SOUTH, | ||
block5 == Backrooms.PIPE)).with(WEST, block6 == Backrooms.PIPE); | ||
} | ||
|
||
@Override | ||
public BlockState getPlacementState(ItemPlacementContext ctx) { | ||
return this.withConnectionProperties(ctx.getWorld(), ctx.getBlockPos()); | ||
} | ||
|
||
@Override | ||
public BlockState getStateForNeighborUpdate(BlockState state, Direction facing, BlockState neighborState, | ||
IWorld world, BlockPos pos, BlockPos neighborPos) { | ||
Block block = neighborState.getBlock(); | ||
boolean bl = block == Backrooms.PIPE; | ||
return (BlockState) state.with((Property<Boolean>) ConnectingBlock.FACING_PROPERTIES.get(facing), bl); | ||
} | ||
} |
80 changes: 0 additions & 80 deletions
80
src/main/java/net/ludocrypt/backrooms/blocks/PortalDebug.java
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
27 changes: 27 additions & 0 deletions
27
src/main/java/net/ludocrypt/backrooms/blocks/TornWallpaper.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,27 @@ | ||
package net.ludocrypt.backrooms.blocks; | ||
|
||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; | ||
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.block.BlockState; | ||
import net.minecraft.block.Material; | ||
import net.minecraft.sound.BlockSoundGroup; | ||
import net.minecraft.state.StateManager; | ||
import net.minecraft.state.property.IntProperty; | ||
|
||
public class TornWallpaper extends Block { | ||
|
||
public static final IntProperty TORN_LEVEL = IntProperty.of("torn_level", 1, 4); | ||
|
||
public TornWallpaper() { | ||
super(FabricBlockSettings.of(Material.WOOD).breakByTool(FabricToolTags.AXES).sounds(BlockSoundGroup.WOOD) | ||
.hardness(2).resistance(2)); | ||
setDefaultState(getStateManager().getDefaultState().with(TORN_LEVEL, 1)); | ||
} | ||
|
||
@Override | ||
protected void appendProperties(StateManager.Builder<Block, BlockState> stateManager) { | ||
stateManager.add(TORN_LEVEL); | ||
} | ||
|
||
} |
Oops, something went wrong.