added thicker and even thicker end rod and advancements

This commit is contained in:
J-onasJones 2024-10-06 17:24:45 +02:00
parent 0fec88bf8a
commit ed3eae942f
17 changed files with 376 additions and 0 deletions

View file

@ -0,0 +1,34 @@
{
"parent": "minecraft:nec/got_thicker_end_rod",
"criteria": {
"got_even_thicker_end_rod": {
"conditions": {
"items": [
{
"items": "nec:even_thicker_end_rod"
}
]
},
"trigger": "minecraft:inventory_changed"
}
},
"display": {
"description": {
"translate": "advancements.nec.even_thicker_end_rod.description"
},
"hidden": true,
"icon": {
"count": 1,
"id": "nec:even_thicker_end_rod"
},
"title": {
"translate": "advancements.nec.even_thicker_end_rod.title"
}
},
"requirements": [
[
"got_even_thicker_end_rod"
]
],
"sends_telemetry_event": true
}

View file

@ -0,0 +1,34 @@
{
"parent": "minecraft:nec/got_thick_end_rod",
"criteria": {
"got_thicker_end_rod": {
"conditions": {
"items": [
{
"items": "nec:thicker_end_rod"
}
]
},
"trigger": "minecraft:inventory_changed"
}
},
"display": {
"description": {
"translate": "advancements.nec.thicker_end_rod.description"
},
"hidden": true,
"icon": {
"count": 1,
"id": "nec:thicker_end_rod"
},
"title": {
"translate": "advancements.nec.thicker_end_rod.title"
}
},
"requirements": [
[
"got_thicker_end_rod"
]
],
"sends_telemetry_event": true
}

View file

