添加新的战利品表
This commit is contained in:
parent
cede106430
commit
d2698c11fa
19 changed files with 84 additions and 113 deletions
|
@ -18,13 +18,11 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.DirectionProperty;
|
||||
import net.minecraft.world.level.block.state.properties.NoteBlockInstrument;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.Shapes;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class BarbedWireBlock extends Block {
|
||||
|
@ -45,11 +43,6 @@ public class BarbedWireBlock extends Block {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightBlock(BlockState state, BlockGetter worldIn, BlockPos pos) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getVisualShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
|
||||
return Shapes.empty();
|
||||
|
@ -73,14 +66,6 @@ public class BarbedWireBlock extends Block {
|
|||
return state.rotate(mirrorIn.getRotation(state.getValue(FACING)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
List<ItemStack> dropsOriginal = super.getDrops(state, builder);
|
||||
if (!dropsOriginal.isEmpty())
|
||||
return dropsOriginal;
|
||||
return Collections.singletonList(new ItemStack(this, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void entityInside(BlockState blockstate, Level world, BlockPos pos, Entity entity) {
|
||||
super.entityInside(blockstate, world, pos, entity);
|
||||
|
|
|
@ -12,44 +12,19 @@ import net.minecraft.world.MenuProvider;
|
|||
import net.minecraft.world.entity.player.Inventory;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.inventory.AbstractContainerMenu;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.TooltipFlag;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import net.minecraftforge.network.NetworkHooks;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class GunRecycleBlock extends Block {
|
||||
public GunRecycleBlock() {
|
||||
super(BlockBehaviour.Properties.of().sound(SoundType.METAL).strength(1f, 10f));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendHoverText(ItemStack itemstack, BlockGetter world, List<Component> list, TooltipFlag flag) {
|
||||
super.appendHoverText(itemstack, world, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightBlock(BlockState state, BlockGetter worldIn, BlockPos pos) {
|
||||
return 15;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
List<ItemStack> dropsOriginal = super.getDrops(state, builder);
|
||||
if (!dropsOriginal.isEmpty())
|
||||
return dropsOriginal;
|
||||
return Collections.singletonList(new ItemStack(this, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public InteractionResult use(BlockState blockstate, Level world, BlockPos pos, Player entity, InteractionHand hand, BlockHitResult hit) {
|
||||
super.use(blockstate, world, pos, entity, hand, hit);
|
||||
|
|
|
@ -5,11 +5,8 @@ import net.mcreator.target.init.TargetModSounds;
|
|||
import net.mcreator.target.network.TargetModVariables;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.TooltipFlag;
|
||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
@ -19,38 +16,25 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.DirectionProperty;
|
||||
import net.minecraft.world.level.block.state.properties.NoteBlockInstrument;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.Shapes;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class JumppadBlockBlock extends Block {
|
||||
public class JumpPadBlock extends Block {
|
||||
public static final DirectionProperty FACING = HorizontalDirectionalBlock.FACING;
|
||||
|
||||
public JumppadBlockBlock() {
|
||||
public JumpPadBlock() {
|
||||
super(BlockBehaviour.Properties.of().instrument(NoteBlockInstrument.BASEDRUM).sound(SoundType.STONE).strength(-1, 3600000).noCollission().noOcclusion().isRedstoneConductor((bs, br, bp) -> false));
|
||||
this.registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendHoverText(ItemStack itemstack, BlockGetter world, List<Component> list, TooltipFlag flag) {
|
||||
super.appendHoverText(itemstack, world, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean propagatesSkylightDown(BlockState state, BlockGetter reader, BlockPos pos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightBlock(BlockState state, BlockGetter worldIn, BlockPos pos) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getVisualShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
|
||||
return Shapes.empty();
|
||||
|
@ -88,14 +72,6 @@ public class JumppadBlockBlock extends Block {
|
|||
return state.rotate(mirrorIn.getRotation(state.getValue(FACING)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
List<ItemStack> dropsOriginal = super.getDrops(state, builder);
|
||||
if (!dropsOriginal.isEmpty())
|
||||
return dropsOriginal;
|
||||
return Collections.singletonList(new ItemStack(this, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void entityInside(BlockState blockstate, Level level, BlockPos pos, Entity entity) {
|
||||
super.entityInside(blockstate, level, pos, entity);
|
|
@ -1,40 +1,12 @@
|
|||
package net.mcreator.target.block;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.TooltipFlag;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.properties.NoteBlockInstrument;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class SandbagBlock extends Block {
|
||||
public SandbagBlock() {
|
||||
super(BlockBehaviour.Properties.of().instrument(NoteBlockInstrument.SNARE).sound(SoundType.SAND).strength(10f, 20f));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendHoverText(ItemStack itemstack, BlockGetter world, List<Component> list, TooltipFlag flag) {
|
||||
super.appendHoverText(itemstack, world, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightBlock(BlockState state, BlockGetter worldIn, BlockPos pos) {
|
||||
return 15;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
List<ItemStack> dropsOriginal = super.getDrops(state, builder);
|
||||
if (!dropsOriginal.isEmpty())
|
||||
return dropsOriginal;
|
||||
return Collections.singletonList(new ItemStack(this, 1));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ public class TargetModBlocks {
|
|||
|
||||
public static final RegistryObject<Block> SANDBAG = REGISTRY.register("sandbag", SandbagBlock::new);
|
||||
public static final RegistryObject<Block> BARBED_WIRE = REGISTRY.register("barbed_wire", BarbedWireBlock::new);
|
||||
public static final RegistryObject<Block> JUMPPAD_BLOCK = REGISTRY.register("jumppad_block", JumppadBlockBlock::new);
|
||||
public static final RegistryObject<Block> JUMP_PAD = REGISTRY.register("jump_pad", JumpPadBlock::new);
|
||||
public static final RegistryObject<Block> GALENA_ORE = REGISTRY.register("galena_ore", GalenaOreBlock::new);
|
||||
public static final RegistryObject<Block> DEEPSLATE_GALENA_ORE = REGISTRY.register("deepslate_galena_ore", DeepslateGalenaOreBlock::new);
|
||||
public static final RegistryObject<Block> SCHEELITE_ORE = REGISTRY.register("scheelite_ore", ScheeliteOreBlock::new);
|
||||
|
|
|
@ -80,7 +80,7 @@ public class TargetModItems {
|
|||
public static final RegistryObject<Item> SANDBAG = block(TargetModBlocks.SANDBAG);
|
||||
public static final RegistryObject<Item> BARBED_WIRE = block(TargetModBlocks.BARBED_WIRE);
|
||||
public static final RegistryObject<Item> CLAYMORE_MINE = ITEMS.register("claymore_mine", ClaymoreMine::new);
|
||||
public static final RegistryObject<Item> JUMPPAD_BLOCK = block(TargetModBlocks.JUMPPAD_BLOCK);
|
||||
public static final RegistryObject<Item> JUMP_PAD = block(TargetModBlocks.JUMP_PAD);
|
||||
public static final RegistryObject<Item> LIGHT_SABER = ITEMS.register("light_saber", LightSaber::new);
|
||||
public static final RegistryObject<Item> HAMMER = ITEMS.register("hammer", Hammer::new);
|
||||
public static final RegistryObject<Item> MORTAR_DEPLOYER = ITEMS.register("mortar_deployer", MortarDeployer::new);
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
{
|
||||
"variants": {
|
||||
"facing=north": {
|
||||
"model": "target:block/jumppad_block"
|
||||
"model": "target:block/jump_pad"
|
||||
},
|
||||
"facing=east": {
|
||||
"model": "target:block/jumppad_block",
|
||||
"model": "target:block/jump_pad",
|
||||
"y": 90
|
||||
},
|
||||
"facing=south": {
|
||||
"model": "target:block/jumppad_block",
|
||||
"model": "target:block/jump_pad",
|
||||
"y": 180
|
||||
},
|
||||
"facing=west": {
|
||||
"model": "target:block/jumppad_block",
|
||||
"model": "target:block/jump_pad",
|
||||
"y": 270
|
||||
}
|
||||
}
|
|
@ -123,7 +123,7 @@
|
|||
"attribute.target.spread": "Spread",
|
||||
|
||||
"block.target.gun_recycle": "Gun Recycle Table",
|
||||
"block.target.jumppad_block": "Jumppad",
|
||||
"block.target.jump_pad": "Jump Pad",
|
||||
"block.target.sandbag": "Sandbag",
|
||||
"block.target.barbed_wire": "Barbed Wire",
|
||||
"block.target.galena_ore": "Galena Ore",
|
||||
|
|
|
@ -123,7 +123,7 @@
|
|||
"attribute.target.spread": "散布",
|
||||
|
||||
"block.target.gun_recycle": "枪械拆解台",
|
||||
"block.target.jumppad_block": "弹射台",
|
||||
"block.target.jump_pad": "弹射台",
|
||||
"block.target.sandbag": "沙袋",
|
||||
"block.target.barbed_wire": "铁丝网",
|
||||
"block.target.galena_ore": "方铅矿石",
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"parent": "target:custom/jump_pad",
|
||||
"textures": {
|
||||
"all": "target:block/jump_pad",
|
||||
"particle": "target:block/jump_pad",
|
||||
"0": "target:block/jump_pad"
|
||||
},
|
||||
"render_type": "solid"
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"parent": "target:custom/pad",
|
||||
"textures": {
|
||||
"all": "target:block/pad",
|
||||
"particle": "target:block/pad",
|
||||
"0": "target:block/pad"
|
||||
},
|
||||
"render_type": "solid"
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"parent": "target:block/jumppad_block",
|
||||
"parent": "target:block/jump_pad",
|
||||
"display": {
|
||||
"thirdperson": {
|
||||
"rotation": [
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"bonus_rolls": 0.0,
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
],
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "target:barbed_wire"
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
}
|
||||
],
|
||||
"random_sequence": "target:blocks/barbed_wire"
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"bonus_rolls": 0.0,
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
],
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "target:jump_pad"
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
}
|
||||
],
|
||||
"random_sequence": "target:blocks/jump_pad"
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"bonus_rolls": 0.0,
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
],
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "target:sandbag"
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
}
|
||||
],
|
||||
"random_sequence": "target:blocks/sandbag"
|
||||
}
|
|
@ -18,7 +18,7 @@
|
|||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "target:jumppad_block",
|
||||
"item": "target:jump_pad",
|
||||
"count": 1
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue