Added loot tables

This commit is contained in:
Seaswimmer 2023-11-18 20:55:05 -05:00
parent 1b023932db
commit 91243e48d4
24 changed files with 648 additions and 31 deletions

View file

@ -0,0 +1,7 @@
{
"_fv": 47,
"_type": "procedure",
"definition": {
"procedurexml": "<xml xmlns=\"https://developers.google.com/blockly/xml\"><block type=\"event_trigger\" deletable=\"false\" x=\"120\" y=\"58\"><field name=\"trigger\">no_ext_trigger</field><next><block type=\"controls_if\"><value name=\"IF0\"><block type=\"entity_checkgamemode\"><field name=\"gamemode\">SURVIVAL</field><value name=\"entity\"><block type=\"entity_from_deps\"></block></value></block></value><statement name=\"DO0\"><block type=\"controls_if\"><mutation else=\"1\"></mutation><value name=\"IF0\"><block type=\"is_mod_loaded\"><value name=\"modid\"><block type=\"text\"><field name=\"TEXT\">scalinghealth</field></block></value></block></value><statement name=\"DO0\"><block type=\"spawn_gem\"><field name=\"despawn\">TRUE</field><value name=\"block\"><block type=\"registryname_to_mcitem\"><value name=\"registryname\"><block type=\"text\"><field name=\"TEXT\">scalinghealth:heart_crystal_shard</field></block></value></block></value><value name=\"x\"><block type=\"coord_x\"></block></value><value name=\"y\"><block type=\"coord_y\"></block></value><value name=\"z\"><block type=\"coord_z\"></block></value><value name=\"pickUpDelay\"><block type=\"math_number\"><field name=\"NUM\">10</field></block></value></block></statement><statement name=\"ELSE\"><block type=\"spawn_gem\"><field name=\"despawn\">TRUE</field><value name=\"block\"><block type=\"mcitem_all\"><field name=\"value\">CUSTOM:ModNotFound</field></block></value><value name=\"x\"><block type=\"coord_x\"></block></value><value name=\"y\"><block type=\"coord_y\"></block></value><value name=\"z\"><block type=\"coord_z\"></block></value><value name=\"pickUpDelay\"><block type=\"math_number\"><field name=\"NUM\">10</field></block></value></block></statement></block></statement><next><block type=\"controls_if\"><value name=\"IF0\"><block type=\"entity_checkgamemode\"><field name=\"gamemode\">ADVENTURE</field><value name=\"entity\"><block type=\"entity_from_deps\"></block></value></block></value><statement name=\"DO0\"><block type=\"controls_if\"><mutation else=\"1\"></mutation><value name=\"IF0\"><block type=\"is_mod_loaded\"><value name=\"modid\"><block type=\"text\"><field name=\"TEXT\">scalinghealth</field></block></value></block></value><statement name=\"DO0\"><block type=\"spawn_gem\"><field name=\"despawn\">TRUE</field><value name=\"block\"><block type=\"registryname_to_mcitem\"><value name=\"registryname\"><block type=\"text\"><field name=\"TEXT\">scalinghealth:heart_crystal_shard</field></block></value></block></value><value name=\"x\"><block type=\"coord_x\"></block></value><value name=\"y\"><block type=\"coord_y\"></block></value><value name=\"z\"><block type=\"coord_z\"></block></value><value name=\"pickUpDelay\"><block type=\"math_number\"><field name=\"NUM\">10</field></block></value></block></statement><statement name=\"ELSE\"><block type=\"spawn_gem\"><field name=\"despawn\">TRUE</field><value name=\"block\"><block type=\"mcitem_all\"><field name=\"value\">CUSTOM:ModNotFound</field></block></value><value name=\"x\"><block type=\"coord_x\"></block></value><value name=\"y\"><block type=\"coord_y\"></block></value><value name=\"z\"><block type=\"coord_z\"></block></value><value name=\"pickUpDelay\"><block type=\"math_number\"><field name=\"NUM\">10</field></block></value></block></statement></block></statement></block></next></block></next></block></xml>"
}
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,7 @@
{
"_fv": 47,
"_type": "procedure",
"definition": {
"procedurexml": "<xml xmlns=\"https://developers.google.com/blockly/xml\"><block type=\"event_trigger\" deletable=\"false\" x=\"120\" y=\"58\"><field name=\"trigger\">no_ext_trigger</field><next><block type=\"controls_if\"><value name=\"IF0\"><block type=\"entity_checkgamemode\"><field name=\"gamemode\">SURVIVAL</field><value name=\"entity\"><block type=\"entity_from_deps\"></block></value></block></value><statement name=\"DO0\"><block type=\"controls_if\"><mutation else=\"1\"></mutation><value name=\"IF0\"><block type=\"is_mod_loaded\"><value name=\"modid\"><block type=\"text\"><field name=\"TEXT\">scalinghealth</field></block></value></block></value><statement name=\"DO0\"><block type=\"spawn_gem\"><field name=\"despawn\">TRUE</field><value name=\"block\"><block type=\"registryname_to_mcitem\"><value name=\"registryname\"><block type=\"text\"><field name=\"TEXT\">scalinghealth:heart_dust</field></block></value></block></value><value name=\"x\"><block type=\"coord_x\"></block></value><value name=\"y\"><block type=\"coord_y\"></block></value><value name=\"z\"><block type=\"coord_z\"></block></value><value name=\"pickUpDelay\"><block type=\"math_number\"><field name=\"NUM\">10</field></block></value><next><block type=\"spawn_gem\"><field name=\"despawn\">TRUE</field><value name=\"block\"><block type=\"registryname_to_mcitem\"><value name=\"registryname\"><block type=\"text\"><field name=\"TEXT\">scalinghealth:heart_dust</field></block></value></block></value><value name=\"x\"><block type=\"coord_x\"></block></value><value name=\"y\"><block type=\"coord_y\"></block></value><value name=\"z\"><block type=\"coord_z\"></block></value><value name=\"pickUpDelay\"><block type=\"math_number\"><field name=\"NUM\">10</field></block></value></block></next></block></statement><statement name=\"ELSE\"><block type=\"spawn_gem\"><field name=\"despawn\">TRUE</field><value name=\"block\"><block type=\"mcitem_all\"><field name=\"value\">CUSTOM:ModNotFound</field></block></value><value name=\"x\"><block type=\"coord_x\"></block></value><value name=\"y\"><block type=\"coord_y\"></block></value><value name=\"z\"><block type=\"coord_z\"></block></value><value name=\"pickUpDelay\"><block type=\"math_number\"><field name=\"NUM\">10</field></block></value></block></statement></block></statement><next><block type=\"controls_if\"><value name=\"IF0\"><block type=\"entity_checkgamemode\"><field name=\"gamemode\">ADVENTURE</field><value name=\"entity\"><block type=\"entity_from_deps\"></block></value></block></value><statement name=\"DO0\"><block type=\"controls_if\"><mutation else=\"1\"></mutation><value name=\"IF0\"><block type=\"is_mod_loaded\"><value name=\"modid\"><block type=\"text\"><field name=\"TEXT\">scalinghealth</field></block></value></block></value><statement name=\"DO0\"><block type=\"spawn_gem\"><field name=\"despawn\">TRUE</field><value name=\"block\"><block type=\"registryname_to_mcitem\"><value name=\"registryname\"><block type=\"text\"><field name=\"TEXT\">scalinghealth:heart_dust</field></block></value></block></value><value name=\"x\"><block type=\"coord_x\"></block></value><value name=\"y\"><block type=\"coord_y\"></block></value><value name=\"z\"><block type=\"coord_z\"></block></value><value name=\"pickUpDelay\"><block type=\"math_number\"><field name=\"NUM\">10</field></block></value><next><block type=\"spawn_gem\"><field name=\"despawn\">TRUE</field><value name=\"block\"><block type=\"registryname_to_mcitem\"><value name=\"registryname\"><block type=\"text\"><field name=\"TEXT\">scalinghealth:heart_dust</field></block></value></block></value><value name=\"x\"><block type=\"coord_x\"></block></value><value name=\"y\"><block type=\"coord_y\"></block></value><value name=\"z\"><block type=\"coord_z\"></block></value><value name=\"pickUpDelay\"><block type=\"math_number\"><field name=\"NUM\">10</field></block></value></block></next></block></statement><statement name=\"ELSE\"><block type=\"spawn_gem\"><field name=\"despawn\">TRUE</field><value name=\"block\"><block type=\"mcitem_all\"><field name=\"value\">CUSTOM:ModNotFound</field></block></value><value name=\"x\"><block type=\"coord_x\"></block></value><value name=\"y\"><block type=\"coord_y\"></block></value><value name=\"z\"><block type=\"coord_z\"></block></value><value name=\"pickUpDelay\"><block type=\"math_number\"><field name=\"NUM\">10</field></block></value></block></statement></block></statement></block></next></block></next></block></xml>"
}
}

View file

@ -0,0 +1,7 @@
{
"_fv": 47,
"_type": "procedure",
"definition": {
"procedurexml": "<xml xmlns=\"https://developers.google.com/blockly/xml\"><block type=\"event_trigger\" deletable=\"false\" x=\"120\" y=\"58\"><field name=\"trigger\">no_ext_trigger</field><next><block type=\"controls_if\"><value name=\"IF0\"><block type=\"entity_checkgamemode\"><field name=\"gamemode\">SURVIVAL</field><value name=\"entity\"><block type=\"entity_from_deps\"></block></value></block></value><statement name=\"DO0\"><block type=\"controls_if\"><mutation else=\"1\"></mutation><value name=\"IF0\"><block type=\"is_mod_loaded\"><value name=\"modid\"><block type=\"text\"><field name=\"TEXT\">scalinghealth</field></block></value></block></value><statement name=\"DO0\"><block type=\"spawn_gem\"><field name=\"despawn\">TRUE</field><value name=\"block\"><block type=\"registryname_to_mcitem\"><value name=\"registryname\"><block type=\"text\"><field name=\"TEXT\">scalinghealth:heart_dust</field></block></value></block></value><value name=\"x\"><block type=\"coord_x\"></block></value><value name=\"y\"><block type=\"coord_y\"></block></value><value name=\"z\"><block type=\"coord_z\"></block></value><value name=\"pickUpDelay\"><block type=\"math_number\"><field name=\"NUM\">10</field></block></value></block></statement><statement name=\"ELSE\"><block type=\"spawn_gem\"><field name=\"despawn\">TRUE</field><value name=\"block\"><block type=\"mcitem_all\"><field name=\"value\">CUSTOM:ModNotFound</field></block></value><value name=\"x\"><block type=\"coord_x\"></block></value><value name=\"y\"><block type=\"coord_y\"></block></value><value name=\"z\"><block type=\"coord_z\"></block></value><value name=\"pickUpDelay\"><block type=\"math_number\"><field name=\"NUM\">10</field></block></value></block></statement></block></statement><next><block type=\"controls_if\"><value name=\"IF0\"><block type=\"entity_checkgamemode\"><field name=\"gamemode\">ADVENTURE</field><value name=\"entity\"><block type=\"entity_from_deps\"></block></value></block></value><statement name=\"DO0\"><block type=\"controls_if\"><mutation else=\"1\"></mutation><value name=\"IF0\"><block type=\"is_mod_loaded\"><value name=\"modid\"><block type=\"text\"><field name=\"TEXT\">scalinghealth</field></block></value></block></value><statement name=\"DO0\"><block type=\"spawn_gem\"><field name=\"despawn\">TRUE</field><value name=\"block\"><block type=\"registryname_to_mcitem\"><value name=\"registryname\"><block type=\"text\"><field name=\"TEXT\">scalinghealth:heart_dust</field></block></value></block></value><value name=\"x\"><block type=\"coord_x\"></block></value><value name=\"y\"><block type=\"coord_y\"></block></value><value name=\"z\"><block type=\"coord_z\"></block></value><value name=\"pickUpDelay\"><block type=\"math_number\"><field name=\"NUM\">10</field></block></value></block></statement><statement name=\"ELSE\"><block type=\"spawn_gem\"><field name=\"despawn\">TRUE</field><value name=\"block\"><block type=\"mcitem_all\"><field name=\"value\">CUSTOM:ModNotFound</field></block></value><value name=\"x\"><block type=\"coord_x\"></block></value><value name=\"y\"><block type=\"coord_y\"></block></value><value name=\"z\"><block type=\"coord_z\"></block></value><value name=\"pickUpDelay\"><block type=\"math_number\"><field name=\"NUM\">10</field></block></value></block></statement></block></statement></block></next></block></next></block></xml>"
}
}

View file

@ -40,13 +40,13 @@
"hasGravity": false, "hasGravity": false,
"isWaterloggable": true, "isWaterloggable": true,
"creativeTab": { "creativeTab": {
"value": "No creative tab entry" "value": "CUSTOM:HeartGeodes"
}, },
"destroyTool": "pickaxe", "destroyTool": "pickaxe",
"customDrop": { "customDrop": {
"value": "" "value": ""
}, },
"dropAmount": 4, "dropAmount": 0,
"useLootTableForDrops": false, "useLootTableForDrops": false,
"requiresCorrectTool": true, "requiresCorrectTool": true,
"enchantPowerBonus": 0.0, "enchantPowerBonus": 0.0,
@ -54,7 +54,7 @@
"canRedstoneConnect": false, "canRedstoneConnect": false,
"lightOpacity": 0, "lightOpacity": 0,
"material": { "material": {
"value": "GLASS" "value": "AMETHYST"
}, },
"tickRate": 20, "tickRate": 20,
"tickRandomly": false, "tickRandomly": false,
@ -117,6 +117,9 @@
"isFluidTank": false, "isFluidTank": false,
"fluidCapacity": 8000, "fluidCapacity": 8000,
"fluidRestrictions": [], "fluidRestrictions": [],
"onDestroyedByPlayer": {
"name": "DropCluster"
},
"spawnWorldTypes": [], "spawnWorldTypes": [],
"restrictionBiomes": [], "restrictionBiomes": [],
"blocksToReplace": [], "blocksToReplace": [],

View file

@ -40,7 +40,7 @@
"hasGravity": false, "hasGravity": false,
"isWaterloggable": true, "isWaterloggable": true,
"creativeTab": { "creativeTab": {
"value": "No creative tab entry" "value": "CUSTOM:HeartGeodes"
}, },
"destroyTool": "pickaxe", "destroyTool": "pickaxe",
"customDrop": { "customDrop": {
@ -54,7 +54,7 @@
"canRedstoneConnect": false, "canRedstoneConnect": false,
"lightOpacity": 0, "lightOpacity": 0,
"material": { "material": {
"value": "GLASS" "value": "AMETHYST"
}, },
"tickRate": 20, "tickRate": 20,
"tickRandomly": false, "tickRandomly": false,
@ -117,6 +117,9 @@
"isFluidTank": false, "isFluidTank": false,
"fluidCapacity": 8000, "fluidCapacity": 8000,
"fluidRestrictions": [], "fluidRestrictions": [],
"onDestroyedByPlayer": {
"name": "DropLargeBud"
},
"spawnWorldTypes": [], "spawnWorldTypes": [],
"restrictionBiomes": [], "restrictionBiomes": [],
"blocksToReplace": [], "blocksToReplace": [],

View file

@ -40,7 +40,7 @@
"hasGravity": false, "hasGravity": false,
"isWaterloggable": true, "isWaterloggable": true,
"creativeTab": { "creativeTab": {
"value": "No creative tab entry" "value": "CUSTOM:HeartGeodes"
}, },
"destroyTool": "pickaxe", "destroyTool": "pickaxe",
"customDrop": { "customDrop": {
@ -54,7 +54,7 @@
"canRedstoneConnect": false, "canRedstoneConnect": false,
"lightOpacity": 0, "lightOpacity": 0,
"material": { "material": {
"value": "GLASS" "value": "AMETHYST"
}, },
"tickRate": 20, "tickRate": 20,
"tickRandomly": false, "tickRandomly": false,
@ -117,6 +117,9 @@
"isFluidTank": false, "isFluidTank": false,
"fluidCapacity": 8000, "fluidCapacity": 8000,
"fluidRestrictions": [], "fluidRestrictions": [],
"onDestroyedByPlayer": {
"name": "DropMediumBud"
},
"spawnWorldTypes": [], "spawnWorldTypes": [],
"restrictionBiomes": [], "restrictionBiomes": [],
"blocksToReplace": [], "blocksToReplace": [],

View file

@ -0,0 +1,46 @@
{
"_fv": 47,
"_type": "item",
"definition": {
"renderType": 0,
"texture": "modnotfound",
"customModelName": "Normal",
"customProperties": {},
"states": [],
"name": "Mod Not Found",
"rarity": "COMMON",
"creativeTab": {
"value": "CUSTOM:HeartGeodes"
},
"stackSize": 64,
"enchantability": 0,
"useDuration": 0,
"toolType": 1.0,
"damageCount": 0,
"recipeRemainder": {
"value": ""
},
"destroyAnyBlock": false,
"immuneToFire": false,
"stayInGridWhenCrafting": false,
"damageOnCrafting": false,
"enableMeleeDamage": false,
"damageVsEntity": 0.0,
"specialInfo": [
"Please install the Scaling Health mod to get drops from Heart Geodes!"
],
"hasGlow": false,
"guiBoundTo": "<NONE>",
"inventorySize": 9,
"inventoryStackSize": 64,
"isFood": false,
"nutritionalValue": 4,
"saturation": 0.3,
"eatResultItem": {
"value": ""
},
"isMeat": false,
"isAlwaysEdible": false,
"animation": "none"
}
}

View file

@ -40,7 +40,7 @@
"hasGravity": false, "hasGravity": false,
"isWaterloggable": true, "isWaterloggable": true,
"creativeTab": { "creativeTab": {
"value": "No creative tab entry" "value": "CUSTOM:HeartGeodes"
}, },
"destroyTool": "pickaxe", "destroyTool": "pickaxe",
"customDrop": { "customDrop": {
@ -54,7 +54,7 @@
"canRedstoneConnect": false, "canRedstoneConnect": false,
"lightOpacity": 0, "lightOpacity": 0,
"material": { "material": {
"value": "GLASS" "value": "AMETHYST"
}, },
"tickRate": 20, "tickRate": 20,
"tickRandomly": false, "tickRandomly": false,
@ -117,6 +117,9 @@
"isFluidTank": false, "isFluidTank": false,
"fluidCapacity": 8000, "fluidCapacity": 8000,
"fluidRestrictions": [], "fluidRestrictions": [],
"onDestroyedByPlayer": {
"name": "DropSmallBud"
},
"spawnWorldTypes": [], "spawnWorldTypes": [],
"restrictionBiomes": [], "restrictionBiomes": [],
"blocksToReplace": [], "blocksToReplace": [],

View file

@ -127,6 +127,160 @@
"src/main/resources/assets/heartgeodes/models/item/inert_budding_amethyst.json" "src/main/resources/assets/heartgeodes/models/item/inert_budding_amethyst.json"
] ]
} }
},
{
"name": "ModNotFound",
"type": "item",
"sortid": 13,
"compiles": true,
"locked_code": false,
"registry_name": "mod_not_found",
"metadata": {
"files": [
"src/main/java/net/seaswimmerthefsh/heartgeodes/item/ModNotFoundItem.java",
"src/main/resources/assets/heartgeodes/models/item/mod_not_found.json"
]
}
},
{
"name": "DropCluster",
"type": "procedure",
"sortid": 14,
"compiles": true,
"locked_code": false,
"registry_name": "drop_cluster",
"metadata": {
"files": [
"src/main/java/net/seaswimmerthefsh/heartgeodes/procedures/DropClusterProcedure.java"
],
"dependencies": [
{
"name": "entity",
"type": "entity"
},
{
"name": "x",
"type": "number"
},
{
"name": "y",
"type": "number"
},
{
"name": "z",
"type": "number"
},
{
"name": "world",
"type": "world"
}
]
}
},
{
"name": "DropLargeBud",
"type": "procedure",
"sortid": 15,
"compiles": true,
"locked_code": false,
"registry_name": "drop_large_bud",
"metadata": {
"files": [
"src/main/java/net/seaswimmerthefsh/heartgeodes/procedures/DropLargeBudProcedure.java"
],
"dependencies": [
{
"name": "entity",
"type": "entity"
},
{
"name": "x",
"type": "number"
},
{
"name": "y",
"type": "number"
},
{
"name": "z",
"type": "number"
},
{
"name": "world",
"type": "world"
}
]
}
},
{
"name": "DropMediumBud",
"type": "procedure",
"sortid": 16,
"compiles": true,
"locked_code": false,
"registry_name": "drop_medium_bud",
"metadata": {
"files": [
"src/main/java/net/seaswimmerthefsh/heartgeodes/procedures/DropMediumBudProcedure.java"
],
"dependencies": [
{
"name": "entity",
"type": "entity"
},
{
"name": "x",
"type": "number"
},
{
"name": "y",
"type": "number"
},
{
"name": "z",
"type": "number"
},
{
"name": "world",
"type": "world"
}
]
}
},
{
"name": "DropSmallBud",
"type": "procedure",
"sortid": 17,
"compiles": true,
"locked_code": false,
"registry_name": "drop_small_bud",
"metadata": {
"files": [
"src/main/java/net/seaswimmerthefsh/heartgeodes/procedures/DropSmallBudProcedure.java"
],
"dependencies": [
{
"name": "entity",
"type": "entity"
},
{
"name": "x",
"type": "number"
},
{
"name": "y",
"type": "number"
},
{
"name": "z",
"type": "number"
},
{
"name": "world",
"type": "world"
}
]
}
} }
], ],
"variable_elements": [], "variable_elements": [],
@ -136,6 +290,7 @@
"block.heartgeodes.budding_heart_block": "Budding Heart Block", "block.heartgeodes.budding_heart_block": "Budding Heart Block",
"block.heartgeodes.inert_budding_amethyst": "Inert Budding Amethyst", "block.heartgeodes.inert_budding_amethyst": "Inert Budding Amethyst",
"block.heartgeodes.small_heart_bud": "Small Heart Bud", "block.heartgeodes.small_heart_bud": "Small Heart Bud",
"item.heartgeodes.mod_not_found": "Mod Not Found",
"block.heartgeodes.heart_cluster": "Heart Cluster", "block.heartgeodes.heart_cluster": "Heart Cluster",
"block.heartgeodes.heart_block": "Heart Block", "block.heartgeodes.heart_block": "Heart Block",
"item_group.heartgeodes.heart_geodes": "Heart Geodes", "item_group.heartgeodes.heart_geodes": "Heart Geodes",

