generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 10
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 #31 from warior456/main
0.0.7 for 1.20-1.20.1
- Loading branch information
Showing
66 changed files
with
919 additions
and
166 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
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
102 changes: 58 additions & 44 deletions
102
src/main/java/net/ugi/sculk_depths/block/ModBlocks.java
Large diffs are not rendered by default.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
src/main/java/net/ugi/sculk_depths/block/ModFluidBlock.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
3 changes: 2 additions & 1 deletion
3
...culk_depths/block/CephleraLightBlock.java → ...pths/block/custom/CephleraLightBlock.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
72 changes: 72 additions & 0 deletions
72
src/main/java/net/ugi/sculk_depths/block/custom/KryslumEnrichedSoilBLock.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,72 @@ | ||
package net.ugi.sculk_depths.block.custom; | ||
|
||
import com.mojang.datafixers.types.templates.Tag; | ||
import net.minecraft.block.*; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.item.ItemPlacementContext; | ||
import net.minecraft.server.world.ServerWorld; | ||
import net.minecraft.state.StateManager; | ||
import net.minecraft.state.property.IntProperty; | ||
import net.minecraft.state.property.Properties; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.util.math.Direction; | ||
import net.minecraft.util.math.random.Random; | ||
import net.minecraft.util.shape.VoxelShape; | ||
import net.minecraft.world.*; | ||
|
||
public class KryslumEnrichedSoilBLock extends FarmlandBlock { | ||
|
||
public static final IntProperty MOISTURE = Properties.MOISTURE; | ||
protected static final VoxelShape SHAPE = Block.createCuboidShape(0.0, 0.0, 0.0, 16.0, 15.0, 16.0); | ||
public static final int MAX_MOISTURE = 7; | ||
|
||
public KryslumEnrichedSoilBLock(AbstractBlock.Settings settings) { | ||
super(settings); | ||
this.setDefaultState((BlockState)((BlockState)this.stateManager.getDefaultState()).with(MOISTURE, MAX_MOISTURE)); | ||
} | ||
|
||
|
||
|
||
@Override | ||
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) { | ||
if (direction == Direction.UP && !state.canPlaceAt(world, pos)) { | ||
world.scheduleBlockTick(pos, this, 1); | ||
} | ||
return super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos); | ||
} | ||
|
||
|
||
@Override | ||
public BlockState getPlacementState(ItemPlacementContext ctx) { | ||
if (!this.getDefaultState().canPlaceAt(ctx.getWorld(), ctx.getBlockPos())) { | ||
return Blocks.DIRT.getDefaultState(); | ||
} | ||
return super.getPlacementState(ctx); | ||
} | ||
|
||
|
||
@Override | ||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { | ||
return SHAPE; | ||
} | ||
|
||
@Override | ||
public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random random) { | ||
} | ||
|
||
@Override | ||
public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random) { | ||
} | ||
|
||
@Override | ||
public void onLandedUpon(World world, BlockState state, BlockPos pos, Entity entity, float fallDistance) { | ||
} | ||
|
||
|
||
|
||
@Override | ||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) { | ||
builder.add(MOISTURE); | ||
} | ||
|
||
} |
46 changes: 46 additions & 0 deletions
46
src/main/java/net/ugi/sculk_depths/block/custom/SoulFireBlock.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,46 @@ | ||
package net.ugi.sculk_depths.block.custom; | ||
|
||
|
||
import net.kyrptonaught.customportalapi.portal.PortalPlacer; | ||
import net.minecraft.block.*; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.util.math.Direction; | ||
import net.minecraft.world.World; | ||
import net.minecraft.world.WorldAccess; | ||
import net.minecraft.world.WorldView; | ||
|
||
import static net.ugi.sculk_depths.portal.Portals.SOUL_FIRE; | ||
|
||
|
||
public class SoulFireBlock extends AbstractFireBlock { | ||
|
||
|
||
|
||
public SoulFireBlock(AbstractBlock.Settings settings) { | ||
super(settings, 2); | ||
} | ||
|
||
@Override | ||
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) { | ||
if (this.canPlaceAt(state, world, pos)) { | ||
return this.getDefaultState(); | ||
} | ||
return Blocks.AIR.getDefaultState(); | ||
} | ||
|
||
@Override | ||
public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) { | ||
return isSoulBase(world.getBlockState(pos.down())); | ||
} | ||
|
||
public static boolean isSoulBase(BlockState state) { | ||
//return true || state.isOf(Blocks.REINFORCED_DEEPSLATE) || state.isIn(BlockTags.LOGS) || state.isIn(BlockTags.INFINIBURN_END); | ||
return !state.isOf(Blocks.AIR); | ||
} | ||
|
||
@Override | ||
protected boolean isFlammable(BlockState state) { | ||
return true; | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/net/ugi/sculk_depths/block/custom/nonConnectingBlock.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,17 @@ | ||
package net.ugi.sculk_depths.block.custom; | ||
|
||
import net.minecraft.block.*; | ||
|
||
|
||
public class nonConnectingBlock extends Block { | ||
|
||
|
||
public nonConnectingBlock(Settings settings) { | ||
super(settings); | ||
} | ||
|
||
//@Override | ||
public static boolean cannotConnect(BlockState state) { | ||
return true; | ||
} | ||
} |
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.