Merge pull request #24 from JonasunderscoreJones/thick-end-rod

campfire fuling
This commit is contained in:
Jonas_Jones 2024-10-06 18:00:51 +02:00 committed by GitHub
commit 67741c8cb9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 442 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

@ -0,0 +1,34 @@
{
"parent": "minecraft:nec/root",
"criteria": {
"use_campfire_as_fuel": {
"conditions": {
"items": [
{
"items": "minecraft:campfire"
}
]
},
"trigger": "minecraft:inventory_changed"
}
},
"display": {
"description": {
"translate": "advancements.nec.use_campfire_as_fuel.description"
},
"hidden": true,
"icon": {
"count": 1,
"id": "minecraft:campfire"
},
"title": {
"translate": "advancements.nec.use_campfire_as_fuel.title"
}
},
"requirements": [
[
"use_campfire_as_fuel"
]
],
"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

@ -10,6 +10,8 @@ import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import net.minecraft.advancement.criterion.InventoryChangedCriterion;
import net.minecraft.advancement.criterion.RecipeCraftedCriterion;
import net.minecraft.advancement.criterion.RecipeUnlockedCriterion;
import net.minecraft.advancement.criterion.TickCriterion;
import net.minecraft.item.Items;
import net.minecraft.registry.RegistryWrapper;
@ -149,6 +151,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,
@ -162,6 +192,20 @@ public class NecDataGen implements DataGeneratorEntrypoint {
)
.criterion("got_lapis_golden_apple", InventoryChangedCriterion.Conditions.items(LAPIS_GOLDEN_APPLE_ITEM))
.build(consumer, "nec" + "/got_lapis_golden_apple");
AdvancementEntry useCampfireAsFuelAdvancement = Advancement.Builder.create().parent(rootAdvancement)
.display(
Items.CAMPFIRE,
Text.translatable("advancements.nec.use_campfire_as_fuel.title"),
Text.translatable("advancements.nec.use_campfire_as_fuel.description"),
null, // children to parent advancements don't need a background set
AdvancementFrame.TASK,
true,
true,
true
)
.criterion("use_campfire_as_fuel", InventoryChangedCriterion.Conditions.items(Items.CAMPFIRE))
.build(consumer, "nec" + "/use_campfire_as_fuel");
}
}
}

View file

@ -4,9 +4,11 @@ import me.jonasjones.nec.block.ModBlocks;
import me.jonasjones.nec.item.ModItems;
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup;
import net.fabricmc.fabric.api.registry.FlammableBlockRegistry;
import net.fabricmc.fabric.api.registry.FuelRegistry;
import net.fabricmc.fabric.api.registry.StrippableBlockRegistry;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.text.Text;
@ -21,6 +23,7 @@ public class ModRegistries {
registerStrippables();
registerFlammableBlock();
register_itemGroup();
fuelRegistry();
}
private static void registerStrippables() {
@ -33,6 +36,13 @@ public class ModRegistries {
instance.add(ModBlocks.GREEN_BIRCH_LOG, 5, 5);
}
private static void fuelRegistry() {
FuelRegistry.INSTANCE.add(ModBlocks.GREEN_BIRCH_LOG, 300);
FuelRegistry.INSTANCE.add(ModBlocks.FLETCHING_STAIRS_BLOCK, 300);
FuelRegistry.INSTANCE.add(ModBlocks.BLAZE_BLOCK, 1200);
FuelRegistry.INSTANCE.add(Items.CAMPFIRE, Integer.MAX_VALUE); // very broken thus cursed enough
}
public static void register_itemGroup() {
NEC_GROUP = FabricItemGroup.builder()
.icon(() -> new ItemStack(ModItems.DIRT_SWORD_ITEM))
@ -47,6 +57,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,8 +16,14 @@
"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",
"advancements.nec.use_campfire_as_fuel.title": "Die Lösung für alle Energieprobleme gefunden!",
"advancements.nec.use_campfire_as_fuel.description": "Benutze ein Lagerfeuer als Brennstoff",
"block.nec.blaze_block": "Lohenblock",
"block.nec.cursed_dirt_stairs": "Verfluchte Erdtreppe",
@ -31,6 +37,8 @@
"block.nec.java_block": "Javablock",
"block.nec.pocket_block": "Pocketblock",
"block.nec.thick_end_rod": "Dicker Endstab",
"block.nec.thicker_end_rod": "Dickerer Endstab",
"block.nec.even_thicker_end_rod": "Noch Dickerer Endstab",
"item.nec.ak_47": "AK-47",
"item.nec.chainmail": "Kettenbrief",
"item.nec.dirt_sword": "Erdschwert",

View file

@ -16,8 +16,14 @@
"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",
"advancements.nec.use_campfire_as_fuel.title": "Found the solution to all energy problems!",
"advancements.nec.use_campfire_as_fuel.description": "Use a Campfire as fuel",
"block.nec.blaze_block": "Blaze Block",
"block.nec.cursed_dirt_stairs": "Cursed Dirt Stairs",
@ -31,6 +37,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"
}
]
}
]
}