View file

@ -1,16 +1,15 @@
package net.seaswimmerthefsh.heartgeodes.block; package net.seaswimmerthefsh.heartgeodes.block;
import net.seaswimmerthefsh.heartgeodes.procedures.DropClusterProcedure;
import net.seaswimmerthefsh.heartgeodes.block.entity.HeartClusterBlockEntity; import net.seaswimmerthefsh.heartgeodes.block.entity.HeartClusterBlockEntity;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.level.storage.loot.LootParams;
import net.minecraft.world.level.material.MapColor; import net.minecraft.world.level.material.MapColor;
import net.minecraft.world.level.material.Fluids; import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.block.state.properties.NoteBlockInstrument;
import net.minecraft.world.level.block.state.properties.EnumProperty; import net.minecraft.world.level.block.state.properties.EnumProperty;
import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.BlockStateProperties;
@ -28,22 +27,17 @@ import net.minecraft.world.level.Level;
import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.item.PickaxeItem; import net.minecraft.world.item.PickaxeItem;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Player;
import net.minecraft.world.MenuProvider; import net.minecraft.world.MenuProvider;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import java.util.List;
import java.util.Collections;
public class HeartClusterBlock extends Block implements SimpleWaterloggedBlock, EntityBlock { public class HeartClusterBlock extends Block implements SimpleWaterloggedBlock, EntityBlock {
public static final EnumProperty<Direction.Axis> AXIS = BlockStateProperties.AXIS; public static final EnumProperty<Direction.Axis> AXIS = BlockStateProperties.AXIS;
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
public HeartClusterBlock() { public HeartClusterBlock() {
super(BlockBehaviour.Properties.of().instrument(NoteBlockInstrument.HAT).mapColor(MapColor.TERRACOTTA_RED).sound(SoundType.AMETHYST_CLUSTER).strength(1f, 10f).requiresCorrectToolForDrops().noOcclusion() super(BlockBehaviour.Properties.of().mapColor(MapColor.TERRACOTTA_RED).sound(SoundType.AMETHYST_CLUSTER).strength(1f, 10f).requiresCorrectToolForDrops().noOcclusion().isRedstoneConductor((bs, br, bp) -> false).noLootTable());
.isRedstoneConductor((bs, br, bp) -> false));
this.registerDefaultState(this.stateDefinition.any().setValue(AXIS, Direction.Axis.Y).setValue(WATERLOGGED, false)); this.registerDefaultState(this.stateDefinition.any().setValue(AXIS, Direction.Axis.Y).setValue(WATERLOGGED, false));
} }
@ -115,11 +109,10 @@ public class HeartClusterBlock extends Block implements SimpleWaterloggedBlock,
} }
@Override @Override
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) { public boolean onDestroyedByPlayer(BlockState blockstate, Level world, BlockPos pos, Player entity, boolean willHarvest, FluidState fluid) {
List<ItemStack> dropsOriginal = super.getDrops(state, builder); boolean retval = super.onDestroyedByPlayer(blockstate, world, pos, entity, willHarvest, fluid);
if (!dropsOriginal.isEmpty()) DropClusterProcedure.execute(world, pos.getX(), pos.getY(), pos.getZ(), entity);
return dropsOriginal; return retval;
return Collections.singletonList(new ItemStack(this, 4));
} }
@Override @Override

