Compare commits
4 Commits
mc-1.20
...
mc-1.20-de
Author | SHA1 | Date | |
---|---|---|---|
|
60fa86bbd0 | ||
|
c1f4747dbf | ||
|
84429b4ec9 | ||
|
0ae128d5b0 |
@ -2,6 +2,10 @@ package net.wtr.morepaths;
|
||||
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
|
||||
//import net.wtr.morepaths.block.ModBlocks;
|
||||
import net.wtr.morepaths.block.ModBlocks;
|
||||
import net.wtr.morepaths.item.ModItemGroups;
|
||||
import net.wtr.morepaths.item.ModItems;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -19,5 +23,9 @@ public class MorePathBlocks implements ModInitializer {
|
||||
// Proceed with mild caution.
|
||||
|
||||
LOGGER.info("Hello Fabric world!");
|
||||
|
||||
ModItemGroups.registerItemGroups();
|
||||
ModItems.registerModItems();
|
||||
ModBlocks.registerModBlocks();
|
||||
}
|
||||
}
|
72
src/main/java/net/wtr/morepaths/block/ModBlocks.java
Normal file
@ -0,0 +1,72 @@
|
||||
package net.wtr.morepaths.block;
|
||||
|
||||
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.wtr.morepaths.MorePathBlocks;
|
||||
|
||||
import net.minecraft.registry.Registry;
|
||||
|
||||
public class ModBlocks {
|
||||
|
||||
public static final Block TEST_PATH =
|
||||
registerBlock(
|
||||
"test_path",
|
||||
new PathBlock()
|
||||
);
|
||||
|
||||
public static final Block STONE_BRICKS_PATH =
|
||||
registerBlock(
|
||||
"stone_bricks_path",
|
||||
new PathBlock(
|
||||
AbstractBlock.Settings.create()
|
||||
.mapColor(MapColor.STONE_GRAY)
|
||||
.sounds(BlockSoundGroup.STONE))
|
||||
);
|
||||
|
||||
public static final Block SMALL_STONE_PATH =
|
||||
registerBlock(
|
||||
"small_stone_path",
|
||||
new PathBlock(
|
||||
AbstractBlock.Settings.create()
|
||||
.mapColor(MapColor.STONE_GRAY)
|
||||
.sounds(BlockSoundGroup.STONE))
|
||||
);
|
||||
|
||||
public static final Block OAK_DIRT_PATH =
|
||||
registerBlock(
|
||||
"oak_dirt_path",
|
||||
new PathBlock(
|
||||
AbstractBlock.Settings.create()
|
||||
.mapColor(MapColor.OAK_TAN)
|
||||
.sounds(BlockSoundGroup.BAMBOO_WOOD))
|
||||
);
|
||||
|
||||
|
||||
|
||||
private static Block registerBlock(String name, Block block) {
|
||||
registerBlockItem( name, block );
|
||||
return Registry.register(
|
||||
Registries.BLOCK,
|
||||
new Identifier(MorePathBlocks.MOD_ID, name),
|
||||
block
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
private static Item registerBlockItem(String name, Block block) {
|
||||
return Registry.register(
|
||||
Registries.ITEM,
|
||||
new Identifier( MorePathBlocks.MOD_ID, name ),
|
||||
new BlockItem(block, new FabricItemSettings())
|
||||
);
|
||||
}
|
||||
|
||||
public static void registerModBlocks() {
|
||||
MorePathBlocks.LOGGER.info("Registering ModBlocks for " + MorePathBlocks.MOD_ID);
|
||||
}
|
||||
}
|
48
src/main/java/net/wtr/morepaths/block/PathBlock.java
Normal file
@ -0,0 +1,48 @@
|
||||
package net.wtr.morepaths.block;
|
||||
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.entity.ai.pathing.NavigationType;
|
||||
|
||||
import net.minecraft.item.ItemPlacementContext;
|
||||
|
||||
import net.minecraft.state.property.DirectionProperty;
|
||||
|
||||
import net.minecraft.util.BlockMirror;
|
||||
import net.minecraft.util.BlockRotation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.world.BlockView;
|
||||
|
||||
|
||||
|
||||
public class PathBlock extends Block {
|
||||
|
||||
// See VoxelShape below
|
||||
protected static final VoxelShape SHAPE = Block.createCuboidShape(0.0, 0.0, 0.0, 16.0, 15.0, 16.0);
|
||||
|
||||
public PathBlock() {
|
||||
super(Settings.copy(Blocks.DIRT_PATH));
|
||||
}
|
||||
|
||||
public PathBlock(AbstractBlock.Settings settings) {
|
||||
super(settings);
|
||||
}
|
||||
|
||||
// Allows for Sides of neigboring blocks to be seen
|
||||
@Override
|
||||
public boolean hasSidedTransparency(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Changes the Outline and Collision to the shape defined above
|
||||
@Override
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||
return SHAPE;
|
||||
}
|
||||
}
|
35
src/main/java/net/wtr/morepaths/item/ModItemGroups.java
Normal file
@ -0,0 +1,35 @@
|
||||
package net.wtr.morepaths.item;
|
||||
|
||||
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup;
|
||||
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;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.wtr.morepaths.MorePathBlocks;
|
||||
import net.wtr.morepaths.block.ModBlocks;
|
||||
|
||||
public class ModItemGroups {
|
||||
|
||||
// PATH BLOCKS ITEM GROUP //
|
||||
public static final ItemGroup PATH_BLOCKS = Registry.register(Registries.ITEM_GROUP,
|
||||
new Identifier(MorePathBlocks.MOD_ID, "test_path"),
|
||||
FabricItemGroup.builder().displayName(Text.translatable("itemgroup.path"))
|
||||
.icon(() -> new ItemStack(ModBlocks.STONE_BRICKS_PATH)).entries((displayContext, entries) -> {
|
||||
|
||||
entries.add(ModBlocks.STONE_BRICKS_PATH);
|
||||
entries.add(ModBlocks.SMALL_STONE_PATH);
|
||||
entries.add(ModBlocks.OAK_DIRT_PATH);
|
||||
|
||||
entries.add(Items.DIRT_PATH);
|
||||
|
||||
}).build());
|
||||
// // // // //
|
||||
|
||||
|
||||
public static void registerItemGroups() {
|
||||
MorePathBlocks.LOGGER.info("Registering Item Groups for " + MorePathBlocks.MOD_ID);
|
||||
}
|
||||
}
|
38
src/main/java/net/wtr/morepaths/item/ModItems.java
Normal file
@ -0,0 +1,38 @@
|
||||
package net.wtr.morepaths.item;
|
||||
|
||||
import net.fabricmc.fabric.api.item.v1.FabricItem;
|
||||
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
|
||||
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroupEntries;
|
||||
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
|
||||
import net.fabricmc.fabric.impl.itemgroup.FabricItemGroup;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemGroups;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.wtr.morepaths.MorePathBlocks;
|
||||
|
||||
public class ModItems {
|
||||
|
||||
public static final Item TITEM = registerItem("titem", new Item(new FabricItemSettings()));
|
||||
public static final Item FALSE_TITEM = registerItem("falsetitem", new Item(new FabricItemSettings()));
|
||||
|
||||
private static void addItemsToIngriedientItemGroup(FabricItemGroupEntries entries) {
|
||||
}
|
||||
|
||||
private static Item registerItem(String name, Item item) {
|
||||
return Registry.register(
|
||||
Registries.ITEM,
|
||||
new Identifier( MorePathBlocks.MOD_ID, name ),
|
||||
item
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
public static void registerModItems() {
|
||||
MorePathBlocks.LOGGER.info( "Registering Mod Items for " + MorePathBlocks.MOD_ID );
|
||||
|
||||
ItemGroupEvents.modifyEntriesEvent(ItemGroups.INGREDIENTS).register(ModItems::addItemsToIngriedientItemGroup);
|
||||
}
|
||||
}
|
21
src/main/resources/assets/morepaths/blockstates/_path.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"variants": {
|
||||
"": [
|
||||
{
|
||||
"model": "minecraft:block/dirt_path"
|
||||
},
|
||||
{
|
||||
"model": "minecraft:block/dirt_path",
|
||||
"y": 90
|
||||
},
|
||||
{
|
||||
"model": "minecraft:block/dirt_path",
|
||||
"y": 180
|
||||
},
|
||||
{
|
||||
"model": "minecraft:block/dirt_path",
|
||||
"y": 270
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "morepaths:block/oak_dirt_path"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "morepaths:block/small_stone_path"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "morepaths:block/stone_bricks_path"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
{
|
||||
"variants": {
|
||||
"": [
|
||||
{
|
||||
"model": "morepaths:block/test_path"
|
||||
},
|
||||
{
|
||||
"model": "morepaths:block/test_path",
|
||||
"y": 90
|
||||
},
|
||||
{
|
||||
"model": "morepaths:block/test_path",
|
||||
"y": 180
|
||||
},
|
||||
{
|
||||
"model": "morepaths:block/test_path",
|
||||
"y": 270
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 4.6 KiB |
7
src/main/resources/assets/morepaths/lang/en_us.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"block.morepaths.test_path": "Test Path Block",
|
||||
"block.morepaths.stone_bricks_path": "Stone Brick Path",
|
||||
"block.morepaths.small_stone_path": "Small Stone Path",
|
||||
|
||||
"itemgroup.path": "More Path Blocks [DEV]"
|
||||
}
|
21
src/main/resources/assets/morepaths/models/block/_path.json
Normal file
@ -0,0 +1,21 @@
|
||||
{ "parent": "block/block",
|
||||
"textures": {
|
||||
"particle": "block/dirt",
|
||||
"top": "block/dirt_path_top",
|
||||
"side": "block/dirt_path_side",
|
||||
"bottom": "block/dirt"
|
||||
},
|
||||
"elements": [
|
||||
{ "from": [ 0, 0, 0 ],
|
||||
"to": [ 16, 15, 16 ],
|
||||
"faces": {
|
||||
"down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" },
|
||||
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" },
|
||||
"north": { "uv": [ 0, 1, 16, 16 ], "texture": "#side", "cullface": "north" },
|
||||
"south": { "uv": [ 0, 1, 16, 16 ], "texture": "#side", "cullface": "south" },
|
||||
"west": { "uv": [ 0, 1, 16, 16 ], "texture": "#side", "cullface": "west" },
|
||||
"east": { "uv": [ 0, 1, 16, 16 ], "texture": "#side", "cullface": "east" }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
{ "parent": "block/block",
|
||||
"textures": {
|
||||
"particle": "minecraft:block/oak_planks",
|
||||
"top": "morepaths:block/oak_dirt_path_top",
|
||||
"side1": "morepaths:block/oak_dirt_path_side_1",
|
||||
"side2": "morepaths:block/oak_dirt_path_side_2",
|
||||
"side3": "morepaths:block/oak_dirt_path_side_3",
|
||||
"side4": "morepaths:block/oak_dirt_path_side_4",
|
||||
"bottom": "minecraft:block/dirt"
|
||||
},
|
||||
"elements": [
|
||||
{ "from": [ 0, 0, 0 ],
|
||||
"to": [ 16, 15, 16 ],
|
||||
"faces": {
|
||||
"down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" },
|
||||
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" },
|
||||
"north": { "uv": [ 0, 1, 16, 16 ], "texture": "#side1", "cullface": "north" },
|
||||
"south": { "uv": [ 0, 1, 16, 16 ], "texture": "#side2", "cullface": "south" },
|
||||
"west": { "uv": [ 0, 1, 16, 16 ], "texture": "#side3", "cullface": "west" },
|
||||
"east": { "uv": [ 0, 1, 16, 16 ], "texture": "#side4", "cullface": "east" }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
{ "parent": "block/block",
|
||||
"textures": {
|
||||
"particle": "morepaths:block/small_stone_path_top",
|
||||
"top": "morepaths:block/small_stone_path_top",
|
||||
"side": "morepaths:block/stone_bricks_path_side_3",
|
||||
"bottom": "minecraft:block/stone"
|
||||
},
|
||||
"elements": [
|
||||
{ "from": [ 0, 0, 0 ],
|
||||
"to": [ 16, 15, 16 ],
|
||||
"faces": {
|
||||
"down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" },
|
||||
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" },
|
||||
"north": { "uv": [ 0, 1, 16, 16 ], "texture": "#side", "cullface": "north" },
|
||||
"south": { "uv": [ 0, 1, 16, 16 ], "texture": "#side", "cullface": "south" },
|
||||
"west": { "uv": [ 0, 1, 16, 16 ], "texture": "#side", "cullface": "west" },
|
||||
"east": { "uv": [ 0, 1, 16, 16 ], "texture": "#side", "cullface": "east" }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
{ "parent": "block/block",
|
||||
"textures": {
|
||||
"particle": "minecraft:block/stone_bricks",
|
||||
"top": "morepaths:block/stone_bricks_path_top",
|
||||
"side1": "morepaths:block/stone_bricks_path_side_1",
|
||||
"side2": "morepaths:block/stone_bricks_path_side_2",
|
||||
"side3": "morepaths:block/stone_bricks_path_side_3",
|
||||
"bottom": "minecraft:block/stone"
|
||||
},
|
||||
"elements": [
|
||||
{ "from": [ 0, 0, 0 ],
|
||||
"to": [ 16, 15, 16 ],
|
||||
"faces": {
|
||||
"down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" },
|
||||
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" },
|
||||
"north": { "uv": [ 0, 1, 16, 16 ], "texture": "#side1", "cullface": "north" },
|
||||
"south": { "uv": [ 0, 1, 16, 16 ], "texture": "#side2", "cullface": "south" },
|
||||
"west": { "uv": [ 0, 1, 16, 16 ], "texture": "#side3", "cullface": "west" },
|
||||
"east": { "uv": [ 0, 1, 16, 16 ], "texture": "#side3", "cullface": "east" }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
{ "parent": "block/block",
|
||||
"textures": {
|
||||
"particle": "minecraft:block/stone",
|
||||
"top": "morepaths:block/test_path_top",
|
||||
"side": "morepaths:block/test_path_side",
|
||||
"bottom": "minecraft:block/stone"
|
||||
},
|
||||
"elements": [
|
||||
{ "from": [ 0, 0, 0 ],
|
||||
"to": [ 16, 15, 16 ],
|
||||
"faces": {
|
||||
"down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" },
|
||||
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" },
|
||||
"north": { "uv": [ 0, 1, 16, 16 ], "texture": "#side", "cullface": "north" },
|
||||
"south": { "uv": [ 0, 1, 16, 16 ], "texture": "#side", "cullface": "south" },
|
||||
"west": { "uv": [ 0, 1, 16, 16 ], "texture": "#side", "cullface": "west" },
|
||||
"east": { "uv": [ 0, 1, 16, 16 ], "texture": "#side", "cullface": "east" }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "minecraft:block/dirt_path"
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "morepaths:block/oak_dirt_path"
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "morepaths:block/small_stone_path"
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "morepaths:block/stone_bricks_path"
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "morepaths:block/test_path"
|
||||
}
|
After Width: | Height: | Size: 289 B |
BIN
src/main/resources/assets/morepaths/textures/block/_path_top.png
Normal file
After Width: | Height: | Size: 258 B |
After Width: | Height: | Size: 646 B |
After Width: | Height: | Size: 686 B |
After Width: | Height: | Size: 660 B |
After Width: | Height: | Size: 696 B |
After Width: | Height: | Size: 689 B |
After Width: | Height: | Size: 661 B |
After Width: | Height: | Size: 574 B |
After Width: | Height: | Size: 493 B |
After Width: | Height: | Size: 505 B |
After Width: | Height: | Size: 538 B |
After Width: | Height: | Size: 560 B |
After Width: | Height: | Size: 402 B |
After Width: | Height: | Size: 452 B |