compilability

This commit is contained in:
Ella Paws 2022-04-16 17:09:43 +02:00
parent 9656f9dfef
commit 176b2e256c
19 changed files with 168 additions and 93 deletions

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@ -5,22 +5,29 @@ import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
import net.minecraft.client.render.RenderLayer;
public class EllasModClient implements ClientModInitializer {
public class DecorationsClient implements ClientModInitializer {
@Override
public void onInitializeClient() {
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(),
DecorationsRegistry.BAMBOO_PLATFORM,
DecorationsRegistry.CLEAR_GLASS,
DecorationsRegistry.CLEAR_GLASS_PANE,
DecorationsRegistry.CLEAR_GLASS_PLATFORM,
DecorationsRegistry.CLEAR_GLASS_SLAB,
DecorationsRegistry.CLEAR_GLASS_STAIRS,
DecorationsRegistry.CLEAR_GLASS_STEP,
DecorationsRegistry.GLASS_PLATFORM,
DecorationsRegistry.GLASS_SLAB,
DecorationsRegistry.IRON_BAR_PLATFORM,
DecorationsRegistry.WINDOWED_ACACIA_DOOR,
DecorationsRegistry.WINDOWED_BIRCH_DOOR,
DecorationsRegistry.WINDOWED_DARK_OAK_DOOR,
DecorationsRegistry.ACACIA_BLOCKS.windowedDoor,
DecorationsRegistry.BIRCH_BLOCKS.windowedDoor,
DecorationsRegistry.CRIMSON_BLOCKS.windowedDoor,
DecorationsRegistry.DARK_OAK_BLOCKS.windowedDoor,
DecorationsRegistry.WINDOWED_IRON_DOOR,
DecorationsRegistry.WINDOWED_JUNGLE_DOOR,
DecorationsRegistry.WINDOWED_OAK_DOOR,
DecorationsRegistry.WINDOWED_SPRUCE_DOOR
DecorationsRegistry.JUNGLE_BLOCKS.windowedDoor,
DecorationsRegistry.OAK_BLOCKS.windowedDoor,
DecorationsRegistry.SPRUCE_BLOCKS.windowedDoor,
DecorationsRegistry.WARPED_BLOCKS.windowedDoor
);
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getTranslucent(),
DecorationsRegistry.WHITE_STAINED_GLASS_PLATFORM,
@ -38,7 +45,24 @@ public class EllasModClient implements ClientModInitializer {
DecorationsRegistry.BROWN_STAINED_GLASS_PLATFORM,
DecorationsRegistry.GREEN_STAINED_GLASS_PLATFORM,
DecorationsRegistry.RED_STAINED_GLASS_PLATFORM,
DecorationsRegistry.BLACK_STAINED_GLASS_PLATFORM
DecorationsRegistry.BLACK_STAINED_GLASS_PLATFORM,
DecorationsRegistry.WHITE_STAINED_GLASS_SLAB,
DecorationsRegistry.ORANGE_STAINED_GLASS_SLAB,
DecorationsRegistry.MAGENTA_STAINED_GLASS_SLAB,
DecorationsRegistry.LIGHT_BLUE_STAINED_GLASS_SLAB,
DecorationsRegistry.YELLOW_STAINED_GLASS_SLAB,
DecorationsRegistry.LIME_STAINED_GLASS_SLAB,
DecorationsRegistry.PINK_STAINED_GLASS_SLAB,
DecorationsRegistry.GRAY_STAINED_GLASS_SLAB,
DecorationsRegistry.LIGHT_GRAY_STAINED_GLASS_SLAB,
DecorationsRegistry.CYAN_STAINED_GLASS_SLAB,
DecorationsRegistry.PURPLE_STAINED_GLASS_SLAB,
DecorationsRegistry.BLUE_STAINED_GLASS_SLAB,
DecorationsRegistry.BROWN_STAINED_GLASS_SLAB,
DecorationsRegistry.GREEN_STAINED_GLASS_SLAB,
DecorationsRegistry.RED_STAINED_GLASS_SLAB,
DecorationsRegistry.BLACK_STAINED_GLASS_SLAB
);
}
}

View File