View file

@ -1,6 +1,7 @@
package net.seaswimmerthefsh.heartgeodes.block; package net.seaswimmerthefsh.heartgeodes.block;
import net.seaswimmerthefsh.heartgeodes.procedures.DropLargeBudProcedure;
import net.seaswimmerthefsh.heartgeodes.block.entity.LargeHeartBudBlockEntity; import net.seaswimmerthefsh.heartgeodes.block.entity.LargeHeartBudBlockEntity;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
@ -9,7 +10,6 @@ import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.level.material.MapColor; import net.minecraft.world.level.material.MapColor;
import net.minecraft.world.level.material.Fluids; import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.block.state.properties.NoteBlockInstrument;
import net.minecraft.world.level.block.state.properties.EnumProperty; import net.minecraft.world.level.block.state.properties.EnumProperty;
import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.BlockStateProperties;
@ -37,8 +37,7 @@ public class LargeHeartBudBlock extends Block implements SimpleWaterloggedBlock,
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
public LargeHeartBudBlock() { public LargeHeartBudBlock() {
super(BlockBehaviour.Properties.of().instrument(NoteBlockInstrument.HAT).mapColor(MapColor.TERRACOTTA_RED).sound(SoundType.AMETHYST_CLUSTER).strength(1f, 10f).requiresCorrectToolForDrops().noOcclusion() super(BlockBehaviour.Properties.of().mapColor(MapColor.TERRACOTTA_RED).sound(SoundType.AMETHYST_CLUSTER).strength(1f, 10f).requiresCorrectToolForDrops().noOcclusion().isRedstoneConductor((bs, br, bp) -> false).noLootTable());
.isRedstoneConductor((bs, br, bp) -> false).noLootTable());
this.registerDefaultState(this.stateDefinition.any().setValue(AXIS, Direction.Axis.Y).setValue(WATERLOGGED, false)); this.registerDefaultState(this.stateDefinition.any().setValue(AXIS, Direction.Axis.Y).setValue(WATERLOGGED, false));
} }
@ -109,6 +108,13 @@ public class LargeHeartBudBlock extends Block implements SimpleWaterloggedBlock,
return false; return false;
} }
@Override
public boolean onDestroyedByPlayer(BlockState blockstate, Level world, BlockPos pos, Player entity, boolean willHarvest, FluidState fluid) {
boolean retval = super.onDestroyedByPlayer(blockstate, world, pos, entity, willHarvest, fluid);
DropLargeBudProcedure.execute(world, pos.getX(), pos.getY(), pos.getZ(), entity);
return retval;
}
@Override @Override
public MenuProvider getMenuProvider(BlockState state, Level worldIn, BlockPos pos) { public MenuProvider getMenuProvider(BlockState state, Level worldIn, BlockPos pos) {
BlockEntity tileEntity = worldIn.getBlockEntity(pos); BlockEntity tileEntity = worldIn.getBlockEntity(pos);

View file

@ -1,6 +1,7 @@
package net.seaswimmerthefsh.heartgeodes.block; package net.seaswimmerthefsh.heartgeodes.block;
import net.seaswimmerthefsh.heartgeodes.procedures.DropMediumBudProcedure;
import net.seaswimmerthefsh.heartgeodes.block.entity.MediumHeartBudBlockEntity; import net.seaswimmerthefsh.heartgeodes.block.entity.MediumHeartBudBlockEntity;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
@ -9,7 +10,6 @@ import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.level.material.MapColor; import net.minecraft.world.level.material.MapColor;
import net.minecraft.world.level.material.Fluids; import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.block.state.properties.NoteBlockInstrument;
import net.minecraft.world.level.block.state.properties.EnumProperty; import net.minecraft.world.level.block.state.properties.EnumProperty;
import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.BlockStateProperties;
@ -37,8 +37,7 @@ public class MediumHeartBudBlock extends Block implements SimpleWaterloggedBlock
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
public MediumHeartBudBlock() { public MediumHeartBudBlock() {
super(BlockBehaviour.Properties.of().instrument(NoteBlockInstrument.HAT).mapColor(MapColor.TERRACOTTA_RED).sound(SoundType.AMETHYST_CLUSTER).strength(1f, 10f).requiresCorrectToolForDrops().noOcclusion() super(BlockBehaviour.Properties.of().mapColor(MapColor.TERRACOTTA_RED).sound(SoundType.AMETHYST_CLUSTER).strength(1f, 10f).requiresCorrectToolForDrops().noOcclusion().isRedstoneConductor((bs, br, bp) -> false).noLootTable());
.isRedstoneConductor((bs, br, bp) -> false).noLootTable());
this.registerDefaultState(this.stateDefinition.any().setValue(AXIS, Direction.Axis.Y).setValue(WATERLOGGED, false)); this.registerDefaultState(this.stateDefinition.any().setValue(AXIS, Direction.Axis.Y).setValue(WATERLOGGED, false));
} }
@ -109,6 +108,13 @@ public class MediumHeartBudBlock extends Block implements SimpleWaterloggedBlock
return false; return false;
} }
@Override
public boolean onDestroyedByPlayer(BlockState blockstate, Level world, BlockPos pos, Player entity, boolean willHarvest, FluidState fluid) {
boolean retval = super.onDestroyedByPlayer(blockstate, world, pos, entity, willHarvest, fluid);
DropMediumBudProcedure.execute(world, pos.getX(), pos.getY(), pos.getZ(), entity);
return retval;
}
@Override @Override
public MenuProvider getMenuProvider(BlockState state, Level worldIn, BlockPos pos) { public MenuProvider getMenuProvider(BlockState state, Level worldIn, BlockPos pos) {
BlockEntity tileEntity = worldIn.getBlockEntity(pos); BlockEntity tileEntity = worldIn.getBlockEntity(pos);

View file

@ -1,6 +1,7 @@
package net.seaswimmerthefsh.heartgeodes.block; package net.seaswimmerthefsh.heartgeodes.block;
import net.seaswimmerthefsh.heartgeodes.procedures.DropSmallBudProcedure;
import net.seaswimmerthefsh.heartgeodes.block.entity.SmallHeartBudBlockEntity; import net.seaswimmerthefsh.heartgeodes.block.entity.SmallHeartBudBlockEntity;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
@ -9,7 +10,6 @@ import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.level.material.MapColor; import net.minecraft.world.level.material.MapColor;
import net.minecraft.world.level.material.Fluids; import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.block.state.properties.NoteBlockInstrument;
import net.minecraft.world.level.block.state.properties.EnumProperty; import net.minecraft.world.level.block.state.properties.EnumProperty;
import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.BlockStateProperties;
@ -37,8 +37,7 @@ public class SmallHeartBudBlock extends Block implements SimpleWaterloggedBlock,
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
public SmallHeartBudBlock() { public SmallHeartBudBlock() {
super(BlockBehaviour.Properties.of().instrument(NoteBlockInstrument.HAT).mapColor(MapColor.TERRACOTTA_RED).sound(SoundType.AMETHYST_CLUSTER).strength(1f, 10f).requiresCorrectToolForDrops().noOcclusion() super(BlockBehaviour.Properties.of().mapColor(MapColor.TERRACOTTA_RED).sound(SoundType.AMETHYST_CLUSTER).strength(1f, 10f).requiresCorrectToolForDrops().noOcclusion().isRedstoneConductor((bs, br, bp) -> false).noLootTable());
.isRedstoneConductor((bs, br, bp) -> false).noLootTable());
this.registerDefaultState(this.stateDefinition.any().setValue(AXIS, Direction.Axis.Y).setValue(WATERLOGGED, false)); this.registerDefaultState(this.stateDefinition.any().setValue(AXIS, Direction.Axis.Y).setValue(WATERLOGGED, false));
} }
@ -109,6 +108,13 @@ public class SmallHeartBudBlock extends Block implements SimpleWaterloggedBlock,
return false; return false;
} }
@Override
public boolean onDestroyedByPlayer(BlockState blockstate, Level world, BlockPos pos, Player entity, boolean willHarvest, FluidState fluid) {
boolean retval = super.onDestroyedByPlayer(blockstate, world, pos, entity, willHarvest, fluid);
DropSmallBudProcedure.execute(world, pos.getX(), pos.getY(), pos.getZ(), entity);
return retval;
}
@Override @Override
public MenuProvider getMenuProvider(BlockState state, Level worldIn, BlockPos pos) { public MenuProvider getMenuProvider(BlockState state, Level worldIn, BlockPos pos) {
BlockEntity tileEntity = worldIn.getBlockEntity(pos); BlockEntity tileEntity = worldIn.getBlockEntity(pos);

View file

@ -4,6 +4,7 @@
*/ */
package net.seaswimmerthefsh.heartgeodes.init; package net.seaswimmerthefsh.heartgeodes.init;
import net.seaswimmerthefsh.heartgeodes.item.ModNotFoundItem;
import net.seaswimmerthefsh.heartgeodes.HeartgeodesMod; import net.seaswimmerthefsh.heartgeodes.HeartgeodesMod;
import net.minecraftforge.registries.RegistryObject; import net.minecraftforge.registries.RegistryObject;
@ -23,6 +24,7 @@ public class HeartgeodesModItems {
public static final RegistryObject<Item> MEDIUM_HEART_BUD = block(HeartgeodesModBlocks.MEDIUM_HEART_BUD); public static final RegistryObject<Item> MEDIUM_HEART_BUD = block(HeartgeodesModBlocks.MEDIUM_HEART_BUD);
public static final RegistryObject<Item> SMALL_HEART_BUD = block(HeartgeodesModBlocks.SMALL_HEART_BUD); public static final RegistryObject<Item> SMALL_HEART_BUD = block(HeartgeodesModBlocks.SMALL_HEART_BUD);
public static final RegistryObject<Item> INERT_BUDDING_AMETHYST = block(HeartgeodesModBlocks.INERT_BUDDING_AMETHYST); public static final RegistryObject<Item> INERT_BUDDING_AMETHYST = block(HeartgeodesModBlocks.INERT_BUDDING_AMETHYST);
public static final RegistryObject<Item> MOD_NOT_FOUND = REGISTRY.register("mod_not_found", () -> new ModNotFoundItem());
private static RegistryObject<Item> block(RegistryObject<Block> block) { private static RegistryObject<Item> block(RegistryObject<Block> block) {
return REGISTRY.register(block.getId().getPath(), () -> new BlockItem(block.get(), new Item.Properties())); return REGISTRY.register(block.getId().getPath(), () -> new BlockItem(block.get(), new Item.Properties()));

View file

@ -20,7 +20,12 @@ public class HeartgeodesModTabs {
() -> CreativeModeTab.builder().title(Component.translatable("item_group.heartgeodes.heart_geodes")).icon(() -> new ItemStack(HeartgeodesModBlocks.HEART_CLUSTER.get())).displayItems((parameters, tabData) -> { () -> CreativeModeTab.builder().title(Component.translatable("item_group.heartgeodes.heart_geodes")).icon(() -> new ItemStack(HeartgeodesModBlocks.HEART_CLUSTER.get())).displayItems((parameters, tabData) -> {
tabData.accept(HeartgeodesModBlocks.HEART_BLOCK.get().asItem()); tabData.accept(HeartgeodesModBlocks.HEART_BLOCK.get().asItem());
tabData.accept(HeartgeodesModBlocks.BUDDING_HEART_BLOCK.get().asItem()); tabData.accept(HeartgeodesModBlocks.BUDDING_HEART_BLOCK.get().asItem());
tabData.accept(HeartgeodesModBlocks.HEART_CLUSTER.get().asItem());
tabData.accept(HeartgeodesModBlocks.LARGE_HEART_BUD.get().asItem());
tabData.accept(HeartgeodesModBlocks.MEDIUM_HEART_BUD.get().asItem());
tabData.accept(HeartgeodesModBlocks.SMALL_HEART_BUD.get().asItem());
tabData.accept(HeartgeodesModBlocks.INERT_BUDDING_AMETHYST.get().asItem()); tabData.accept(HeartgeodesModBlocks.INERT_BUDDING_AMETHYST.get().asItem());
tabData.accept(HeartgeodesModItems.MOD_NOT_FOUND.get());
}) })
.build()); .build());

View file

@ -0,0 +1,23 @@
package net.seaswimmerthefsh.heartgeodes.item;
import net.minecraft.world.level.Level;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.item.Rarity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Item;
import net.minecraft.network.chat.Component;
import java.util.List;
public class ModNotFoundItem extends Item {
public ModNotFoundItem() {
super(new Item.Properties().stacksTo(64).rarity(Rarity.COMMON));
}
@Override
public void appendHoverText(ItemStack itemstack, Level world, List<Component> list, TooltipFlag flag) {
super.appendHoverText(itemstack, world, list, flag);
list.add(Component.literal("Please install the Scaling Health mod to get drops from Heart Geodes!"));
}
}

View file

@ -0,0 +1,72 @@
package net.seaswimmerthefsh.heartgeodes.procedures;
import net.seaswimmerthefsh.heartgeodes.init.HeartgeodesModItems;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.fml.ModList;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.GameType;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.Entity;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.client.Minecraft;
public class DropClusterProcedure {
public static void execute(LevelAccessor world, double x, double y, double z, Entity entity) {
if (entity == null)
return;
if (new Object() {
public boolean checkGamemode(Entity _ent) {
if (_ent instanceof ServerPlayer _serverPlayer) {
return _serverPlayer.gameMode.getGameModeForPlayer() == GameType.SURVIVAL;
} else if (_ent.level().isClientSide() && _ent instanceof Player _player) {
return Minecraft.getInstance().getConnection().getPlayerInfo(_player.getGameProfile().getId()) != null && Minecraft.getInstance().getConnection().getPlayerInfo(_player.getGameProfile().getId()).getGameMode() == GameType.SURVIVAL;
}
return false;
}
}.checkGamemode(entity)) {
if (ModList.get().isLoaded("scalinghealth")) {
if (world instanceof ServerLevel _level) {
ItemEntity entityToSpawn = new ItemEntity(_level, x, y, z, new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation("scalinghealth:heart_crystal_shard"))));
entityToSpawn.setPickUpDelay(10);
_level.addFreshEntity(entityToSpawn);
}
} else {
if (world instanceof ServerLevel _level) {
ItemEntity entityToSpawn = new ItemEntity(_level, x, y, z, new ItemStack(HeartgeodesModItems.MOD_NOT_FOUND.get()));
entityToSpawn.setPickUpDelay(10);
_level.addFreshEntity(entityToSpawn);
}
}
}
if (new Object() {
public boolean checkGamemode(Entity _ent) {
if (_ent instanceof ServerPlayer _serverPlayer) {
return _serverPlayer.gameMode.getGameModeForPlayer() == GameType.ADVENTURE;
} else if (_ent.level().isClientSide() && _ent instanceof Player _player) {
return Minecraft.getInstance().getConnection().getPlayerInfo(_player.getGameProfile().getId()) != null && Minecraft.getInstance().getConnection().getPlayerInfo(_player.getGameProfile().getId()).getGameMode() == GameType.ADVENTURE;
}
return false;
}
}.checkGamemode(entity)) {
if (ModList.get().isLoaded("scalinghealth")) {
if (world instanceof ServerLevel _level) {
ItemEntity entityToSpawn = new ItemEntity(_level, x, y, z, new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation("scalinghealth:heart_crystal_shard"))));
entityToSpawn.setPickUpDelay(10);
_level.addFreshEntity(entityToSpawn);
}
} else {
if (world instanceof ServerLevel _level) {
ItemEntity entityToSpawn = new ItemEntity(_level, x, y, z, new ItemStack(HeartgeodesModItems.MOD_NOT_FOUND.get()));
entityToSpawn.setPickUpDelay(10);
_level.addFreshEntity(entityToSpawn);
}
}
}
}
}