@ -1,6 +1,8 @@
package me.jonasjones.nec.block;
import me.jonasjones.nec.block.util.EvenThickerEndRodBlock;
import me.jonasjones.nec.block.util.ThickEndRodBlock;
import me.jonasjones.nec.block.util.ThickerEndRodBlock;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.*;
import net.minecraft.item.BlockItem;
@ -22,6 +24,8 @@ public class ModBlocks {
public static Block POCKET_BLOCK;
public static Block FLETCHING_STAIRS_BLOCK;
public static Block THICK_END_ROD;
public static Block THICKER_END_ROD;
public static Block EVEN_THICKER_END_ROD;
public static BlockItem GUN_BLOCK_ITEM;
public static Block GUN_BLOCK_BLOCK;
public static BlockItem BLAZE_BLOCK_ITEM;
@ -40,6 +44,10 @@ public class ModBlocks {
public static Block FLETCHING_STAIRS_BLOCK_BLOCK;
public static BlockItem THICK_END_ROD_ITEM;
public static Block THICK_END_ROD_BLOCK;
public static BlockItem THICKER_END_ROD_ITEM;
public static Block THICKER_END_ROD_BLOCK;
public static BlockItem EVEN_THICKER_END_ROD_ITEM;
public static Block EVEN_THICKER_END_ROD_BLOCK;
public static void register() {
BLAZE_BLOCK = new Block(FabricBlockSettings.copyOf(Blocks.DIAMOND_BLOCK).strength(5.0F));
@ -77,5 +85,13 @@ public class ModBlocks {
THICK_END_ROD = new ThickEndRodBlock(FabricBlockSettings.copyOf(Blocks.END_ROD).strength(0.0F));
THICK_END_ROD_BLOCK = Registry.register(BLOCK, Identifier.of(MOD_ID, "thick_end_rod"), THICK_END_ROD);
THICK_END_ROD_ITEM = Registry.register(ITEM, Identifier.of(MOD_ID, "thick_end_rod"), new BlockItem(THICK_END_ROD, new Item.Settings()));
THICKER_END_ROD = new ThickerEndRodBlock(FabricBlockSettings.copyOf(Blocks.END_ROD).strength(0.0F));
THICKER_END_ROD_BLOCK = Registry.register(BLOCK, Identifier.of(MOD_ID, "thicker_end_rod"), THICKER_END_ROD);
THICKER_END_ROD_ITEM = Registry.register(ITEM, Identifier.of(MOD_ID, "thicker_end_rod"), new BlockItem(THICKER_END_ROD, new Item.Settings()));
EVEN_THICKER_END_ROD = new EvenThickerEndRodBlock(FabricBlockSettings.copyOf(Blocks.END_ROD).strength(0.0F));
EVEN_THICKER_END_ROD_BLOCK = Registry.register(BLOCK, Identifier.of(MOD_ID, "even_thicker_end_rod"), EVEN_THICKER_END_ROD);
EVEN_THICKER_END_ROD_ITEM = Registry.register(ITEM, Identifier.of(MOD_ID, "even_thicker_end_rod"), new BlockItem(EVEN_THICKER_END_ROD, new Item.Settings()));
}
}

View file

@ -0,0 +1,33 @@
package me.jonasjones.nec.block.util;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.EndRodBlock;
import net.minecraft.block.ShapeContext;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.world.BlockView;
public class EvenThickerEndRodBlock extends EndRodBlock {
public EvenThickerEndRodBlock(Settings settings) {
super(settings);
}
protected static final VoxelShape Y_SHAPE = Block.createCuboidShape(1.0, 0.0, 1.0, 15.0, 16.0, 15.0);
protected static final VoxelShape Z_SHAPE = Block.createCuboidShape(1.0, 1.0, 0.0, 15.0, 15.0, 16.0);
protected static final VoxelShape X_SHAPE = Block.createCuboidShape(0.0, 1.0, 1.0, 16.0, 15.0, 15.0);
@Override
protected VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
switch (((Direction)state.get(FACING)).getAxis()) {
case X:
default:
return X_SHAPE;
case Z:
return Z_SHAPE;
case Y:
return Y_SHAPE;
}
}
}

View file

@ -0,0 +1,33 @@
package me.jonasjones.nec.block.util;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.EndRodBlock;
import net.minecraft.block.ShapeContext;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.world.BlockView;
public class ThickerEndRodBlock extends EndRodBlock {
public ThickerEndRodBlock(Settings settings) {
super(settings);
}
protected static final VoxelShape Y_SHAPE = Block.createCuboidShape(3.0, 0.0, 3.0, 13.0, 16.0, 13.0);
protected static final VoxelShape Z_SHAPE = Block.createCuboidShape(3.0, 3.0, 0.0, 13.0, 13.0, 16.0);
protected static final VoxelShape X_SHAPE = Block.createCuboidShape(0.0, 3.0, 3.0, 16.0, 13.0, 11.0);
@Override
protected VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
switch (((Direction)state.get(FACING)).getAxis()) {
case X:
default:
return X_SHAPE;
case Z:
return Z_SHAPE;
case Y:
return Y_SHAPE;
}
}
}

View file

