-
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.
Merge pull request #33 from PssbleTrngle/develop
Develop
- Loading branch information
Showing
32 changed files
with
321 additions
and
52 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
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
42 changes: 42 additions & 0 deletions
42
src/main/java/com/possible_triangle/brazier/block/SpawnPowder.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,42 @@ | ||
package com.possible_triangle.brazier.block; | ||
|
||
import net.minecraft.block.Block; | ||
import net.minecraft.block.BlockState; | ||
import net.minecraft.block.Blocks; | ||
import net.minecraft.block.material.Material; | ||
import net.minecraft.util.Direction; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.util.math.shapes.ISelectionContext; | ||
import net.minecraft.util.math.shapes.VoxelShape; | ||
import net.minecraft.world.IBlockReader; | ||
import net.minecraft.world.IWorld; | ||
import net.minecraft.world.IWorldReader; | ||
|
||
public class SpawnPowder extends Block { | ||
|
||
private static final VoxelShape SHAPE = Block.makeCuboidShape(2.0D, 0.0D, 2.0D, 14.0D, 1.0D, 14.0D); | ||
|
||
public SpawnPowder() { | ||
super(Properties.create(Material.MISCELLANEOUS) | ||
.doesNotBlockMovement() | ||
.zeroHardnessAndResistance() | ||
.func_235838_a_($ -> 1) | ||
); | ||
} | ||
|
||
@Override | ||
public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext context) { | ||
return SHAPE; | ||
} | ||
|
||
@Override | ||
public boolean isValidPosition(BlockState state, IWorldReader world, BlockPos pos) { | ||
BlockState below = world.getBlockState(pos.down()); | ||
return below.isSolidSide(world, pos.down(), Direction.UP); | ||
} | ||
|
||
public BlockState updatePostPlacement(BlockState state, Direction facing, BlockState neighbor, IWorld world, BlockPos block, BlockPos facingPos) { | ||
return !state.isValidPosition(world, block) ? Blocks.AIR.getDefaultState() : super.updatePostPlacement(state, facing, neighbor, world, block, facingPos); | ||
} | ||
|
||
} |
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
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
Oops, something went wrong.