View file

@ -0,0 +1,102 @@
package net.seaswimmerthefsh.heartgeodes.procedures;
import net.seaswimmerthefsh.heartgeodes.init.HeartgeodesModItems;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.fml.ModList;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.GameType;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.Entity;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.client.Minecraft;
public class DropLargeBudProcedure {
public static void execute(LevelAccessor world, double x, double y, double z, Entity entity) {
if (entity == null)
return;
if (new Object() {
public boolean checkGamemode(Entity _ent) {
if (_ent instanceof ServerPlayer _serverPlayer) {
return _serverPlayer.gameMode.getGameModeForPlayer() == GameType.SURVIVAL;
} else if (_ent.level().isClientSide() && _ent instanceof Player _player) {
return Minecraft.getInstance().getConnection().getPlayerInfo(_player.getGameProfile().getId()) != null && Minecraft.getInstance().getConnection().getPlayerInfo(_player.getGameProfile().getId()).getGameMode() == GameType.SURVIVAL;
}
return false;
}
}.checkGamemode(entity)) {
if (ModList.get().isLoaded("scalinghealth")) {
if (world instanceof ServerLevel _level) {
ItemEntity entityToSpawn = new ItemEntity(_level, x, y, z, new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation("scalinghealth:heart_dust"))));
entityToSpawn.setPickUpDelay(10);
_level.addFreshEntity(entityToSpawn);
}
if (world instanceof ServerLevel _level) {
ItemEntity entityToSpawn = new ItemEntity(_level, x, y, z, new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation("scalinghealth:heart_dust"))));
entityToSpawn.setPickUpDelay(10);
_level.addFreshEntity(entityToSpawn);
}
if (world instanceof ServerLevel _level) {
ItemEntity entityToSpawn = new ItemEntity(_level, x, y, z, new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation("scalinghealth:heart_dust"))));
entityToSpawn.setPickUpDelay(10);
_level.addFreshEntity(entityToSpawn);
}
if (world instanceof ServerLevel _level) {
ItemEntity entityToSpawn = new ItemEntity(_level, x, y, z, new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation("scalinghealth:heart_dust"))));
entityToSpawn.setPickUpDelay(10);
_level.addFreshEntity(entityToSpawn);
}
} else {
if (world instanceof ServerLevel _level) {
ItemEntity entityToSpawn = new ItemEntity(_level, x, y, z, new ItemStack(HeartgeodesModItems.MOD_NOT_FOUND.get()));
entityToSpawn.setPickUpDelay(10);
_level.addFreshEntity(entityToSpawn);
}
}
}
if (new Object() {
public boolean checkGamemode(Entity _ent) {
if (_ent instanceof ServerPlayer _serverPlayer) {
return _serverPlayer.gameMode.getGameModeForPlayer() == GameType.ADVENTURE;
} else if (_ent.level().isClientSide() && _ent instanceof Player _player) {
return Minecraft.getInstance().getConnection().getPlayerInfo(_player.getGameProfile().getId()) != null && Minecraft.getInstance().getConnection().getPlayerInfo(_player.getGameProfile().getId()).getGameMode() == GameType.ADVENTURE;
}
return false;
}
}.checkGamemode(entity)) {
if (ModList.get().isLoaded("scalinghealth")) {
if (world instanceof ServerLevel _level) {
ItemEntity entityToSpawn = new ItemEntity(_level, x, y, z, new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation("scalinghealth:heart_dust"))));
entityToSpawn.setPickUpDelay(10);
_level.addFreshEntity(entityToSpawn);
}
if (world instanceof ServerLevel _level) {
ItemEntity entityToSpawn = new ItemEntity(_level, x, y, z, new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation("scalinghealth:heart_dust"))));
entityToSpawn.setPickUpDelay(10);
_level.addFreshEntity(entityToSpawn);
}
if (world instanceof ServerLevel _level) {
ItemEntity entityToSpawn = new ItemEntity(_level, x, y, z, new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation("scalinghealth:heart_dust"))));
entityToSpawn.setPickUpDelay(10);
_level.addFreshEntity(entityToSpawn);
}
if (world instanceof ServerLevel _level) {
ItemEntity entityToSpawn = new ItemEntity(_level, x, y, z, new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation("scalinghealth:heart_dust"))));
entityToSpawn.setPickUpDelay(10);
_level.addFreshEntity(entityToSpawn);
}
} else {
if (world instanceof ServerLevel _level) {
ItemEntity entityToSpawn = new ItemEntity(_level, x, y, z, new ItemStack(HeartgeodesModItems.MOD_NOT_FOUND.get()));
entityToSpawn.setPickUpDelay(10);
_level.addFreshEntity(entityToSpawn);
}
}
}
}
}