@ -11,14 +11,17 @@ import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
//import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.registry.Registry;
import net.minecraft.util.DyeColor;
import net.minecraft.util.Identifier;
import net.minecraft.world.BlockView;
import java.util.LinkedHashMap;
public class DecorationsRegistry {
public static final String ID = "ellas_mod";
private static final LinkedHashMap<String, Block> BLOCKS = new LinkedHashMap<>();
private static final LinkedHashMap<String, BlockItem> ITEMS = new LinkedHashMap<>();
private static final LinkedHashMap<String, Item> ITEMS = new LinkedHashMap<>();
private static final FabricBlockSettings YELLOW_BRICK_SETTINGS = FabricBlockSettings.copyOf(Blocks.BRICKS).mapColor(MapColor.PALE_YELLOW);
@ -32,7 +35,7 @@ public class DecorationsRegistry {
public static WoodExtension WARPED_BLOCKS = new WoodExtension("warped", Blocks.WARPED_PLANKS, Blocks.WARPED_DOOR);
public static MetalExtension IRON_BLOCKS = new MetalExtension("iron", Blocks.IRON_BLOCK);
public static Block WINDOWED_IRON_DOOR = add("windowed_iron_door", new DoorBlock(IRON_DOOR)), ItemGroup.DECORATIONS);
public static Block WINDOWED_IRON_DOOR = add("windowed_iron_door", new EDoorBlock(FabricBlockSettings.copyOf(Blocks.IRON_DOOR)), ItemGroup.DECORATIONS);
public static Block IRON_RODS = add("iron_rods", new BarsBlock(FabricBlockSettings.copyOf(Blocks.IRON_BLOCK)), ItemGroup.DECORATIONS);
public static MetalExtension GOLD_BLOCKS = new MetalExtension("gold", Blocks.GOLD_BLOCK);
public static MetalExtension EMERALD_BLOCKS = new MetalExtension("emerald", Blocks.EMERALD_BLOCK);
@ -43,7 +46,7 @@ public class DecorationsRegistry {
public static final Block STONE_BRICK_TILES = add("stone_brick_tiles",
new Block(FabricBlockSettings.copyOf(Blocks.STONE_BRICKS)), ItemGroup.BUILDING_BLOCKS);
public static final Block STONE_BRICK_TILE_STAIRS = add("stone_brick_tile_stairs",
new StairsBlock(FabricBlockSettings.copyOf(Blocks.STONE_BRICK_STAIRS)), ItemGroup.BUILDING_BLOCKS);
new EStairsBlock(STONE_BRICK_TILES.getDefaultState(), FabricBlockSettings.copyOf(Blocks.STONE_BRICK_STAIRS)), ItemGroup.BUILDING_BLOCKS);
public static final Block STONE_BRICK_TILE_SLAB = add("stone_brick_tile_slab",
new SlabBlock(FabricBlockSettings.copyOf(Blocks.STONE_BRICK_SLAB)), ItemGroup.BUILDING_BLOCKS);
public static final Block STONE_BRICK_TILE_WALL = add("stone_brick_tile_wall",
@ -51,14 +54,14 @@ public class DecorationsRegistry {
public static final Block DEEPSLATE_BRICK_TILES = add("deepslate_brick_tiles",
new Block(FabricBlockSettings.copyOf(Blocks.DEEPSLATE_TILES)), ItemGroup.BUILDING_BLOCKS);
public static final Block DEEPSLATE_BRICK_TILE_STAIRS = add("deepslate_brick_tile_stairs",
new StairsBlock(FabricBlockSettings.copyOf(Blocks.DEEPSLATE_TILE_STAIRS)), ItemGroup.BUILDING_BLOCKS);
new EStairsBlock(DEEPSLATE_BRICK_TILES.getDefaultState(), FabricBlockSettings.copyOf(Blocks.DEEPSLATE_TILE_STAIRS)), ItemGroup.BUILDING_BLOCKS);
public static final Block DEEPSLATE_BRICK_TILE_SLAB = add("deepslate_brick_tile_slab",
new SlabBlock(FabricBlockSettings.copyOf(Blocks.DEEPSLATE_TILE_SLAB)), ItemGroup.BUILDING_BLOCKS);
public static final Block DEEPSLATE_BRICK_TILE_WALL = add("deepslate_brick_tile_wall",
new EWallBlock(FabricBlockSettings.copyOf(Blocks.DEEPSLATE_TILE_WALL)), ItemGroup.BUILDING_BLOCKS);
public static final Block BAMBOO_PLATFORM = add("bamboo_platform",
new PlatformBlock(FabricBlockSettings.copyOf(Blocks.SCAFFOLDING).solidBlock()), ItemGroup.BUILDING_BLOCKS);
new PlatformBlock(FabricBlockSettings.copyOf(Blocks.SCAFFOLDING).solidBlock(DecorationsRegistry::always)), ItemGroup.BUILDING_BLOCKS);
public static final Block IRON_BAR_PLATFORM = add("iron_bar_platform",
new PlatformBlock(FabricBlockSettings.copyOf(Blocks.IRON_BARS)), ItemGroup.BUILDING_BLOCKS);
public static final Block QUARTZ_PLATFORM = add("quartz_platform",
@ -123,74 +126,74 @@ public class DecorationsRegistry {
public static final Block CLEAR_GLASS_PLATFORM = add("clear_glass_platform",
new PlatformBlock(FabricBlockSettings.copyOf(Blocks.GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block WHITE_STAINED_GLASS_PLATFORM = add("white_stained_glass_platform",
new StainedPlatformBlock(FabricBlockSettings.copyOf(Blocks.WHITE_STAINED_GLASS, DyeColor.WHITE)), ItemGroup.BUILDING_BLOCKS);
new StainedPlatformBlock(DyeColor.WHITE, FabricBlockSettings.copyOf(Blocks.WHITE_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block ORANGE_STAINED_GLASS_PLATFORM = add("orange_stained_glass_platform",
new StainedPlatformBlock(FabricBlockSettings.copyOf(Blocks.ORANGE_STAINED_GLASS, DyeColor.ORANGE)), ItemGroup.BUILDING_BLOCKS);
new StainedPlatformBlock(DyeColor.ORANGE, FabricBlockSettings.copyOf(Blocks.ORANGE_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block MAGENTA_STAINED_GLASS_PLATFORM = add("magenta_stained_glass_platform",
new StainedPlatformBlock(FabricBlockSettings.copyOf(Blocks.MAGENTA_STAINED_GLASS, DyeColor.MAGENTA)), ItemGroup.BUILDING_BLOCKS);
new StainedPlatformBlock(DyeColor.MAGENTA, FabricBlockSettings.copyOf(Blocks.MAGENTA_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block LIGHT_BLUE_STAINED_GLASS_PLATFORM = add("light_blue_stained_glass_platform",
new StainedPlatformBlock(FabricBlockSettings.copyOf(Blocks.LIGHT_BLUE_STAINED_GLASS, DyeColor.LIGHT_BLUE)), ItemGroup.BUILDING_BLOCKS);
new StainedPlatformBlock(DyeColor.LIGHT_BLUE, FabricBlockSettings.copyOf(Blocks.LIGHT_BLUE_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block YELLOW_STAINED_GLASS_PLATFORM = add("yellow_stained_glass_platform",
new StainedPlatformBlock(FabricBlockSettings.copyOf(Blocks.YELLOW_STAINED_GLASS, DyeColor.YELLOW)), ItemGroup.BUILDING_BLOCKS);
new StainedPlatformBlock(DyeColor.YELLOW, FabricBlockSettings.copyOf(Blocks.YELLOW_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block LIME_STAINED_GLASS_PLATFORM = add("lime_stained_glass_platform",
new StainedPlatformBlock(FabricBlockSettings.copyOf(Blocks.LIME_STAINED_GLASS, DyeColor.LIME)), ItemGroup.BUILDING_BLOCKS);
new StainedPlatformBlock(DyeColor.LIME, FabricBlockSettings.copyOf(Blocks.LIME_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block PINK_STAINED_GLASS_PLATFORM = add("pink_stained_glass_platform",
new StainedPlatformBlock(FabricBlockSettings.copyOf(Blocks.PINK_STAINED_GLASS, DyeColor.PINK)), ItemGroup.BUILDING_BLOCKS);
new StainedPlatformBlock(DyeColor.PINK, FabricBlockSettings.copyOf(Blocks.PINK_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block GRAY_STAINED_GLASS_PLATFORM = add("gray_stained_glass_platform",
new StainedPlatformBlock(FabricBlockSettings.copyOf(Blocks.GRAY_STAINED_GLASS, DyeColor.GRAY)), ItemGroup.BUILDING_BLOCKS);
new StainedPlatformBlock(DyeColor.GRAY, FabricBlockSettings.copyOf(Blocks.GRAY_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block LIGHT_GRAY_STAINED_GLASS_PLATFORM = add("light_gray_stained_glass_platform",
new StainedPlatformBlock(FabricBlockSettings.copyOf(Blocks.LIGHT_GRAY_STAINED_GLASS, DyeColor.LIGHT_GRAY)), ItemGroup.BUILDING_BLOCKS);
new StainedPlatformBlock(DyeColor.LIGHT_GRAY, FabricBlockSettings.copyOf(Blocks.LIGHT_GRAY_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block CYAN_STAINED_GLASS_PLATFORM = add("cyan_stained_glass_platform",
new StainedPlatformBlock(FabricBlockSettings.copyOf(Blocks.CYAN_STAINED_GLASS, DyeColor.CYAN)), ItemGroup.BUILDING_BLOCKS);
new StainedPlatformBlock(DyeColor.CYAN, FabricBlockSettings.copyOf(Blocks.CYAN_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block PURPLE_STAINED_GLASS_PLATFORM = add("purple_stained_glass_platform",
new StainedPlatformBlock(FabricBlockSettings.copyOf(Blocks.PURPLE_STAINED_GLASS, DyeColor.PURPLE)), ItemGroup.BUILDING_BLOCKS);
new StainedPlatformBlock(DyeColor.PURPLE, FabricBlockSettings.copyOf(Blocks.PURPLE_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block BLUE_STAINED_GLASS_PLATFORM = add("blue_stained_glass_platform",
new StainedPlatformBlock(FabricBlockSettings.copyOf(Blocks.BLUE_STAINED_GLASS, DyeColor.BLUE)), ItemGroup.BUILDING_BLOCKS);
new StainedPlatformBlock(DyeColor.BLUE, FabricBlockSettings.copyOf(Blocks.BLUE_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block BROWN_STAINED_GLASS_PLATFORM = add("brown_stained_glass_platform",
new StainedPlatformBlock(FabricBlockSettings.copyOf(Blocks.BROWN_STAINED_GLASS, DyeColor.BROWN)), ItemGroup.BUILDING_BLOCKS);
new StainedPlatformBlock(DyeColor.BROWN, FabricBlockSettings.copyOf(Blocks.BROWN_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block GREEN_STAINED_GLASS_PLATFORM = add("green_stained_glass_platform",
new StainedPlatformBlock(FabricBlockSettings.copyOf(Blocks.GREEN_STAINED_GLASS, DyeColor.GREEN)), ItemGroup.BUILDING_BLOCKS);
new StainedPlatformBlock(DyeColor.GREEN, FabricBlockSettings.copyOf(Blocks.GREEN_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block RED_STAINED_GLASS_PLATFORM = add("red_stained_glass_platform",
new StainedPlatformBlock(FabricBlockSettings.copyOf(Blocks.RED_STAINED_GLASS, DyeColor.RED)), ItemGroup.BUILDING_BLOCKS);
new StainedPlatformBlock(DyeColor.RED, FabricBlockSettings.copyOf(Blocks.RED_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block BLACK_STAINED_GLASS_PLATFORM = add("black_stained_glass_platform",
new StainedPlatformBlock(FabricBlockSettings.copyOf(Blocks.BLACK_STAINED_GLASS, DyeColor.BLACK)), ItemGroup.BUILDING_BLOCKS);
new StainedPlatformBlock(DyeColor.BLACK, FabricBlockSettings.copyOf(Blocks.BLACK_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block GLASS_SLAB = add("glass_slab",
new SlabBlock(FabricBlockSettings.copyOf(Blocks.GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block CLEAR_GLASS_SLAB = add("clear_glass_slab",
new SlabBlock(FabricBlockSettings.copyOf(Blocks.GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block WHITE_STAINED_GLASS_SLAB = add("white_stained_glass_slab",
new StainedSlabBlock(FabricBlockSettings.copyOf(Blocks.WHITE_STAINED_GLASS, DyeColor.WHITE)), ItemGroup.BUILDING_BLOCKS);
new StainedSlabBlock(DyeColor.WHITE, FabricBlockSettings.copyOf(Blocks.WHITE_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block ORANGE_STAINED_GLASS_SLAB = add("orange_stained_glass_slab",
new StainedSlabBlock(FabricBlockSettings.copyOf(Blocks.ORANGE_STAINED_GLASS, DyeColor.ORANGE)), ItemGroup.BUILDING_BLOCKS);
new StainedSlabBlock(DyeColor.ORANGE, FabricBlockSettings.copyOf(Blocks.ORANGE_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block MAGENTA_STAINED_GLASS_SLAB = add("magenta_stained_glass_slab",
new StainedSlabBlock(FabricBlockSettings.copyOf(Blocks.MAGENTA_STAINED_GLASS, DyeColor.MAGENTA)), ItemGroup.BUILDING_BLOCKS);
new StainedSlabBlock(DyeColor.MAGENTA, FabricBlockSettings.copyOf(Blocks.MAGENTA_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block LIGHT_BLUE_STAINED_GLASS_SLAB = add("light_blue_stained_glass_slab",
new StainedSlabBlock(FabricBlockSettings.copyOf(Blocks.LIGHT_BLUE_STAINED_GLASS, DyeColor.LIGHT_BLUE)), ItemGroup.BUILDING_BLOCKS);
new StainedSlabBlock(DyeColor.LIGHT_BLUE, FabricBlockSettings.copyOf(Blocks.LIGHT_BLUE_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block YELLOW_STAINED_GLASS_SLAB = add("yellow_stained_glass_slab",
new StainedSlabBlock(FabricBlockSettings.copyOf(Blocks.YELLOW_STAINED_GLASS, DyeColor.YELLOW)), ItemGroup.BUILDING_BLOCKS);
new StainedSlabBlock(DyeColor.YELLOW, FabricBlockSettings.copyOf(Blocks.YELLOW_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block LIME_STAINED_GLASS_SLAB = add("lime_stained_glass_slab",
new StainedSlabBlock(FabricBlockSettings.copyOf(Blocks.LIME_STAINED_GLASS, DyeColor.LIME)), ItemGroup.BUILDING_BLOCKS);
new StainedSlabBlock(DyeColor.LIME, FabricBlockSettings.copyOf(Blocks.LIME_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block PINK_STAINED_GLASS_SLAB = add("pink_stained_glass_slab",
new StainedSlabBlock(FabricBlockSettings.copyOf(Blocks.PINK_STAINED_GLASS, DyeColor.PINK)), ItemGroup.BUILDING_BLOCKS);
new StainedSlabBlock(DyeColor.PINK, FabricBlockSettings.copyOf(Blocks.PINK_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block GRAY_STAINED_GLASS_SLAB = add("gray_stained_glass_slab",
new StainedSlabBlock(FabricBlockSettings.copyOf(Blocks.GRAY_STAINED_GLASS, DyeColor.GRAY)), ItemGroup.BUILDING_BLOCKS);
new StainedSlabBlock(DyeColor.GRAY, FabricBlockSettings.copyOf(Blocks.GRAY_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block LIGHT_GRAY_STAINED_GLASS_SLAB = add("light_gray_stained_glass_slab",
new StainedSlabBlock(FabricBlockSettings.copyOf(Blocks.LIGHT_GRAY_STAINED_GLASS, DyeColor.LIGHT_GRAY)), ItemGroup.BUILDING_BLOCKS);
new StainedSlabBlock(DyeColor.LIGHT_GRAY, FabricBlockSettings.copyOf(Blocks.LIGHT_GRAY_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block CYAN_STAINED_GLASS_SLAB = add("cyan_stained_glass_slab",
new StainedSlabBlock(FabricBlockSettings.copyOf(Blocks.CYAN_STAINED_GLASS, DyeColor.CYAN)), ItemGroup.BUILDING_BLOCKS);
new StainedSlabBlock(DyeColor.CYAN, FabricBlockSettings.copyOf(Blocks.CYAN_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block PURPLE_STAINED_GLASS_SLAB = add("purple_stained_glass_slab",
new StainedSlabBlock(FabricBlockSettings.copyOf(Blocks.PURPLE_STAINED_GLASS, DyeColor.PURPLE)), ItemGroup.BUILDING_BLOCKS);
new StainedSlabBlock(DyeColor.PURPLE, FabricBlockSettings.copyOf(Blocks.PURPLE_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block BLUE_STAINED_GLASS_SLAB = add("blue_stained_glass_slab",
new StainedSlabBlock(FabricBlockSettings.copyOf(Blocks.BLUE_STAINED_GLASS, DyeColor.BLUE)), ItemGroup.BUILDING_BLOCKS);
new StainedSlabBlock(DyeColor.BLUE, FabricBlockSettings.copyOf(Blocks.BLUE_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block BROWN_STAINED_GLASS_SLAB = add("brown_stained_glass_slab",
new StainedSlabBlock(FabricBlockSettings.copyOf(Blocks.BROWN_STAINED_GLASS, DyeColor.BROWN)), ItemGroup.BUILDING_BLOCKS);
new StainedSlabBlock(DyeColor.BROWN, FabricBlockSettings.copyOf(Blocks.BROWN_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block GREEN_STAINED_GLASS_SLAB = add("green_stained_glass_slab",
new StainedSlabBlock(FabricBlockSettings.copyOf(Blocks.GREEN_STAINED_GLASS, DyeColor.GREEN)), ItemGroup.BUILDING_BLOCKS);
new StainedSlabBlock(DyeColor.GREEN, FabricBlockSettings.copyOf(Blocks.GREEN_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block RED_STAINED_GLASS_SLAB = add("red_stained_glass_slab",
new StainedSlabBlock(FabricBlockSettings.copyOf(Blocks.RED_STAINED_GLASS, DyeColor.RED)), ItemGroup.BUILDING_BLOCKS);
new StainedSlabBlock(DyeColor.RED, FabricBlockSettings.copyOf(Blocks.RED_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block BLACK_STAINED_GLASS_SLAB = add("black_stained_glass_slab",
new StainedSlabBlock(FabricBlockSettings.copyOf(Blocks.BLACK_STAINED_GLASS, DyeColor.BLACK)), ItemGroup.BUILDING_BLOCKS);
new StainedSlabBlock(DyeColor.BLACK, FabricBlockSettings.copyOf(Blocks.BLACK_STAINED_GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block QUARTZ_STEP = add("quartz_step",
new StepBlock(FabricBlockSettings.copyOf(Blocks.QUARTZ_BLOCK)), ItemGroup.BUILDING_BLOCKS);
@ -252,7 +255,7 @@ public class DecorationsRegistry {
public static final Block YELLOW_BRICKS = add("yellow_bricks",
new Block(YELLOW_BRICK_SETTINGS), ItemGroup.BUILDING_BLOCKS);
public static final Block YELLOW_BRICK_STAIRS = add("yellow_brick_stairs",
new StairsBlock(YELLOW_BRICK_SETTINGS), ItemGroup.BUILDING_BLOCKS);
new EStairsBlock(YELLOW_BRICKS.getDefaultState(), YELLOW_BRICK_SETTINGS), ItemGroup.BUILDING_BLOCKS);
public static final Block YELLOW_BRICK_SLAB = add("yellow_brick_slab",
new SlabBlock(YELLOW_BRICK_SETTINGS), ItemGroup.BUILDING_BLOCKS);
public static final Block YELLOW_BRICK_WALL = add("yellow_brick_wall",
@ -261,13 +264,13 @@ public class DecorationsRegistry {
public static final Block CLEAR_GLASS = add("clear_glass",
new GlassBlock(FabricBlockSettings.copyOf(Blocks.GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block CLEAR_GLASS_STAIRS = add("clear_glass_stairs",
new StairsBlock(FabricBlockSettings.copyOf(Blocks.GLASS)), ItemGroup.BUILDING_BLOCKS);
new EStairsBlock(CLEAR_GLASS.getDefaultState(), FabricBlockSettings.copyOf(Blocks.GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block CLEAR_GLASS_STEP = add("clear_glass_step",
new StepBlock(FabricBlockSettings.copyOf(Blocks.GLASS)), ItemGroup.BUILDING_BLOCKS);
public static final Block CLEAR_GLASS_PANE = add("clear_glass_pane",
new PaneBlock(FabricBlockSettings.copyOf(Blocks.GLASS_PANE)), ItemGroup.BUILDING_BLOCKS);
new EPaneBlock(FabricBlockSettings.copyOf(Blocks.GLASS_PANE)), ItemGroup.BUILDING_BLOCKS);
private static <B extends Block> B add(String name, B block, ItemGroup tab){
public static <B extends Block> B add(String name, B block, ItemGroup tab){
return add(name, block, new BlockItem(block, new Item.Settings().group(tab)));
}
@ -300,10 +303,10 @@ public class DecorationsRegistry {
}*/
for(String id : ITEMS.keySet()){
register(id), ITEMS.get(id));
register(id, ITEMS.get(id));
}
for(String id : BLOCKS.keySet()){
register(id), BLOCKS.get(id));
register(id, BLOCKS.get(id));
}
FlammableBlockRegistry flammable = FlammableBlockRegistry.getDefaultInstance();
@ -319,17 +322,21 @@ public class DecorationsRegistry {
//BLOCKS = null;
//ITEMS = null;
}
public void register(String id, Block block){
public static void register(String id, Block block){
Registry.register(Registry.BLOCK, new Identifier(ID, id), block);
}
public void register(String id, Item item){
public static void register(String id, Item item){
Registry.register(Registry.ITEM, new Identifier(ID, id), item);
}
/*public BlockEntityType register(String id, BlockEntityType entity){
/*public static BlockEntityType register(String id, BlockEntityType entity){
Registry.register(Registry.BLOCK_ENTITY_TYPE, new Identifier(ID, id), entity);
}*/
/*public void register(Identifier id){
/*public static void register(Identifier id){
Registry.register(Registry.CUSTOM_STAT, id, id);
Stats.CUSTOM.getOrCreateStat(id, StatFormatter.DEFAULT);
}*/
private static boolean always(BlockState state, BlockView world, BlockPos pos){
return true;
}
}

View File

@ -1,4 +1,4 @@
package ella.ellas_mod;
package ella.decorations;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder;

View File

@ -0,0 +1,9 @@
package ella.decorations.block;
import net.minecraft.block.*;
public class EDoorBlock extends DoorBlock {
public EDoorBlock(AbstractBlock.Settings settings){
super(settings);
}
}

View File

@ -0,0 +1,9 @@
package ella.decorations.block;
import net.minecraft.block.*;
public class EPaneBlock extends PaneBlock {
public EPaneBlock(AbstractBlock.Settings settings){
super(settings);
}
}

View File

@ -0,0 +1,9 @@
package ella.decorations.block;
import net.minecraft.block.*;
public class EStairsBlock extends StairsBlock {
public EStairsBlock(BlockState state, AbstractBlock.Settings settings){
super(state, settings);
}
}

View File

@ -1,7 +1,9 @@
package ella.decorations.block;
import ella.decorations.DecorationsRegistry;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.*;
import net.minecraft.item.ItemGroup;
public class MetalExtension {
public SlabBlock slab;
@ -14,10 +16,11 @@ public class MetalExtension {
//public StepBlock;
String name;
public MetalExtension(String type, FabricBlockSettings baseSettings){
public MetalExtension(String type, Block baseBlock){
FabricBlockSettings baseSettings = FabricBlockSettings.copyOf(baseBlock);
name = type;
slab = new SlabBlock(baseSettings);
pane = new PaneBlock(baseSettings);
pane = new EPaneBlock(baseSettings);
lowPane = new LowPaneBlock(baseSettings);
platform = new PlatformBlock(baseSettings);
panel = new PanelBlock(baseSettings); //16
@ -25,13 +28,13 @@ public class MetalExtension {
miniPanel = new MiniPanelBlock(baseSettings); //4
//step = new StepBlock(baseSettings);
DecorationsRegistry.add(name + "_slab", slab, ItemGroup.BUILDING_BLOCKS);
DecorationsRegistry.add(name + "_pane", pane, ItemGroup.DECORATIONS);
DecorationsRegistry.add("low_" + name + "_pane", lowPane, ItemGroup.DECORATIONS);
DecorationsRegistry.add(name + "_platform", platform, ItemGroup.BUILDING_BLOCKS);
DecorationsRegistry.add(name + "_panel", panel, ItemGroup.DECORATIONS);
DecorationsRegistry.add("small_" + name + "_panel", smallPanel, ItemGroup.DECORATIONS);
DecorationsRegistry.add("mini_" + name + "_panel", miniPanel, ItemGroup.DECORATIONS);
//DecorationsRegistry.add(name + "_step", step, ItemGroup.DECORATIONS);name + "_pane", pane, ItemGroup.DECORATIONS);
DecorationsRegistry.add(name + "_slab", (Block)slab, ItemGroup.BUILDING_BLOCKS);
DecorationsRegistry.add(name + "_pane", (Block)pane, ItemGroup.DECORATIONS);
DecorationsRegistry.add("low_" + name + "_pane", (Block)lowPane, ItemGroup.DECORATIONS);
DecorationsRegistry.add(name + "_platform", (Block)platform, ItemGroup.BUILDING_BLOCKS);
DecorationsRegistry.add(name + "_panel", (Block)panel, ItemGroup.DECORATIONS);
DecorationsRegistry.add("small_" + name + "_panel", (Block)smallPanel, ItemGroup.DECORATIONS);
DecorationsRegistry.add("mini_" + name + "_panel", (Block)miniPanel, ItemGroup.DECORATIONS);
//DecorationsRegistry.add(name + "_step", (Block)step, ItemGroup.DECORATIONS);name + "_pane", (Block)pane, ItemGroup.DECORATIONS);
}
}

View File

@ -4,6 +4,7 @@ import net.minecraft.block.*;
import net.minecraft.state.property.Properties;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;
public class MiniPanelBlock extends PanelBlock {
@ -13,7 +14,7 @@ public class MiniPanelBlock extends PanelBlock {
static final VoxelShape EAST_SHAPE = createCuboidShape(14d, 0d, 0d, 16d, 4d, 16d);
static final VoxelShape WEST_SHAPE = createCuboidShape( 0d, 0d, 0d, 2d, 4d, 16d);
public PanelBlock(Settings settings){
public MiniPanelBlock(Settings settings){
super(settings);
}

View File

@ -71,7 +71,7 @@ public class PanelBlock extends Block implements Waterloggable {
@Override
public boolean canReplace(BlockState state, ItemPlacementContext context) {
if(!context.getStack().isOf(this.asItem()) || super.canReplace(state, context)){
int side = getSideordinal(context);
int side = getSideOrdinal(context);
if(state.get(
side == Direction.NORTH.ordinal()? Properties.NORTH:
side == Direction.EAST.ordinal()? Properties.EAST:

View File

@ -21,7 +21,7 @@ import net.minecraft.world.WorldView;
public class PlatformBlock extends Block implements Waterloggable {
public PlatformBlock(net.minecraft.block.AbstractBlock.Settings settings){
super(settings.suffocates(EllasModBlocks::never).blockVision(EllasModBlocks::never));
super(settings/*.suffocates(Blocks::never).blockVision(Blocks::never)*/);
this.setDefaultState(this.stateManager.getDefaultState().with(Properties.WATERLOGGED, false));
}

View File

@ -4,6 +4,7 @@ import net.minecraft.block.*;
import net.minecraft.state.property.Properties;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;
public class SmallPanelBlock extends PanelBlock {
@ -13,7 +14,7 @@ public class SmallPanelBlock extends PanelBlock {
static final VoxelShape EAST_SHAPE = createCuboidShape(14d, 0d, 0d, 16d, 12d, 16d);
static final VoxelShape WEST_SHAPE = createCuboidShape( 0d, 0d, 0d, 2d, 12d, 16d);
public PanelBlock(Settings settings){
public SmallPanelBlock(Settings settings){
super(settings);
}

View File

@ -2,11 +2,16 @@ package ella.decorations.block;
import net.minecraft.block.*;
import net.minecraft.block.enums.BlockHalf;
import net.minecraft.fluid.FluidState;
import net.minecraft.fluid.Fluids;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.state.property.Properties;
import net.minecraft.state.StateManager;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;
public class StepBlock extends Block implements Waterloggable {
final VoxelShape BOTTOM_NORTH_SHAPE = createCuboidShape( 0d, 0d, 0d, 16d, 8d, 8d);
@ -22,7 +27,7 @@ public class StepBlock extends Block implements Waterloggable {
super(settings);
this.setDefaultState(
this.stateManager.getDefaultState()
.with(Properties.BLOCK_HALF, BlockHalf.LOWER)
.with(Properties.BLOCK_HALF, BlockHalf.BOTTOM)
.with(Properties.HORIZONTAL_FACING, Direction.NORTH)
.with(Properties.WATERLOGGED, false)
);
@ -31,11 +36,11 @@ public class StepBlock extends Block implements Waterloggable {
@Override
protected void appendProperties(StateManager.Builder<Block, BlockState> builder){
super.appendProperties(builder);
builder.add(Properties.BLOCK_HALF, Properties.HORIZONTAL_FACING);
builder.add(Properties.BLOCK_HALF, Properties.HORIZONTAL_FACING, Properties.WATERLOGGED);
}
@Override
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context){
if(state.get(Properties.BLOCK_HALF) == BlockHalf.UPPER){
if(state.get(Properties.BLOCK_HALF) == BlockHalf.TOP){
switch(state.get(Properties.HORIZONTAL_FACING)){
case SOUTH:
return TOP_SOUTH_SHAPE;
@ -63,8 +68,8 @@ public class StepBlock extends Block implements Waterloggable {
return super.getPlacementState(context)
.with(Properties.HORIZONTAL_FACING, context.getPlayerLookDirection())
.with(Properties.BLOCK_HALF,
context.getVerticalPlayerLookDirection().equals(Direction.UP) ? BlockHalf.UPPER : BlockHalf.LOWER);
.with(Properties.WATERLOGGED, context.getWorld().getFluidState(context.getBlockPos()).getFluid() == Fluids.WATER)
context.getVerticalPlayerLookDirection().equals(Direction.UP) ? BlockHalf.TOP : BlockHalf.BOTTOM)
.with(Properties.WATERLOGGED, context.getWorld().getFluidState(context.getBlockPos()).getFluid() == Fluids.WATER);
}
@Override
public FluidState getFluidState(BlockState state){

View File

@ -1,8 +1,10 @@
package ella.decorations.block;
import ella.decorations.DecorationsRegistry;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.registry.FlammableBlockRegistry;
import net.minecraft.block.*;
import net.minecraft.item.ItemGroup;
public class WoodExtension {
public PaneBlock pane;
@ -17,13 +19,13 @@ public class WoodExtension {
public SmallPanelBlock smallPanelFence;
public MiniPanelBlock miniPanelFence;
public StepBlock step;
public DoorBlock windowedDoor
public DoorBlock windowedDoor;
String name;
public WoodExtension(String type, Block baseBlock, Block door){
FabricBlockSettings baseSettings = FabricBlockSettings.copyOf(baseBlock);
name = type;
pane = new PaneBlock(baseSettings);
pane = new EPaneBlock(baseSettings);
lowPane = new LowPaneBlock(baseSettings);
bars = new BarsBlock(baseSettings);
platform = new PlatformBlock(baseSettings);
@ -35,23 +37,23 @@ public class WoodExtension {
smallPanelFence = new SmallPanelBlock(baseSettings); //12
miniPanelFence = new MiniPanelBlock(baseSettings); //4
step = new StepBlock(baseSettings);
windowedDoor = new DoorBlock(FabricBlockSettings.copyOf(door));
windowedDoor = new EDoorBlock(FabricBlockSettings.copyOf(door));
DecorationsRegistry.add(name + "_pane", pane, ItemGroup.DECORATIONS);
DecorationsRegistry.add("low_" + name + "_pane", lowPane, ItemGroup.DECORATIONS);
DecorationsRegistry.add(name + "_bars", bars, ItemGroup.DECORATIONS);
DecorationsRegistry.add(name + "_platform", platform, ItemGroup.BUILDING_BLOCKS);
DecorationsRegistry.add(name + "_bar_platform", barPlatform, ItemGroup.DECORATIONS);
DecorationsRegistry.add(name + "_panel", panel, ItemGroup.DECORATIONS);
DecorationsRegistry.add("small_" + name + "_panel", smallPanel, ItemGroup.DECORATIONS);
DecorationsRegistry.add("mini_" + name + "_panel", miniPanel, ItemGroup.DECORATIONS);
DecorationsRegistry.add(name + "_panel_fence", panelFence, ItemGroup.DECORATIONS);
DecorationsRegistry.add("small_" + name + "_panel_fence", smallPanelFence, ItemGroup.DECORATIONS);
DecorationsRegistry.add("mini_" + name + "_panel_fence", miniPanelFence, ItemGroup.DECORATIONS);
DecorationsRegistry.add(name + "_step", step, ItemGroup.DECORATIONS);
DecorationsRegistry.add("windowed_" + name + "_door", windowedDoor, ItemGroup.DECORATIONS);
DecorationsRegistry.add(name + "_pane", (Block)pane, ItemGroup.DECORATIONS);
DecorationsRegistry.add("low_" + name + "_pane", (Block)lowPane, ItemGroup.DECORATIONS);
DecorationsRegistry.add(name + "_bars", (Block)bars, ItemGroup.DECORATIONS);
DecorationsRegistry.add(name + "_platform", (Block)platform, ItemGroup.BUILDING_BLOCKS);
DecorationsRegistry.add(name + "_bar_platform", (Block)barPlatform, ItemGroup.DECORATIONS);
DecorationsRegistry.add(name + "_panel", (Block)panel, ItemGroup.DECORATIONS);
DecorationsRegistry.add("small_" + name + "_panel", (Block)smallPanel, ItemGroup.DECORATIONS);
DecorationsRegistry.add("mini_" + name + "_panel", (Block)miniPanel, ItemGroup.DECORATIONS);
DecorationsRegistry.add(name + "_panel_fence", (Block)panelFence, ItemGroup.DECORATIONS);
DecorationsRegistry.add("small_" + name + "_panel_fence", (Block)smallPanelFence, ItemGroup.DECORATIONS);
DecorationsRegistry.add("mini_" + name + "_panel_fence", (Block)miniPanelFence, ItemGroup.DECORATIONS);
DecorationsRegistry.add(name + "_step", (Block)step, ItemGroup.DECORATIONS);
DecorationsRegistry.add("windowed_" + name + "_door", (Block)windowedDoor, ItemGroup.DECORATIONS);
}
registerFlammable(FlammableBlockRegistry registry){
public void registerFlammable(FlammableBlockRegistry registry){
registry.add(pane, 5, 20);
registry.add(lowPane, 5, 20);
registry.add(bars, 5, 20);

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 418 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 B