Skip to content

Commit

Permalink
Merge pull request #785 from devs-immortal/2.2.0/1.19.2/polish
Browse files Browse the repository at this point in the history
2.2.x Feature: Heliolith, Levita, and Surtrum rework
  • Loading branch information
MBatt1 authored Apr 5, 2024
2 parents 817891a + 8e4470e commit 77234bf
Show file tree
Hide file tree
Showing 100 changed files with 1,572 additions and 145 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.id.paradiselost.entities.block.FloatingBlockEntity;
import net.id.paradiselost.entities.util.FloatingBlockHelperImpls;
import net.id.paradiselost.items.tools.base_tools.GravityWandItem;
import net.id.paradiselost.tag.ParadiseLostBlockTags;
import net.id.incubus_core.blocklikeentities.api.BlockLikeEntity;
import net.id.incubus_core.blocklikeentities.api.BlockLikeSet;
Expand All @@ -10,6 +11,7 @@
import net.minecraft.block.piston.PistonHandler;
import net.minecraft.item.Item;
import net.minecraft.item.ItemUsageContext;
import net.minecraft.tag.BlockTags;
import net.minecraft.util.math.*;
import net.minecraft.world.World;

Expand Down Expand Up @@ -126,10 +128,15 @@ static boolean isToolAdequate(ItemUsageContext context) {
BlockState state = world.getBlockState(pos);
Item heldItem = context.getStack().getItem();
return world.getBlockEntity(pos) == null && state.getHardness(world, pos) != -1.0F
&& (!state.isToolRequired() || heldItem.isSuitableFor(state))
&& (!state.isToolRequired() || heldItem.isSuitableFor(state) || (heldItem instanceof GravityWandItem && validForWand(state)))
&& !state.isIn(ParadiseLostBlockTags.NON_FLOATERS);
}

static boolean validForWand(BlockState bs) {
return !bs.isIn(BlockTags.NEEDS_DIAMOND_TOOL);
}


/**
* A structure builder intended to aid the creation of floating block structures.
*/
Expand Down
13 changes: 12 additions & 1 deletion src/main/java/net/id/paradiselost/blocks/ParadiseLostBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ private static Settings grassBlock() {
// Soil Blocks
public static final Block DIRT = add("dirt", new Block(copy(Blocks.DIRT).strength(0.3f)), tillable(), flattenable());
public static final Block COARSE_DIRT = add("coarse_dirt", new Block(copy(Blocks.DIRT).strength(0.3f)), coarseTillable(), flattenable());
public static final FloatingBlock LEVITA = add("levita", new FloatingBlock(false, copy(Blocks.GRAVEL).strength(0.3f)));
public static final Block PERMAFROST = add("permafrost", new Block(copy(Blocks.DIRT).strength(2f).sounds(BlockSoundGroup.GILDED_BLACKSTONE)), flattenable());
public static final FarmlandBlock FARMLAND = add("farmland", new ParadiseLostFarmlandBlock(copy(Blocks.FARMLAND)));
public static final ParadiseLostDirtPathBlock DIRT_PATH = add("grass_path", new ParadiseLostDirtPathBlock(copy(Blocks.DIRT_PATH)));
Expand Down Expand Up @@ -131,6 +132,15 @@ private static Settings floestoneBrick() {
public static final ParadiseLostStairsBlock FLOESTONE_BRICK_STAIRS = add("floestone_brick_stairs", new ParadiseLostStairsBlock(FLOESTONE_BRICK.getDefaultState(), floestoneBrick()));
public static final WallBlock FLOESTONE_BRICK_WALL = add("floestone_brick_wall", new WallBlock(floestoneBrick()));

// Heliolith
public static final Block HELIOLITH = add("heliolith", new Block(floestone()));
public static final Block SMOOTH_HELIOLITH = add("smooth_heliolith", new Block(floestone()));
public static final SlabBlock HELIOLITH_SLAB = add("heliolith_slab", new SlabBlock(floestone()));
public static final SlabBlock SMOOTH_HELIOLITH_SLAB = add("smooth_heliolith_slab", new SlabBlock(floestone()));
public static final ParadiseLostStairsBlock HELIOLITH_STAIRS = add("heliolith_stairs", new ParadiseLostStairsBlock(FLOESTONE_BRICK.getDefaultState(), floestone()));
public static final ParadiseLostStairsBlock SMOOTH_HELIOLITH_STAIRS = add("smooth_heliolith_stairs", new ParadiseLostStairsBlock(FLOESTONE_BRICK.getDefaultState(), floestone()));
public static final WallBlock HELIOLITH_WALL = add("heliolith_wall", new WallBlock(floestone()));

// Dungeon Blocks
private static Settings carvedStone() {
return of(Material.STONE).hardness(0.5f).resistance(1f).sounds(BlockSoundGroup.STONE);
Expand Down Expand Up @@ -360,9 +370,10 @@ private static Settings flower() {
public static final OreBlock SURTRUM = add("surtrum", new SurtrumOreBlock(of(Material.STONE).sounds(BlockSoundGroup.NETHER_GOLD_ORE).requiresTool().strength(9f, 20f), UniformIntProvider.create(2, 5)));
public static final Block METAMORPHIC_SHELL = add("metamorphic_shell", new Block(of(Material.STONE).sounds(BlockSoundGroup.TUFF).requiresTool().strength(40f, 15f)));
public static final PoofBlock SURTRUM_AIR = add("surtrum_air", new PoofBlock(of(Material.FIRE).sounds(BlockSoundGroup.NETHER_GOLD_ORE)));
public static final FloatingBlock LEVITA_ORE = add("levita_ore", new FloatingBlock(false, of(Material.STONE).requiresTool().strength(4f), UniformIntProvider.create(4, 7)));
public static final Block CHERINE_BLOCK = add("cherine_block", new Block(of(Material.METAL).requiresTool().strength(3f, -1f).sounds(BlockSoundGroup.STONE)));
public static final Block OLVITE_BLOCK = add("olvite_block", new Block(of(Material.METAL).requiresTool().strength(3f, -1f).sounds(BlockSoundGroup.METAL)));
public static final FloatingBlock REFINED_SURTRUM_BLOCK = add("refined_surtrum_block", new FloatingBlock(false, of(Material.METAL).requiresTool().strength(4f, -1f).sounds(BlockSoundGroup.METAL)));
public static final Block REFINED_SURTRUM_BLOCK = add("refined_surtrum_block", new Block(of(Material.METAL).requiresTool().strength(4f, -1f).sounds(BlockSoundGroup.METAL)));
// Misc
public static final FloatingBlock LEVITATOR = add("levitator", new FloatingBlock(true, of(Material.WOOD).strength(3f, 3f).sounds(BlockSoundGroup.WOOD)));
public static final ChainBlock OLVITE_CHAIN = add("olvite_chain", new ChainBlock(copy(CHAIN)), cutoutMippedRenderLayer);
Expand Down
Loading

0 comments on commit 77234bf

Please sign in to comment.