View file

@ -0,0 +1,82 @@
package net.seaswimmerthefsh.heartgeodes.procedures;
import net.seaswimmerthefsh.heartgeodes.init.HeartgeodesModItems;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.fml.ModList;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.GameType;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.Entity;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.client.Minecraft;
public class DropMediumBudProcedure {
public static void execute(LevelAccessor world, double x, double y, double z, Entity entity) {
if (entity == null)
return;
if (new Object() {
public boolean checkGamemode(Entity _ent) {
if (_ent instanceof ServerPlayer _serverPlayer) {
return _serverPlayer.gameMode.getGameModeForPlayer() == GameType.SURVIVAL;
} else if (_ent.level().isClientSide() && _ent instanceof Player _player) {
return Minecraft.getInstance().getConnection().getPlayerInfo(_player.getGameProfile().getId()) != null && Minecraft.getInstance().getConnection().getPlayerInfo(_player.getGameProfile().getId()).getGameMode() == GameType.SURVIVAL;
}
return false;
}
}.checkGamemode(entity)) {
if (ModList.get().isLoaded("scalinghealth")) {
if (world instanceof ServerLevel _level) {
ItemEntity entityToSpawn = new ItemEntity(_level, x, y, z, new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation("scalinghealth:heart_dust"))));
entityToSpawn.setPickUpDelay(10);
_level.addFreshEntity(entityToSpawn);
}
if (world instanceof ServerLevel _level) {
ItemEntity entityToSpawn = new ItemEntity(_level, x, y, z, new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation("scalinghealth:heart_dust"))));
entityToSpawn.setPickUpDelay(10);
_level.addFreshEntity(entityToSpawn);
}
} else {
if (world instanceof ServerLevel _level) {
ItemEntity entityToSpawn = new ItemEntity(_level, x, y, z, new ItemStack(HeartgeodesModItems.MOD_NOT_FOUND.get()));
entityToSpawn.setPickUpDelay(10);
_level.addFreshEntity(entityToSpawn);
}
}
}
if (new Object() {
public boolean checkGamemode(Entity _ent) {
if (_ent instanceof ServerPlayer _serverPlayer) {
return _serverPlayer.gameMode.getGameModeForPlayer() == GameType.ADVENTURE;
} else if (_ent.level().isClientSide() && _ent instanceof Player _player) {
return Minecraft.getInstance().getConnection().getPlayerInfo(_player.getGameProfile().getId()) != null && Minecraft.getInstance().getConnection().getPlayerInfo(_player.getGameProfile().getId()).getGameMode() == GameType.ADVENTURE;
}
return false;
}
}.checkGamemode(entity)) {
if (ModList.get().isLoaded("scalinghealth")) {
if (world instanceof ServerLevel _level) {
ItemEntity entityToSpawn = new ItemEntity(_level, x, y, z, new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation("scalinghealth:heart_dust"))));
entityToSpawn.setPickUpDelay(10);
_level.addFreshEntity(entityToSpawn);
}
if (world instanceof ServerLevel _level) {
ItemEntity entityToSpawn = new ItemEntity(_level, x, y, z, new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation("scalinghealth:heart_dust"))));
entityToSpawn.setPickUpDelay(10);
_level.addFreshEntity(entityToSpawn);
}
} else {
if (world instanceof ServerLevel _level) {
ItemEntity entityToSpawn = new ItemEntity(_level, x, y, z, new ItemStack(HeartgeodesModItems.MOD_NOT_FOUND.get()));
entityToSpawn.setPickUpDelay(10);
_level.addFreshEntity(entityToSpawn);
}
}
}
}
}