@ -149,6 +149,34 @@ public class NecDataGen implements DataGeneratorEntrypoint {
.criterion("got_thick_end_rod", InventoryChangedCriterion.Conditions.items(THICK_END_ROD_ITEM))
.build(consumer, "nec" + "/got_thick_end_rod");
AdvancementEntry gotThickerEndRodAdvancement = Advancement.Builder.create().parent(gotThickEndRodAdvancement)
.display(
THICKER_END_ROD_ITEM,
Text.translatable("advancements.nec.thicker_end_rod.title"),
Text.translatable("advancements.nec.thicker_end_rod.description"),
null, // children to parent advancements don't need a background set
AdvancementFrame.TASK,
true,
true,
true
)
.criterion("got_thicker_end_rod", InventoryChangedCriterion.Conditions.items(THICKER_END_ROD_ITEM))
.build(consumer, "nec" + "/got_thicker_end_rod");
AdvancementEntry gotEvenThickerEndRodAdvancement = Advancement.Builder.create().parent(gotThickerEndRodAdvancement)
.display(
EVEN_THICKER_END_ROD_ITEM,
Text.translatable("advancements.nec.even_thicker_end_rod.title"),
Text.translatable("advancements.nec.even_thicker_end_rod.description"),
null, // children to parent advancements don't need a background set
AdvancementFrame.TASK,
true,
true,
true
)
.criterion("got_even_thicker_end_rod", InventoryChangedCriterion.Conditions.items(EVEN_THICKER_END_ROD_ITEM))
.build(consumer, "nec" + "/got_even_thicker_end_rod");
AdvancementEntry gotLapisGoldenAppleAdvancement = Advancement.Builder.create().parent(rootAdvancement)
.display(
LAPIS_GOLDEN_APPLE_ITEM,

View file

@ -47,6 +47,8 @@ public class ModRegistries {
entries.add(new ItemStack(ModBlocks.POCKET_BLOCK));
entries.add(new ItemStack(ModBlocks.FLETCHING_STAIRS_BLOCK));
entries.add(new ItemStack(ModBlocks.THICK_END_ROD));
entries.add(new ItemStack(ModBlocks.THICKER_END_ROD));
entries.add(new ItemStack(ModBlocks.EVEN_THICKER_END_ROD));
entries.add(new ItemStack(ModItems.STEEL_ITEM));
entries.add(new ItemStack(ModItems.NEGATIVE_FLINT_ITEM));

View file

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

View file

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

View file

@ -16,6 +16,10 @@
"advancements.nec.root.title": "Not Enough Cursedness",
"advancements.nec.thick_end_rod.title": "Du bist dicker als sonst!",
"advancements.nec.thick_end_rod.description": "Bekomme einen dicken Endstab",
"advancements.nec.thicker_end_rod.title": "Hast den dickeren Bruder gefunden!",
"advancements.nec.thicker_end_rod.description": "Bekomme einen Dickeren Endstab",
"advancements.nec.even_thicker_end_rod.title": "Der hier ist der dickste!",
"advancements.nec.even_thicker_end_rod.description": "Bekomme einen Noch Dickeren Endstab",
"advancements.nec.lapis_golden_apple.title": "Verdammt, du bist geizig!",
"advancements.nec.lapis_golden_apple.description": "Crafte einen Wenn du nicht genug Gold hast, also benutzt du Lapis stattdessen Goldener Apfel",

View file

@ -16,6 +16,10 @@
"advancements.nec.root.title": "Not Enough Cursedness",
"advancements.nec.thick_end_rod.title": "You're thicker than usual!",
"advancements.nec.thick_end_rod.description": "Obtain a Thick End Rod",
"advancements.nec.thicker_end_rod.title": "Found the thicker Brother!",
"advancements.nec.thicker_end_rod.description": "Obtain a Thicker End Rod",
"advancements.nec.even_thicker_end_rod.title": "This one is the thickest!",
"advancements.nec.even_thicker_end_rod.description": "Obtain an Even Thicker End Rod",
"advancements.nec.lapis_golden_apple.title": "Damn You're cheap!",
"advancements.nec.lapis_golden_apple.description": "Craft a When You Don't Have Enough Gold So You Use Lapis Instead Golden Apple",
@ -31,6 +35,8 @@
"block.nec.java_block": "Java Block",
"block.nec.pocket_block": "Pocket Block",
"block.nec.thick_end_rod": "Thick End Rod",
"block.nec.thicker_end_rod": "Thicker End Rod",
"block.nec.even_thicker_end_rod": "Even Thicker End Rod",
"item.nec.ak_47": "AK-47",
"item.nec.chainmail": "Chainmail",
"item.nec.dirt_sword": "Dirt Sword",

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": [1, 1, 1],
"to": [15, 16, 15],
"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,41 @@
{
"parent": "block/block",
"textures": {
"0": "nec:block/thick_end_rod",
"particle": "nec:block/thick_end_rod"
},
"elements": [
{
"from": [2, 0, 2],
"to": [14, 1, 14],
"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": [3, 1, 3],
"to": [13, 16, 13],
"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/even_thicker_end_rod"
}

View file

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

View file

@ -0,0 +1,19 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "nec:even_thicker_end_rod"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}

View file

@ -0,0 +1,19 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "nec:thicker_end_rod"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}