添加充电站模型
This commit is contained in:
parent
a9cdb73423
commit
82d138679d
11 changed files with 93 additions and 8 deletions
|
@ -1,7 +1,7 @@
|
|||
// 1.20.1 2024-12-06T21:51:55.0829733 Loot Tables
|
||||
// 1.20.1 2024-12-06T23:36:40.4889693 Loot Tables
|
||||
98386b2e65b2afb7cf5b0cabf6a7b0f062c1e640 data/superbwarfare/loot_tables/blocks/barbed_wire.json
|
||||
811e69929a14e6736015849c220100bb58d914c9 data/superbwarfare/loot_tables/blocks/cemented_carbide_block.json
|
||||
9e4d3e3c60529571c1902818916ffe72dd2dbc2a data/superbwarfare/loot_tables/blocks/charging_station.json
|
||||
89568ab53a9e33d332b9125c1acccc80db6eb5bc data/superbwarfare/loot_tables/blocks/charging_station.json
|
||||
8ed3f1d518c86fe6ed14f14f3121c2e24e109269 data/superbwarfare/loot_tables/blocks/container.json
|
||||
dabbe17417c944567dc6dfcdcba32b8377c24f69 data/superbwarfare/loot_tables/blocks/deepslate_galena_ore.json
|
||||
a7c1af3e194d35a64544902468bd964f45f2f9ef data/superbwarfare/loot_tables/blocks/deepslate_scheelite_ore.json
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// 1.20.1 2024-12-02T20:47:31.4312883 Item Models: superbwarfare
|
||||
// 1.20.1 2024-12-06T23:44:15.5221819 Item Models: superbwarfare
|
||||
13ca8d5676888ff51f3308d88e4bf67691fa34f8 assets/superbwarfare/models/item/aa_12_blueprint.json
|
||||
13ca8d5676888ff51f3308d88e4bf67691fa34f8 assets/superbwarfare/models/item/ak_12_blueprint.json
|
||||
13ca8d5676888ff51f3308d88e4bf67691fa34f8 assets/superbwarfare/models/item/ak_47_blueprint.json
|
||||
|
@ -13,6 +13,7 @@ b793716e367623d60461fc760de4f012c28fdc53 assets/superbwarfare/models/item/cement
|
|||
b97ce523ca85cddff78abd9fd735295414ee07fd assets/superbwarfare/models/item/cemented_carbide_ingot.json
|
||||
93010fbed0bd569659abeba111426f8c5b11d173 assets/superbwarfare/models/item/cemented_carbide_spring.json
|
||||
7ab968b2348594022646fbd90a8e6ecebb16ea46 assets/superbwarfare/models/item/cemented_carbide_trigger.json
|
||||
010681616771bb8e8327af52ead01a632774426c assets/superbwarfare/models/item/charging_station.json
|
||||
42e097f04239673810c7dc5fcf77d1dbc0ec1938 assets/superbwarfare/models/item/coal_iron_powder.json
|
||||
a52a7f9dc18d5af69903c2249239c15cb6d38c8e assets/superbwarfare/models/item/coal_powder.json
|
||||
5ccef04175adcc9fa0797caca6bf04526f702d5c assets/superbwarfare/models/item/common_material_pack.json
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// 1.20.1 2024-11-28T19:10:17.3403255 Block States: superbwarfare
|
||||
// 1.20.1 2024-12-06T23:36:40.4869712 Block States: superbwarfare
|
||||
f3b778ca36ca78c3d80f1b778078897f59bdb0c5 assets/superbwarfare/blockstates/barbed_wire.json
|
||||
0cfad4f53a8047c402edf978d0c8cf6269f063cb assets/superbwarfare/blockstates/cemented_carbide_block.json
|
||||
13e5bd940f02c3719459d17722b79619e98194e5 assets/superbwarfare/blockstates/charging_station.json
|
||||
921500c7cf6c92da0e656486126068bbf5e30348 assets/superbwarfare/blockstates/container.json
|
||||
62fb0464ca59ac21693639c406e08730427d87b3 assets/superbwarfare/blockstates/deepslate_galena_ore.json
|
||||
b8b7cdea6c8626c74d652d0b300b3afe19c60674 assets/superbwarfare/blockstates/deepslate_scheelite_ore.json
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"variants": {
|
||||
"facing=east": {
|
||||
"model": "superbwarfare:block/charging_station",
|
||||
"y": 90
|
||||
},
|
||||
"facing=north": {
|
||||
"model": "superbwarfare:block/charging_station"
|
||||
},
|
||||
"facing=south": {
|
||||
"model": "superbwarfare:block/charging_station",
|
||||
"y": 180
|
||||
},
|
||||
"facing=west": {
|
||||
"model": "superbwarfare:block/charging_station",
|
||||
"y": 270
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"parent": "superbwarfare:block/charging_station"
|
||||
}
|
|
@ -11,7 +11,7 @@
|
|||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "minecraft:air"
|
||||
"name": "superbwarfare:charging_station"
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
|
|
|
@ -3,20 +3,34 @@ package com.atsuishio.superbwarfare.block;
|
|||
import com.atsuishio.superbwarfare.block.entity.ChargingStationBlockEntity;
|
||||
import com.atsuishio.superbwarfare.init.ModBlockEntities;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.Containers;
|
||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.BaseEntityBlock;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.level.block.*;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityTicker;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
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 org.jetbrains.annotations.Nullable;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class ChargingStationBlock extends BaseEntityBlock {
|
||||
|
||||
public static final DirectionProperty FACING = HorizontalDirectionalBlock.FACING;
|
||||
|
||||
public ChargingStationBlock() {
|
||||
super(BlockBehaviour.Properties.of().sound(SoundType.METAL).strength(3.0f).requiresCorrectToolForDrops());
|
||||
this.registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH));
|
||||
}
|
||||
|
||||
@Override
|
||||
public RenderShape getRenderShape(BlockState pState) {
|
||||
return RenderShape.MODEL;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
@ -34,4 +48,26 @@ public class ChargingStationBlock extends BaseEntityBlock {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemove(BlockState pState, Level pLevel, BlockPos pPos, BlockState pNewState, boolean pMovedByPiston) {
|
||||
if (pLevel instanceof ServerLevel serverLevel) {
|
||||
BlockEntity blockentity = pLevel.getBlockEntity(pPos);
|
||||
if (blockentity instanceof ChargingStationBlockEntity blockEntity) {
|
||||
Containers.dropContents(serverLevel, pPos, blockEntity);
|
||||
}
|
||||
}
|
||||
|
||||
super.onRemove(pState, pLevel, pPos, pNewState, pMovedByPiston);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> pBuilder) {
|
||||
pBuilder.add(FACING);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockPlaceContext pContext) {
|
||||
return this.defaultBlockState().setValue(FACING, pContext.getHorizontalDirection().getOpposite());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ public class ModBlockStateProvider extends BlockStateProvider {
|
|||
horizontalBlock(ModBlocks.JUMP_PAD.get(), new ModelFile.UncheckedModelFile(modLoc("block/jump_pad")));
|
||||
horizontalBlock(ModBlocks.REFORGING_TABLE.get(), new ModelFile.UncheckedModelFile(modLoc("block/reforging_table")));
|
||||
horizontalBlock(ModBlocks.CONTAINER.get(), new ModelFile.UncheckedModelFile(modLoc("block/container")));
|
||||
horizontalBlock(ModBlocks.CHARGING_STATION.get(), new ModelFile.UncheckedModelFile(modLoc("block/charging_station")));
|
||||
|
||||
blockWithItem(ModBlocks.GALENA_ORE);
|
||||
blockWithItem(ModBlocks.DEEPSLATE_GALENA_ORE);
|
||||
|
|
|
@ -89,7 +89,6 @@ public class ModItemModelProvider extends ItemModelProvider {
|
|||
simpleItem(ModItems.LEGENDARY_MATERIAL_PACK);
|
||||
|
||||
// armor
|
||||
|
||||
simpleItem(ModItems.RU_HELMET_6B47);
|
||||
simpleItem(ModItems.RU_CHEST_6B43);
|
||||
simpleItem(ModItems.US_HELMET_PASTG);
|
||||
|
@ -135,6 +134,7 @@ public class ModItemModelProvider extends ItemModelProvider {
|
|||
evenSimplerBlockItem(ModBlocks.BARBED_WIRE);
|
||||
evenSimplerBlockItem(ModBlocks.JUMP_PAD);
|
||||
evenSimplerBlockItem(ModBlocks.REFORGING_TABLE);
|
||||
evenSimplerBlockItem(ModBlocks.CHARGING_STATION);
|
||||
}
|
||||
|
||||
private ItemModelBuilder simpleItem(RegistryObject<Item> item) {
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"credit": "Made with Blockbench",
|
||||
"parent": "minecraft:block/block",
|
||||
"ambientocclusion": false,
|
||||
"texture_size": [32, 32],
|
||||
"textures": {
|
||||
"4": "superbwarfare:block/charging_station",
|
||||
"particle": "superbwarfare:block/charging_station"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [0, 0, 0],
|
||||
"to": [16, 16, 16],
|
||||
"faces": {
|
||||
"north": {"uv": [0, 0, 8, 8], "texture": "#4"},
|
||||
"east": {"uv": [0, 8, 8, 16], "texture": "#4"},
|
||||
"south": {"uv": [0, 8, 8, 16], "texture": "#4"},
|
||||
"west": {"uv": [0, 8, 8, 16], "texture": "#4"},
|
||||
"up": {"uv": [16, 8, 8, 0], "texture": "#4"},
|
||||
"down": {"uv": [16, 0, 8, 8], "texture": "#4"}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 1,009 B |
Loading…
Add table
Reference in a new issue