Skip to content

Commit

Permalink
quazarith lester spawn (non raycast)
Browse files Browse the repository at this point in the history
  • Loading branch information
warior456 committed Jan 6, 2024
1 parent a8c9da0 commit 4c79215
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/net/ugi/sculk_depths/block/ModBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ public class ModBlocks {

//ores
public static final Block QUAZARITH_ORE = registerBlock("quazarith_ore",
new Block(FabricBlockSettings.copyOf(ModBlocks.UMBRUSK).strength(5.5f,9.0f).requiresTool()), ModItemGroup.SCULK_DEPTHS);
new LesterSpawningBlock(FabricBlockSettings.copyOf(ModBlocks.UMBRUSK).strength(5.5f,9.0f).requiresTool()), ModItemGroup.SCULK_DEPTHS);
public static final Block CRUX_ORE = registerBlock("crux_ore",
new Block(FabricBlockSettings.copyOf(ModBlocks.ZYGRIN).strength(4.5f,8.0f).requiresTool()), ModItemGroup.SCULK_DEPTHS);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package net.ugi.sculk_depths.block.custom;

import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.WorldAccess;
import net.ugi.sculk_depths.entity.ModEntities;
import net.ugi.sculk_depths.entity.custom.LesterEntity;

public class LesterSpawningBlock extends Block {
public LesterSpawningBlock(Settings settings) {
super(settings);
}

@Override
public void onBroken(WorldAccess world, BlockPos pos, BlockState state) {
if(world.isClient())return;
Entity entity = new LesterEntity(ModEntities.LESTER, (World) world);

entity.setPosition(pos.getX(),pos.getY(),pos.getZ());
world.spawnEntity(entity);
}
}

0 comments on commit 4c79215

Please sign in to comment.