added End Rod Block

This commit is contained in:
J-onasJones 2024-10-07 02:08:36 +02:00
parent 76fa00ec8c
commit 20e536ecbc
8 changed files with 101 additions and 1 deletions

View file

@ -0,0 +1,19 @@
package me.jonasjones.nec.block;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.ShapeContext;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.world.BlockView;
public class RodBlock extends net.minecraft.block.EndRodBlock {
public RodBlock(Settings settings) {
super(settings);
}
@Override
protected VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
return Block.createCuboidShape(0.0, 0.0, 0.0, 16.0, 16.0, 16.0);
}
}

View file

@ -99,6 +99,10 @@ public class ModBlocks {
);
END_ROD_BLOCK = registerBlock(
"end_rod_block",
new RodBlock(FabricBlockSettings.copyOf(Blocks.BONE_BLOCK).strength(1.0F))
);
}
public static BlockWithItem registerBlock(String name, Block block) {
Identifier id = Identifier.of(MOD_ID, name);

View file

@ -0,0 +1,30 @@
{
"variants": {
"facing=down": {
"model": "nec:block/end_rod_block",
"x": 180
},
"facing=east": {
"model": "nec:block/end_rod_block",
"x": 90,
"y": 90
},
"facing=north": {
"model": "nec:block/end_rod_block",
"x": 90
},
"facing=south": {
"model": "nec:block/end_rod_block",
"x": 90,
"y": 180
},
"facing=up": {
"model": "nec:block/end_rod_block"
},
"facing=west": {
"model": "nec:block/end_rod_block",
"x": 90,
"y": 270
}
}
}

View file

@ -33,6 +33,7 @@
"block.nec.cursed_dirt": "Verfluchte Erde",
"block.nec.deepslate_diamond_ore_ore": "Tiefenschiefer-Diamanterzerz",
"block.nec.diamond_ore_ore": "Diamanterzerz",
"block.nec.end_rod_block": "Endstabblock",
"block.nec.even_thicker_end_rod": "Noch Dickerer Endstab",
"block.nec.fletching_stairs": "Bognertischstufe",
"block.nec.green_birch_log": "Grüner Birkenstamm",

View file

@ -33,6 +33,7 @@
"block.nec.cursed_dirt": "Cursed Dirt",
"block.nec.deepslate_diamond_ore_ore": "Deepslate Diamond Ore Ore",
"block.nec.diamond_ore_ore": "Diamond Ore Ore",
"block.nec.end_rod_block": "End Rod Block",
"block.nec.even_thicker_end_rod": "Even Thicker End Rod",
"block.nec.fletching_stairs": "Fletching Stairs",
"block.nec.green_birch_log": "Green Birch Log",

View file

@ -0,0 +1,41 @@
{
"parent": "block/block",
"textures": {
"0": "nec:block/thick_end_rod",
"particle": "nec:block/thick_end_rod"
},
"elements": [
{
"from": [0, 0, 0],
"to": [16, 1, 16],
"faces": {
"north": {"uv": [2, 6, 6, 7], "texture": "#0"},
"east": {"uv": [2, 6, 6, 7], "texture": "#0"},
"south": {"uv": [2, 6, 6, 7], "texture": "#0"},
"west": {"uv": [2, 6, 6, 7], "texture": "#0"},
"up": {"uv": [2, 2, 6, 6], "texture": "#0"},
"down": {"uv": [6, 8, 2, 7], "texture": "#0", "cullface": "down"}
}
},
{
"from": [0, 1, 0],
"to": [16, 16, 16],
"faces": {
"north": {"uv": [0, 0, 2, 15], "texture": "#0"},
"east": {"uv": [0, 0, 2, 15], "texture": "#0"},
"south": {"uv": [0, 0, 2, 15], "texture": "#0"},
"west": {"uv": [0, 0, 2, 15], "texture": "#0"},
"up": {"uv": [2, 0, 4, 2], "texture": "#0", "cullface": "up"}
}
}
],
"display": {
"thirdperson_righthand": {
"scale": [0.375, 0.375, 0.375]
},
"head": {
"rotation": [-60, 0, 0],
"translation": [0, 5, -9]
}
}
}

View file

@ -0,0 +1,3 @@
{
"parent": "nec:block/end_rod_block"
}

View file

@ -6,7 +6,8 @@
"nec:diamond_ore_ore",
"nec:deepslate_diamond_ore_ore",
"nec:gun_block",
"nec:blaze_block"
"nec:blaze_block",
"nec:end_rod_block"
]
}