View file

@ -0,0 +1,72 @@
package net.seaswimmerthefsh.heartgeodes.procedures;
import net.seaswimmerthefsh.heartgeodes.init.HeartgeodesModItems;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.fml.ModList;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.GameType;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.Entity;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.client.Minecraft;
public class DropSmallBudProcedure {
public static void execute(LevelAccessor world, double x, double y, double z, Entity entity) {
if (entity == null)
return;
if (new Object() {
public boolean checkGamemode(Entity _ent) {
if (_ent instanceof ServerPlayer _serverPlayer) {
return _serverPlayer.gameMode.getGameModeForPlayer() == GameType.SURVIVAL;
} else if (_ent.level().isClientSide() && _ent instanceof Player _player) {
return Minecraft.getInstance().getConnection().getPlayerInfo(_player.getGameProfile().getId()) != null && Minecraft.getInstance().getConnection().getPlayerInfo(_player.getGameProfile().getId()).getGameMode() == GameType.SURVIVAL;
}
return false;
}
}.checkGamemode(entity)) {
if (ModList.get().isLoaded("scalinghealth")) {
if (world instanceof ServerLevel _level) {
ItemEntity entityToSpawn = new ItemEntity(_level, x, y, z, new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation("scalinghealth:heart_dust"))));
entityToSpawn.setPickUpDelay(10);
_level.addFreshEntity(entityToSpawn);
}
} else {
if (world instanceof ServerLevel _level) {
ItemEntity entityToSpawn = new ItemEntity(_level, x, y, z, new ItemStack(HeartgeodesModItems.MOD_NOT_FOUND.get()));
entityToSpawn.setPickUpDelay(10);
_level.addFreshEntity(entityToSpawn);
}
}
}
if (new Object() {
public boolean checkGamemode(Entity _ent) {
if (_ent instanceof ServerPlayer _serverPlayer) {
return _serverPlayer.gameMode.getGameModeForPlayer() == GameType.ADVENTURE;
} else if (_ent.level().isClientSide() && _ent instanceof Player _player) {
return Minecraft.getInstance().getConnection().getPlayerInfo(_player.getGameProfile().getId()) != null && Minecraft.getInstance().getConnection().getPlayerInfo(_player.getGameProfile().getId()).getGameMode() == GameType.ADVENTURE;
}
return false;
}
}.checkGamemode(entity)) {
if (ModList.get().isLoaded("scalinghealth")) {
if (world instanceof ServerLevel _level) {
ItemEntity entityToSpawn = new ItemEntity(_level, x, y, z, new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation("scalinghealth:heart_dust"))));
entityToSpawn.setPickUpDelay(10);
_level.addFreshEntity(entityToSpawn);
}
} else {
if (world instanceof ServerLevel _level) {
ItemEntity entityToSpawn = new ItemEntity(_level, x, y, z, new ItemStack(HeartgeodesModItems.MOD_NOT_FOUND.get()));
entityToSpawn.setPickUpDelay(10);
_level.addFreshEntity(entityToSpawn);
}
}
}
}
}

View file

@ -2,6 +2,7 @@
"block.heartgeodes.budding_heart_block": "Budding Heart Block", "block.heartgeodes.budding_heart_block": "Budding Heart Block",
"block.heartgeodes.inert_budding_amethyst": "Inert Budding Amethyst", "block.heartgeodes.inert_budding_amethyst": "Inert Budding Amethyst",
"block.heartgeodes.small_heart_bud": "Small Heart Bud", "block.heartgeodes.small_heart_bud": "Small Heart Bud",
"item.heartgeodes.mod_not_found": "Mod Not Found",
"block.heartgeodes.heart_cluster": "Heart Cluster", "block.heartgeodes.heart_cluster": "Heart Cluster",
"block.heartgeodes.heart_block": "Heart Block", "block.heartgeodes.heart_block": "Heart Block",
"item_group.heartgeodes.heart_geodes": "Heart Geodes", "item_group.heartgeodes.heart_geodes": "Heart Geodes",

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "heartgeodes:item/modnotfound"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B