mirror of
https://github.com/TeamMidnightDust/Decorative.git
synced 2025-12-16 21:15:10 +01:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6aa127ecfe |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,6 +1,7 @@
|
|||||||
# gradle
|
# gradle
|
||||||
|
|
||||||
.gradle/
|
.gradle/
|
||||||
|
build/
|
||||||
out/
|
out/
|
||||||
classes/
|
classes/
|
||||||
|
|
||||||
|
|||||||
@@ -27,12 +27,9 @@ dependencies {
|
|||||||
// Fabric API. This is technically optional, but you probably want it anyway.
|
// Fabric API. This is technically optional, but you probably want it anyway.
|
||||||
modCompile "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
modCompile "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
||||||
|
|
||||||
modCompile("vazkii.patchouli:Patchouli:${project.patchouli_version}")
|
modCompile("vazkii.patchouli:Patchouli_1.15-fabric:${project.patchouli_version}")
|
||||||
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
|
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
|
||||||
// You may need to force-disable transitiveness on them.
|
// You may need to force-disable transitiveness on them.
|
||||||
|
|
||||||
modImplementation "eu.midnightdust:midnight-hats:${midnighthats_version}"
|
|
||||||
include "eu.midnightdust:midnight-hats:${midnighthats_version}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
|
|||||||
Binary file not shown.
@@ -3,17 +3,16 @@ org.gradle.jvmargs=-Xmx1G
|
|||||||
|
|
||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# check these on https://fabricmc.net/use
|
# check these on https://fabricmc.net/use
|
||||||
minecraft_version=1.16.2
|
minecraft_version=1.15.2
|
||||||
yarn_mappings=1.16.2+build.6
|
yarn_mappings=1.15.2+build.17
|
||||||
loader_version=0.9.1+build.205
|
loader_version=0.8.9+build.203
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 3.0.0
|
mod_version = 1.0.0-1.15
|
||||||
maven_group = eu.midnightdust.motschen
|
maven_group = eu.midnightdust.motschen
|
||||||
archives_base_name = decorative
|
archives_base_name = decorative
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
||||||
fabric_version=0.17.2+build.396-1.16
|
fabric_version=0.14.0+build.317-1.15
|
||||||
patchouli_version=1.16-40-FABRIC
|
patchouli_version=1.15.2-1.2-35-FABRIC
|
||||||
midnighthats_version=1.0.2
|
|
||||||
|
|||||||
@@ -1,48 +1,19 @@
|
|||||||
package eu.midnightdust.motschen.decorative;
|
package eu.midnightdust.motschen.decorative;
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.block.render.*;
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.client.renderer.*;
|
|
||||||
import eu.midnightdust.motschen.decorative.init.BathTires;
|
|
||||||
import eu.midnightdust.motschen.decorative.init.BlockEntities;
|
|
||||||
import eu.midnightdust.motschen.decorative.init.Pool;
|
|
||||||
import eu.midnightdust.motschen.decorative.init.Signs;
|
import eu.midnightdust.motschen.decorative.init.Signs;
|
||||||
import net.fabricmc.api.ClientModInitializer;
|
import net.fabricmc.api.ClientModInitializer;
|
||||||
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
|
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
|
||||||
import net.fabricmc.fabric.api.client.rendereregistry.v1.BlockEntityRendererRegistry;
|
|
||||||
import net.fabricmc.fabric.api.client.rendereregistry.v1.EntityRendererRegistry;
|
|
||||||
import net.fabricmc.fabric.api.client.rendering.v1.ColorProviderRegistry;
|
import net.fabricmc.fabric.api.client.rendering.v1.ColorProviderRegistry;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.Blocks;
|
import net.minecraft.block.Blocks;
|
||||||
import net.minecraft.client.color.block.BlockColorProvider;
|
import net.minecraft.client.color.block.BlockColorProvider;
|
||||||
|
import net.minecraft.client.color.item.ItemColorProvider;
|
||||||
import net.minecraft.client.render.RenderLayer;
|
import net.minecraft.client.render.RenderLayer;
|
||||||
|
|
||||||
public class DecorativeClient implements ClientModInitializer {
|
public class DecorativeClient implements ClientModInitializer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitializeClient() {
|
public void onInitializeClient() {
|
||||||
|
|
||||||
EntityRendererRegistry.INSTANCE.register(Pool.BEACH_BALL, (dispatcher, context) -> new BeachBallRenderer(dispatcher));
|
|
||||||
|
|
||||||
EntityRendererRegistry.INSTANCE.register(BathTires.WHITE_BATH_TIRE, (dispatcher, context) -> new WhiteBathTireRenderer(dispatcher));
|
|
||||||
EntityRendererRegistry.INSTANCE.register(BathTires.ORANGE_BATH_TIRE, (dispatcher, context) -> new OrangeBathTireRenderer(dispatcher));
|
|
||||||
EntityRendererRegistry.INSTANCE.register(BathTires.MAGENTA_BATH_TIRE, (dispatcher, context) -> new MagentaBathTireRenderer(dispatcher));
|
|
||||||
EntityRendererRegistry.INSTANCE.register(BathTires.LIGHT_BLUE_BATH_TIRE, (dispatcher, context) -> new LightBlueBathTireRenderer(dispatcher));
|
|
||||||
EntityRendererRegistry.INSTANCE.register(BathTires.YELLOW_BATH_TIRE, (dispatcher, context) -> new YellowBathTireRenderer(dispatcher));
|
|
||||||
EntityRendererRegistry.INSTANCE.register(BathTires.LIME_BATH_TIRE, (dispatcher, context) -> new LimeBathTireRenderer(dispatcher));
|
|
||||||
EntityRendererRegistry.INSTANCE.register(BathTires.PINK_BATH_TIRE, (dispatcher, context) -> new PinkBathTireRenderer(dispatcher));
|
|
||||||
EntityRendererRegistry.INSTANCE.register(BathTires.GRAY_BATH_TIRE, (dispatcher, context) -> new GrayBathTireRenderer(dispatcher));
|
|
||||||
EntityRendererRegistry.INSTANCE.register(BathTires.LIGHT_GRAY_BATH_TIRE, (dispatcher, context) -> new LightGrayBathTireRenderer(dispatcher));
|
|
||||||
EntityRendererRegistry.INSTANCE.register(BathTires.CYAN_BATH_TIRE, (dispatcher, context) -> new CyanBathTireRenderer(dispatcher));
|
|
||||||
EntityRendererRegistry.INSTANCE.register(BathTires.PURPLE_BATH_TIRE, (dispatcher, context) -> new PurpleBathTireRenderer(dispatcher));
|
|
||||||
EntityRendererRegistry.INSTANCE.register(BathTires.BLUE_BATH_TIRE, (dispatcher, context) -> new BlueBathTireRenderer(dispatcher));
|
|
||||||
EntityRendererRegistry.INSTANCE.register(BathTires.BROWN_BATH_TIRE, (dispatcher, context) -> new BrownBathTireRenderer(dispatcher));
|
|
||||||
EntityRendererRegistry.INSTANCE.register(BathTires.GREEN_BATH_TIRE, (dispatcher, context) -> new GreenBathTireRenderer(dispatcher));
|
|
||||||
EntityRendererRegistry.INSTANCE.register(BathTires.RED_BATH_TIRE, (dispatcher, context) -> new RedBathTireRenderer(dispatcher));
|
|
||||||
EntityRendererRegistry.INSTANCE.register(BathTires.BLACK_BATH_TIRE, (dispatcher, context) -> new BlackBathTireRenderer(dispatcher));
|
|
||||||
|
|
||||||
EntityRendererRegistry.INSTANCE.register(BathTires.DUCK_BATH_TIRE, (dispatcher, context) -> new DuckBathTireRenderer(dispatcher));
|
|
||||||
|
|
||||||
|
|
||||||
registerBlockColor(DecorativeMain.BirdBath, Blocks.WATER);
|
registerBlockColor(DecorativeMain.BirdBath, Blocks.WATER);
|
||||||
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(),DecorativeMain.RoadWhiteShort);
|
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(),DecorativeMain.RoadWhiteShort);
|
||||||
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(),DecorativeMain.RoadWhiteLong);
|
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(),DecorativeMain.RoadWhiteLong);
|
||||||
@@ -66,15 +37,6 @@ public class DecorativeClient implements ClientModInitializer {
|
|||||||
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(),DecorativeMain.SlidingDoor);
|
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(),DecorativeMain.SlidingDoor);
|
||||||
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getTranslucent(),DecorativeMain.BirdBath);
|
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getTranslucent(),DecorativeMain.BirdBath);
|
||||||
|
|
||||||
BlockEntityRendererRegistry.INSTANCE.register(BlockEntities.CeilingFanBlockEntity, CeilingFanRenderer::new);
|
|
||||||
|
|
||||||
BlockEntityRendererRegistry.INSTANCE.register(BlockEntities.OakChoppingLogBlockEntity, OakChoppingLogBlockEntityRenderer::new);
|
|
||||||
BlockEntityRendererRegistry.INSTANCE.register(BlockEntities.SpruceChoppingLogBlockEntity, SpruceChoppingLogBlockEntityRenderer::new);
|
|
||||||
BlockEntityRendererRegistry.INSTANCE.register(BlockEntities.BirchChoppingLogBlockEntity, BirchChoppingLogBlockEntityRenderer::new);
|
|
||||||
BlockEntityRendererRegistry.INSTANCE.register(BlockEntities.AcaciaChoppingLogBlockEntity, AcaciaChoppingLogBlockEntityRenderer::new);
|
|
||||||
BlockEntityRendererRegistry.INSTANCE.register(BlockEntities.JungleChoppingLogBlockEntity, JungleChoppingLogBlockEntityRenderer::new);
|
|
||||||
BlockEntityRendererRegistry.INSTANCE.register(BlockEntities.DarkOakChoppingLogBlockEntity, DarkOakChoppingLogBlockEntityRenderer::new);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
public void registerBlockColor(Block block, Block templateBlock) {
|
public void registerBlockColor(Block block, Block templateBlock) {
|
||||||
ColorProviderRegistry.BLOCK.register((type, pos, world, layer) -> {
|
ColorProviderRegistry.BLOCK.register((type, pos, world, layer) -> {
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
package eu.midnightdust.motschen.decorative;
|
package eu.midnightdust.motschen.decorative;
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.block.*;
|
import eu.midnightdust.motschen.decorative.block.*;
|
||||||
import eu.midnightdust.motschen.decorative.blockstates.CeilingFanStage;
|
|
||||||
import eu.midnightdust.motschen.decorative.blockstates.Part;
|
|
||||||
import eu.midnightdust.motschen.decorative.blockstates.PoolShape;
|
|
||||||
import eu.midnightdust.motschen.decorative.blockstates.Program;
|
|
||||||
import eu.midnightdust.motschen.decorative.init.*;
|
import eu.midnightdust.motschen.decorative.init.*;
|
||||||
import eu.midnightdust.motschen.decorative.world.OreFeatureInjector;
|
|
||||||
import eu.midnightdust.motschen.decorative.world.OreFeatures;
|
|
||||||
import net.fabricmc.api.ModInitializer;
|
import net.fabricmc.api.ModInitializer;
|
||||||
import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder;
|
import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
@@ -18,17 +12,15 @@ import net.minecraft.state.property.EnumProperty;
|
|||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
import net.minecraft.util.registry.Registry;
|
import net.minecraft.util.registry.Registry;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
public class DecorativeMain implements ModInitializer {
|
public class DecorativeMain implements ModInitializer {
|
||||||
public static final String MOD_ID = "decorative";
|
public static final String MOD_ID = "decorative";
|
||||||
|
|
||||||
public static final ItemGroup IndoorGroup = FabricItemGroupBuilder.build(new Identifier(MOD_ID, "indoor"), () -> new ItemStack(DecorativeMain.Television));
|
public static final ItemGroup IndoorGroup = FabricItemGroupBuilder.build(new Identifier(MOD_ID, "indoor"), () -> new ItemStack(DecorativeMain.Television));
|
||||||
public static final ItemGroup TrafficGroup = FabricItemGroupBuilder.build(new Identifier(MOD_ID, "traffic"), () -> new ItemStack(DecorativeMain.TrafficCone));
|
public static final ItemGroup TrafficGroup = FabricItemGroupBuilder.build(new Identifier(MOD_ID, "traffic"), () -> new ItemStack(DecorativeMain.TrafficCone));
|
||||||
public static final ItemGroup GardenGroup = FabricItemGroupBuilder.build(new Identifier(MOD_ID, "garden"), () -> new ItemStack(LogsWithAxes.OakChoppingLog));
|
public static final ItemGroup GardenGroup = FabricItemGroupBuilder.build(new Identifier(MOD_ID, "garden"), () -> new ItemStack(LogsWithAxes.OakLogWithAxe));
|
||||||
public static final ItemGroup PoolGroup = FabricItemGroupBuilder.build(new Identifier(MOD_ID, "pool"), () -> new ItemStack(Pool.BEACH_BALL_ITEM));
|
|
||||||
public static final EnumProperty<Program> PROGRAM = EnumProperty.of("program", Program.class);
|
public static final EnumProperty<Program> PROGRAM = EnumProperty.of("program", Program.class);
|
||||||
public static final EnumProperty<PoolShape> POOL_SHAPE = EnumProperty.of("shape", PoolShape.class);
|
|
||||||
public static final EnumProperty<Part> PART = EnumProperty.of("part", Part.class);
|
|
||||||
public static final EnumProperty<CeilingFanStage> STAGE = EnumProperty.of("stage", CeilingFanStage.class);
|
|
||||||
public static Block RockyAsphalt = new Block(FabricBlockSettings.copyOf(Blocks.COAL_ORE));
|
public static Block RockyAsphalt = new Block(FabricBlockSettings.copyOf(Blocks.COAL_ORE));
|
||||||
public static Block Road = new Block(FabricBlockSettings.copyOf(Blocks.STONE));
|
public static Block Road = new Block(FabricBlockSettings.copyOf(Blocks.STONE));
|
||||||
public static Block RoadWhiteShort = new RotatableBlock();
|
public static Block RoadWhiteShort = new RotatableBlock();
|
||||||
@@ -46,59 +38,74 @@ public class DecorativeMain implements ModInitializer {
|
|||||||
public static Block BirdBath = new BirdBath();
|
public static Block BirdBath = new BirdBath();
|
||||||
public static Block ChristmasTree = new ChristmasTree();
|
public static Block ChristmasTree = new ChristmasTree();
|
||||||
public static Block ChristmasLights = new ChristmasLights();
|
public static Block ChristmasLights = new ChristmasLights();
|
||||||
public static Block ShowerHead = new ShowerHead();
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitialize() {
|
public void onInitialize() {
|
||||||
BlockEntities.init();
|
|
||||||
// Traffic //
|
// Traffic //
|
||||||
Registry.register(Registry.BLOCK, new Identifier(MOD_ID,"rocky_asphalt"), RockyAsphalt);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","rocky_asphalt"), RockyAsphalt);
|
||||||
Registry.register(Registry.ITEM, new Identifier(MOD_ID,"rocky_asphalt"), new BlockItem(RockyAsphalt, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","rocky_asphalt"), new BlockItem(RockyAsphalt, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(MOD_ID,"road"), Road);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","road"), Road);
|
||||||
Registry.register(Registry.ITEM, new Identifier(MOD_ID,"road"), new BlockItem(Road, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","road"), new BlockItem(Road, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(MOD_ID,"road_white_short"), RoadWhiteShort);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","road_white_short"), RoadWhiteShort);
|
||||||
Registry.register(Registry.ITEM, new Identifier(MOD_ID,"road_white_short"), new BlockItem(RoadWhiteShort, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","road_white_short"), new BlockItem(RoadWhiteShort, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(MOD_ID,"road_white_long"), RoadWhiteLong);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","road_white_long"), RoadWhiteLong);
|
||||||
Registry.register(Registry.ITEM, new Identifier(MOD_ID,"road_white_long"), new BlockItem(RoadWhiteLong, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","road_white_long"), new BlockItem(RoadWhiteLong, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(MOD_ID,"traffic_cone"), TrafficCone);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","traffic_cone"), TrafficCone);
|
||||||
Registry.register(Registry.ITEM, new Identifier(MOD_ID,"traffic_cone"), new BlockItem(TrafficCone, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","traffic_cone"), new BlockItem(TrafficCone, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(MOD_ID,"fire_hydrant"), FireHydrant);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","fire_hydrant"), FireHydrant);
|
||||||
Registry.register(Registry.ITEM, new Identifier(MOD_ID,"fire_hydrant"), new BlockItem(FireHydrant, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","fire_hydrant"), new BlockItem(FireHydrant, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(MOD_ID,"guardrail"), Guardrail);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","guardrail"), Guardrail);
|
||||||
Registry.register(Registry.ITEM, new Identifier(MOD_ID,"guardrail"), new BlockItem(Guardrail, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","guardrail"), new BlockItem(Guardrail, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(MOD_ID,"sign_post"), SignPost);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","sign_post"), SignPost);
|
||||||
Registry.register(Registry.ITEM, new Identifier(MOD_ID,"sign_post"), new BlockItem(SignPost, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","sign_post"), new BlockItem(SignPost, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
||||||
Signs.init();
|
Signs.init();
|
||||||
|
|
||||||
//Garden//
|
//Garden//
|
||||||
Registry.register(Registry.BLOCK, new Identifier(MOD_ID,"bird_bath"), BirdBath);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","bird_bath"), BirdBath);
|
||||||
Registry.register(Registry.ITEM, new Identifier(MOD_ID,"bird_bath"), new BlockItem(BirdBath, new Item.Settings().group(DecorativeMain.GardenGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","bird_bath"), new BlockItem(BirdBath, new Item.Settings().group(DecorativeMain.GardenGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(MOD_ID,"water_pump"), WaterPump);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","water_pump"), WaterPump);
|
||||||
Registry.register(Registry.ITEM, new Identifier(MOD_ID,"water_pump"), new BlockItem(WaterPump, new Item.Settings().group(DecorativeMain.GardenGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","water_pump"), new BlockItem(WaterPump, new Item.Settings().group(DecorativeMain.GardenGroup)));
|
||||||
LogsWithAxes.init();
|
LogsWithAxes.init();
|
||||||
Pool.init();
|
|
||||||
|
|
||||||
//Furniture//
|
//Furniture//
|
||||||
Registry.register(Registry.BLOCK, new Identifier(MOD_ID,"kitchen_tiles"), KitchenTiles);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","kitchen_tiles"), KitchenTiles);
|
||||||
Registry.register(Registry.ITEM, new Identifier(MOD_ID,"kitchen_tiles"), new BlockItem(KitchenTiles, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","kitchen_tiles"), new BlockItem(KitchenTiles, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(MOD_ID,"television"), Television);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","television"), Television);
|
||||||
Registry.register(Registry.ITEM, new Identifier(MOD_ID,"television"), new BlockItem(Television, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","television"), new BlockItem(Television, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(MOD_ID,"old_television"), OldTelevision);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","old_television"), OldTelevision);
|
||||||
Registry.register(Registry.ITEM, new Identifier(MOD_ID,"old_television"), new BlockItem(OldTelevision, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","old_television"), new BlockItem(OldTelevision, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(MOD_ID,"ceilingfan"), CeilingFan);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","ceilingfan"), CeilingFan);
|
||||||
Registry.register(Registry.ITEM, new Identifier(MOD_ID,"ceilingfan"), new BlockItem(CeilingFan, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","ceilingfan"), new BlockItem(CeilingFan, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(MOD_ID,"shower_head"), ShowerHead);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","sliding_door"), SlidingDoor);
|
||||||
Registry.register(Registry.ITEM, new Identifier(MOD_ID,"shower_head"), new BlockItem(ShowerHead, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","sliding_door"), new BlockItem(SlidingDoor, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(MOD_ID,"sliding_door"), SlidingDoor);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","christmas_tree"), ChristmasTree);
|
||||||
Registry.register(Registry.ITEM, new Identifier(MOD_ID,"sliding_door"), new BlockItem(SlidingDoor, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","christmas_tree"), new BlockItem(ChristmasTree, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(MOD_ID,"christmas_tree"), ChristmasTree);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","christmas_lights"), ChristmasLights);
|
||||||
Registry.register(Registry.ITEM, new Identifier(MOD_ID,"christmas_tree"), new BlockItem(ChristmasTree, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","christmas_lights"), new BlockItem(ChristmasLights, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(MOD_ID,"christmas_lights"), ChristmasLights);
|
|
||||||
Registry.register(Registry.ITEM, new Identifier(MOD_ID,"christmas_lights"), new BlockItem(ChristmasLights, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
|
||||||
|
|
||||||
Lamps.init();
|
Lamps.init();
|
||||||
DoubleLamps.init();
|
DoubleLamps.init();
|
||||||
OreFeatures.init();
|
eu.midnightdust.motschen.decorative.world.RockyAsphalt.initBiomeFeatures();
|
||||||
OreFeatureInjector.init();
|
}
|
||||||
|
public enum Ores implements ItemConvertible {
|
||||||
|
RockyAsphalt(7, 20, 14, 200);
|
||||||
|
|
||||||
|
public final String name;
|
||||||
|
public final int veinSize;
|
||||||
|
public final int veinsPerChunk;
|
||||||
|
public final int minY;
|
||||||
|
public final int maxY;
|
||||||
|
|
||||||
|
Ores(int veinSize, int veinsPerChunk, int minY, int maxY) {
|
||||||
|
name = this.toString().toLowerCase(Locale.ROOT);
|
||||||
|
this.veinSize = veinSize;
|
||||||
|
this.veinsPerChunk = veinsPerChunk;
|
||||||
|
this.minY = minY;
|
||||||
|
this.maxY = maxY;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Item asItem() {
|
||||||
|
return RockyAsphalt.asItem();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package eu.midnightdust.motschen.decorative.blockstates;
|
package eu.midnightdust.motschen.decorative;
|
||||||
|
|
||||||
import net.minecraft.util.StringIdentifiable;
|
import net.minecraft.util.StringIdentifiable;
|
||||||
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.block.blockentity.AcaciaChoppingLogBlockEntity;
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
|
||||||
import net.minecraft.block.*;
|
|
||||||
import net.minecraft.block.entity.BlockEntity;
|
|
||||||
import net.minecraft.item.ItemPlacementContext;
|
|
||||||
import net.minecraft.sound.BlockSoundGroup;
|
|
||||||
import net.minecraft.state.StateManager;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.util.math.Direction;
|
|
||||||
import net.minecraft.world.BlockView;
|
|
||||||
import net.minecraft.world.WorldView;
|
|
||||||
|
|
||||||
public class AcaciaChoppingLog extends HorizontalFacingBlock implements BlockEntityProvider {
|
|
||||||
|
|
||||||
public AcaciaChoppingLog() {
|
|
||||||
super(FabricBlockSettings.copy(Blocks.OAK_PLANKS).nonOpaque().sounds(BlockSoundGroup.WOOD));
|
|
||||||
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BlockState getPlacementState(ItemPlacementContext itemPlacementContext) {
|
|
||||||
return super.getPlacementState(itemPlacementContext)
|
|
||||||
.with(FACING, itemPlacementContext.getPlayerFacing().getOpposite());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
|
||||||
builder.add(FACING);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canPlaceAt(BlockState state, WorldView worldView, BlockPos pos) {
|
|
||||||
return !worldView.isAir(pos.down());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BlockEntity createBlockEntity(BlockView view) {
|
|
||||||
return new AcaciaChoppingLogBlockEntity();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.block.blockentity.BirchChoppingLogBlockEntity;
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
|
||||||
import net.minecraft.block.*;
|
|
||||||
import net.minecraft.block.entity.BlockEntity;
|
|
||||||
import net.minecraft.item.ItemPlacementContext;
|
|
||||||
import net.minecraft.sound.BlockSoundGroup;
|
|
||||||
import net.minecraft.state.StateManager;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.util.math.Direction;
|
|
||||||
import net.minecraft.world.BlockView;
|
|
||||||
import net.minecraft.world.WorldView;
|
|
||||||
|
|
||||||
public class BirchChoppingLog extends HorizontalFacingBlock implements BlockEntityProvider {
|
|
||||||
|
|
||||||
public BirchChoppingLog() {
|
|
||||||
super(FabricBlockSettings.copy(Blocks.OAK_PLANKS).nonOpaque().sounds(BlockSoundGroup.WOOD));
|
|
||||||
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BlockState getPlacementState(ItemPlacementContext itemPlacementContext) {
|
|
||||||
return super.getPlacementState(itemPlacementContext)
|
|
||||||
.with(FACING, itemPlacementContext.getPlayerFacing().getOpposite());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
|
||||||
builder.add(FACING);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canPlaceAt(BlockState state, WorldView worldView, BlockPos pos) {
|
|
||||||
return !worldView.isAir(pos.down());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BlockEntity createBlockEntity(BlockView view) {
|
|
||||||
return new BirchChoppingLogBlockEntity();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -2,6 +2,7 @@ package eu.midnightdust.motschen.decorative.block;
|
|||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.block.*;
|
import net.minecraft.block.*;
|
||||||
|
import net.minecraft.entity.EntityContext;
|
||||||
import net.minecraft.item.ItemPlacementContext;
|
import net.minecraft.item.ItemPlacementContext;
|
||||||
import net.minecraft.sound.BlockSoundGroup;
|
import net.minecraft.sound.BlockSoundGroup;
|
||||||
import net.minecraft.state.StateManager;
|
import net.minecraft.state.StateManager;
|
||||||
@@ -14,7 +15,8 @@ public class BirdBath extends CauldronBlock {
|
|||||||
private static final VoxelShape SHAPE;
|
private static final VoxelShape SHAPE;
|
||||||
|
|
||||||
public BirdBath() {
|
public BirdBath() {
|
||||||
super(FabricBlockSettings.copy(Blocks.CAULDRON).nonOpaque().sounds(BlockSoundGroup.STONE));
|
super(FabricBlockSettings.copy(Blocks.CAULDRON).nonOpaque());
|
||||||
|
this.setDefaultState(this.stateManager.getDefaultState().with(LEVEL, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -24,7 +26,12 @@ public class BirdBath extends CauldronBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||||
|
builder.add(LEVEL);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
|
||||||
return SHAPE;
|
return SHAPE;
|
||||||
}
|
}
|
||||||
static {
|
static {
|
||||||
|
|||||||
@@ -1,18 +1,14 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block;
|
package eu.midnightdust.motschen.decorative.block;
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.blockstates.CeilingFanStage;
|
|
||||||
import eu.midnightdust.motschen.decorative.DecorativeMain;
|
|
||||||
import eu.midnightdust.motschen.decorative.block.blockentity.CeilingFanBlockEntity;
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.block.*;
|
import net.minecraft.block.*;
|
||||||
import net.minecraft.block.entity.BlockEntity;
|
import net.minecraft.entity.EntityContext;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.ItemPlacementContext;
|
import net.minecraft.item.ItemPlacementContext;
|
||||||
import net.minecraft.sound.BlockSoundGroup;
|
import net.minecraft.sound.BlockSoundGroup;
|
||||||
import net.minecraft.sound.SoundCategory;
|
import net.minecraft.sound.SoundCategory;
|
||||||
import net.minecraft.sound.SoundEvents;
|
import net.minecraft.sound.SoundEvents;
|
||||||
import net.minecraft.state.StateManager;
|
import net.minecraft.state.StateManager;
|
||||||
import net.minecraft.state.property.EnumProperty;
|
|
||||||
import net.minecraft.util.ActionResult;
|
import net.minecraft.util.ActionResult;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.hit.BlockHitResult;
|
import net.minecraft.util.hit.BlockHitResult;
|
||||||
@@ -22,41 +18,31 @@ import net.minecraft.world.BlockView;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.WorldView;
|
import net.minecraft.world.WorldView;
|
||||||
|
|
||||||
public class CeilingFan extends Block implements BlockEntityProvider {
|
public class CeilingFan extends RedstoneLampBlock {
|
||||||
private static final VoxelShape SHAPE;
|
private static final VoxelShape SHAPE;
|
||||||
private static final EnumProperty<CeilingFanStage> STAGE = DecorativeMain.STAGE;
|
|
||||||
|
|
||||||
public CeilingFan() {
|
public CeilingFan() {
|
||||||
super(FabricBlockSettings.copy(Blocks.BLACK_CONCRETE).nonOpaque().sounds(BlockSoundGroup.STONE));
|
super(FabricBlockSettings.copy(Blocks.BLACK_CONCRETE).nonOpaque());
|
||||||
this.setDefaultState(this.stateManager.getDefaultState().with(STAGE, CeilingFanStage.OFF));
|
this.setDefaultState(this.stateManager.getDefaultState().with(LIT, true));
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BlockEntity createBlockEntity(BlockView view) {
|
|
||||||
return new CeilingFanBlockEntity();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState getPlacementState(ItemPlacementContext itemPlacementContext) {
|
public BlockState getPlacementState(ItemPlacementContext itemPlacementContext) {
|
||||||
return super.getPlacementState(itemPlacementContext)
|
return super.getPlacementState(itemPlacementContext)
|
||||||
.with(STAGE, CeilingFanStage.OFF);
|
.with(LIT, false);
|
||||||
}
|
}
|
||||||
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
||||||
if (state.get(STAGE) == CeilingFanStage.OFF) {world.setBlockState(pos, state.with(STAGE, CeilingFanStage.LEVEL_1));}
|
world.setBlockState(pos, state.with(LIT, Boolean.valueOf(!state.get(LIT))));
|
||||||
if (state.get(STAGE) == CeilingFanStage.LEVEL_1) {world.setBlockState(pos, state.with(STAGE, CeilingFanStage.LEVEL_2));}
|
world.playSound(player, pos, SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON, SoundCategory.BLOCKS, 0.2f, 0.5f);
|
||||||
if (state.get(STAGE) == CeilingFanStage.LEVEL_2) {world.setBlockState(pos, state.with(STAGE, CeilingFanStage.LEVEL_3));}
|
return ActionResult.SUCCESS;
|
||||||
if (state.get(STAGE) == CeilingFanStage.LEVEL_3) {world.setBlockState(pos, state.with(STAGE, CeilingFanStage.OFF));}
|
|
||||||
|
|
||||||
world.playSound(player, pos, SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON, SoundCategory.BLOCKS, 0.2f, 0.5f);
|
|
||||||
return ActionResult.SUCCESS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||||
builder.add(STAGE);
|
builder.add(LIT);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
|
||||||
return SHAPE;
|
return SHAPE;
|
||||||
}
|
}
|
||||||
static {
|
static {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package eu.midnightdust.motschen.decorative.block;
|
|||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.block.*;
|
import net.minecraft.block.*;
|
||||||
|
import net.minecraft.entity.EntityContext;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.ItemPlacementContext;
|
import net.minecraft.item.ItemPlacementContext;
|
||||||
import net.minecraft.sound.BlockSoundGroup;
|
import net.minecraft.sound.BlockSoundGroup;
|
||||||
@@ -26,10 +27,10 @@ public class ChristmasLights extends HorizontalFacingBlock {
|
|||||||
private static final VoxelShape EAST_SHAPE;
|
private static final VoxelShape EAST_SHAPE;
|
||||||
private static final VoxelShape SOUTH_SHAPE;
|
private static final VoxelShape SOUTH_SHAPE;
|
||||||
private static final VoxelShape WEST_SHAPE;
|
private static final VoxelShape WEST_SHAPE;
|
||||||
public static final BooleanProperty LIT = RedstoneLampBlock.LIT;
|
public static final BooleanProperty LIT = RedstoneTorchBlock.LIT;
|
||||||
|
|
||||||
public ChristmasLights() {
|
public ChristmasLights() {
|
||||||
super(FabricBlockSettings.copy(Blocks.REDSTONE_LAMP).nonOpaque().sounds(BlockSoundGroup.STONE));
|
super(FabricBlockSettings.copy(Blocks.REDSTONE_LAMP).nonOpaque());
|
||||||
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH).with(LIT, Boolean.FALSE));
|
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH).with(LIT, Boolean.FALSE));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,7 +53,7 @@ public class ChristmasLights extends HorizontalFacingBlock {
|
|||||||
builder.add(LIT);
|
builder.add(LIT);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
|
||||||
switch (state.get(FACING)) {
|
switch (state.get(FACING)) {
|
||||||
case NORTH: return NORTH_SHAPE;
|
case NORTH: return NORTH_SHAPE;
|
||||||
case EAST: return EAST_SHAPE;
|
case EAST: return EAST_SHAPE;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package eu.midnightdust.motschen.decorative.block;
|
|||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.block.*;
|
import net.minecraft.block.*;
|
||||||
|
import net.minecraft.entity.EntityContext;
|
||||||
import net.minecraft.sound.BlockSoundGroup;
|
import net.minecraft.sound.BlockSoundGroup;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.shape.VoxelShape;
|
import net.minecraft.util.shape.VoxelShape;
|
||||||
@@ -12,11 +13,11 @@ public class ChristmasTree extends Block{
|
|||||||
private static final VoxelShape SHAPE;
|
private static final VoxelShape SHAPE;
|
||||||
|
|
||||||
public ChristmasTree() {
|
public ChristmasTree() {
|
||||||
super(FabricBlockSettings.copy(Blocks.BLACK_CONCRETE).nonOpaque().sounds(BlockSoundGroup.STONE));
|
super(FabricBlockSettings.copy(Blocks.BLACK_CONCRETE).nonOpaque());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
|
||||||
return SHAPE;
|
return SHAPE;
|
||||||
}
|
}
|
||||||
static {
|
static {
|
||||||
|
|||||||
@@ -1,42 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.block.blockentity.DarkOakChoppingLogBlockEntity;
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
|
||||||
import net.minecraft.block.*;
|
|
||||||
import net.minecraft.block.entity.BlockEntity;
|
|
||||||
import net.minecraft.item.ItemPlacementContext;
|
|
||||||
import net.minecraft.sound.BlockSoundGroup;
|
|
||||||
import net.minecraft.state.StateManager;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.util.math.Direction;
|
|
||||||
import net.minecraft.world.BlockView;
|
|
||||||
import net.minecraft.world.WorldView;
|
|
||||||
|
|
||||||
public class DarkOakChoppingLog extends HorizontalFacingBlock implements BlockEntityProvider {
|
|
||||||
|
|
||||||
public DarkOakChoppingLog() {
|
|
||||||
super(FabricBlockSettings.copy(Blocks.OAK_PLANKS).nonOpaque().sounds(BlockSoundGroup.WOOD));
|
|
||||||
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BlockState getPlacementState(ItemPlacementContext itemPlacementContext) {
|
|
||||||
return super.getPlacementState(itemPlacementContext)
|
|
||||||
.with(FACING, itemPlacementContext.getPlayerFacing().getOpposite());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
|
||||||
builder.add(FACING);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canPlaceAt(BlockState state, WorldView worldView, BlockPos pos) {
|
|
||||||
return !worldView.isAir(pos.down());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BlockEntity createBlockEntity(BlockView view) {
|
|
||||||
return new DarkOakChoppingLogBlockEntity();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -3,12 +3,11 @@ package eu.midnightdust.motschen.decorative.block;
|
|||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.block.*;
|
import net.minecraft.block.*;
|
||||||
import net.minecraft.block.enums.DoubleBlockHalf;
|
import net.minecraft.block.enums.DoubleBlockHalf;
|
||||||
|
import net.minecraft.entity.EntityContext;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.ItemPlacementContext;
|
import net.minecraft.item.ItemPlacementContext;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.server.world.ServerWorld;
|
|
||||||
import net.minecraft.sound.BlockSoundGroup;
|
|
||||||
import net.minecraft.sound.SoundCategory;
|
import net.minecraft.sound.SoundCategory;
|
||||||
import net.minecraft.sound.SoundEvents;
|
import net.minecraft.sound.SoundEvents;
|
||||||
import net.minecraft.state.StateManager;
|
import net.minecraft.state.StateManager;
|
||||||
@@ -23,20 +22,17 @@ import net.minecraft.util.math.Direction;
|
|||||||
import net.minecraft.util.shape.VoxelShape;
|
import net.minecraft.util.shape.VoxelShape;
|
||||||
import net.minecraft.world.BlockView;
|
import net.minecraft.world.BlockView;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.WorldAccess;
|
|
||||||
import net.minecraft.world.WorldView;
|
import net.minecraft.world.WorldView;
|
||||||
|
|
||||||
import java.util.Random;
|
public class DoubleLamp extends RedstoneLampBlock {
|
||||||
|
|
||||||
public class DoubleLamp extends Block {
|
|
||||||
private static final VoxelShape SHAPE_TOP;
|
private static final VoxelShape SHAPE_TOP;
|
||||||
private static final VoxelShape SHAPE_BOTTOM;
|
private static final VoxelShape SHAPE_BOTTOM;
|
||||||
|
|
||||||
public static final BooleanProperty LIT = RedstoneLampBlock.LIT;
|
public static final BooleanProperty LIT = RedstoneTorchBlock.LIT;
|
||||||
public static final EnumProperty<DoubleBlockHalf> HALF = Properties.DOUBLE_BLOCK_HALF;
|
public static final EnumProperty<DoubleBlockHalf> HALF = Properties.DOUBLE_BLOCK_HALF;
|
||||||
|
|
||||||
public DoubleLamp() {
|
public DoubleLamp() {
|
||||||
super(FabricBlockSettings.copy(Blocks.REDSTONE_LAMP).nonOpaque().sounds(BlockSoundGroup.STONE));
|
super(FabricBlockSettings.copy(Blocks.REDSTONE_LAMP).nonOpaque());
|
||||||
this.setDefaultState(this.stateManager.getDefaultState().with(LIT, false).with(HALF, DoubleBlockHalf.LOWER));
|
this.setDefaultState(this.stateManager.getDefaultState().with(LIT, false).with(HALF, DoubleBlockHalf.LOWER));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,36 +51,30 @@ public class DoubleLamp extends Block {
|
|||||||
public void onPlaced(World arg, BlockPos arg2, BlockState arg3, LivingEntity arg4, ItemStack arg5) {
|
public void onPlaced(World arg, BlockPos arg2, BlockState arg3, LivingEntity arg4, ItemStack arg5) {
|
||||||
arg.setBlockState(arg2.up(), arg3.with(HALF, DoubleBlockHalf.UPPER), 3);
|
arg.setBlockState(arg2.up(), arg3.with(HALF, DoubleBlockHalf.UPPER), 3);
|
||||||
}
|
}
|
||||||
@Override
|
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos neighborPos, boolean moved) {
|
||||||
public BlockState getStateForNeighborUpdate(BlockState arg, Direction arg2, BlockState arg3, WorldAccess arg4, BlockPos arg5, BlockPos arg6) {
|
boolean bl = world.isReceivingRedstonePower(pos) || world.isReceivingRedstonePower(pos.offset(state.get(HALF) == DoubleBlockHalf.LOWER ? Direction.UP : Direction.DOWN));
|
||||||
DoubleBlockHalf lv = arg.get(HALF);
|
if (block != this && bl != state.get(LIT)) {
|
||||||
if (arg2.getAxis() == Direction.Axis.Y && lv == DoubleBlockHalf.LOWER == (arg2 == Direction.UP)) {
|
world.setBlockState(pos, state.with(LIT, bl), 2);
|
||||||
if (arg3.isOf(this) && arg3.get(HALF) != lv) {
|
|
||||||
return (arg.with(LIT, arg3.get(LIT)));
|
|
||||||
}
|
|
||||||
return Blocks.AIR.getDefaultState();
|
|
||||||
}
|
}
|
||||||
if (lv == DoubleBlockHalf.LOWER && arg2 == Direction.DOWN && !arg.canPlaceAt(arg4, arg5)) {
|
|
||||||
return Blocks.AIR.getDefaultState();
|
|
||||||
}
|
|
||||||
return super.getStateForNeighborUpdate(arg, arg2, arg3, arg4, arg5, arg6);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) {
|
||||||
public boolean canPlaceAt(BlockState arg, WorldView arg2, BlockPos arg3) {
|
BlockPos blockPos = pos.down();
|
||||||
BlockPos lv = arg3.down();
|
BlockState blockState = world.getBlockState(blockPos);
|
||||||
BlockState lv2 = arg2.getBlockState(lv);
|
if (state.get(HALF) == DoubleBlockHalf.LOWER) {
|
||||||
if (arg.get(HALF) == DoubleBlockHalf.LOWER) {
|
return blockState.isSideSolidFullSquare(world, blockPos, Direction.UP);
|
||||||
return lv2.isSideSolidFullSquare(arg2, lv, Direction.UP);
|
} else {
|
||||||
|
return blockState.getBlock() == this;
|
||||||
}
|
}
|
||||||
return lv2.isOf(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void appendProperties(StateManager.Builder<Block, BlockState> arg) {
|
protected void appendProperties(StateManager.Builder<Block, BlockState> arg) {
|
||||||
arg.add(LIT);
|
arg.add(LIT);
|
||||||
arg.add(HALF);
|
arg.add(HALF);
|
||||||
}
|
}
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, EntityContext context) {
|
||||||
boolean bl = state.get(HALF) == DoubleBlockHalf.UPPER;
|
boolean bl = state.get(HALF) == DoubleBlockHalf.UPPER;
|
||||||
return bl ? SHAPE_TOP : SHAPE_BOTTOM;
|
return bl ? SHAPE_TOP : SHAPE_BOTTOM;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package eu.midnightdust.motschen.decorative.block;
|
|||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.block.*;
|
import net.minecraft.block.*;
|
||||||
|
import net.minecraft.entity.EntityContext;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.ItemPlacementContext;
|
import net.minecraft.item.ItemPlacementContext;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@@ -28,12 +29,12 @@ public class FireHydrant extends HorizontalFacingBlock {
|
|||||||
private static final VoxelShape WEST_SHAPE;
|
private static final VoxelShape WEST_SHAPE;
|
||||||
|
|
||||||
public FireHydrant() {
|
public FireHydrant() {
|
||||||
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque().sounds(BlockSoundGroup.STONE));
|
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque());
|
||||||
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
|
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
|
||||||
}
|
}
|
||||||
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
||||||
ItemStack itemStack = player.getStackInHand(hand);
|
ItemStack itemStack = player.getStackInHand(hand);
|
||||||
if (!itemStack.isEmpty() && hand==Hand.MAIN_HAND) {
|
if (!itemStack.isEmpty()) {
|
||||||
if (itemStack.getItem() == Items.BUCKET) {
|
if (itemStack.getItem() == Items.BUCKET) {
|
||||||
if (!world.isClient) {
|
if (!world.isClient) {
|
||||||
if (!player.abilities.creativeMode) {
|
if (!player.abilities.creativeMode) {
|
||||||
@@ -68,7 +69,7 @@ public class FireHydrant extends HorizontalFacingBlock {
|
|||||||
builder.add(FACING);
|
builder.add(FACING);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
|
||||||
switch (state.get(FACING)) {
|
switch (state.get(FACING)) {
|
||||||
case NORTH: return NORTH_SHAPE;
|
case NORTH: return NORTH_SHAPE;
|
||||||
case EAST: return EAST_SHAPE;
|
case EAST: return EAST_SHAPE;
|
||||||
|
|||||||
@@ -2,14 +2,24 @@ package eu.midnightdust.motschen.decorative.block;
|
|||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.block.*;
|
import net.minecraft.block.*;
|
||||||
|
import net.minecraft.entity.EntityContext;
|
||||||
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.ItemPlacementContext;
|
import net.minecraft.item.ItemPlacementContext;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.item.Items;
|
||||||
import net.minecraft.sound.BlockSoundGroup;
|
import net.minecraft.sound.BlockSoundGroup;
|
||||||
|
import net.minecraft.sound.SoundCategory;
|
||||||
|
import net.minecraft.sound.SoundEvents;
|
||||||
import net.minecraft.state.StateManager;
|
import net.minecraft.state.StateManager;
|
||||||
|
import net.minecraft.util.ActionResult;
|
||||||
|
import net.minecraft.util.Hand;
|
||||||
|
import net.minecraft.util.hit.BlockHitResult;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.Direction;
|
import net.minecraft.util.math.Direction;
|
||||||
import net.minecraft.util.shape.VoxelShape;
|
import net.minecraft.util.shape.VoxelShape;
|
||||||
import net.minecraft.util.shape.VoxelShapes;
|
import net.minecraft.util.shape.VoxelShapes;
|
||||||
import net.minecraft.world.BlockView;
|
import net.minecraft.world.BlockView;
|
||||||
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.WorldView;
|
import net.minecraft.world.WorldView;
|
||||||
|
|
||||||
public class Guardrail extends HorizontalFacingBlock {
|
public class Guardrail extends HorizontalFacingBlock {
|
||||||
@@ -19,9 +29,34 @@ public class Guardrail extends HorizontalFacingBlock {
|
|||||||
private static final VoxelShape WEST_SHAPE;
|
private static final VoxelShape WEST_SHAPE;
|
||||||
|
|
||||||
public Guardrail() {
|
public Guardrail() {
|
||||||
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque().sounds(BlockSoundGroup.STONE));
|
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque());
|
||||||
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
|
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
|
||||||
}
|
}
|
||||||
|
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
||||||
|
ItemStack itemStack = player.getStackInHand(hand);
|
||||||
|
if (!itemStack.isEmpty()) {
|
||||||
|
if (itemStack.getItem() == Items.BUCKET) {
|
||||||
|
if (!world.isClient) {
|
||||||
|
if (!player.abilities.creativeMode) {
|
||||||
|
itemStack.decrement(1);
|
||||||
|
if (itemStack.isEmpty()) {
|
||||||
|
player.setStackInHand(hand, new ItemStack(Items.WATER_BUCKET));
|
||||||
|
} else if (!player.inventory.insertStack(new ItemStack(Items.WATER_BUCKET))) {
|
||||||
|
player.dropItem(new ItemStack(Items.WATER_BUCKET), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
world.playSound(null, pos, SoundEvents.ITEM_BUCKET_FILL, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||||
|
}
|
||||||
|
return ActionResult.SUCCESS;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return ActionResult.PASS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (itemStack.isEmpty()) {
|
||||||
|
return ActionResult.PASS;
|
||||||
|
} return ActionResult.PASS;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState getPlacementState(ItemPlacementContext itemPlacementContext) {
|
public BlockState getPlacementState(ItemPlacementContext itemPlacementContext) {
|
||||||
@@ -34,7 +69,7 @@ public class Guardrail extends HorizontalFacingBlock {
|
|||||||
builder.add(FACING);
|
builder.add(FACING);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
|
||||||
switch (state.get(FACING)) {
|
switch (state.get(FACING)) {
|
||||||
case NORTH: return NORTH_SHAPE;
|
case NORTH: return NORTH_SHAPE;
|
||||||
case EAST: return EAST_SHAPE;
|
case EAST: return EAST_SHAPE;
|
||||||
|
|||||||
@@ -1,42 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.block.blockentity.JungleChoppingLogBlockEntity;
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
|
||||||
import net.minecraft.block.*;
|
|
||||||
import net.minecraft.block.entity.BlockEntity;
|
|
||||||
import net.minecraft.item.ItemPlacementContext;
|
|
||||||
import net.minecraft.sound.BlockSoundGroup;
|
|
||||||
import net.minecraft.state.StateManager;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.util.math.Direction;
|
|
||||||
import net.minecraft.world.BlockView;
|
|
||||||
import net.minecraft.world.WorldView;
|
|
||||||
|
|
||||||
public class JungleChoppingLog extends HorizontalFacingBlock implements BlockEntityProvider {
|
|
||||||
|
|
||||||
public JungleChoppingLog() {
|
|
||||||
super(FabricBlockSettings.copy(Blocks.OAK_PLANKS).nonOpaque().sounds(BlockSoundGroup.WOOD));
|
|
||||||
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BlockState getPlacementState(ItemPlacementContext itemPlacementContext) {
|
|
||||||
return super.getPlacementState(itemPlacementContext)
|
|
||||||
.with(FACING, itemPlacementContext.getPlayerFacing().getOpposite());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
|
||||||
builder.add(FACING);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canPlaceAt(BlockState state, WorldView worldView, BlockPos pos) {
|
|
||||||
return !worldView.isAir(pos.down());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BlockEntity createBlockEntity(BlockView view) {
|
|
||||||
return new JungleChoppingLogBlockEntity();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -2,14 +2,11 @@ package eu.midnightdust.motschen.decorative.block;
|
|||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.block.*;
|
import net.minecraft.block.*;
|
||||||
import net.minecraft.block.enums.DoubleBlockHalf;
|
import net.minecraft.entity.EntityContext;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.ItemPlacementContext;
|
|
||||||
import net.minecraft.sound.BlockSoundGroup;
|
import net.minecraft.sound.BlockSoundGroup;
|
||||||
import net.minecraft.sound.SoundCategory;
|
import net.minecraft.sound.SoundCategory;
|
||||||
import net.minecraft.sound.SoundEvents;
|
import net.minecraft.sound.SoundEvents;
|
||||||
import net.minecraft.state.StateManager;
|
|
||||||
import net.minecraft.state.property.BooleanProperty;
|
|
||||||
import net.minecraft.util.ActionResult;
|
import net.minecraft.util.ActionResult;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.hit.BlockHitResult;
|
import net.minecraft.util.hit.BlockHitResult;
|
||||||
@@ -18,30 +15,19 @@ import net.minecraft.util.shape.VoxelShape;
|
|||||||
import net.minecraft.world.BlockView;
|
import net.minecraft.world.BlockView;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class Lamp extends Block {
|
public class Lamp extends RedstoneLampBlock {
|
||||||
private static final VoxelShape SHAPE;
|
private static final VoxelShape SHAPE;
|
||||||
public static final BooleanProperty LIT = RedstoneLampBlock.LIT;
|
|
||||||
|
|
||||||
public Lamp() {
|
public Lamp() {
|
||||||
super(FabricBlockSettings.copy(Blocks.REDSTONE_LAMP).nonOpaque().sounds(BlockSoundGroup.STONE));
|
super(FabricBlockSettings.copy(Blocks.REDSTONE_LAMP).nonOpaque());
|
||||||
this.setDefaultState(this.stateManager.getDefaultState().with(LIT, false));
|
|
||||||
}
|
}
|
||||||
@Override
|
|
||||||
protected void appendProperties(StateManager.Builder<Block, BlockState> arg) {
|
|
||||||
arg.add(LIT);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public BlockState getPlacementState(ItemPlacementContext arg) {
|
|
||||||
return this.getDefaultState().with(LIT, arg.getWorld().isReceivingRedstonePower(arg.getBlockPos()));
|
|
||||||
}
|
|
||||||
|
|
||||||
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
||||||
world.setBlockState(pos, state.with(LIT, Boolean.valueOf(!state.get(LIT))));
|
world.setBlockState(pos, state.with(LIT, Boolean.valueOf(!state.get(LIT))));
|
||||||
world.playSound(player, pos, SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON, SoundCategory.BLOCKS, 0.2f, 0.5f);
|
world.playSound(player, pos, SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON, SoundCategory.BLOCKS, 0.2f, 0.5f);
|
||||||
return ActionResult.SUCCESS;
|
return ActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
|
||||||
return SHAPE;
|
return SHAPE;
|
||||||
}
|
}
|
||||||
static {
|
static {
|
||||||
|
|||||||
@@ -1,21 +1,18 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block;
|
package eu.midnightdust.motschen.decorative.block;
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.block.blockentity.OakChoppingLogBlockEntity;
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.block.*;
|
import net.minecraft.block.*;
|
||||||
import net.minecraft.block.entity.BlockEntity;
|
|
||||||
import net.minecraft.item.ItemPlacementContext;
|
import net.minecraft.item.ItemPlacementContext;
|
||||||
import net.minecraft.sound.BlockSoundGroup;
|
import net.minecraft.sound.BlockSoundGroup;
|
||||||
import net.minecraft.state.StateManager;
|
import net.minecraft.state.StateManager;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.Direction;
|
import net.minecraft.util.math.Direction;
|
||||||
import net.minecraft.world.BlockView;
|
|
||||||
import net.minecraft.world.WorldView;
|
import net.minecraft.world.WorldView;
|
||||||
|
|
||||||
public class OakChoppingLog extends HorizontalFacingBlock implements BlockEntityProvider {
|
public class LogWithAxe extends HorizontalFacingBlock {
|
||||||
|
|
||||||
public OakChoppingLog() {
|
public LogWithAxe() {
|
||||||
super(FabricBlockSettings.copy(Blocks.OAK_PLANKS).nonOpaque().sounds(BlockSoundGroup.WOOD));
|
super(FabricBlockSettings.copy(Blocks.OAK_PLANKS).nonOpaque());
|
||||||
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
|
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,9 +31,4 @@ public class OakChoppingLog extends HorizontalFacingBlock implements BlockEntity
|
|||||||
return !worldView.isAir(pos.down());
|
return !worldView.isAir(pos.down());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public BlockEntity createBlockEntity(BlockView view) {
|
|
||||||
return new OakChoppingLogBlockEntity();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block;
|
package eu.midnightdust.motschen.decorative.block;
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.DecorativeMain;
|
import eu.midnightdust.motschen.decorative.DecorativeMain;
|
||||||
import eu.midnightdust.motschen.decorative.blockstates.Program;
|
import eu.midnightdust.motschen.decorative.Program;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.block.*;
|
import net.minecraft.block.*;
|
||||||
|
import net.minecraft.entity.EntityContext;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.ItemPlacementContext;
|
import net.minecraft.item.ItemPlacementContext;
|
||||||
import net.minecraft.sound.BlockSoundGroup;
|
import net.minecraft.sound.BlockSoundGroup;
|
||||||
@@ -22,8 +23,6 @@ import net.minecraft.world.BlockView;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.WorldView;
|
import net.minecraft.world.WorldView;
|
||||||
|
|
||||||
import java.util.function.ToIntFunction;
|
|
||||||
|
|
||||||
public class OldTelevision extends HorizontalFacingBlock {
|
public class OldTelevision extends HorizontalFacingBlock {
|
||||||
|
|
||||||
private static final VoxelShape NORTH_SHAPE;
|
private static final VoxelShape NORTH_SHAPE;
|
||||||
@@ -33,7 +32,7 @@ public class OldTelevision extends HorizontalFacingBlock {
|
|||||||
private static final EnumProperty<Program> PROGRAM = DecorativeMain.PROGRAM;
|
private static final EnumProperty<Program> PROGRAM = DecorativeMain.PROGRAM;
|
||||||
|
|
||||||
public OldTelevision() {
|
public OldTelevision() {
|
||||||
super(FabricBlockSettings.copy(Blocks.BLACK_CONCRETE).nonOpaque().sounds(BlockSoundGroup.STONE).lightLevel(createLightLevelFromBlockState(15)));
|
super(FabricBlockSettings.copy(Blocks.BLACK_CONCRETE).nonOpaque());
|
||||||
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH).with(PROGRAM, Program.OFF));
|
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH).with(PROGRAM, Program.OFF));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +70,7 @@ public class OldTelevision extends HorizontalFacingBlock {
|
|||||||
builder.add(PROGRAM);
|
builder.add(PROGRAM);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
|
||||||
switch (state.get(FACING)) {
|
switch (state.get(FACING)) {
|
||||||
case NORTH: return NORTH_SHAPE;
|
case NORTH: return NORTH_SHAPE;
|
||||||
case EAST: return EAST_SHAPE;
|
case EAST: return EAST_SHAPE;
|
||||||
@@ -104,15 +103,4 @@ public class OldTelevision extends HorizontalFacingBlock {
|
|||||||
return !worldView.isAir(pos.down());
|
return !worldView.isAir(pos.down());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ToIntFunction<BlockState> createLightLevelFromBlockState(int litLevel) {
|
|
||||||
return (blockState) -> {
|
|
||||||
if (blockState.get(PROGRAM) == Program.OFF) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return 11;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,96 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.block.blockentity.PoolSprinklerBlockEntity;
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
|
||||||
import net.minecraft.block.*;
|
|
||||||
import net.minecraft.block.entity.BlockEntity;
|
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
|
||||||
import net.minecraft.item.ItemPlacementContext;
|
|
||||||
import net.minecraft.sound.BlockSoundGroup;
|
|
||||||
import net.minecraft.sound.SoundCategory;
|
|
||||||
import net.minecraft.sound.SoundEvents;
|
|
||||||
import net.minecraft.state.StateManager;
|
|
||||||
import net.minecraft.state.property.BooleanProperty;
|
|
||||||
import net.minecraft.util.ActionResult;
|
|
||||||
import net.minecraft.util.Hand;
|
|
||||||
import net.minecraft.util.hit.BlockHitResult;
|
|
||||||
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;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.WorldView;
|
|
||||||
|
|
||||||
public class PoolSprinkler extends HorizontalFacingBlock implements BlockEntityProvider {
|
|
||||||
|
|
||||||
private static final VoxelShape NORTH_SHAPE;
|
|
||||||
private static final VoxelShape EAST_SHAPE;
|
|
||||||
private static final VoxelShape SOUTH_SHAPE;
|
|
||||||
private static final VoxelShape WEST_SHAPE;
|
|
||||||
public static final BooleanProperty POWERED = DoorBlock.POWERED;
|
|
||||||
|
|
||||||
public PoolSprinkler() {
|
|
||||||
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque().sounds(BlockSoundGroup.STONE));
|
|
||||||
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH).with(POWERED, Boolean.FALSE));
|
|
||||||
}
|
|
||||||
|
|
||||||
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
|
||||||
world.setBlockState(pos, state.with(POWERED, Boolean.valueOf(!state.get(POWERED))));
|
|
||||||
world.playSound(player, pos, SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON, SoundCategory.BLOCKS, 0.2f, 0.5f);
|
|
||||||
return ActionResult.SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BlockState getPlacementState(ItemPlacementContext itemPlacementContext) {
|
|
||||||
return super.getPlacementState(itemPlacementContext)
|
|
||||||
.with(FACING, itemPlacementContext.getPlayerFacing().getOpposite())
|
|
||||||
.with(POWERED, Boolean.FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
|
||||||
builder.add(FACING);
|
|
||||||
builder.add(POWERED);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
|
||||||
switch (state.get(FACING)) {
|
|
||||||
case NORTH: return NORTH_SHAPE;
|
|
||||||
case EAST: return EAST_SHAPE;
|
|
||||||
case SOUTH: return SOUTH_SHAPE;
|
|
||||||
case WEST: return WEST_SHAPE;
|
|
||||||
default: return super.getOutlineShape(state, view, pos, context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
static {
|
|
||||||
VoxelShape post = createCuboidShape(7, 0, 0, 9, 13, 2);
|
|
||||||
VoxelShape upper = createCuboidShape(7, 9.65, -6.2, 9, 13, 1);
|
|
||||||
VoxelShape shape = VoxelShapes.union(post, upper);
|
|
||||||
|
|
||||||
NORTH_SHAPE = shape;
|
|
||||||
WEST_SHAPE = rotate(Direction.EAST, Direction.NORTH, shape);
|
|
||||||
EAST_SHAPE = rotate(Direction.EAST, Direction.SOUTH, shape);
|
|
||||||
SOUTH_SHAPE = rotate(Direction.EAST, Direction.WEST, shape);
|
|
||||||
}
|
|
||||||
private static VoxelShape rotate(Direction from, Direction to, VoxelShape shape) {
|
|
||||||
VoxelShape[] buffer = new VoxelShape[]{ shape, VoxelShapes.empty() };
|
|
||||||
|
|
||||||
int times = (to.getHorizontal() - from.getHorizontal() + 4) % 4;
|
|
||||||
for (int i = 0; i < times; i++) {
|
|
||||||
buffer[0].forEachBox((minX, minY, minZ, maxX, maxY, maxZ) -> buffer[1] = VoxelShapes.union(buffer[1], VoxelShapes.cuboid(1-maxZ, minY, minX, 1-minZ, maxY, maxX)));
|
|
||||||
buffer[0] = buffer[1];
|
|
||||||
buffer[1] = VoxelShapes.empty();
|
|
||||||
}
|
|
||||||
|
|
||||||
return buffer[0];
|
|
||||||
}
|
|
||||||
public boolean canPlaceAt(BlockState state, WorldView worldView, BlockPos pos) {
|
|
||||||
return !worldView.isAir(pos.down());
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public BlockEntity createBlockEntity(BlockView world) {
|
|
||||||
return new PoolSprinklerBlockEntity();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.DecorativeMain;
|
|
||||||
import eu.midnightdust.motschen.decorative.blockstates.PoolShape;
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
|
||||||
import net.minecraft.block.*;
|
|
||||||
import net.minecraft.fluid.FluidState;
|
|
||||||
import net.minecraft.fluid.Fluids;
|
|
||||||
import net.minecraft.item.ItemPlacementContext;
|
|
||||||
import net.minecraft.sound.BlockSoundGroup;
|
|
||||||
import net.minecraft.state.StateManager;
|
|
||||||
import net.minecraft.state.property.BooleanProperty;
|
|
||||||
import net.minecraft.state.property.DirectionProperty;
|
|
||||||
import net.minecraft.state.property.EnumProperty;
|
|
||||||
import net.minecraft.state.property.Properties;
|
|
||||||
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 PoolWall extends HorizontalFacingBlock implements Waterloggable {
|
|
||||||
public static final DirectionProperty FACING = DoorBlock.FACING;
|
|
||||||
public static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED;
|
|
||||||
public static final EnumProperty<PoolShape> SHAPE = DecorativeMain.POOL_SHAPE;
|
|
||||||
private static final VoxelShape NORTH_SHAPE;
|
|
||||||
private static final VoxelShape EAST_SHAPE;
|
|
||||||
private static final VoxelShape SOUTH_SHAPE;
|
|
||||||
private static final VoxelShape WEST_SHAPE;
|
|
||||||
private static final VoxelShape NORTH_WEST_CORNER_SHAPE;
|
|
||||||
private static final VoxelShape SOUTH_WEST_CORNER_SHAPE;
|
|
||||||
private static final VoxelShape NORTH_EAST_CORNER_SHAPE;
|
|
||||||
private static final VoxelShape SOUTH_EAST_CORNER_SHAPE;
|
|
||||||
|
|
||||||
|
|
||||||
public PoolWall() {
|
|
||||||
super(FabricBlockSettings.copy(Blocks.STONE_STAIRS).nonOpaque().sounds(BlockSoundGroup.STONE));
|
|
||||||
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH).with(SHAPE, PoolShape.STRAIGHT).with(WATERLOGGED, false));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public FluidState getFluidState(BlockState blockState_1) {
|
|
||||||
return blockState_1.get(WATERLOGGED) ? Fluids.WATER.getStill(true) : super.getFluidState(blockState_1);
|
|
||||||
}
|
|
||||||
|
|
||||||
public BlockState getPlacementState(ItemPlacementContext ctx) {
|
|
||||||
BlockPos blockPos = ctx.getBlockPos();
|
|
||||||
FluidState fluidState = ctx.getWorld().getFluidState(blockPos);
|
|
||||||
BlockState blockState = this.getDefaultState().with(FACING, ctx.getPlayerFacing().getOpposite()).with(WATERLOGGED, fluidState.getFluid() == Fluids.WATER);
|
|
||||||
return blockState.with(SHAPE, getPoolShape(blockState, ctx.getWorld(), blockPos));
|
|
||||||
}
|
|
||||||
|
|
||||||
private static PoolShape getPoolShape(BlockState state, BlockView view, BlockPos pos) {
|
|
||||||
Direction direction = state.get(FACING).getOpposite();
|
|
||||||
BlockState blockState2 = view.getBlockState(pos.offset(direction.getOpposite()));
|
|
||||||
if (isPoolWall(blockState2)) {
|
|
||||||
Direction direction3 = blockState2.get(FACING).getOpposite();
|
|
||||||
if (direction3.getAxis() != (state.get(FACING).getOpposite()).getAxis() && getSide(state, view, pos, direction3)) {
|
|
||||||
if (direction3 == direction.rotateYCounterclockwise()) {
|
|
||||||
return PoolShape.INNER_LEFT;
|
|
||||||
}
|
|
||||||
|
|
||||||
return PoolShape.INNER_RIGHT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return PoolShape.STRAIGHT;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static boolean getSide(BlockState state, BlockView view, BlockPos pos, Direction dir) {
|
|
||||||
BlockState blockState = view.getBlockState(pos.offset(dir));
|
|
||||||
return !isPoolWall(blockState) || blockState.get(FACING) != state.get(FACING);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isPoolWall(BlockState state) {
|
|
||||||
return state.getBlock() instanceof PoolWall;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
|
||||||
builder.add(FACING,SHAPE,WATERLOGGED);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
|
||||||
switch (state.get(FACING)) {
|
|
||||||
case NORTH: switch (state.get(SHAPE)) { case STRAIGHT: return NORTH_SHAPE; case INNER_LEFT: return NORTH_WEST_CORNER_SHAPE; case INNER_RIGHT: return NORTH_EAST_CORNER_SHAPE;}
|
|
||||||
case EAST: switch (state.get(SHAPE)) { case STRAIGHT: return EAST_SHAPE; case INNER_LEFT: return NORTH_EAST_CORNER_SHAPE; case INNER_RIGHT: return SOUTH_EAST_CORNER_SHAPE;}
|
|
||||||
case SOUTH: switch (state.get(SHAPE)) { case STRAIGHT: return SOUTH_SHAPE; case INNER_LEFT: return SOUTH_EAST_CORNER_SHAPE; case INNER_RIGHT: return SOUTH_WEST_CORNER_SHAPE;}
|
|
||||||
case WEST: switch (state.get(SHAPE)) { case STRAIGHT: return WEST_SHAPE; case INNER_LEFT: return SOUTH_WEST_CORNER_SHAPE; case INNER_RIGHT: return NORTH_WEST_CORNER_SHAPE;}
|
|
||||||
default: return super.getOutlineShape(state, view, pos, context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
static {
|
|
||||||
VoxelShape base = createCuboidShape(0, 0, 15, 16, 16, 16);
|
|
||||||
VoxelShape corner = createCuboidShape(15, 0, 0, 16, 16, 16);
|
|
||||||
VoxelShape corner_shapes = VoxelShapes.union(base, corner);
|
|
||||||
|
|
||||||
NORTH_SHAPE = base;
|
|
||||||
WEST_SHAPE = rotate(Direction.EAST, Direction.NORTH, base);
|
|
||||||
EAST_SHAPE = rotate(Direction.EAST, Direction.SOUTH, base);
|
|
||||||
SOUTH_SHAPE = rotate(Direction.EAST, Direction.WEST, base);
|
|
||||||
NORTH_WEST_CORNER_SHAPE = corner_shapes;
|
|
||||||
SOUTH_WEST_CORNER_SHAPE = rotate(Direction.EAST, Direction.NORTH, corner_shapes);
|
|
||||||
NORTH_EAST_CORNER_SHAPE = rotate(Direction.EAST, Direction.SOUTH, corner_shapes);
|
|
||||||
SOUTH_EAST_CORNER_SHAPE = rotate(Direction.EAST, Direction.WEST, corner_shapes);
|
|
||||||
}
|
|
||||||
private static VoxelShape rotate(Direction from, Direction to, VoxelShape shape) {
|
|
||||||
VoxelShape[] buffer = new VoxelShape[]{ shape, VoxelShapes.empty() };
|
|
||||||
|
|
||||||
int times = (to.getHorizontal() - from.getHorizontal() + 4) % 4;
|
|
||||||
for (int i = 0; i < times; i++) {
|
|
||||||
buffer[0].forEachBox((minX, minY, minZ, maxX, maxY, maxZ) -> buffer[1] = VoxelShapes.union(buffer[1], VoxelShapes.cuboid(1-maxZ, minY, minX, 1-minZ, maxY, maxX)));
|
|
||||||
buffer[0] = buffer[1];
|
|
||||||
buffer[1] = VoxelShapes.empty();
|
|
||||||
}
|
|
||||||
|
|
||||||
return buffer[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -8,12 +8,14 @@ import net.minecraft.block.HorizontalFacingBlock;
|
|||||||
import net.minecraft.item.ItemPlacementContext;
|
import net.minecraft.item.ItemPlacementContext;
|
||||||
import net.minecraft.sound.BlockSoundGroup;
|
import net.minecraft.sound.BlockSoundGroup;
|
||||||
import net.minecraft.state.StateManager;
|
import net.minecraft.state.StateManager;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.Direction;
|
import net.minecraft.util.math.Direction;
|
||||||
|
import net.minecraft.world.WorldView;
|
||||||
|
|
||||||
public class RotatableBlock extends HorizontalFacingBlock {
|
public class RotatableBlock extends HorizontalFacingBlock {
|
||||||
|
|
||||||
public RotatableBlock() {
|
public RotatableBlock() {
|
||||||
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque().sounds(BlockSoundGroup.STONE));
|
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque());
|
||||||
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
|
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,4 +30,8 @@ public class RotatableBlock extends HorizontalFacingBlock {
|
|||||||
builder.add(FACING);
|
builder.add(FACING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean canPlaceAt(BlockState state, WorldView worldView, BlockPos pos) {
|
||||||
|
return !worldView.isAir(pos.down());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,98 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.block.blockentity.ShowerHeadBlockEntity;
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
|
||||||
import net.minecraft.block.*;
|
|
||||||
import net.minecraft.block.entity.BlockEntity;
|
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
|
||||||
import net.minecraft.item.ItemPlacementContext;
|
|
||||||
import net.minecraft.sound.BlockSoundGroup;
|
|
||||||
import net.minecraft.sound.SoundCategory;
|
|
||||||
import net.minecraft.sound.SoundEvents;
|
|
||||||
import net.minecraft.state.StateManager;
|
|
||||||
import net.minecraft.state.property.BooleanProperty;
|
|
||||||
import net.minecraft.util.ActionResult;
|
|
||||||
import net.minecraft.util.Hand;
|
|
||||||
import net.minecraft.util.hit.BlockHitResult;
|
|
||||||
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;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.WorldView;
|
|
||||||
|
|
||||||
public class ShowerHead extends HorizontalFacingBlock implements BlockEntityProvider {
|
|
||||||
|
|
||||||
private static final VoxelShape NORTH_SHAPE;
|
|
||||||
private static final VoxelShape EAST_SHAPE;
|
|
||||||
private static final VoxelShape SOUTH_SHAPE;
|
|
||||||
private static final VoxelShape WEST_SHAPE;
|
|
||||||
public static final BooleanProperty POWERED = DoorBlock.POWERED;
|
|
||||||
|
|
||||||
public ShowerHead() {
|
|
||||||
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque().sounds(BlockSoundGroup.STONE));
|
|
||||||
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH).with(POWERED, Boolean.FALSE));
|
|
||||||
}
|
|
||||||
|
|
||||||
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
|
||||||
world.setBlockState(pos, state.with(POWERED, Boolean.valueOf(!state.get(POWERED))));
|
|
||||||
world.playSound(player, pos, SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON, SoundCategory.BLOCKS, 0.2f, 0.5f);
|
|
||||||
return ActionResult.SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BlockState getPlacementState(ItemPlacementContext itemPlacementContext) {
|
|
||||||
return super.getPlacementState(itemPlacementContext)
|
|
||||||
.with(FACING, itemPlacementContext.getPlayerFacing().getOpposite())
|
|
||||||
.with(POWERED, Boolean.FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
|
||||||
builder.add(FACING);
|
|
||||||
builder.add(POWERED);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
|
||||||
switch (state.get(FACING)) {
|
|
||||||
case NORTH: return NORTH_SHAPE;
|
|
||||||
case EAST: return EAST_SHAPE;
|
|
||||||
case SOUTH: return SOUTH_SHAPE;
|
|
||||||
case WEST: return WEST_SHAPE;
|
|
||||||
default: return super.getOutlineShape(state, view, pos, context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
static {
|
|
||||||
VoxelShape pipe = createCuboidShape(7, 12, 8.75, 9, 14, 16);
|
|
||||||
VoxelShape pivot_pipe = createCuboidShape(7, 12, 8.25, 9, 13, 11);
|
|
||||||
VoxelShape pivot_pipe2 = createCuboidShape(7, 10.5, 7.25, 9, 12, 11);
|
|
||||||
VoxelShape head = createCuboidShape(4, 9.75, 5, 12, 11.25, 13);
|
|
||||||
VoxelShape shape = VoxelShapes.union(pipe, head, pivot_pipe, pivot_pipe2);
|
|
||||||
|
|
||||||
NORTH_SHAPE = shape;
|
|
||||||
WEST_SHAPE = rotate(Direction.EAST, Direction.NORTH, shape);
|
|
||||||
EAST_SHAPE = rotate(Direction.EAST, Direction.SOUTH, shape);
|
|
||||||
SOUTH_SHAPE = rotate(Direction.EAST, Direction.WEST, shape);
|
|
||||||
}
|
|
||||||
private static VoxelShape rotate(Direction from, Direction to, VoxelShape shape) {
|
|
||||||
VoxelShape[] buffer = new VoxelShape[]{ shape, VoxelShapes.empty() };
|
|
||||||
|
|
||||||
int times = (to.getHorizontal() - from.getHorizontal() + 4) % 4;
|
|
||||||
for (int i = 0; i < times; i++) {
|
|
||||||
buffer[0].forEachBox((minX, minY, minZ, maxX, maxY, maxZ) -> buffer[1] = VoxelShapes.union(buffer[1], VoxelShapes.cuboid(1-maxZ, minY, minX, 1-minZ, maxY, maxX)));
|
|
||||||
buffer[0] = buffer[1];
|
|
||||||
buffer[1] = VoxelShapes.empty();
|
|
||||||
}
|
|
||||||
|
|
||||||
return buffer[0];
|
|
||||||
}
|
|
||||||
public boolean canPlaceAt(BlockState state, WorldView worldView, BlockPos pos) {
|
|
||||||
return !worldView.isAir(pos.north()) | !worldView.isAir(pos.east()) | !worldView.isAir(pos.south()) | !worldView.isAir(pos.west());
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public BlockEntity createBlockEntity(BlockView world) {
|
|
||||||
return new ShowerHeadBlockEntity();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -2,14 +2,24 @@ package eu.midnightdust.motschen.decorative.block;
|
|||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.block.*;
|
import net.minecraft.block.*;
|
||||||
|
import net.minecraft.entity.EntityContext;
|
||||||
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.ItemPlacementContext;
|
import net.minecraft.item.ItemPlacementContext;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.item.Items;
|
||||||
import net.minecraft.sound.BlockSoundGroup;
|
import net.minecraft.sound.BlockSoundGroup;
|
||||||
|
import net.minecraft.sound.SoundCategory;
|
||||||
|
import net.minecraft.sound.SoundEvents;
|
||||||
import net.minecraft.state.StateManager;
|
import net.minecraft.state.StateManager;
|
||||||
|
import net.minecraft.util.ActionResult;
|
||||||
|
import net.minecraft.util.Hand;
|
||||||
|
import net.minecraft.util.hit.BlockHitResult;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.Direction;
|
import net.minecraft.util.math.Direction;
|
||||||
import net.minecraft.util.shape.VoxelShape;
|
import net.minecraft.util.shape.VoxelShape;
|
||||||
import net.minecraft.util.shape.VoxelShapes;
|
import net.minecraft.util.shape.VoxelShapes;
|
||||||
import net.minecraft.world.BlockView;
|
import net.minecraft.world.BlockView;
|
||||||
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.WorldView;
|
import net.minecraft.world.WorldView;
|
||||||
|
|
||||||
public class Sign extends HorizontalFacingBlock {
|
public class Sign extends HorizontalFacingBlock {
|
||||||
@@ -19,7 +29,7 @@ public class Sign extends HorizontalFacingBlock {
|
|||||||
private static final VoxelShape WEST_SHAPE;
|
private static final VoxelShape WEST_SHAPE;
|
||||||
|
|
||||||
public Sign() {
|
public Sign() {
|
||||||
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque().sounds(BlockSoundGroup.STONE));
|
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque());
|
||||||
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
|
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,7 +44,7 @@ public class Sign extends HorizontalFacingBlock {
|
|||||||
builder.add(FACING);
|
builder.add(FACING);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
|
||||||
switch (state.get(FACING)) {
|
switch (state.get(FACING)) {
|
||||||
case NORTH: return NORTH_SHAPE;
|
case NORTH: return NORTH_SHAPE;
|
||||||
case EAST: return EAST_SHAPE;
|
case EAST: return EAST_SHAPE;
|
||||||
|
|||||||
@@ -4,8 +4,7 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
|||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.block.Blocks;
|
import net.minecraft.block.Blocks;
|
||||||
import net.minecraft.block.ShapeContext;
|
import net.minecraft.entity.EntityContext;
|
||||||
import net.minecraft.sound.BlockSoundGroup;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.shape.VoxelShape;
|
import net.minecraft.util.shape.VoxelShape;
|
||||||
import net.minecraft.world.BlockView;
|
import net.minecraft.world.BlockView;
|
||||||
@@ -15,11 +14,11 @@ public class SignPost extends Block {
|
|||||||
private static final VoxelShape SHAPE;
|
private static final VoxelShape SHAPE;
|
||||||
|
|
||||||
public SignPost() {
|
public SignPost() {
|
||||||
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque().sounds(BlockSoundGroup.STONE));
|
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
|
||||||
return SHAPE;
|
return SHAPE;
|
||||||
}
|
}
|
||||||
static {
|
static {
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ package eu.midnightdust.motschen.decorative.block;
|
|||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.block.*;
|
import net.minecraft.block.*;
|
||||||
import net.minecraft.block.enums.DoorHinge;
|
import net.minecraft.block.enums.DoorHinge;
|
||||||
|
import net.minecraft.entity.EntityContext;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
import net.minecraft.item.ItemPlacementContext;
|
||||||
import net.minecraft.sound.BlockSoundGroup;
|
import net.minecraft.sound.BlockSoundGroup;
|
||||||
import net.minecraft.sound.SoundCategory;
|
import net.minecraft.sound.SoundCategory;
|
||||||
import net.minecraft.sound.SoundEvents;
|
import net.minecraft.sound.SoundEvents;
|
||||||
@@ -16,6 +18,7 @@ import net.minecraft.util.shape.VoxelShape;
|
|||||||
import net.minecraft.util.shape.VoxelShapes;
|
import net.minecraft.util.shape.VoxelShapes;
|
||||||
import net.minecraft.world.BlockView;
|
import net.minecraft.world.BlockView;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.WorldView;
|
||||||
|
|
||||||
public class SlidingDoor extends DoorBlock {
|
public class SlidingDoor extends DoorBlock {
|
||||||
|
|
||||||
@@ -29,7 +32,7 @@ public class SlidingDoor extends DoorBlock {
|
|||||||
private static final VoxelShape WEST_SHAPE_OPEN;
|
private static final VoxelShape WEST_SHAPE_OPEN;
|
||||||
|
|
||||||
public SlidingDoor() {
|
public SlidingDoor() {
|
||||||
super(FabricBlockSettings.copy(Blocks.BLACK_CONCRETE).nonOpaque().sounds(BlockSoundGroup.STONE));
|
super(FabricBlockSettings.copy(Blocks.BLACK_CONCRETE).nonOpaque());
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
||||||
@@ -39,7 +42,7 @@ public class SlidingDoor extends DoorBlock {
|
|||||||
return ActionResult.SUCCESS;
|
return ActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, EntityContext context) {
|
||||||
state.get(FACING);
|
state.get(FACING);
|
||||||
boolean bl = !state.get(OPEN);
|
boolean bl = !state.get(OPEN);
|
||||||
boolean bl2 = state.get(HINGE) == DoorHinge.RIGHT;
|
boolean bl2 = state.get(HINGE) == DoorHinge.RIGHT;
|
||||||
|
|||||||
@@ -1,235 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.DecorativeMain;
|
|
||||||
import eu.midnightdust.motschen.decorative.blockstates.Part;
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
|
||||||
import net.minecraft.block.*;
|
|
||||||
import net.minecraft.entity.LivingEntity;
|
|
||||||
import net.minecraft.entity.effect.StatusEffectInstance;
|
|
||||||
import net.minecraft.entity.effect.StatusEffects;
|
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
|
||||||
import net.minecraft.item.ItemPlacementContext;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.sound.BlockSoundGroup;
|
|
||||||
import net.minecraft.state.StateManager;
|
|
||||||
import net.minecraft.state.property.EnumProperty;
|
|
||||||
import net.minecraft.util.ActionResult;
|
|
||||||
import net.minecraft.util.Hand;
|
|
||||||
import net.minecraft.util.hit.BlockHitResult;
|
|
||||||
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;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.WorldView;
|
|
||||||
|
|
||||||
public class Springboard extends HorizontalFacingBlock {
|
|
||||||
private static final VoxelShape NORTH_SHAPE_FRONT;
|
|
||||||
private static final VoxelShape EAST_SHAPE_FRONT;
|
|
||||||
private static final VoxelShape SOUTH_SHAPE_FRONT;
|
|
||||||
private static final VoxelShape WEST_SHAPE_FRONT;
|
|
||||||
private static final VoxelShape NORTH_SHAPE_BACK;
|
|
||||||
private static final VoxelShape EAST_SHAPE_BACK;
|
|
||||||
private static final VoxelShape SOUTH_SHAPE_BACK;
|
|
||||||
private static final VoxelShape WEST_SHAPE_BACK;
|
|
||||||
private static final EnumProperty<Part> PART = DecorativeMain.PART;
|
|
||||||
|
|
||||||
public Springboard() {
|
|
||||||
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque().sounds(BlockSoundGroup.STONE));
|
|
||||||
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH).with(PART, Part.BACK));
|
|
||||||
}
|
|
||||||
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
|
||||||
ItemStack itemStack = player.getStackInHand(hand);
|
|
||||||
if (!world.isClient) {
|
|
||||||
if (itemStack.isEmpty() && hand==Hand.MAIN_HAND) {
|
|
||||||
switch (state.get(PART)) {
|
|
||||||
case FRONT:
|
|
||||||
if (player.getY() >= pos.getY()+0.1 && player.squaredDistanceTo(pos.getX(), pos.getY(), pos.getZ()) <= 1.0) {
|
|
||||||
player.addStatusEffect(new StatusEffectInstance(StatusEffects.LEVITATION, 10, 10));
|
|
||||||
return ActionResult.SUCCESS;
|
|
||||||
}
|
|
||||||
else return ActionResult.FAIL;
|
|
||||||
default:
|
|
||||||
return ActionResult.FAIL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else return ActionResult.FAIL;
|
|
||||||
}
|
|
||||||
else return ActionResult.FAIL;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public BlockState getPlacementState(ItemPlacementContext itemPlacementContext) {
|
|
||||||
return super.getPlacementState(itemPlacementContext)
|
|
||||||
.with(FACING, itemPlacementContext.getPlayerFacing())
|
|
||||||
.with(PART, Part.BACK);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPlaced(World arg, BlockPos pos, BlockState state, LivingEntity arg4, ItemStack arg5) {
|
|
||||||
switch (state.get(PART)) {
|
|
||||||
case BACK: switch (state.get(FACING)) {
|
|
||||||
case NORTH:
|
|
||||||
if (!arg.getBlockState(pos.north()).isAir()) {
|
|
||||||
arg.breakBlock(pos, true);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
arg.setBlockState(pos.north(), state.with(PART, Part.FRONT).with(FACING, Direction.NORTH));
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
case EAST:
|
|
||||||
if (!arg.getBlockState(pos.east()).isAir()) {
|
|
||||||
arg.breakBlock(pos, true);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
arg.setBlockState(pos.east(), state.with(PART, Part.FRONT).with(FACING, Direction.EAST));
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
case SOUTH:
|
|
||||||
if (!arg.getBlockState(pos.south()).isAir()) {
|
|
||||||
arg.breakBlock(pos, true);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
arg.setBlockState(pos.south(), state.with(PART, Part.FRONT).with(FACING, Direction.SOUTH));
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
case WEST:
|
|
||||||
if (!arg.getBlockState(pos.west()).isAir()) {
|
|
||||||
arg.breakBlock(pos, true);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
arg.setBlockState(pos.west(), state.with(PART, Part.FRONT).with(FACING, Direction.WEST));
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
default:
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
default: return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player) {
|
|
||||||
switch (state.get(PART)) {
|
|
||||||
case BACK: switch (state.get(FACING)) {
|
|
||||||
case NORTH:
|
|
||||||
if (world.getBlockState(pos.north()).contains(PART)) { world.breakBlock(pos.north(), true);}
|
|
||||||
return;
|
|
||||||
case EAST:
|
|
||||||
if (world.getBlockState(pos.east()).contains(PART)) { world.breakBlock(pos.east(), true);}
|
|
||||||
return;
|
|
||||||
case SOUTH:
|
|
||||||
if (world.getBlockState(pos.south()).contains(PART)) { world.breakBlock(pos.south(), true);}
|
|
||||||
|
|
||||||
return;
|
|
||||||
case WEST:
|
|
||||||
if (world.getBlockState(pos.west()).contains(PART)) { world.breakBlock(pos.west(), true);}
|
|
||||||
return;
|
|
||||||
default:
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
case FRONT: switch (state.get(FACING)) {
|
|
||||||
case NORTH:
|
|
||||||
if (world.getBlockState(pos.south()).contains(PART)) { world.breakBlock(pos.south(), true); }
|
|
||||||
return;
|
|
||||||
case EAST:
|
|
||||||
if (world.getBlockState(pos.west()).contains(PART)) { world.breakBlock(pos.south(), true); }
|
|
||||||
return;
|
|
||||||
case SOUTH:
|
|
||||||
if (world.getBlockState(pos.north()).contains(PART)) { world.breakBlock(pos.south(), true); }
|
|
||||||
return;
|
|
||||||
case WEST:
|
|
||||||
if (world.getBlockState(pos.east()).contains(PART)) { world.breakBlock(pos.south(), true); }
|
|
||||||
return;
|
|
||||||
default:
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
default: return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
|
||||||
builder.add(FACING);
|
|
||||||
builder.add(PART);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
|
||||||
switch (state.get(FACING)) {
|
|
||||||
case NORTH: switch (state.get(PART)) { case FRONT: return NORTH_SHAPE_FRONT; case BACK: return NORTH_SHAPE_BACK;}
|
|
||||||
case EAST: switch (state.get(PART)) { case FRONT: return EAST_SHAPE_FRONT; case BACK: return EAST_SHAPE_BACK;}
|
|
||||||
case SOUTH: switch (state.get(PART)) { case FRONT: return SOUTH_SHAPE_FRONT; case BACK: return SOUTH_SHAPE_BACK;}
|
|
||||||
case WEST: switch (state.get(PART)) { case FRONT: return WEST_SHAPE_FRONT; case BACK: return WEST_SHAPE_BACK;}
|
|
||||||
default: return super.getOutlineShape(state, view, pos, context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
static {
|
|
||||||
//long_plank
|
|
||||||
VoxelShape front1 = createCuboidShape(1, 2, 0, 15, 3, 28);
|
|
||||||
VoxelShape back1 = createCuboidShape(1, 2, -16, 15, 3, 12);
|
|
||||||
//plank-y
|
|
||||||
VoxelShape front2 = createCuboidShape(1, 1, 21, 15, 2, 30);
|
|
||||||
VoxelShape back2 = createCuboidShape(1, 1, 5, 15, 2, 14);
|
|
||||||
//plank--y
|
|
||||||
VoxelShape front3 = createCuboidShape(1, 0, 23, 15, 1, 32);
|
|
||||||
VoxelShape back3 = createCuboidShape(1, 0, 7, 15, 1, 16);
|
|
||||||
//lower_siding
|
|
||||||
VoxelShape front4left = createCuboidShape(0, 0, 8, 1, 1, 32);
|
|
||||||
VoxelShape back4left = createCuboidShape(0, 0, -8, 1, 1, 16);
|
|
||||||
VoxelShape front4right = createCuboidShape(15, 0, 8, 16, 1, 32);
|
|
||||||
VoxelShape back4right = createCuboidShape(15, 0, -8, 16, 1, 16);
|
|
||||||
//upper_siding
|
|
||||||
VoxelShape front5left = createCuboidShape(0, 6, 9, 1, 7, 31);
|
|
||||||
VoxelShape back5left = createCuboidShape(0, 6, -7, 1, 7, 15);
|
|
||||||
VoxelShape front5right = createCuboidShape(15, 6, 9, 16, 7, 31);
|
|
||||||
VoxelShape back5right = createCuboidShape(15, 6, -7, 16, 7, 15);
|
|
||||||
//siding_front
|
|
||||||
VoxelShape front6left = createCuboidShape(0, 1, 31, 1, 6, 32);
|
|
||||||
VoxelShape back6left = createCuboidShape(0, 1, 15, 1, 6, 16);
|
|
||||||
VoxelShape front6right = createCuboidShape(15, 1, 31, 16, 6, 32);
|
|
||||||
VoxelShape back6right = createCuboidShape(15, 1, 15, 16, 6, 16);
|
|
||||||
//siding_back
|
|
||||||
VoxelShape front7left = createCuboidShape(0, 1, 8, 1, 6, 9);
|
|
||||||
VoxelShape back7left = createCuboidShape(0, 1, -8, 1, 6, -7);
|
|
||||||
VoxelShape front7right = createCuboidShape(15, 1, 8, 16, 6, 9);
|
|
||||||
VoxelShape back7right = createCuboidShape(15, 1, -8, 16, 6, -7);
|
|
||||||
//dot_front
|
|
||||||
VoxelShape front8left = createCuboidShape(0, 5, 30, 1, 6, 31);
|
|
||||||
VoxelShape back8left = createCuboidShape(0, 5, 14, 1, 6, 15);
|
|
||||||
VoxelShape front8right = createCuboidShape(15, 5, 30, 16, 6, 31);
|
|
||||||
VoxelShape back8right = createCuboidShape(15, 5, 14, 16, 6, 15);
|
|
||||||
//dot_back
|
|
||||||
VoxelShape front9left = createCuboidShape(0, 5, 9, 1, 6, 10);
|
|
||||||
VoxelShape back9left = createCuboidShape(0, 5, -7, 1, 6, -6);
|
|
||||||
VoxelShape front9right = createCuboidShape(15, 5, 9, 16, 6, 10);
|
|
||||||
VoxelShape back9right = createCuboidShape(15, 5, -7, 16, 6, -6);
|
|
||||||
//union
|
|
||||||
VoxelShape front = VoxelShapes.union(front1, front2, front3, front4left, front4right, front5left, front5right, front6left, front6right, front7left, front7right, front8left, front8right, front9left, front9right);
|
|
||||||
VoxelShape back = VoxelShapes.union(back1, back2, back3, back4left, back4right, back5left, back5right, back6left, back6right, back7left, back7right, back8left, back8right, back9left, back9right);
|
|
||||||
|
|
||||||
NORTH_SHAPE_FRONT = front;
|
|
||||||
WEST_SHAPE_FRONT = rotate(Direction.EAST, Direction.NORTH, front);
|
|
||||||
EAST_SHAPE_FRONT = rotate(Direction.EAST, Direction.SOUTH, front);
|
|
||||||
SOUTH_SHAPE_FRONT = rotate(Direction.EAST, Direction.WEST, front);
|
|
||||||
NORTH_SHAPE_BACK = back;
|
|
||||||
WEST_SHAPE_BACK = rotate(Direction.EAST, Direction.NORTH, back);
|
|
||||||
EAST_SHAPE_BACK = rotate(Direction.EAST, Direction.SOUTH, back);
|
|
||||||
SOUTH_SHAPE_BACK = rotate(Direction.EAST, Direction.WEST, back);
|
|
||||||
}
|
|
||||||
private static VoxelShape rotate(Direction from, Direction to, VoxelShape shape) {
|
|
||||||
VoxelShape[] buffer = new VoxelShape[]{ shape, VoxelShapes.empty() };
|
|
||||||
|
|
||||||
int times = (to.getHorizontal() - from.getHorizontal() + 4) % 4;
|
|
||||||
for (int i = 0; i < times; i++) {
|
|
||||||
buffer[0].forEachBox((minX, minY, minZ, maxX, maxY, maxZ) -> buffer[1] = VoxelShapes.union(buffer[1], VoxelShapes.cuboid(1-maxZ, minY, minX, 1-minZ, maxY, maxX)));
|
|
||||||
buffer[0] = buffer[1];
|
|
||||||
buffer[1] = VoxelShapes.empty();
|
|
||||||
}
|
|
||||||
|
|
||||||
return buffer[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canPlaceAt(BlockState state, WorldView worldView, BlockPos pos) {
|
|
||||||
return !worldView.isAir(pos.down());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.block.blockentity.SpruceChoppingLogBlockEntity;
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
|
||||||
import net.minecraft.block.*;
|
|
||||||
import net.minecraft.block.entity.BlockEntity;
|
|
||||||
import net.minecraft.item.ItemPlacementContext;
|
|
||||||
import net.minecraft.sound.BlockSoundGroup;
|
|
||||||
import net.minecraft.state.StateManager;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.util.math.Direction;
|
|
||||||
import net.minecraft.world.BlockView;
|
|
||||||
import net.minecraft.world.WorldView;
|
|
||||||
|
|
||||||
public class SpruceChoppingLog extends HorizontalFacingBlock implements BlockEntityProvider {
|
|
||||||
|
|
||||||
public SpruceChoppingLog() {
|
|
||||||
super(FabricBlockSettings.copy(Blocks.OAK_PLANKS).nonOpaque().sounds(BlockSoundGroup.WOOD));
|
|
||||||
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BlockState getPlacementState(ItemPlacementContext itemPlacementContext) {
|
|
||||||
return super.getPlacementState(itemPlacementContext)
|
|
||||||
.with(FACING, itemPlacementContext.getPlayerFacing().getOpposite());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
|
||||||
builder.add(FACING);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canPlaceAt(BlockState state, WorldView worldView, BlockPos pos) {
|
|
||||||
return !worldView.isAir(pos.down());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BlockEntity createBlockEntity(BlockView view) {
|
|
||||||
return new SpruceChoppingLogBlockEntity();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block;
|
package eu.midnightdust.motschen.decorative.block;
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.DecorativeMain;
|
import eu.midnightdust.motschen.decorative.DecorativeMain;
|
||||||
import eu.midnightdust.motschen.decorative.blockstates.Program;
|
import eu.midnightdust.motschen.decorative.Program;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.block.*;
|
import net.minecraft.block.*;
|
||||||
|
import net.minecraft.entity.EntityContext;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.ItemPlacementContext;
|
import net.minecraft.item.ItemPlacementContext;
|
||||||
import net.minecraft.sound.BlockSoundGroup;
|
import net.minecraft.sound.BlockSoundGroup;
|
||||||
@@ -11,7 +12,6 @@ import net.minecraft.sound.SoundCategory;
|
|||||||
import net.minecraft.sound.SoundEvents;
|
import net.minecraft.sound.SoundEvents;
|
||||||
import net.minecraft.state.StateManager;
|
import net.minecraft.state.StateManager;
|
||||||
import net.minecraft.state.property.EnumProperty;
|
import net.minecraft.state.property.EnumProperty;
|
||||||
import net.minecraft.state.property.Properties;
|
|
||||||
import net.minecraft.util.ActionResult;
|
import net.minecraft.util.ActionResult;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.hit.BlockHitResult;
|
import net.minecraft.util.hit.BlockHitResult;
|
||||||
@@ -23,8 +23,6 @@ import net.minecraft.world.BlockView;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.WorldView;
|
import net.minecraft.world.WorldView;
|
||||||
|
|
||||||
import java.util.function.ToIntFunction;
|
|
||||||
|
|
||||||
public class Television extends HorizontalFacingBlock {
|
public class Television extends HorizontalFacingBlock {
|
||||||
|
|
||||||
private static final VoxelShape NORTH_SHAPE;
|
private static final VoxelShape NORTH_SHAPE;
|
||||||
@@ -34,7 +32,7 @@ public class Television extends HorizontalFacingBlock {
|
|||||||
private static final EnumProperty<Program> PROGRAM = DecorativeMain.PROGRAM;
|
private static final EnumProperty<Program> PROGRAM = DecorativeMain.PROGRAM;
|
||||||
|
|
||||||
public Television() {
|
public Television() {
|
||||||
super(FabricBlockSettings.copy(Blocks.BLACK_CONCRETE).nonOpaque().sounds(BlockSoundGroup.STONE).lightLevel(createLightLevelFromBlockState(15)));
|
super(FabricBlockSettings.copy(Blocks.BLACK_CONCRETE).nonOpaque());
|
||||||
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH).with(PROGRAM, Program.OFF));
|
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH).with(PROGRAM, Program.OFF));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,7 +70,7 @@ public class Television extends HorizontalFacingBlock {
|
|||||||
builder.add(PROGRAM);
|
builder.add(PROGRAM);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
|
||||||
switch (state.get(FACING)) {
|
switch (state.get(FACING)) {
|
||||||
case NORTH: return NORTH_SHAPE;
|
case NORTH: return NORTH_SHAPE;
|
||||||
case EAST: return EAST_SHAPE;
|
case EAST: return EAST_SHAPE;
|
||||||
@@ -105,16 +103,4 @@ public class Television extends HorizontalFacingBlock {
|
|||||||
return !worldView.isAir(pos.down());
|
return !worldView.isAir(pos.down());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ToIntFunction<BlockState> createLightLevelFromBlockState(int litLevel) {
|
|
||||||
return (blockState) -> {
|
|
||||||
if (blockState.get(PROGRAM) == Program.OFF) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return 11;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,21 +2,35 @@ package eu.midnightdust.motschen.decorative.block;
|
|||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.block.*;
|
import net.minecraft.block.*;
|
||||||
|
import net.minecraft.entity.EntityContext;
|
||||||
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
import net.minecraft.item.ItemPlacementContext;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.item.Items;
|
||||||
import net.minecraft.sound.BlockSoundGroup;
|
import net.minecraft.sound.BlockSoundGroup;
|
||||||
|
import net.minecraft.sound.SoundCategory;
|
||||||
|
import net.minecraft.sound.SoundEvents;
|
||||||
|
import net.minecraft.state.StateManager;
|
||||||
|
import net.minecraft.util.ActionResult;
|
||||||
|
import net.minecraft.util.Hand;
|
||||||
|
import net.minecraft.util.hit.BlockHitResult;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.Direction;
|
||||||
import net.minecraft.util.shape.VoxelShape;
|
import net.minecraft.util.shape.VoxelShape;
|
||||||
|
import net.minecraft.util.shape.VoxelShapes;
|
||||||
import net.minecraft.world.BlockView;
|
import net.minecraft.world.BlockView;
|
||||||
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.WorldView;
|
import net.minecraft.world.WorldView;
|
||||||
|
|
||||||
public class TrafficCone extends Block {
|
public class TrafficCone extends Block {
|
||||||
private static final VoxelShape SHAPE;
|
private static final VoxelShape SHAPE;
|
||||||
|
|
||||||
public TrafficCone() {
|
public TrafficCone() {
|
||||||
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque().sounds(BlockSoundGroup.STONE));
|
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
|
||||||
return SHAPE;
|
return SHAPE;
|
||||||
}
|
}
|
||||||
static {
|
static {
|
||||||
|
|||||||
@@ -2,11 +2,19 @@ package eu.midnightdust.motschen.decorative.block;
|
|||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.block.*;
|
import net.minecraft.block.*;
|
||||||
|
import net.minecraft.block.entity.BannerBlockEntity;
|
||||||
|
import net.minecraft.entity.EntityContext;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
import net.minecraft.fluid.WaterFluid;
|
||||||
import net.minecraft.item.*;
|
import net.minecraft.item.*;
|
||||||
|
import net.minecraft.nbt.CompoundTag;
|
||||||
|
import net.minecraft.potion.PotionUtil;
|
||||||
|
import net.minecraft.potion.Potions;
|
||||||
|
import net.minecraft.server.network.ServerPlayerEntity;
|
||||||
import net.minecraft.sound.BlockSoundGroup;
|
import net.minecraft.sound.BlockSoundGroup;
|
||||||
import net.minecraft.sound.SoundCategory;
|
import net.minecraft.sound.SoundCategory;
|
||||||
import net.minecraft.sound.SoundEvents;
|
import net.minecraft.sound.SoundEvents;
|
||||||
|
import net.minecraft.stat.Stats;
|
||||||
import net.minecraft.state.StateManager;
|
import net.minecraft.state.StateManager;
|
||||||
import net.minecraft.util.ActionResult;
|
import net.minecraft.util.ActionResult;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
@@ -26,12 +34,12 @@ public class WaterPump extends HorizontalFacingBlock {
|
|||||||
private static final VoxelShape WEST_SHAPE;
|
private static final VoxelShape WEST_SHAPE;
|
||||||
|
|
||||||
public WaterPump() {
|
public WaterPump() {
|
||||||
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque().sounds(BlockSoundGroup.STONE));
|
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque());
|
||||||
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
|
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
|
||||||
}
|
}
|
||||||
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
||||||
ItemStack itemStack = player.getStackInHand(hand);
|
ItemStack itemStack = player.getStackInHand(hand);
|
||||||
if (!itemStack.isEmpty() && hand==Hand.MAIN_HAND) {
|
if (!itemStack.isEmpty()) {
|
||||||
if (itemStack.getItem() == Items.BUCKET) {
|
if (itemStack.getItem() == Items.BUCKET) {
|
||||||
if (!world.isClient) {
|
if (!world.isClient) {
|
||||||
if (!player.abilities.creativeMode) {
|
if (!player.abilities.creativeMode) {
|
||||||
@@ -66,7 +74,7 @@ public class WaterPump extends HorizontalFacingBlock {
|
|||||||
builder.add(FACING);
|
builder.add(FACING);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
|
||||||
switch (state.get(FACING)) {
|
switch (state.get(FACING)) {
|
||||||
case NORTH: return NORTH_SHAPE;
|
case NORTH: return NORTH_SHAPE;
|
||||||
case EAST: return EAST_SHAPE;
|
case EAST: return EAST_SHAPE;
|
||||||
|
|||||||
@@ -1,61 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block.blockentity;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.init.BlockEntities;
|
|
||||||
import net.minecraft.block.BlockState;
|
|
||||||
import net.minecraft.block.HorizontalFacingBlock;
|
|
||||||
import net.minecraft.block.entity.BlockEntity;
|
|
||||||
import net.minecraft.util.Tickable;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.util.math.Direction;
|
|
||||||
|
|
||||||
public class AcaciaChoppingLogBlockEntity extends BlockEntity implements Tickable {
|
|
||||||
private int facing;
|
|
||||||
private double axe_x;
|
|
||||||
private double axe_z;
|
|
||||||
|
|
||||||
public AcaciaChoppingLogBlockEntity() {
|
|
||||||
super(BlockEntities.AcaciaChoppingLogBlockEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void tick() {
|
|
||||||
|
|
||||||
BlockPos pos = this.pos;
|
|
||||||
BlockState state = this.world.getBlockState(pos);
|
|
||||||
|
|
||||||
if (world != null && state.get(HorizontalFacingBlock.FACING) == Direction.EAST) {
|
|
||||||
facing = 180;
|
|
||||||
axe_x = 0.2D;
|
|
||||||
axe_z = 0.5D;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (world != null && state.get(HorizontalFacingBlock.FACING) == Direction.SOUTH) {
|
|
||||||
facing = 90;
|
|
||||||
axe_x = 0.5D;
|
|
||||||
axe_z = 0.2D;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (world != null && state.get(HorizontalFacingBlock.FACING) == Direction.WEST) {
|
|
||||||
facing = 0;
|
|
||||||
axe_x = 0.8D;
|
|
||||||
axe_z = 0.5D;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
facing = 270;
|
|
||||||
axe_x = 0.5D;
|
|
||||||
axe_z = 0.8D;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getFacing() {
|
|
||||||
return facing;
|
|
||||||
}
|
|
||||||
public double getAxeX() {
|
|
||||||
return axe_x;
|
|
||||||
}
|
|
||||||
public double getAxeZ() {
|
|
||||||
return axe_z;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block.blockentity;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.init.BlockEntities;
|
|
||||||
import net.minecraft.block.BlockState;
|
|
||||||
import net.minecraft.block.HorizontalFacingBlock;
|
|
||||||
import net.minecraft.block.entity.BlockEntity;
|
|
||||||
import net.minecraft.util.Tickable;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.util.math.Direction;
|
|
||||||
|
|
||||||
public class BirchChoppingLogBlockEntity extends BlockEntity implements Tickable {
|
|
||||||
private int facing;
|
|
||||||
private double axe_x;
|
|
||||||
private double axe_z;
|
|
||||||
|
|
||||||
public BirchChoppingLogBlockEntity() {
|
|
||||||
super(BlockEntities.BirchChoppingLogBlockEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void tick() {
|
|
||||||
|
|
||||||
BlockPos pos = this.pos;
|
|
||||||
BlockState state = this.world.getBlockState(pos);
|
|
||||||
|
|
||||||
if (world != null && state.get(HorizontalFacingBlock.FACING) == Direction.EAST) {
|
|
||||||
facing = 180;
|
|
||||||
axe_x = 0.2D;
|
|
||||||
axe_z = 0.5D;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (world != null && state.get(HorizontalFacingBlock.FACING) == Direction.SOUTH) {
|
|
||||||
facing = 90;
|
|
||||||
axe_x = 0.5D;
|
|
||||||
axe_z = 0.2D;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (world != null && state.get(HorizontalFacingBlock.FACING) == Direction.WEST) {
|
|
||||||
facing = 0;
|
|
||||||
axe_x = 0.8D;
|
|
||||||
axe_z = 0.5D;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
facing = 270;
|
|
||||||
axe_x = 0.5D;
|
|
||||||
axe_z = 0.8D;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getFacing() {
|
|
||||||
return facing;
|
|
||||||
}
|
|
||||||
public double getAxeX() {
|
|
||||||
return axe_x;
|
|
||||||
}
|
|
||||||
public double getAxeZ() {
|
|
||||||
return axe_z;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block.blockentity;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.blockstates.CeilingFanStage;
|
|
||||||
import eu.midnightdust.motschen.decorative.DecorativeMain;
|
|
||||||
import eu.midnightdust.motschen.decorative.init.BlockEntities;
|
|
||||||
import eu.midnightdust.motschen.decorative.sound.DecorativeSoundEvents;
|
|
||||||
import net.minecraft.block.BlockState;
|
|
||||||
import net.minecraft.block.entity.BlockEntity;
|
|
||||||
import net.minecraft.sound.SoundCategory;
|
|
||||||
import net.minecraft.util.Tickable;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
|
|
||||||
public class CeilingFanBlockEntity extends BlockEntity implements Tickable {
|
|
||||||
private int rot;
|
|
||||||
|
|
||||||
public CeilingFanBlockEntity() {
|
|
||||||
super(BlockEntities.CeilingFanBlockEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void tick() {
|
|
||||||
|
|
||||||
BlockPos pos = this.pos;
|
|
||||||
BlockState state = this.world.getBlockState(pos);
|
|
||||||
if (world != null && state.get(DecorativeMain.STAGE) == CeilingFanStage.LEVEL_1) {
|
|
||||||
world.playSound(null,pos, DecorativeSoundEvents.CEILINGFAN_AMBIENT, SoundCategory.BLOCKS, 0.1f, 1.0f);
|
|
||||||
rot = rot + 6;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (world != null && state.get(DecorativeMain.STAGE) == CeilingFanStage.LEVEL_2) {
|
|
||||||
world.playSound(null,pos, DecorativeSoundEvents.CEILINGFAN_AMBIENT, SoundCategory.BLOCKS, 0.2f, 1.0f);
|
|
||||||
rot = rot + 10;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (world != null && state.get(DecorativeMain.STAGE) == CeilingFanStage.LEVEL_3) {
|
|
||||||
world.playSound(null,pos, DecorativeSoundEvents.CEILINGFAN_AMBIENT, SoundCategory.BLOCKS, 0.3f, 1.0f);
|
|
||||||
rot = rot + 14;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
rot = rot;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public int getRot() {
|
|
||||||
return rot;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block.blockentity;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.init.BlockEntities;
|
|
||||||
import net.minecraft.block.BlockState;
|
|
||||||
import net.minecraft.block.HorizontalFacingBlock;
|
|
||||||
import net.minecraft.block.entity.BlockEntity;
|
|
||||||
import net.minecraft.util.Tickable;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.util.math.Direction;
|
|
||||||
|
|
||||||
public class DarkOakChoppingLogBlockEntity extends BlockEntity implements Tickable {
|
|
||||||
private int facing;
|
|
||||||
private double axe_x;
|
|
||||||
private double axe_z;
|
|
||||||
|
|
||||||
public DarkOakChoppingLogBlockEntity() {
|
|
||||||
super(BlockEntities.DarkOakChoppingLogBlockEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void tick() {
|
|
||||||
|
|
||||||
BlockPos pos = this.pos;
|
|
||||||
BlockState state = this.world.getBlockState(pos);
|
|
||||||
|
|
||||||
if (world != null && state.get(HorizontalFacingBlock.FACING) == Direction.EAST) {
|
|
||||||
facing = 180;
|
|
||||||
axe_x = 0.2D;
|
|
||||||
axe_z = 0.5D;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (world != null && state.get(HorizontalFacingBlock.FACING) == Direction.SOUTH) {
|
|
||||||
facing = 90;
|
|
||||||
axe_x = 0.5D;
|
|
||||||
axe_z = 0.2D;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (world != null && state.get(HorizontalFacingBlock.FACING) == Direction.WEST) {
|
|
||||||
facing = 0;
|
|
||||||
axe_x = 0.8D;
|
|
||||||
axe_z = 0.5D;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
facing = 270;
|
|
||||||
axe_x = 0.5D;
|
|
||||||
axe_z = 0.8D;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getFacing() {
|
|
||||||
return facing;
|
|
||||||
}
|
|
||||||
public double getAxeX() {
|
|
||||||
return axe_x;
|
|
||||||
}
|
|
||||||
public double getAxeZ() {
|
|
||||||
return axe_z;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block.blockentity;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.init.BlockEntities;
|
|
||||||
import net.minecraft.block.BlockState;
|
|
||||||
import net.minecraft.block.HorizontalFacingBlock;
|
|
||||||
import net.minecraft.block.entity.BlockEntity;
|
|
||||||
import net.minecraft.util.Tickable;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.util.math.Direction;
|
|
||||||
|
|
||||||
public class JungleChoppingLogBlockEntity extends BlockEntity implements Tickable {
|
|
||||||
private int facing;
|
|
||||||
private double axe_x;
|
|
||||||
private double axe_z;
|
|
||||||
|
|
||||||
public JungleChoppingLogBlockEntity() {
|
|
||||||
super(BlockEntities.JungleChoppingLogBlockEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void tick() {
|
|
||||||
|
|
||||||
BlockPos pos = this.pos;
|
|
||||||
BlockState state = this.world.getBlockState(pos);
|
|
||||||
|
|
||||||
if (world != null && state.get(HorizontalFacingBlock.FACING) == Direction.EAST) {
|
|
||||||
facing = 180;
|
|
||||||
axe_x = 0.2D;
|
|
||||||
axe_z = 0.5D;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (world != null && state.get(HorizontalFacingBlock.FACING) == Direction.SOUTH) {
|
|
||||||
facing = 90;
|
|
||||||
axe_x = 0.5D;
|
|
||||||
axe_z = 0.2D;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (world != null && state.get(HorizontalFacingBlock.FACING) == Direction.WEST) {
|
|
||||||
facing = 0;
|
|
||||||
axe_x = 0.8D;
|
|
||||||
axe_z = 0.5D;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
facing = 270;
|
|
||||||
axe_x = 0.5D;
|
|
||||||
axe_z = 0.8D;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getFacing() {
|
|
||||||
return facing;
|
|
||||||
}
|
|
||||||
public double getAxeX() {
|
|
||||||
return axe_x;
|
|
||||||
}
|
|
||||||
public double getAxeZ() {
|
|
||||||
return axe_z;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block.blockentity;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.init.BlockEntities;
|
|
||||||
import net.minecraft.block.BlockState;
|
|
||||||
import net.minecraft.block.HorizontalFacingBlock;
|
|
||||||
import net.minecraft.block.entity.BlockEntity;
|
|
||||||
import net.minecraft.util.Tickable;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.util.math.Direction;
|
|
||||||
|
|
||||||
public class OakChoppingLogBlockEntity extends BlockEntity implements Tickable {
|
|
||||||
private int facing;
|
|
||||||
private double axe_x;
|
|
||||||
private double axe_z;
|
|
||||||
|
|
||||||
public OakChoppingLogBlockEntity() {
|
|
||||||
super(BlockEntities.OakChoppingLogBlockEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void tick() {
|
|
||||||
|
|
||||||
BlockPos pos = this.pos;
|
|
||||||
BlockState state = this.world.getBlockState(pos);
|
|
||||||
|
|
||||||
if (world != null && state.get(HorizontalFacingBlock.FACING) == Direction.EAST) {
|
|
||||||
facing = 180;
|
|
||||||
axe_x = 0.2D;
|
|
||||||
axe_z = 0.5D;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (world != null && state.get(HorizontalFacingBlock.FACING) == Direction.SOUTH) {
|
|
||||||
facing = 90;
|
|
||||||
axe_x = 0.5D;
|
|
||||||
axe_z = 0.2D;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (world != null && state.get(HorizontalFacingBlock.FACING) == Direction.WEST) {
|
|
||||||
facing = 0;
|
|
||||||
axe_x = 0.8D;
|
|
||||||
axe_z = 0.5D;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
facing = 270;
|
|
||||||
axe_x = 0.5D;
|
|
||||||
axe_z = 0.8D;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getFacing() {
|
|
||||||
return facing;
|
|
||||||
}
|
|
||||||
public double getAxeX() {
|
|
||||||
return axe_x;
|
|
||||||
}
|
|
||||||
public double getAxeZ() {
|
|
||||||
return axe_z;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block.blockentity;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.block.PoolSprinkler;
|
|
||||||
import eu.midnightdust.motschen.decorative.init.BlockEntities;
|
|
||||||
import eu.midnightdust.motschen.decorative.init.Pool;
|
|
||||||
import net.minecraft.block.BlockState;
|
|
||||||
import net.minecraft.block.entity.BlockEntity;
|
|
||||||
import net.minecraft.particle.ParticleTypes;
|
|
||||||
import net.minecraft.util.Tickable;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
|
|
||||||
public class PoolSprinklerBlockEntity extends BlockEntity implements Tickable {
|
|
||||||
|
|
||||||
public PoolSprinklerBlockEntity() {
|
|
||||||
super(BlockEntities.PoolSprinklerBlockEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void tick() {
|
|
||||||
BlockPos pos = this.pos;
|
|
||||||
BlockState state = this.world.getBlockState(pos);
|
|
||||||
if (world != null && state.get(PoolSprinkler.POWERED) == true) {
|
|
||||||
switch (state.get(PoolSprinkler.FACING)) {
|
|
||||||
case NORTH: world.addParticle(ParticleTypes.DRIPPING_WATER,pos.getX()+0.5,pos.getY()+0.5,pos.getZ()-0.34,1,1,1); return;
|
|
||||||
case EAST: world.addParticle(ParticleTypes.DRIPPING_WATER,pos.getX()+1.34,pos.getY()+0.5,pos.getZ()+0.5,1,1,1); return;
|
|
||||||
case SOUTH: world.addParticle(ParticleTypes.DRIPPING_WATER,pos.getX()+0.5,pos.getY()+0.5,pos.getZ()+1.34,1,1,1); return;
|
|
||||||
case WEST: world.addParticle(ParticleTypes.DRIPPING_WATER,pos.getX()-0.34,pos.getY()+0.5,pos.getZ()+0.5,1,1,1); return;
|
|
||||||
default: return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block.blockentity;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.block.PoolSprinkler;
|
|
||||||
import eu.midnightdust.motschen.decorative.init.BlockEntities;
|
|
||||||
import eu.midnightdust.motschen.decorative.init.Pool;
|
|
||||||
import net.minecraft.block.BlockState;
|
|
||||||
import net.minecraft.block.entity.BlockEntity;
|
|
||||||
import net.minecraft.particle.ParticleTypes;
|
|
||||||
import net.minecraft.util.Tickable;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
|
|
||||||
public class ShowerHeadBlockEntity extends BlockEntity implements Tickable {
|
|
||||||
|
|
||||||
public ShowerHeadBlockEntity() {
|
|
||||||
super(BlockEntities.ShowerHeadBlockEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void tick() {
|
|
||||||
BlockPos pos = this.pos;
|
|
||||||
BlockState state = this.world.getBlockState(pos);
|
|
||||||
if (world != null && state.get(PoolSprinkler.POWERED) == true) {
|
|
||||||
switch (state.get(PoolSprinkler.FACING)) {
|
|
||||||
case NORTH: world.addParticle(ParticleTypes.DRIPPING_WATER,pos.getX()+0.5,pos.getY()+0.5,pos.getZ()+0.625,1,1,1); return;
|
|
||||||
case EAST: world.addParticle(ParticleTypes.DRIPPING_WATER,pos.getX()+0.375,pos.getY()+0.5,pos.getZ()+0.5,1,1,1); return;
|
|
||||||
case SOUTH: world.addParticle(ParticleTypes.DRIPPING_WATER,pos.getX()+0.5,pos.getY()+0.5,pos.getZ()+0.375,1,1,1); return;
|
|
||||||
case WEST: world.addParticle(ParticleTypes.DRIPPING_WATER,pos.getX()+0.625,pos.getY()+0.5,pos.getZ()+0.5,1,1,1); return;
|
|
||||||
default: return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block.blockentity;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.init.BlockEntities;
|
|
||||||
import net.minecraft.block.BlockState;
|
|
||||||
import net.minecraft.block.HorizontalFacingBlock;
|
|
||||||
import net.minecraft.block.entity.BlockEntity;
|
|
||||||
import net.minecraft.util.Tickable;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.util.math.Direction;
|
|
||||||
|
|
||||||
public class SpruceChoppingLogBlockEntity extends BlockEntity implements Tickable {
|
|
||||||
private int facing;
|
|
||||||
private double axe_x;
|
|
||||||
private double axe_z;
|
|
||||||
|
|
||||||
public SpruceChoppingLogBlockEntity() {
|
|
||||||
super(BlockEntities.SpruceChoppingLogBlockEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void tick() {
|
|
||||||
|
|
||||||
BlockPos pos = this.pos;
|
|
||||||
BlockState state = this.world.getBlockState(pos);
|
|
||||||
|
|
||||||
if (world != null && state.get(HorizontalFacingBlock.FACING) == Direction.EAST) {
|
|
||||||
facing = 180;
|
|
||||||
axe_x = 0.2D;
|
|
||||||
axe_z = 0.5D;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (world != null && state.get(HorizontalFacingBlock.FACING) == Direction.SOUTH) {
|
|
||||||
facing = 90;
|
|
||||||
axe_x = 0.5D;
|
|
||||||
axe_z = 0.2D;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (world != null && state.get(HorizontalFacingBlock.FACING) == Direction.WEST) {
|
|
||||||
facing = 0;
|
|
||||||
axe_x = 0.8D;
|
|
||||||
axe_z = 0.5D;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
facing = 270;
|
|
||||||
axe_x = 0.5D;
|
|
||||||
axe_z = 0.8D;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getFacing() {
|
|
||||||
return facing;
|
|
||||||
}
|
|
||||||
public double getAxeX() {
|
|
||||||
return axe_x;
|
|
||||||
}
|
|
||||||
public double getAxeZ() {
|
|
||||||
return axe_z;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block.render;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.block.blockentity.AcaciaChoppingLogBlockEntity;
|
|
||||||
import net.fabricmc.api.EnvType;
|
|
||||||
import net.fabricmc.api.Environment;
|
|
||||||
import net.minecraft.block.BlockState;
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
|
||||||
import net.minecraft.client.render.VertexConsumerProvider;
|
|
||||||
import net.minecraft.client.render.WorldRenderer;
|
|
||||||
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
|
|
||||||
import net.minecraft.client.render.model.json.ModelTransformation;
|
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
|
||||||
import net.minecraft.client.util.math.Vector3f;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.item.Items;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
|
||||||
public class AcaciaChoppingLogBlockEntityRenderer extends BlockEntityRenderer<AcaciaChoppingLogBlockEntity> {
|
|
||||||
|
|
||||||
public AcaciaChoppingLogBlockEntityRenderer(BlockEntityRenderDispatcher blockEntityRenderDispatcher) {
|
|
||||||
super(blockEntityRenderDispatcher);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean rendersOutsideBoundingBox(AcaciaChoppingLogBlockEntity blockEntity) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void render(AcaciaChoppingLogBlockEntity blockEntity, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) {
|
|
||||||
BlockPos pos = blockEntity.getPos();
|
|
||||||
BlockState state = blockEntity.getWorld().getBlockState(pos);
|
|
||||||
|
|
||||||
matrices.push();
|
|
||||||
int lightAbove = WorldRenderer.getLightmapCoordinates(blockEntity.getWorld(), blockEntity.getPos().up());
|
|
||||||
|
|
||||||
matrices.translate(blockEntity.getAxeX(), 1.5D, blockEntity.getAxeZ());
|
|
||||||
matrices.scale(2.5f,2.5f,2.5f);
|
|
||||||
|
|
||||||
matrices.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(blockEntity.getFacing()));
|
|
||||||
|
|
||||||
matrices.multiply(Vector3f.POSITIVE_Z.getDegreesQuaternion(160));
|
|
||||||
MinecraftClient.getInstance().getItemRenderer().renderItem(new ItemStack(Items.IRON_AXE),
|
|
||||||
ModelTransformation.Mode.GROUND, lightAbove, overlay, matrices, vertexConsumers);
|
|
||||||
|
|
||||||
|
|
||||||
matrices.pop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block.render;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.block.blockentity.BirchChoppingLogBlockEntity;
|
|
||||||
import net.fabricmc.api.EnvType;
|
|
||||||
import net.fabricmc.api.Environment;
|
|
||||||
import net.minecraft.block.BlockState;
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
|
||||||
import net.minecraft.client.render.VertexConsumerProvider;
|
|
||||||
import net.minecraft.client.render.WorldRenderer;
|
|
||||||
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
|
|
||||||
import net.minecraft.client.render.model.json.ModelTransformation;
|
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
|
||||||
import net.minecraft.client.util.math.Vector3f;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.item.Items;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
|
||||||
public class BirchChoppingLogBlockEntityRenderer extends BlockEntityRenderer<BirchChoppingLogBlockEntity> {
|
|
||||||
|
|
||||||
public BirchChoppingLogBlockEntityRenderer(BlockEntityRenderDispatcher blockEntityRenderDispatcher) {
|
|
||||||
super(blockEntityRenderDispatcher);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean rendersOutsideBoundingBox(BirchChoppingLogBlockEntity blockEntity) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void render(BirchChoppingLogBlockEntity blockEntity, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) {
|
|
||||||
BlockPos pos = blockEntity.getPos();
|
|
||||||
BlockState state = blockEntity.getWorld().getBlockState(pos);
|
|
||||||
|
|
||||||
matrices.push();
|
|
||||||
int lightAbove = WorldRenderer.getLightmapCoordinates(blockEntity.getWorld(), blockEntity.getPos().up());
|
|
||||||
|
|
||||||
matrices.translate(blockEntity.getAxeX(), 1.5D, blockEntity.getAxeZ());
|
|
||||||
matrices.scale(2.5f,2.5f,2.5f);
|
|
||||||
|
|
||||||
matrices.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(blockEntity.getFacing()));
|
|
||||||
|
|
||||||
matrices.multiply(Vector3f.POSITIVE_Z.getDegreesQuaternion(160));
|
|
||||||
MinecraftClient.getInstance().getItemRenderer().renderItem(new ItemStack(Items.IRON_AXE),
|
|
||||||
ModelTransformation.Mode.GROUND, lightAbove, overlay, matrices, vertexConsumers);
|
|
||||||
|
|
||||||
|
|
||||||
matrices.pop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block.render;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.block.blockentity.CeilingFanBlockEntity;
|
|
||||||
import net.fabricmc.api.EnvType;
|
|
||||||
import net.fabricmc.api.Environment;
|
|
||||||
import net.minecraft.block.DoorBlock;
|
|
||||||
import net.minecraft.client.model.ModelPart;
|
|
||||||
import net.minecraft.client.render.OverlayTexture;
|
|
||||||
import net.minecraft.client.render.RenderLayer;
|
|
||||||
import net.minecraft.client.render.VertexConsumer;
|
|
||||||
import net.minecraft.client.render.VertexConsumerProvider;
|
|
||||||
import net.minecraft.client.render.WorldRenderer;
|
|
||||||
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
|
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
|
||||||
import net.minecraft.client.util.math.Vector3f;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
|
||||||
public class CeilingFanRenderer extends BlockEntityRenderer<CeilingFanBlockEntity> {
|
|
||||||
private static int rot;
|
|
||||||
private final ModelPart blades;
|
|
||||||
private final ModelPart point;
|
|
||||||
|
|
||||||
public CeilingFanRenderer(BlockEntityRenderDispatcher blockEntityRenderDispatcher) {
|
|
||||||
super(blockEntityRenderDispatcher);
|
|
||||||
blades = new ModelPart(64, 64, 0, 0);
|
|
||||||
blades.setPivot(0.0F, 0.0F, 0.0F);
|
|
||||||
blades.addCuboid(-1.0F, 0.0F, 1.0F, 2.0F, 1.0F, 10.0F, 0.0F);
|
|
||||||
blades.addCuboid(-1.0F, 0.0F, -11.0F, 2.0F, 1.0F, 10.0F, 0.0F);
|
|
||||||
blades.addCuboid(1.0F, 0.0F, -1.0F, 10.0F, 1.0F, 2.0F, 0.0F);
|
|
||||||
blades.addCuboid(-11.0F, 0.0F, -1.0F, 10.0F, 1.0F, 2.0F, 0.0F);
|
|
||||||
point = new ModelPart(32, 32, 16, 0);
|
|
||||||
point.addCuboid(-1.0F, -1.0F, -1.0F, 2.0F, 2.0F, 2.0F, 0.0F);
|
|
||||||
blades.addChild(point);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean rendersOutsideBoundingBox(CeilingFanBlockEntity blockEntity) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void render(CeilingFanBlockEntity blockEntity, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) {
|
|
||||||
|
|
||||||
matrices.push();
|
|
||||||
int lightAtBlock = WorldRenderer.getLightmapCoordinates(blockEntity.getWorld(), blockEntity.getPos());
|
|
||||||
VertexConsumer vertexConsumer = vertexConsumers.getBuffer(RenderLayer.getEntityCutoutNoCull(new Identifier("decorative:textures/block/ceilingfan.png")));
|
|
||||||
matrices.translate(0.5,0.31,0.5);
|
|
||||||
|
|
||||||
matrices.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(blockEntity.getRot()));
|
|
||||||
|
|
||||||
|
|
||||||
blades.render(matrices, vertexConsumer, lightAtBlock, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0F);
|
|
||||||
matrices.pop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block.render;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.block.blockentity.DarkOakChoppingLogBlockEntity;
|
|
||||||
import net.fabricmc.api.EnvType;
|
|
||||||
import net.fabricmc.api.Environment;
|
|
||||||
import net.minecraft.block.BlockState;
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
|
||||||
import net.minecraft.client.render.VertexConsumerProvider;
|
|
||||||
import net.minecraft.client.render.WorldRenderer;
|
|
||||||
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
|
|
||||||
import net.minecraft.client.render.model.json.ModelTransformation;
|
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
|
||||||
import net.minecraft.client.util.math.Vector3f;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.item.Items;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
|
||||||
public class DarkOakChoppingLogBlockEntityRenderer extends BlockEntityRenderer<DarkOakChoppingLogBlockEntity> {
|
|
||||||
|
|
||||||
public DarkOakChoppingLogBlockEntityRenderer(BlockEntityRenderDispatcher blockEntityRenderDispatcher) {
|
|
||||||
super(blockEntityRenderDispatcher);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean rendersOutsideBoundingBox(DarkOakChoppingLogBlockEntity blockEntity) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void render(DarkOakChoppingLogBlockEntity blockEntity, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) {
|
|
||||||
BlockPos pos = blockEntity.getPos();
|
|
||||||
BlockState state = blockEntity.getWorld().getBlockState(pos);
|
|
||||||
|
|
||||||
matrices.push();
|
|
||||||
int lightAbove = WorldRenderer.getLightmapCoordinates(blockEntity.getWorld(), blockEntity.getPos().up());
|
|
||||||
|
|
||||||
matrices.translate(blockEntity.getAxeX(), 1.5D, blockEntity.getAxeZ());
|
|
||||||
matrices.scale(2.5f,2.5f,2.5f);
|
|
||||||
|
|
||||||
matrices.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(blockEntity.getFacing()));
|
|
||||||
|
|
||||||
matrices.multiply(Vector3f.POSITIVE_Z.getDegreesQuaternion(160));
|
|
||||||
MinecraftClient.getInstance().getItemRenderer().renderItem(new ItemStack(Items.IRON_AXE),
|
|
||||||
ModelTransformation.Mode.GROUND, lightAbove, overlay, matrices, vertexConsumers);
|
|
||||||
|
|
||||||
|
|
||||||
matrices.pop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block.render;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.block.blockentity.JungleChoppingLogBlockEntity;
|
|
||||||
import net.fabricmc.api.EnvType;
|
|
||||||
import net.fabricmc.api.Environment;
|
|
||||||
import net.minecraft.block.BlockState;
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
|
||||||
import net.minecraft.client.render.VertexConsumerProvider;
|
|
||||||
import net.minecraft.client.render.WorldRenderer;
|
|
||||||
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
|
|
||||||
import net.minecraft.client.render.model.json.ModelTransformation;
|
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
|
||||||
import net.minecraft.client.util.math.Vector3f;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.item.Items;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
|
||||||
public class JungleChoppingLogBlockEntityRenderer extends BlockEntityRenderer<JungleChoppingLogBlockEntity> {
|
|
||||||
|
|
||||||
public JungleChoppingLogBlockEntityRenderer(BlockEntityRenderDispatcher blockEntityRenderDispatcher) {
|
|
||||||
super(blockEntityRenderDispatcher);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean rendersOutsideBoundingBox(JungleChoppingLogBlockEntity blockEntity) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void render(JungleChoppingLogBlockEntity blockEntity, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) {
|
|
||||||
BlockPos pos = blockEntity.getPos();
|
|
||||||
BlockState state = blockEntity.getWorld().getBlockState(pos);
|
|
||||||
|
|
||||||
matrices.push();
|
|
||||||
int lightAbove = WorldRenderer.getLightmapCoordinates(blockEntity.getWorld(), blockEntity.getPos().up());
|
|
||||||
|
|
||||||
matrices.translate(blockEntity.getAxeX(), 1.5D, blockEntity.getAxeZ());
|
|
||||||
matrices.scale(2.5f,2.5f,2.5f);
|
|
||||||
|
|
||||||
matrices.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(blockEntity.getFacing()));
|
|
||||||
|
|
||||||
matrices.multiply(Vector3f.POSITIVE_Z.getDegreesQuaternion(160));
|
|
||||||
MinecraftClient.getInstance().getItemRenderer().renderItem(new ItemStack(Items.IRON_AXE),
|
|
||||||
ModelTransformation.Mode.GROUND, lightAbove, overlay, matrices, vertexConsumers);
|
|
||||||
|
|
||||||
|
|
||||||
matrices.pop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block.render;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.block.blockentity.OakChoppingLogBlockEntity;
|
|
||||||
import net.fabricmc.api.EnvType;
|
|
||||||
import net.fabricmc.api.Environment;
|
|
||||||
import net.minecraft.block.BlockState;
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
|
||||||
import net.minecraft.client.render.*;
|
|
||||||
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
|
|
||||||
import net.minecraft.client.render.model.json.ModelTransformation;
|
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
|
||||||
import net.minecraft.client.util.math.Vector3f;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.item.Items;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
|
||||||
public class OakChoppingLogBlockEntityRenderer extends BlockEntityRenderer<OakChoppingLogBlockEntity> {
|
|
||||||
|
|
||||||
public OakChoppingLogBlockEntityRenderer(BlockEntityRenderDispatcher blockEntityRenderDispatcher) {
|
|
||||||
super(blockEntityRenderDispatcher);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean rendersOutsideBoundingBox(OakChoppingLogBlockEntity blockEntity) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void render(OakChoppingLogBlockEntity blockEntity, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) {
|
|
||||||
BlockPos pos = blockEntity.getPos();
|
|
||||||
BlockState state = blockEntity.getWorld().getBlockState(pos);
|
|
||||||
|
|
||||||
matrices.push();
|
|
||||||
int lightAbove = WorldRenderer.getLightmapCoordinates(blockEntity.getWorld(), blockEntity.getPos().up());
|
|
||||||
|
|
||||||
matrices.translate(blockEntity.getAxeX(), 1.5D, blockEntity.getAxeZ());
|
|
||||||
matrices.scale(2.5f,2.5f,2.5f);
|
|
||||||
|
|
||||||
matrices.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(blockEntity.getFacing()));
|
|
||||||
|
|
||||||
matrices.multiply(Vector3f.POSITIVE_Z.getDegreesQuaternion(160));
|
|
||||||
MinecraftClient.getInstance().getItemRenderer().renderItem(new ItemStack(Items.IRON_AXE),
|
|
||||||
ModelTransformation.Mode.GROUND, lightAbove, overlay, matrices, vertexConsumers);
|
|
||||||
|
|
||||||
|
|
||||||
matrices.pop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.block.render;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.block.blockentity.SpruceChoppingLogBlockEntity;
|
|
||||||
import net.fabricmc.api.EnvType;
|
|
||||||
import net.fabricmc.api.Environment;
|
|
||||||
import net.minecraft.block.BlockState;
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
|
||||||
import net.minecraft.client.render.VertexConsumerProvider;
|
|
||||||
import net.minecraft.client.render.WorldRenderer;
|
|
||||||
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
|
|
||||||
import net.minecraft.client.render.model.json.ModelTransformation;
|
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
|
||||||
import net.minecraft.client.util.math.Vector3f;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.item.Items;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
|
||||||
public class SpruceChoppingLogBlockEntityRenderer extends BlockEntityRenderer<SpruceChoppingLogBlockEntity> {
|
|
||||||
|
|
||||||
public SpruceChoppingLogBlockEntityRenderer(BlockEntityRenderDispatcher blockEntityRenderDispatcher) {
|
|
||||||
super(blockEntityRenderDispatcher);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean rendersOutsideBoundingBox(SpruceChoppingLogBlockEntity blockEntity) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void render(SpruceChoppingLogBlockEntity blockEntity, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) {
|
|
||||||
BlockPos pos = blockEntity.getPos();
|
|
||||||
BlockState state = blockEntity.getWorld().getBlockState(pos);
|
|
||||||
|
|
||||||
matrices.push();
|
|
||||||
int lightAbove = WorldRenderer.getLightmapCoordinates(blockEntity.getWorld(), blockEntity.getPos().up());
|
|
||||||
|
|
||||||
matrices.translate(blockEntity.getAxeX(), 1.5D, blockEntity.getAxeZ());
|
|
||||||
matrices.scale(2.5f,2.5f,2.5f);
|
|
||||||
|
|
||||||
matrices.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(blockEntity.getFacing()));
|
|
||||||
|
|
||||||
matrices.multiply(Vector3f.POSITIVE_Z.getDegreesQuaternion(160));
|
|
||||||
MinecraftClient.getInstance().getItemRenderer().renderItem(new ItemStack(Items.IRON_AXE),
|
|
||||||
ModelTransformation.Mode.GROUND, lightAbove, overlay, matrices, vertexConsumers);
|
|
||||||
|
|
||||||
|
|
||||||
matrices.pop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.blockstates;
|
|
||||||
|
|
||||||
import net.minecraft.util.StringIdentifiable;
|
|
||||||
|
|
||||||
public enum CeilingFanStage implements StringIdentifiable {
|
|
||||||
OFF("off"),
|
|
||||||
LEVEL_1("level1"),
|
|
||||||
LEVEL_2("level2"),
|
|
||||||
LEVEL_3("level3");
|
|
||||||
|
|
||||||
private final String name;
|
|
||||||
|
|
||||||
CeilingFanStage(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString() {
|
|
||||||
return this.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String asString() {
|
|
||||||
return this.name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.blockstates;
|
|
||||||
|
|
||||||
import net.minecraft.util.StringIdentifiable;
|
|
||||||
|
|
||||||
public enum Part implements StringIdentifiable {
|
|
||||||
FRONT("front"),
|
|
||||||
BACK("back");
|
|
||||||
|
|
||||||
private final String name;
|
|
||||||
|
|
||||||
Part(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString() {
|
|
||||||
return this.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String asString() {
|
|
||||||
return this.name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.blockstates;
|
|
||||||
|
|
||||||
import net.minecraft.util.StringIdentifiable;
|
|
||||||
|
|
||||||
public enum PoolShape implements StringIdentifiable {
|
|
||||||
STRAIGHT("straight"),
|
|
||||||
INNER_LEFT("inner_left"),
|
|
||||||
INNER_RIGHT("inner_right");
|
|
||||||
|
|
||||||
private final String name;
|
|
||||||
|
|
||||||
PoolShape(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString() {
|
|
||||||
return this.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String asString() {
|
|
||||||
return this.name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,129 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.entity;
|
|
||||||
|
|
||||||
import net.minecraft.block.BlockState;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.EntityType;
|
|
||||||
import net.minecraft.entity.damage.DamageSource;
|
|
||||||
import net.minecraft.entity.passive.PigEntity;
|
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
|
||||||
import net.minecraft.fluid.Fluid;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.sound.SoundEvent;
|
|
||||||
import net.minecraft.tag.Tag;
|
|
||||||
import net.minecraft.util.ActionResult;
|
|
||||||
import net.minecraft.util.Hand;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.util.math.Vec3d;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class BathTireEntity extends PigEntity {
|
|
||||||
public BathTireEntity(EntityType<? extends PigEntity> entityType, World world) {
|
|
||||||
super(entityType, world);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected int getCurrentExperience(PlayerEntity player) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEvent getAmbientSound() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEvent getHurtSound(DamageSource source) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEvent getDeathSound() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void playStepSound(BlockPos pos, BlockState state) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canEat() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void swimUpward(Tag<Fluid> fluid) {
|
|
||||||
if (this.getNavigation().canSwim()) {
|
|
||||||
super.swimUpward(fluid);
|
|
||||||
} else {
|
|
||||||
this.setVelocity(this.getVelocity().add(0.0D, 0.7D, 0.0D));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double getHeightOffset() {
|
|
||||||
return 0.0D;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canWalkOnFluid(Fluid fluid) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float getSaddledSpeed() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void initGoals() { }
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canBeRiddenInWater() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected int computeFallDamage(float fallDistance, float damageMultiplier) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean cannotDespawn() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected boolean movesIndependently() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canMoveVoluntarily() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canBeControlledByRider() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ActionResult interactAt(PlayerEntity player, Vec3d hitPos, Hand hand) {
|
|
||||||
if(!player.getEntityWorld().isClient && player.getStackInHand(hand)== ItemStack.EMPTY && hand==Hand.MAIN_HAND)
|
|
||||||
{
|
|
||||||
player.startRiding(this,true);
|
|
||||||
return ActionResult.SUCCESS;
|
|
||||||
}
|
|
||||||
return ActionResult.FAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updatePassengerPosition(Entity passenger) {
|
|
||||||
if(this.getPrimaryPassenger() instanceof PlayerEntity)
|
|
||||||
{
|
|
||||||
passenger.updatePosition(this.getX(),this.getY(),this.getZ());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,126 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.entity;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.init.Pool;
|
|
||||||
import net.minecraft.block.BlockState;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.EntityType;
|
|
||||||
import net.minecraft.entity.damage.DamageSource;
|
|
||||||
import net.minecraft.entity.passive.PigEntity;
|
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
|
||||||
import net.minecraft.fluid.Fluid;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.sound.SoundEvent;
|
|
||||||
import net.minecraft.tag.Tag;
|
|
||||||
import net.minecraft.util.ActionResult;
|
|
||||||
import net.minecraft.util.Hand;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.util.math.Vec3d;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class BeachBallEntity extends PigEntity {
|
|
||||||
public BeachBallEntity(EntityType<? extends PigEntity> entityType, World world) {
|
|
||||||
super(entityType, world);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected int getCurrentExperience(PlayerEntity player) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEvent getAmbientSound() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEvent getHurtSound(DamageSource source) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEvent getDeathSound() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void playStepSound(BlockPos pos, BlockState state) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canEat() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void swimUpward(Tag<Fluid> fluid) {
|
|
||||||
this.setVelocity(this.getVelocity().add(0.0D, 1.0D, 0.0D));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double getHeightOffset() {
|
|
||||||
return 0.0D;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canWalkOnFluid(Fluid fluid) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float getSaddledSpeed() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void initGoals() { }
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canBeRiddenInWater() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected int computeFallDamage(float fallDistance, float damageMultiplier) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean cannotDespawn() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected boolean movesIndependently() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canMoveVoluntarily() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canBeControlledByRider() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ActionResult interactAt(PlayerEntity player, Vec3d hitPos, Hand hand) {
|
|
||||||
if(!player.getEntityWorld().isClient && player.getStackInHand(hand)== ItemStack.EMPTY && hand==Hand.MAIN_HAND && player.isSneaking())
|
|
||||||
{
|
|
||||||
remove();
|
|
||||||
player.setStackInHand(hand, new ItemStack(Pool.BEACH_BALL_ITEM));
|
|
||||||
return ActionResult.SUCCESS;
|
|
||||||
}
|
|
||||||
return ActionResult.FAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updatePassengerPosition(Entity passenger) {
|
|
||||||
if(this.getPrimaryPassenger() instanceof PlayerEntity)
|
|
||||||
{
|
|
||||||
passenger.updatePosition(this.getX(),this.getY(),this.getZ());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.entity.client.model;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.BathTireEntity;
|
|
||||||
import net.minecraft.client.model.ModelPart;
|
|
||||||
import net.minecraft.client.render.VertexConsumer;
|
|
||||||
import net.minecraft.client.render.entity.model.EntityModel;
|
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
|
||||||
|
|
||||||
public class BathTireModel extends EntityModel<BathTireEntity> {
|
|
||||||
private final ModelPart body;
|
|
||||||
|
|
||||||
public BathTireModel() {
|
|
||||||
textureWidth = 16;
|
|
||||||
textureHeight = 16;
|
|
||||||
|
|
||||||
body = new ModelPart(this);
|
|
||||||
body.setPivot(0.0F, 24.0F, 0.0F);
|
|
||||||
body.setTextureOffset(0, 0).addCuboid(6.0F, -9.0F, -11.0F, 4.0F, 4.0F, 16.0F, 0.0F, false);
|
|
||||||
body.setTextureOffset(0, 0).addCuboid(-10.0F, -9.0F, -11.0F, 4.0F, 4.0F, 16.0F, 0.0F, false);
|
|
||||||
body.setTextureOffset(0, 0).addCuboid(-8.0F, -8.99F, -13.0F, 16.0F, 4.0F, 4.0F, 0.0F, false);
|
|
||||||
body.setTextureOffset(0, 0).addCuboid(-8.0F, -8.99F, 3.0F, 16.0F, 4.0F, 4.0F, 0.0F, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setAngles(BathTireEntity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch){
|
|
||||||
//previously the render function, render code was moved to a method below
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void render(MatrixStack matrixStack, VertexConsumer buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha){
|
|
||||||
body.render(matrixStack, buffer, packedLight, packedOverlay);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRotationAngle(ModelPart modelRenderer, float x, float y, float z) {
|
|
||||||
modelRenderer.pivotX = x;
|
|
||||||
modelRenderer.pivotY = y;
|
|
||||||
modelRenderer.pivotZ = z;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.entity.client.model;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.BeachBallEntity;
|
|
||||||
import net.minecraft.client.model.ModelPart;
|
|
||||||
import net.minecraft.client.render.VertexConsumer;
|
|
||||||
import net.minecraft.client.render.entity.model.EntityModel;
|
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
|
||||||
|
|
||||||
public class BeachBallModel extends EntityModel<BeachBallEntity> {
|
|
||||||
private final ModelPart body;
|
|
||||||
|
|
||||||
public BeachBallModel() {
|
|
||||||
textureWidth = 64;
|
|
||||||
textureHeight = 64;
|
|
||||||
|
|
||||||
body = new ModelPart(this);
|
|
||||||
body.setPivot(0.0F, 24.0F, 0.0F);
|
|
||||||
body.setTextureOffset(0, 22).addCuboid(-4.0F, -1.0F, -4.0F, 8.0F, 1.0F, 8.0F, 0.0F, false);
|
|
||||||
body.setTextureOffset(0, 22).addCuboid(-4.0F, -12.0F, -4.0F, 8.0F, 1.0F, 8.0F, 0.0F, false);
|
|
||||||
body.setTextureOffset(0, 48).addCuboid(-6.0F, -10.0F, -4.0F, 1.0F, 8.0F, 8.0F, 0.0F, false);
|
|
||||||
body.setTextureOffset(20, 48).addCuboid(5.0F, -10.0F, -4.0F, 1.0F, 8.0F, 8.0F, 0.0F, false);
|
|
||||||
body.setTextureOffset(0, 33).addCuboid(-4.0F, -10.0F, -6.0F, 8.0F, 8.0F, 1.0F, 0.0F, false);
|
|
||||||
body.setTextureOffset(20, 33).addCuboid(-4.0F, -10.0F, 5.0F, 8.0F, 8.0F, 1.0F, 0.0F, false);
|
|
||||||
body.setTextureOffset(0, 0).addCuboid(-5.0F, -11.0F, -5.0F, 10.0F, 10.0F, 10.0F, 0.0F, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setAngles(BeachBallEntity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch){
|
|
||||||
//previously the render function, render code was moved to a method below
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void render(MatrixStack matrixStack, VertexConsumer buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha){
|
|
||||||
body.render(matrixStack, buffer, packedLight, packedOverlay);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRotationAngle(ModelPart modelRenderer, float x, float y, float z) {
|
|
||||||
modelRenderer.pivotX = x;
|
|
||||||
modelRenderer.pivotY = y;
|
|
||||||
modelRenderer.pivotZ = z;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.entity.client.model;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.BathTireEntity;
|
|
||||||
import net.minecraft.client.model.ModelPart;
|
|
||||||
import net.minecraft.client.render.VertexConsumer;
|
|
||||||
import net.minecraft.client.render.entity.model.EntityModel;
|
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
|
||||||
|
|
||||||
public class DuckBathTireModel extends EntityModel<BathTireEntity> {
|
|
||||||
private final ModelPart body;
|
|
||||||
|
|
||||||
public DuckBathTireModel() {
|
|
||||||
textureWidth = 64;
|
|
||||||
textureHeight = 64;
|
|
||||||
|
|
||||||
body = new ModelPart(this);
|
|
||||||
body.setPivot(0.0F, 19.0F, 0.0F);
|
|
||||||
body.setTextureOffset(0, 9).addCuboid(6.0F, -3.0F, -8.0F, 4.0F, 3.0F, 16.0F, 0.0F, false);
|
|
||||||
body.setTextureOffset(0, 37).addCuboid(-10.0F, -3.0F, -8.0F, 4.0F, 3.0F, 16.0F, 0.0F, false);
|
|
||||||
body.setTextureOffset(0, 57).addCuboid(-8.0F, -2.99F, -10.0F, 16.0F, 3.0F, 4.0F, 0.0F, false);
|
|
||||||
body.setTextureOffset(0, 29).addCuboid(-8.0F, -2.99F, 6.0F, 16.0F, 3.0F, 4.0F, 0.0F, false);
|
|
||||||
body.setTextureOffset(50, 0).addCuboid(-2.0F, -8.0F, -10.0F, 4.0F, 5.0F, 3.0F, 0.0F, false);
|
|
||||||
body.setTextureOffset(46, 11).addCuboid(-2.999F, -10.0F, -12.0F, 6.0F, 5.0F, 3.0F, 0.0F, false);
|
|
||||||
body.setTextureOffset(15, 31).addCuboid(-2.499F, -10.5F, -12.001F, 5.0F, 1.0F, 3.0F, 0.0F, false);
|
|
||||||
body.setTextureOffset(58, 20).addCuboid(-0.999F, -8.0F, -13.0F, 2.0F, 2.0F, 1.0F, 0.0F, false);
|
|
||||||
body.setTextureOffset(58, 20).addCuboid(-1.999F, -7.0F, -13.0F, 1.0F, 1.0F, 1.0F, 0.0F, false);
|
|
||||||
body.setTextureOffset(53, 21).addCuboid(-1.999F, -10.0F, -12.5F, 1.0F, 1.0F, 1.0F, 0.0F, false);
|
|
||||||
body.setTextureOffset(53, 21).addCuboid(1.001F, -10.0F, -12.5F, 1.0F, 1.0F, 1.0F, 0.0F, false);
|
|
||||||
body.setTextureOffset(58, 20).addCuboid(1.001F, -7.0F, -13.0F, 1.0F, 1.0F, 1.0F, 0.0F, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setAngles(BathTireEntity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch){
|
|
||||||
//previously the render function, render code was moved to a method below
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void render(MatrixStack matrixStack, VertexConsumer buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha){
|
|
||||||
body.render(matrixStack, buffer, packedLight, packedOverlay);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRotationAngle(ModelPart modelRenderer, float x, float y, float z) {
|
|
||||||
modelRenderer.pivotX = x;
|
|
||||||
modelRenderer.pivotY = y;
|
|
||||||
modelRenderer.pivotZ = z;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.entity.client.renderer;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.DecorativeMain;
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.BeachBallEntity;
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.client.model.BeachBallModel;
|
|
||||||
import net.fabricmc.api.EnvType;
|
|
||||||
import net.fabricmc.api.Environment;
|
|
||||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.render.entity.MobEntityRenderer;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
|
||||||
public class BeachBallRenderer extends MobEntityRenderer<BeachBallEntity, BeachBallModel> {
|
|
||||||
|
|
||||||
public BeachBallRenderer(EntityRenderDispatcher dispatcher) {
|
|
||||||
super(dispatcher, new BeachBallModel(), 0.5F);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Identifier getTexture(BeachBallEntity entity) {
|
|
||||||
return new Identifier(DecorativeMain.MOD_ID, "textures/entity/beach_ball.png");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.entity.client.renderer;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.BathTireEntity;
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.client.model.BathTireModel;
|
|
||||||
import net.fabricmc.api.EnvType;
|
|
||||||
import net.fabricmc.api.Environment;
|
|
||||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.render.entity.MobEntityRenderer;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
|
||||||
public class BlackBathTireRenderer extends MobEntityRenderer<BathTireEntity, BathTireModel> {
|
|
||||||
|
|
||||||
public BlackBathTireRenderer(EntityRenderDispatcher dispatcher) {
|
|
||||||
super(dispatcher, new BathTireModel(), 0.5F);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Identifier getTexture(BathTireEntity entity) {
|
|
||||||
return new Identifier("minecraft", "textures/block/black_concrete.png");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.entity.client.renderer;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.BathTireEntity;
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.client.model.BathTireModel;
|
|
||||||
import net.fabricmc.api.EnvType;
|
|
||||||
import net.fabricmc.api.Environment;
|
|
||||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.render.entity.MobEntityRenderer;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
|
||||||
public class BlueBathTireRenderer extends MobEntityRenderer<BathTireEntity, BathTireModel> {
|
|
||||||
|
|
||||||
public BlueBathTireRenderer(EntityRenderDispatcher dispatcher) {
|
|
||||||
super(dispatcher, new BathTireModel(), 0.5F);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Identifier getTexture(BathTireEntity entity) {
|
|
||||||
return new Identifier("minecraft", "textures/block/blue_concrete.png");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.entity.client.renderer;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.BathTireEntity;
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.client.model.BathTireModel;
|
|
||||||
import net.fabricmc.api.EnvType;
|
|
||||||
import net.fabricmc.api.Environment;
|
|
||||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.render.entity.MobEntityRenderer;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
|
||||||
public class BrownBathTireRenderer extends MobEntityRenderer<BathTireEntity, BathTireModel> {
|
|
||||||
|
|
||||||
public BrownBathTireRenderer(EntityRenderDispatcher dispatcher) {
|
|
||||||
super(dispatcher, new BathTireModel(), 0.5F);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Identifier getTexture(BathTireEntity entity) {
|
|
||||||
return new Identifier("minecraft", "textures/block/brown_concrete.png");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.entity.client.renderer;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.BathTireEntity;
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.client.model.BathTireModel;
|
|
||||||
import net.fabricmc.api.EnvType;
|
|
||||||
import net.fabricmc.api.Environment;
|
|
||||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.render.entity.MobEntityRenderer;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
|
||||||
public class CyanBathTireRenderer extends MobEntityRenderer<BathTireEntity, BathTireModel> {
|
|
||||||
|
|
||||||
public CyanBathTireRenderer(EntityRenderDispatcher dispatcher) {
|
|
||||||
super(dispatcher, new BathTireModel(), 0.5F);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Identifier getTexture(BathTireEntity entity) {
|
|
||||||
return new Identifier("minecraft", "textures/block/cyan_concrete.png");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.entity.client.renderer;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.DecorativeMain;
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.BathTireEntity;
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.BeachBallEntity;
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.client.model.BeachBallModel;
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.client.model.DuckBathTireModel;
|
|
||||||
import net.fabricmc.api.EnvType;
|
|
||||||
import net.fabricmc.api.Environment;
|
|
||||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.render.entity.MobEntityRenderer;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
|
||||||
public class DuckBathTireRenderer extends MobEntityRenderer<BathTireEntity, DuckBathTireModel> {
|
|
||||||
|
|
||||||
public DuckBathTireRenderer(EntityRenderDispatcher dispatcher) { super(dispatcher, new DuckBathTireModel(), 0.5F); }
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Identifier getTexture(BathTireEntity entity) {
|
|
||||||
return new Identifier(DecorativeMain.MOD_ID, "textures/entity/duck_bath_tire.png");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.entity.client.renderer;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.BathTireEntity;
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.client.model.BathTireModel;
|
|
||||||
import net.fabricmc.api.EnvType;
|
|
||||||
import net.fabricmc.api.Environment;
|
|
||||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.render.entity.MobEntityRenderer;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
|
||||||
public class GrayBathTireRenderer extends MobEntityRenderer<BathTireEntity, BathTireModel> {
|
|
||||||
|
|
||||||
public GrayBathTireRenderer(EntityRenderDispatcher dispatcher) {
|
|
||||||
super(dispatcher, new BathTireModel(), 0.5F);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Identifier getTexture(BathTireEntity entity) {
|
|
||||||
return new Identifier("minecraft", "textures/block/gray_concrete.png");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.entity.client.renderer;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.BathTireEntity;
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.client.model.BathTireModel;
|
|
||||||
import net.fabricmc.api.EnvType;
|
|
||||||
import net.fabricmc.api.Environment;
|
|
||||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.render.entity.MobEntityRenderer;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
|
||||||
public class GreenBathTireRenderer extends MobEntityRenderer<BathTireEntity, BathTireModel> {
|
|
||||||
|
|
||||||
public GreenBathTireRenderer(EntityRenderDispatcher dispatcher) {
|
|
||||||
super(dispatcher, new BathTireModel(), 0.5F);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Identifier getTexture(BathTireEntity entity) {
|
|
||||||
return new Identifier("minecraft", "textures/block/green_concrete.png");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.entity.client.renderer;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.BathTireEntity;
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.client.model.BathTireModel;
|
|
||||||
import net.fabricmc.api.EnvType;
|
|
||||||
import net.fabricmc.api.Environment;
|
|
||||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.render.entity.MobEntityRenderer;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
|
||||||
public class LightBlueBathTireRenderer extends MobEntityRenderer<BathTireEntity, BathTireModel> {
|
|
||||||
|
|
||||||
public LightBlueBathTireRenderer(EntityRenderDispatcher dispatcher) {
|
|
||||||
super(dispatcher, new BathTireModel(), 0.5F);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Identifier getTexture(BathTireEntity entity) {
|
|
||||||
return new Identifier("minecraft", "textures/block/light_blue_concrete.png");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.entity.client.renderer;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.BathTireEntity;
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.client.model.BathTireModel;
|
|
||||||
import net.fabricmc.api.EnvType;
|
|
||||||
import net.fabricmc.api.Environment;
|
|
||||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.render.entity.MobEntityRenderer;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
|
||||||
public class LightGrayBathTireRenderer extends MobEntityRenderer<BathTireEntity, BathTireModel> {
|
|
||||||
|
|
||||||
public LightGrayBathTireRenderer(EntityRenderDispatcher dispatcher) {
|
|
||||||
super(dispatcher, new BathTireModel(), 0.5F);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Identifier getTexture(BathTireEntity entity) {
|
|
||||||
return new Identifier("minecraft", "textures/block/light_gray_concrete.png");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.entity.client.renderer;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.BathTireEntity;
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.client.model.BathTireModel;
|
|
||||||
import net.fabricmc.api.EnvType;
|
|
||||||
import net.fabricmc.api.Environment;
|
|
||||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.render.entity.MobEntityRenderer;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
|
||||||
public class LimeBathTireRenderer extends MobEntityRenderer<BathTireEntity, BathTireModel> {
|
|
||||||
|
|
||||||
public LimeBathTireRenderer(EntityRenderDispatcher dispatcher) {
|
|
||||||
super(dispatcher, new BathTireModel(), 0.5F);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Identifier getTexture(BathTireEntity entity) {
|
|
||||||
return new Identifier("minecraft", "textures/block/lime_concrete.png");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.entity.client.renderer;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.BathTireEntity;
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.client.model.BathTireModel;
|
|
||||||
import net.fabricmc.api.EnvType;
|
|
||||||
import net.fabricmc.api.Environment;
|
|
||||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.render.entity.MobEntityRenderer;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
|
||||||
public class MagentaBathTireRenderer extends MobEntityRenderer<BathTireEntity, BathTireModel> {
|
|
||||||
|
|
||||||
public MagentaBathTireRenderer(EntityRenderDispatcher dispatcher) {
|
|
||||||
super(dispatcher, new BathTireModel(), 0.5F);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Identifier getTexture(BathTireEntity entity) {
|
|
||||||
return new Identifier("minecraft", "textures/block/magenta_concrete.png");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.entity.client.renderer;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.BathTireEntity;
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.client.model.BathTireModel;
|
|
||||||
import net.fabricmc.api.EnvType;
|
|
||||||
import net.fabricmc.api.Environment;
|
|
||||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.render.entity.MobEntityRenderer;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
|
||||||
public class OrangeBathTireRenderer extends MobEntityRenderer<BathTireEntity, BathTireModel> {
|
|
||||||
|
|
||||||
public OrangeBathTireRenderer(EntityRenderDispatcher dispatcher) {
|
|
||||||
super(dispatcher, new BathTireModel(), 0.5F);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Identifier getTexture(BathTireEntity entity) {
|
|
||||||
return new Identifier("minecraft", "textures/block/orange_concrete.png");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.entity.client.renderer;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.BathTireEntity;
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.client.model.BathTireModel;
|
|
||||||
import net.fabricmc.api.EnvType;
|
|
||||||
import net.fabricmc.api.Environment;
|
|
||||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.render.entity.MobEntityRenderer;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
|
||||||
public class PinkBathTireRenderer extends MobEntityRenderer<BathTireEntity, BathTireModel> {
|
|
||||||
|
|
||||||
public PinkBathTireRenderer(EntityRenderDispatcher dispatcher) {
|
|
||||||
super(dispatcher, new BathTireModel(), 0.5F);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Identifier getTexture(BathTireEntity entity) {
|
|
||||||
return new Identifier("minecraft", "textures/block/pink_concrete.png");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.entity.client.renderer;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.BathTireEntity;
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.client.model.BathTireModel;
|
|
||||||
import net.fabricmc.api.EnvType;
|
|
||||||
import net.fabricmc.api.Environment;
|
|
||||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.render.entity.MobEntityRenderer;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
|
||||||
public class PurpleBathTireRenderer extends MobEntityRenderer<BathTireEntity, BathTireModel> {
|
|
||||||
|
|
||||||
public PurpleBathTireRenderer(EntityRenderDispatcher dispatcher) {
|
|
||||||
super(dispatcher, new BathTireModel(), 0.5F);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Identifier getTexture(BathTireEntity entity) {
|
|
||||||
return new Identifier("minecraft", "textures/block/purple_concrete.png");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.entity.client.renderer;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.BathTireEntity;
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.client.model.BathTireModel;
|
|
||||||
import net.fabricmc.api.EnvType;
|
|
||||||
import net.fabricmc.api.Environment;
|
|
||||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.render.entity.MobEntityRenderer;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
|
||||||
public class RedBathTireRenderer extends MobEntityRenderer<BathTireEntity, BathTireModel> {
|
|
||||||
|
|
||||||
public RedBathTireRenderer(EntityRenderDispatcher dispatcher) {
|
|
||||||
super(dispatcher, new BathTireModel(), 0.5F);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Identifier getTexture(BathTireEntity entity) {
|
|
||||||
return new Identifier("minecraft", "textures/block/red_concrete.png");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.entity.client.renderer;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.DecorativeMain;
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.BathTireEntity;
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.client.model.BathTireModel;
|
|
||||||
import net.fabricmc.api.EnvType;
|
|
||||||
import net.fabricmc.api.Environment;
|
|
||||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.render.entity.MobEntityRenderer;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
|
||||||
public class WhiteBathTireRenderer extends MobEntityRenderer<BathTireEntity, BathTireModel> {
|
|
||||||
|
|
||||||
public WhiteBathTireRenderer(EntityRenderDispatcher dispatcher) {
|
|
||||||
super(dispatcher, new BathTireModel(), 0.5F);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Identifier getTexture(BathTireEntity entity) {
|
|
||||||
return new Identifier("minecraft", "textures/block/white_concrete.png");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.entity.client.renderer;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.BathTireEntity;
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.client.model.BathTireModel;
|
|
||||||
import net.fabricmc.api.EnvType;
|
|
||||||
import net.fabricmc.api.Environment;
|
|
||||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.render.entity.MobEntityRenderer;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
|
||||||
public class YellowBathTireRenderer extends MobEntityRenderer<BathTireEntity, BathTireModel> {
|
|
||||||
|
|
||||||
public YellowBathTireRenderer(EntityRenderDispatcher dispatcher) {
|
|
||||||
super(dispatcher, new BathTireModel(), 0.5F);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Identifier getTexture(BathTireEntity entity) {
|
|
||||||
return new Identifier("minecraft", "textures/block/yellow_concrete.png");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.init;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.DecorativeMain;
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.BathTireEntity;
|
|
||||||
import eu.midnightdust.motschen.decorative.item.BathTireItem;
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricDefaultAttributeRegistry;
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricEntityTypeBuilder;
|
|
||||||
import net.minecraft.entity.EntityDimensions;
|
|
||||||
import net.minecraft.entity.EntityType;
|
|
||||||
import net.minecraft.entity.SpawnGroup;
|
|
||||||
import net.minecraft.entity.attribute.EntityAttributes;
|
|
||||||
import net.minecraft.entity.mob.MobEntity;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
import net.minecraft.util.registry.Registry;
|
|
||||||
|
|
||||||
public class BathTires {
|
|
||||||
public static final EntityType<BathTireEntity> WHITE_BATH_TIRE =
|
|
||||||
Registry.register(Registry.ENTITY_TYPE,new Identifier(DecorativeMain.MOD_ID,"white_bath_tire"), FabricEntityTypeBuilder.create(SpawnGroup.AMBIENT,BathTireEntity::new).dimensions(EntityDimensions.fixed(1.5f,1)).trackable(100,4).build());
|
|
||||||
public static final EntityType<BathTireEntity> ORANGE_BATH_TIRE =
|
|
||||||
Registry.register(Registry.ENTITY_TYPE,new Identifier(DecorativeMain.MOD_ID,"orange_bath_tire"), FabricEntityTypeBuilder.create(SpawnGroup.AMBIENT,BathTireEntity::new).dimensions(EntityDimensions.fixed(1.5f,1)).trackable(100,4).build());
|
|
||||||
public static final EntityType<BathTireEntity> MAGENTA_BATH_TIRE=
|
|
||||||
Registry.register(Registry.ENTITY_TYPE,new Identifier(DecorativeMain.MOD_ID,"magenta_bath_tire"), FabricEntityTypeBuilder.create(SpawnGroup.AMBIENT,BathTireEntity::new).dimensions(EntityDimensions.fixed(1.5f,1)).trackable(100,4).build());
|
|
||||||
public static final EntityType<BathTireEntity> LIGHT_BLUE_BATH_TIRE =
|
|
||||||
Registry.register(Registry.ENTITY_TYPE,new Identifier(DecorativeMain.MOD_ID,"light_blue_bath_tire"), FabricEntityTypeBuilder.create(SpawnGroup.AMBIENT,BathTireEntity::new).dimensions(EntityDimensions.fixed(1.5f,1)).trackable(100,4).build());
|
|
||||||
public static final EntityType<BathTireEntity> YELLOW_BATH_TIRE =
|
|
||||||
Registry.register(Registry.ENTITY_TYPE,new Identifier(DecorativeMain.MOD_ID,"yellow_bath_tire"), FabricEntityTypeBuilder.create(SpawnGroup.AMBIENT,BathTireEntity::new).dimensions(EntityDimensions.fixed(1.5f,1)).trackable(100,4).build());
|
|
||||||
public static final EntityType<BathTireEntity> LIME_BATH_TIRE =
|
|
||||||
Registry.register(Registry.ENTITY_TYPE,new Identifier(DecorativeMain.MOD_ID,"lime_bath_tire"), FabricEntityTypeBuilder.create(SpawnGroup.AMBIENT,BathTireEntity::new).dimensions(EntityDimensions.fixed(1.5f,1)).trackable(100,4).build());
|
|
||||||
public static final EntityType<BathTireEntity> PINK_BATH_TIRE =
|
|
||||||
Registry.register(Registry.ENTITY_TYPE,new Identifier(DecorativeMain.MOD_ID,"pink_bath_tire"), FabricEntityTypeBuilder.create(SpawnGroup.AMBIENT,BathTireEntity::new).dimensions(EntityDimensions.fixed(1.5f,1)).trackable(100,4).build());
|
|
||||||
public static final EntityType<BathTireEntity> GRAY_BATH_TIRE =
|
|
||||||
Registry.register(Registry.ENTITY_TYPE,new Identifier(DecorativeMain.MOD_ID,"gray_bath_tire"), FabricEntityTypeBuilder.create(SpawnGroup.AMBIENT,BathTireEntity::new).dimensions(EntityDimensions.fixed(1.5f,1)).trackable(100,4).build());
|
|
||||||
public static final EntityType<BathTireEntity> LIGHT_GRAY_BATH_TIRE =
|
|
||||||
Registry.register(Registry.ENTITY_TYPE,new Identifier(DecorativeMain.MOD_ID,"light_gray_bath_tire"), FabricEntityTypeBuilder.create(SpawnGroup.AMBIENT,BathTireEntity::new).dimensions(EntityDimensions.fixed(1.5f,1)).trackable(100,4).build());
|
|
||||||
public static final EntityType<BathTireEntity> CYAN_BATH_TIRE =
|
|
||||||
Registry.register(Registry.ENTITY_TYPE,new Identifier(DecorativeMain.MOD_ID,"cyan_bath_tire"), FabricEntityTypeBuilder.create(SpawnGroup.AMBIENT,BathTireEntity::new).dimensions(EntityDimensions.fixed(1.5f,1)).trackable(100,4).build());
|
|
||||||
public static final EntityType<BathTireEntity> PURPLE_BATH_TIRE =
|
|
||||||
Registry.register(Registry.ENTITY_TYPE,new Identifier(DecorativeMain.MOD_ID,"purple_bath_tire"), FabricEntityTypeBuilder.create(SpawnGroup.AMBIENT,BathTireEntity::new).dimensions(EntityDimensions.fixed(1.5f,1)).trackable(100,4).build());
|
|
||||||
public static final EntityType<BathTireEntity> BLUE_BATH_TIRE =
|
|
||||||
Registry.register(Registry.ENTITY_TYPE,new Identifier(DecorativeMain.MOD_ID,"blue_bath_tire"), FabricEntityTypeBuilder.create(SpawnGroup.AMBIENT,BathTireEntity::new).dimensions(EntityDimensions.fixed(1.5f,1)).trackable(100,4).build());
|
|
||||||
public static final EntityType<BathTireEntity> BROWN_BATH_TIRE =
|
|
||||||
Registry.register(Registry.ENTITY_TYPE,new Identifier(DecorativeMain.MOD_ID,"brown_bath_tire"), FabricEntityTypeBuilder.create(SpawnGroup.AMBIENT,BathTireEntity::new).dimensions(EntityDimensions.fixed(1.5f,1)).trackable(100,4).build());
|
|
||||||
public static final EntityType<BathTireEntity> GREEN_BATH_TIRE =
|
|
||||||
Registry.register(Registry.ENTITY_TYPE,new Identifier(DecorativeMain.MOD_ID,"green_bath_tire"), FabricEntityTypeBuilder.create(SpawnGroup.AMBIENT,BathTireEntity::new).dimensions(EntityDimensions.fixed(1.5f,1)).trackable(100,4).build());
|
|
||||||
public static final EntityType<BathTireEntity> RED_BATH_TIRE =
|
|
||||||
Registry.register(Registry.ENTITY_TYPE,new Identifier(DecorativeMain.MOD_ID,"red_bath_tire"), FabricEntityTypeBuilder.create(SpawnGroup.AMBIENT,BathTireEntity::new).dimensions(EntityDimensions.fixed(1.5f,1)).trackable(100,4).build());
|
|
||||||
public static final EntityType<BathTireEntity> BLACK_BATH_TIRE =
|
|
||||||
Registry.register(Registry.ENTITY_TYPE,new Identifier(DecorativeMain.MOD_ID,"black_bath_tire"), FabricEntityTypeBuilder.create(SpawnGroup.AMBIENT,BathTireEntity::new).dimensions(EntityDimensions.fixed(1.5f,1)).trackable(100,4).build());
|
|
||||||
|
|
||||||
public static final EntityType<BathTireEntity> DUCK_BATH_TIRE =
|
|
||||||
Registry.register(Registry.ENTITY_TYPE,new Identifier(DecorativeMain.MOD_ID,"duck_bath_tire"), FabricEntityTypeBuilder.create(SpawnGroup.AMBIENT,BathTireEntity::new).dimensions(EntityDimensions.fixed(1.5f,1)).trackable(100,4).build());
|
|
||||||
|
|
||||||
public static void init() {
|
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"white_bath_tire"), new BathTireItem(WHITE_BATH_TIRE, new Item.Settings().group(DecorativeMain.PoolGroup)));
|
|
||||||
FabricDefaultAttributeRegistry.register(WHITE_BATH_TIRE, MobEntity.createMobAttributes().add(EntityAttributes.GENERIC_MAX_HEALTH, 2.0D));
|
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"orange_bath_tire"), new BathTireItem(ORANGE_BATH_TIRE, new Item.Settings().group(DecorativeMain.PoolGroup)));
|
|
||||||
FabricDefaultAttributeRegistry.register(ORANGE_BATH_TIRE, MobEntity.createMobAttributes().add(EntityAttributes.GENERIC_MAX_HEALTH, 2.0D));
|
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"magenta_bath_tire"), new BathTireItem(MAGENTA_BATH_TIRE, new Item.Settings().group(DecorativeMain.PoolGroup)));
|
|
||||||
FabricDefaultAttributeRegistry.register(MAGENTA_BATH_TIRE, MobEntity.createMobAttributes().add(EntityAttributes.GENERIC_MAX_HEALTH, 2.0D));
|
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"light_blue_bath_tire"), new BathTireItem(LIGHT_BLUE_BATH_TIRE, new Item.Settings().group(DecorativeMain.PoolGroup)));
|
|
||||||
FabricDefaultAttributeRegistry.register(LIGHT_BLUE_BATH_TIRE, MobEntity.createMobAttributes().add(EntityAttributes.GENERIC_MAX_HEALTH, 2.0D));
|
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"yellow_bath_tire"), new BathTireItem(YELLOW_BATH_TIRE, new Item.Settings().group(DecorativeMain.PoolGroup)));
|
|
||||||
FabricDefaultAttributeRegistry.register(YELLOW_BATH_TIRE, MobEntity.createMobAttributes().add(EntityAttributes.GENERIC_MAX_HEALTH, 2.0D));
|
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"lime_bath_tire"), new BathTireItem(LIME_BATH_TIRE, new Item.Settings().group(DecorativeMain.PoolGroup)));
|
|
||||||
FabricDefaultAttributeRegistry.register(LIME_BATH_TIRE, MobEntity.createMobAttributes().add(EntityAttributes.GENERIC_MAX_HEALTH, 2.0D));
|
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"pink_bath_tire"), new BathTireItem(PINK_BATH_TIRE, new Item.Settings().group(DecorativeMain.PoolGroup)));
|
|
||||||
FabricDefaultAttributeRegistry.register(PINK_BATH_TIRE, MobEntity.createMobAttributes().add(EntityAttributes.GENERIC_MAX_HEALTH, 2.0D));
|
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"gray_bath_tire"), new BathTireItem(GRAY_BATH_TIRE, new Item.Settings().group(DecorativeMain.PoolGroup)));
|
|
||||||
FabricDefaultAttributeRegistry.register(GRAY_BATH_TIRE, MobEntity.createMobAttributes().add(EntityAttributes.GENERIC_MAX_HEALTH, 2.0D));
|
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"light_gray_bath_tire"), new BathTireItem(LIGHT_GRAY_BATH_TIRE, new Item.Settings().group(DecorativeMain.PoolGroup)));
|
|
||||||
FabricDefaultAttributeRegistry.register(LIGHT_GRAY_BATH_TIRE, MobEntity.createMobAttributes().add(EntityAttributes.GENERIC_MAX_HEALTH, 2.0D));
|
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"cyan_bath_tire"), new BathTireItem(CYAN_BATH_TIRE, new Item.Settings().group(DecorativeMain.PoolGroup)));
|
|
||||||
FabricDefaultAttributeRegistry.register(CYAN_BATH_TIRE, MobEntity.createMobAttributes().add(EntityAttributes.GENERIC_MAX_HEALTH, 2.0D));
|
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"purple_bath_tire"), new BathTireItem(PURPLE_BATH_TIRE, new Item.Settings().group(DecorativeMain.PoolGroup)));
|
|
||||||
FabricDefaultAttributeRegistry.register(PURPLE_BATH_TIRE, MobEntity.createMobAttributes().add(EntityAttributes.GENERIC_MAX_HEALTH, 2.0D));
|
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"blue_bath_tire"), new BathTireItem(BLUE_BATH_TIRE, new Item.Settings().group(DecorativeMain.PoolGroup)));
|
|
||||||
FabricDefaultAttributeRegistry.register(BLUE_BATH_TIRE, MobEntity.createMobAttributes().add(EntityAttributes.GENERIC_MAX_HEALTH, 2.0D));
|
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"brown_bath_tire"), new BathTireItem(BROWN_BATH_TIRE, new Item.Settings().group(DecorativeMain.PoolGroup)));
|
|
||||||
FabricDefaultAttributeRegistry.register(BROWN_BATH_TIRE, MobEntity.createMobAttributes().add(EntityAttributes.GENERIC_MAX_HEALTH, 2.0D));
|
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"green_bath_tire"), new BathTireItem(GREEN_BATH_TIRE, new Item.Settings().group(DecorativeMain.PoolGroup)));
|
|
||||||
FabricDefaultAttributeRegistry.register(GREEN_BATH_TIRE, MobEntity.createMobAttributes().add(EntityAttributes.GENERIC_MAX_HEALTH, 2.0D));
|
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"red_bath_tire"), new BathTireItem(RED_BATH_TIRE, new Item.Settings().group(DecorativeMain.PoolGroup)));
|
|
||||||
FabricDefaultAttributeRegistry.register(RED_BATH_TIRE, MobEntity.createMobAttributes().add(EntityAttributes.GENERIC_MAX_HEALTH, 2.0D));
|
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"black_bath_tire"), new BathTireItem(BLACK_BATH_TIRE, new Item.Settings().group(DecorativeMain.PoolGroup)));
|
|
||||||
FabricDefaultAttributeRegistry.register(BLACK_BATH_TIRE, MobEntity.createMobAttributes().add(EntityAttributes.GENERIC_MAX_HEALTH, 2.0D));
|
|
||||||
|
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"duck_bath_tire"), new BathTireItem(DUCK_BATH_TIRE, new Item.Settings().group(DecorativeMain.PoolGroup)));
|
|
||||||
FabricDefaultAttributeRegistry.register(DUCK_BATH_TIRE, MobEntity.createMobAttributes().add(EntityAttributes.GENERIC_MAX_HEALTH, 2.0D));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.init;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.DecorativeMain;
|
|
||||||
import eu.midnightdust.motschen.decorative.block.blockentity.*;
|
|
||||||
import net.minecraft.block.entity.BlockEntityType;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
import net.minecraft.util.registry.Registry;
|
|
||||||
|
|
||||||
public class BlockEntities {
|
|
||||||
|
|
||||||
public static BlockEntityType<PoolSprinklerBlockEntity> PoolSprinklerBlockEntity;
|
|
||||||
public static BlockEntityType<ShowerHeadBlockEntity> ShowerHeadBlockEntity;
|
|
||||||
public static BlockEntityType<CeilingFanBlockEntity> CeilingFanBlockEntity;
|
|
||||||
public static BlockEntityType<OakChoppingLogBlockEntity> OakChoppingLogBlockEntity;
|
|
||||||
public static BlockEntityType<SpruceChoppingLogBlockEntity> SpruceChoppingLogBlockEntity;
|
|
||||||
public static BlockEntityType<BirchChoppingLogBlockEntity> BirchChoppingLogBlockEntity;
|
|
||||||
public static BlockEntityType<AcaciaChoppingLogBlockEntity> AcaciaChoppingLogBlockEntity;
|
|
||||||
public static BlockEntityType<JungleChoppingLogBlockEntity> JungleChoppingLogBlockEntity;
|
|
||||||
public static BlockEntityType<DarkOakChoppingLogBlockEntity> DarkOakChoppingLogBlockEntity;
|
|
||||||
|
|
||||||
public static void init() {
|
|
||||||
PoolSprinklerBlockEntity = Registry.register(Registry.BLOCK_ENTITY_TYPE, new Identifier(DecorativeMain.MOD_ID,"pool_sprinkler_blockentity"), BlockEntityType.Builder.create(PoolSprinklerBlockEntity::new, Pool.PoolSprinkler).build(null));
|
|
||||||
ShowerHeadBlockEntity = Registry.register(Registry.BLOCK_ENTITY_TYPE, new Identifier(DecorativeMain.MOD_ID,"shower_head_blockentity"), BlockEntityType.Builder.create(ShowerHeadBlockEntity::new, DecorativeMain.ShowerHead).build(null));
|
|
||||||
CeilingFanBlockEntity = Registry.register(Registry.BLOCK_ENTITY_TYPE, new Identifier(DecorativeMain.MOD_ID,"ceiling_fan_blockentity"), BlockEntityType.Builder.create(CeilingFanBlockEntity::new, DecorativeMain.CeilingFan).build(null));
|
|
||||||
OakChoppingLogBlockEntity = Registry.register(Registry.BLOCK_ENTITY_TYPE, new Identifier(DecorativeMain.MOD_ID,"oak_chopping_log_blockentity"), BlockEntityType.Builder.create(OakChoppingLogBlockEntity::new, LogsWithAxes.OakChoppingLog).build(null));
|
|
||||||
SpruceChoppingLogBlockEntity = Registry.register(Registry.BLOCK_ENTITY_TYPE, new Identifier(DecorativeMain.MOD_ID,"spruce_chopping_log_blockentity"), BlockEntityType.Builder.create(SpruceChoppingLogBlockEntity::new, LogsWithAxes.SpruceChoppingLog).build(null));
|
|
||||||
BirchChoppingLogBlockEntity = Registry.register(Registry.BLOCK_ENTITY_TYPE, new Identifier(DecorativeMain.MOD_ID,"birch_chopping_log_blockentity"), BlockEntityType.Builder.create(BirchChoppingLogBlockEntity::new, LogsWithAxes.BirchChoppingLog).build(null));
|
|
||||||
AcaciaChoppingLogBlockEntity = Registry.register(Registry.BLOCK_ENTITY_TYPE, new Identifier(DecorativeMain.MOD_ID,"acacia_chopping_log_blockentity"), BlockEntityType.Builder.create(AcaciaChoppingLogBlockEntity::new, LogsWithAxes.AcaciaChoppingLog).build(null));
|
|
||||||
JungleChoppingLogBlockEntity = Registry.register(Registry.BLOCK_ENTITY_TYPE, new Identifier(DecorativeMain.MOD_ID,"jungle_chopping_log_blockentity"), BlockEntityType.Builder.create(JungleChoppingLogBlockEntity::new, LogsWithAxes.JungleChoppingLog).build(null));
|
|
||||||
DarkOakChoppingLogBlockEntity = Registry.register(Registry.BLOCK_ENTITY_TYPE, new Identifier(DecorativeMain.MOD_ID,"dark_oak_chopping_log_blockentity"), BlockEntityType.Builder.create(DarkOakChoppingLogBlockEntity::new, LogsWithAxes.DarkOakChoppingLog).build(null));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -27,37 +27,37 @@ public class DoubleLamps {
|
|||||||
public static Block BlackDoubleLamp = new DoubleLamp();
|
public static Block BlackDoubleLamp = new DoubleLamp();
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"white_double_lamp"), WhiteDoubleLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","white_double_lamp"), WhiteDoubleLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"white_double_lamp"), new BlockItem(WhiteDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","white_double_lamp"), new BlockItem(WhiteDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"orange_double_lamp"), OrangeDoubleLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","orange_double_lamp"), OrangeDoubleLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"orange_double_lamp"), new BlockItem(OrangeDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","orange_double_lamp"), new BlockItem(OrangeDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"magenta_double_lamp"), MagentaDoubleLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","magenta_double_lamp"), MagentaDoubleLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"magenta_double_lamp"), new BlockItem(MagentaDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","magenta_double_lamp"), new BlockItem(MagentaDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"light_blue_double_lamp"), LightBlueDoubleLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","light_blue_double_lamp"), LightBlueDoubleLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"light_blue_double_lamp"), new BlockItem(LightBlueDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","light_blue_double_lamp"), new BlockItem(LightBlueDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"yellow_double_lamp"), YellowDoubleLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","yellow_double_lamp"), YellowDoubleLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"yellow_double_lamp"), new BlockItem(YellowDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","yellow_double_lamp"), new BlockItem(YellowDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"lime_double_lamp"), LimeDoubleLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","lime_double_lamp"), LimeDoubleLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"lime_double_lamp"), new BlockItem(LimeDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","lime_double_lamp"), new BlockItem(LimeDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"pink_double_lamp"), PinkDoubleLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","pink_double_lamp"), PinkDoubleLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"pink_double_lamp"), new BlockItem(PinkDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","pink_double_lamp"), new BlockItem(PinkDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"gray_double_lamp"), GrayDoubleLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","gray_double_lamp"), GrayDoubleLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"gray_double_lamp"), new BlockItem(GrayDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","gray_double_lamp"), new BlockItem(GrayDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"light_gray_double_lamp"), LightGrayDoubleLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","light_gray_double_lamp"), LightGrayDoubleLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"light_gray_double_lamp"), new BlockItem(LightGrayDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","light_gray_double_lamp"), new BlockItem(LightGrayDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"cyan_double_lamp"), CyanDoubleLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","cyan_double_lamp"), CyanDoubleLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"cyan_double_lamp"), new BlockItem(CyanDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","cyan_double_lamp"), new BlockItem(CyanDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"purple_double_lamp"), PurpleDoubleLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","purple_double_lamp"), PurpleDoubleLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"purple_double_lamp"), new BlockItem(PurpleDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","purple_double_lamp"), new BlockItem(PurpleDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"blue_double_lamp"), BlueDoubleLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","blue_double_lamp"), BlueDoubleLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"blue_double_lamp"), new BlockItem(BlueDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","blue_double_lamp"), new BlockItem(BlueDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"brown_double_lamp"), BrownDoubleLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","brown_double_lamp"), BrownDoubleLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"brown_double_lamp"), new BlockItem(BrownDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","brown_double_lamp"), new BlockItem(BrownDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"green_double_lamp"), GreenDoubleLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","green_double_lamp"), GreenDoubleLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"green_double_lamp"), new BlockItem(GreenDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","green_double_lamp"), new BlockItem(GreenDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"red_double_lamp"), RedDoubleLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","red_double_lamp"), RedDoubleLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"red_double_lamp"), new BlockItem(RedDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","red_double_lamp"), new BlockItem(RedDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"black_double_lamp"), BlackDoubleLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","black_double_lamp"), BlackDoubleLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"black_double_lamp"), new BlockItem(BlackDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","black_double_lamp"), new BlockItem(BlackDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,37 +27,37 @@ public class Lamps {
|
|||||||
public static Block BlackLamp = new Lamp();
|
public static Block BlackLamp = new Lamp();
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"white_lamp"), WhiteLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","white_lamp"), WhiteLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"white_lamp"), new BlockItem(WhiteLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","white_lamp"), new BlockItem(WhiteLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"orange_lamp"), OrangeLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","orange_lamp"), OrangeLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"orange_lamp"), new BlockItem(OrangeLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","orange_lamp"), new BlockItem(OrangeLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"magenta_lamp"), MagentaLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","magenta_lamp"), MagentaLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"magenta_lamp"), new BlockItem(MagentaLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","magenta_lamp"), new BlockItem(MagentaLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"light_blue_lamp"), LightBlueLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","light_blue_lamp"), LightBlueLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"light_blue_lamp"), new BlockItem(LightBlueLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","light_blue_lamp"), new BlockItem(LightBlueLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"yellow_lamp"), YellowLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","yellow_lamp"), YellowLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"yellow_lamp"), new BlockItem(YellowLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","yellow_lamp"), new BlockItem(YellowLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"lime_lamp"), LimeLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","lime_lamp"), LimeLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"lime_lamp"), new BlockItem(LimeLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","lime_lamp"), new BlockItem(LimeLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"pink_lamp"), PinkLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","pink_lamp"), PinkLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"pink_lamp"), new BlockItem(PinkLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","pink_lamp"), new BlockItem(PinkLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"gray_lamp"), GrayLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","gray_lamp"), GrayLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"gray_lamp"), new BlockItem(GrayLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","gray_lamp"), new BlockItem(GrayLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"light_gray_lamp"), LightGrayLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","light_gray_lamp"), LightGrayLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"light_gray_lamp"), new BlockItem(LightGrayLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","light_gray_lamp"), new BlockItem(LightGrayLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"cyan_lamp"), CyanLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","cyan_lamp"), CyanLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"cyan_lamp"), new BlockItem(CyanLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","cyan_lamp"), new BlockItem(CyanLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"purple_lamp"), PurpleLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","purple_lamp"), PurpleLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"purple_lamp"), new BlockItem(PurpleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","purple_lamp"), new BlockItem(PurpleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"blue_lamp"), BlueLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","blue_lamp"), BlueLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"blue_lamp"), new BlockItem(BlueLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","blue_lamp"), new BlockItem(BlueLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"brown_lamp"), BrownLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","brown_lamp"), BrownLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"brown_lamp"), new BlockItem(BrownLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","brown_lamp"), new BlockItem(BrownLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"green_lamp"), GreenLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","green_lamp"), GreenLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"green_lamp"), new BlockItem(GreenLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","green_lamp"), new BlockItem(GreenLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"red_lamp"), RedLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","red_lamp"), RedLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"red_lamp"), new BlockItem(RedLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","red_lamp"), new BlockItem(RedLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"black_lamp"), BlackLamp);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","black_lamp"), BlackLamp);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"black_lamp"), new BlockItem(BlackLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","black_lamp"), new BlockItem(BlackLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
package eu.midnightdust.motschen.decorative.init;
|
package eu.midnightdust.motschen.decorative.init;
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.DecorativeMain;
|
import eu.midnightdust.motschen.decorative.DecorativeMain;
|
||||||
import eu.midnightdust.motschen.decorative.block.*;
|
import eu.midnightdust.motschen.decorative.block.Lamp;
|
||||||
|
import eu.midnightdust.motschen.decorative.block.LogWithAxe;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.item.BlockItem;
|
import net.minecraft.item.BlockItem;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
@@ -9,25 +10,25 @@ import net.minecraft.util.Identifier;
|
|||||||
import net.minecraft.util.registry.Registry;
|
import net.minecraft.util.registry.Registry;
|
||||||
|
|
||||||
public class LogsWithAxes {
|
public class LogsWithAxes {
|
||||||
public static Block OakChoppingLog = new OakChoppingLog();
|
public static Block OakLogWithAxe = new LogWithAxe();
|
||||||
public static Block SpruceChoppingLog = new SpruceChoppingLog();
|
public static Block SpruceLogWithAxe = new LogWithAxe();
|
||||||
public static Block BirchChoppingLog = new BirchChoppingLog();
|
public static Block BirchLogWithAxe = new LogWithAxe();
|
||||||
public static Block AcaciaChoppingLog = new AcaciaChoppingLog();
|
public static Block AcaciaLogWithAxe = new LogWithAxe();
|
||||||
public static Block JungleChoppingLog = new JungleChoppingLog();
|
public static Block JungleLogWithAxe = new LogWithAxe();
|
||||||
public static Block DarkOakChoppingLog = new DarkOakChoppingLog();
|
public static Block DarkOakLogWithAxe = new LogWithAxe();
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"oak_log_with_axe"), OakChoppingLog);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","oak_log_with_axe"), OakLogWithAxe);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"oak_log_with_axe"), new BlockItem(OakChoppingLog, new Item.Settings().group(DecorativeMain.GardenGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","oak_log_with_axe"), new BlockItem(OakLogWithAxe, new Item.Settings().group(DecorativeMain.GardenGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"spruce_log_with_axe"), SpruceChoppingLog);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","spruce_log_with_axe"), SpruceLogWithAxe);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"spruce_log_with_axe"), new BlockItem(SpruceChoppingLog, new Item.Settings().group(DecorativeMain.GardenGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","spruce_log_with_axe"), new BlockItem(SpruceLogWithAxe, new Item.Settings().group(DecorativeMain.GardenGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"birch_log_with_axe"), BirchChoppingLog);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","birch_log_with_axe"), BirchLogWithAxe);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"birch_log_with_axe"), new BlockItem(BirchChoppingLog, new Item.Settings().group(DecorativeMain.GardenGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","birch_log_with_axe"), new BlockItem(BirchLogWithAxe, new Item.Settings().group(DecorativeMain.GardenGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"acacia_log_with_axe"), AcaciaChoppingLog);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","acacia_log_with_axe"), AcaciaLogWithAxe);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"acacia_log_with_axe"), new BlockItem(AcaciaChoppingLog, new Item.Settings().group(DecorativeMain.GardenGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","acacia_log_with_axe"), new BlockItem(AcaciaLogWithAxe, new Item.Settings().group(DecorativeMain.GardenGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"jungle_log_with_axe"), JungleChoppingLog);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","jungle_log_with_axe"), JungleLogWithAxe);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"jungle_log_with_axe"), new BlockItem(JungleChoppingLog, new Item.Settings().group(DecorativeMain.GardenGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","jungle_log_with_axe"), new BlockItem(JungleLogWithAxe, new Item.Settings().group(DecorativeMain.GardenGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"dark_oak_log_with_axe"), DarkOakChoppingLog);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","dark_oak_log_with_axe"), DarkOakLogWithAxe);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"dark_oak_log_with_axe"), new BlockItem(DarkOakChoppingLog, new Item.Settings().group(DecorativeMain.GardenGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","dark_oak_log_with_axe"), new BlockItem(DarkOakLogWithAxe, new Item.Settings().group(DecorativeMain.GardenGroup)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,42 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.init;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.DecorativeMain;
|
|
||||||
import eu.midnightdust.motschen.decorative.block.PoolSprinkler;
|
|
||||||
import eu.midnightdust.motschen.decorative.block.PoolWall;
|
|
||||||
import eu.midnightdust.motschen.decorative.block.Springboard;
|
|
||||||
import eu.midnightdust.motschen.decorative.entity.BeachBallEntity;
|
|
||||||
import eu.midnightdust.motschen.decorative.item.BathTireItem;
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricDefaultAttributeRegistry;
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricEntityTypeBuilder;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.entity.EntityDimensions;
|
|
||||||
import net.minecraft.entity.EntityType;
|
|
||||||
import net.minecraft.entity.SpawnGroup;
|
|
||||||
import net.minecraft.entity.attribute.EntityAttributes;
|
|
||||||
import net.minecraft.entity.mob.MobEntity;
|
|
||||||
import net.minecraft.item.BlockItem;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
import net.minecraft.util.registry.Registry;
|
|
||||||
|
|
||||||
public class Pool {
|
|
||||||
|
|
||||||
public static final EntityType<BeachBallEntity> BEACH_BALL =
|
|
||||||
Registry.register(Registry.ENTITY_TYPE,new Identifier(DecorativeMain.MOD_ID,"beach_ball"), FabricEntityTypeBuilder.create(SpawnGroup.AMBIENT, BeachBallEntity::new).dimensions(EntityDimensions.fixed(0.9f,0.9f)).trackable(100,4).build());
|
|
||||||
public static Item BEACH_BALL_ITEM = new BathTireItem(BEACH_BALL, new Item.Settings().group(DecorativeMain.PoolGroup));
|
|
||||||
public static Block PoolWall = new PoolWall();
|
|
||||||
public static Block Springboard = new Springboard();
|
|
||||||
public static Block PoolSprinkler = new PoolSprinkler();
|
|
||||||
|
|
||||||
public static void init() {
|
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"pool_wall"), PoolWall);
|
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"pool_wall"), new BlockItem(PoolWall, new Item.Settings().group(DecorativeMain.PoolGroup)));
|
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"springboard"), Springboard);
|
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"springboard"), new BlockItem(Springboard, new Item.Settings().group(DecorativeMain.PoolGroup)));
|
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"pool_sprinkler"), PoolSprinkler);
|
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"pool_sprinkler"), new BlockItem(PoolSprinkler, new Item.Settings().group(DecorativeMain.PoolGroup)));
|
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"beach_ball"), BEACH_BALL_ITEM);
|
|
||||||
FabricDefaultAttributeRegistry.register(BEACH_BALL, MobEntity.createMobAttributes().add(EntityAttributes.GENERIC_MAX_HEALTH, 100000.0D).add(EntityAttributes.GENERIC_KNOCKBACK_RESISTANCE, -10D));
|
|
||||||
BathTires.init();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package eu.midnightdust.motschen.decorative.init;
|
package eu.midnightdust.motschen.decorative.init;
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.DecorativeMain;
|
import eu.midnightdust.motschen.decorative.DecorativeMain;
|
||||||
|
import eu.midnightdust.motschen.decorative.block.LogWithAxe;
|
||||||
import eu.midnightdust.motschen.decorative.block.Sign;
|
import eu.midnightdust.motschen.decorative.block.Sign;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.item.BlockItem;
|
import net.minecraft.item.BlockItem;
|
||||||
@@ -25,34 +26,34 @@ public class Signs {
|
|||||||
public static Block OnehundredtenSign = new Sign();
|
public static Block OnehundredtenSign = new Sign();
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"empty_sign"), EmptySign);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","empty_sign"), EmptySign);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"empty_sign"), new BlockItem(EmptySign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","empty_sign"), new BlockItem(EmptySign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
||||||
|
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"stop_sign"), StopSign);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","stop_sign"), StopSign);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"stop_sign"), new BlockItem(StopSign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","stop_sign"), new BlockItem(StopSign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"five_sign"), FiveSign);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","five_sign"), FiveSign);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"five_sign"), new BlockItem(FiveSign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","five_sign"), new BlockItem(FiveSign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"ten_sign"), TenSign);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","ten_sign"), TenSign);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"ten_sign"), new BlockItem(TenSign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","ten_sign"), new BlockItem(TenSign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"twenty_sign"), TwentySign);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","twenty_sign"), TwentySign);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"twenty_sign"), new BlockItem(TwentySign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","twenty_sign"), new BlockItem(TwentySign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"thirty_sign"), ThirtySign);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","thirty_sign"), ThirtySign);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"thirty_sign"), new BlockItem(ThirtySign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","thirty_sign"), new BlockItem(ThirtySign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"forty_sign"), FortySign);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","forty_sign"), FortySign);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"forty_sign"), new BlockItem(FortySign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","forty_sign"), new BlockItem(FortySign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"fifty_sign"), FiftySign);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","fifty_sign"), FiftySign);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"fifty_sign"), new BlockItem(FiftySign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","fifty_sign"), new BlockItem(FiftySign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"sixty_sign"), SixtySign);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","sixty_sign"), SixtySign);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"sixty_sign"), new BlockItem(SixtySign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","sixty_sign"), new BlockItem(SixtySign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"seventy_sign"), SeventySign);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","seventy_sign"), SeventySign);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"seventy_sign"), new BlockItem(SeventySign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","seventy_sign"), new BlockItem(SeventySign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"eighty_sign"), EightySign);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","eighty_sign"), EightySign);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"eighty_sign"), new BlockItem(EightySign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","eighty_sign"), new BlockItem(EightySign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"ninety_sign"), NinetySign);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","ninety_sign"), NinetySign);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"ninety_sign"), new BlockItem(NinetySign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","ninety_sign"), new BlockItem(NinetySign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"onehundred_sign"), OnehundredSign);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","onehundred_sign"), OnehundredSign);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"onehundred_sign"), new BlockItem(OnehundredSign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","onehundred_sign"), new BlockItem(OnehundredSign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
||||||
Registry.register(Registry.BLOCK, new Identifier(DecorativeMain.MOD_ID,"onehundredten_sign"), OnehundredtenSign);
|
Registry.register(Registry.BLOCK, new Identifier("decorative","onehundredten_sign"), OnehundredtenSign);
|
||||||
Registry.register(Registry.ITEM, new Identifier(DecorativeMain.MOD_ID,"onehundredten_sign"), new BlockItem(OnehundredtenSign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
Registry.register(Registry.ITEM, new Identifier("decorative","onehundredten_sign"), new BlockItem(OnehundredtenSign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,72 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.item;
|
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
|
||||||
import java.util.Map;
|
|
||||||
import net.minecraft.block.FluidBlock;
|
|
||||||
import net.minecraft.entity.EntityType;
|
|
||||||
import net.minecraft.entity.SpawnReason;
|
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.nbt.CompoundTag;
|
|
||||||
import net.minecraft.server.world.ServerWorld;
|
|
||||||
import net.minecraft.stat.Stats;
|
|
||||||
import net.minecraft.util.Hand;
|
|
||||||
import net.minecraft.util.TypedActionResult;
|
|
||||||
import net.minecraft.util.hit.BlockHitResult;
|
|
||||||
import net.minecraft.util.hit.HitResult;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.RayTraceContext;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class BathTireItem extends Item {
|
|
||||||
private static final Map<EntityType<?>, BathTireItem> SPAWN_EGGS = Maps.newIdentityHashMap();
|
|
||||||
private final EntityType<?> type;
|
|
||||||
|
|
||||||
public BathTireItem(EntityType<?> type, Item.Settings settings) {
|
|
||||||
super(settings);
|
|
||||||
this.type = type;
|
|
||||||
SPAWN_EGGS.put(type, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public TypedActionResult<ItemStack> use(World world, PlayerEntity user, Hand hand) {
|
|
||||||
ItemStack itemStack = user.getStackInHand(hand);
|
|
||||||
HitResult hitResult = rayTrace(world, user, RayTraceContext.FluidHandling.SOURCE_ONLY);
|
|
||||||
if (hitResult.getType() != HitResult.Type.BLOCK) {
|
|
||||||
return TypedActionResult.pass(itemStack);
|
|
||||||
} else if (world.isClient) {
|
|
||||||
return TypedActionResult.success(itemStack);
|
|
||||||
} else {
|
|
||||||
BlockHitResult blockHitResult = (BlockHitResult)hitResult;
|
|
||||||
BlockPos blockPos = blockHitResult.getBlockPos();
|
|
||||||
if (!(world.getBlockState(blockPos).getBlock() instanceof FluidBlock)) {
|
|
||||||
return TypedActionResult.pass(itemStack);
|
|
||||||
} else if (world.canPlayerModifyAt(user, blockPos) && user.canPlaceOn(blockPos, blockHitResult.getSide(), itemStack)) {
|
|
||||||
EntityType<?> entityType = this.getEntityType(itemStack.getTag());
|
|
||||||
if (entityType.spawnFromItemStack((ServerWorld) world, itemStack, user, blockPos.up(1), SpawnReason.SPAWN_EGG, false, false) == null) {
|
|
||||||
return TypedActionResult.pass(itemStack);
|
|
||||||
} else {
|
|
||||||
if (!user.abilities.creativeMode) {
|
|
||||||
itemStack.decrement(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
user.incrementStat(Stats.USED.getOrCreateStat(this));
|
|
||||||
return TypedActionResult.success(itemStack);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return TypedActionResult.fail(itemStack);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityType<?> getEntityType(CompoundTag tag) {
|
|
||||||
if (tag != null && tag.contains("EntityTag", 10)) {
|
|
||||||
CompoundTag compoundTag = tag.getCompound("EntityTag");
|
|
||||||
if (compoundTag.contains("id", 8)) {
|
|
||||||
return EntityType.get(compoundTag.getString("id")).orElse(this.type);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.type;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.mixin;
|
|
||||||
|
|
||||||
import net.minecraft.world.biome.GenerationSettings;
|
|
||||||
import net.minecraft.world.gen.feature.ConfiguredFeature;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.function.Supplier;
|
|
||||||
|
|
||||||
@Mixin(GenerationSettings.class)
|
|
||||||
public interface GenerationSettingsAccessorMixin {
|
|
||||||
|
|
||||||
@Accessor
|
|
||||||
List<List<Supplier<ConfiguredFeature<?, ?>>>> getFeatures();
|
|
||||||
|
|
||||||
@Accessor
|
|
||||||
void setFeatures(List<List<Supplier<ConfiguredFeature<?, ?>>>> features);
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.sound;
|
|
||||||
|
|
||||||
import net.minecraft.sound.SoundEvent;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
import net.minecraft.util.registry.Registry;
|
|
||||||
|
|
||||||
public class DecorativeSoundEvents {
|
|
||||||
public static final SoundEvent CEILINGFAN_AMBIENT = register("decorative:ceiling_fan.ambient");
|
|
||||||
|
|
||||||
private static SoundEvent register(String id) {
|
|
||||||
return Registry.register(Registry.SOUND_EVENT, id, new SoundEvent(new Identifier(id)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.world;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import eu.midnightdust.motschen.decorative.mixin.GenerationSettingsAccessorMixin;
|
|
||||||
import net.fabricmc.fabric.api.event.registry.RegistryEntryAddedCallback;
|
|
||||||
import net.minecraft.util.registry.BuiltinRegistries;
|
|
||||||
import net.minecraft.world.biome.Biome;
|
|
||||||
import net.minecraft.world.gen.GenerationStep;
|
|
||||||
import net.minecraft.world.gen.feature.ConfiguredFeature;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.function.Supplier;
|
|
||||||
|
|
||||||
public class OreFeatureInjector {
|
|
||||||
|
|
||||||
public static void init() {
|
|
||||||
BuiltinRegistries.BIOME.forEach(OreFeatureInjector::addToBiome);
|
|
||||||
RegistryEntryAddedCallback.event(BuiltinRegistries.BIOME).register((i, identifier, biome) -> addToBiome(biome));
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void addToBiome(Biome biome) {
|
|
||||||
addSaltOre(biome);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void addSaltOre(Biome biome) {
|
|
||||||
if (biome.getCategory() != Biome.Category.NETHER && biome.getCategory() != Biome.Category.THEEND) {
|
|
||||||
addFeature(biome, GenerationStep.Feature.UNDERGROUND_DECORATION, OreFeatures.ROCKY_ASPHALT_FEATURE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void addFeature(Biome biome, GenerationStep.Feature step, ConfiguredFeature<?, ?> feature) {
|
|
||||||
GenerationSettingsAccessorMixin generationSettingsAccessor = (GenerationSettingsAccessorMixin) biome.getGenerationSettings();
|
|
||||||
int stepIndex = step.ordinal();
|
|
||||||
List<List<Supplier<ConfiguredFeature<?, ?>>>> featuresByStep = new ArrayList<>( generationSettingsAccessor.getFeatures());
|
|
||||||
while (featuresByStep.size() <= stepIndex) {
|
|
||||||
featuresByStep.add(Lists.newArrayList());
|
|
||||||
}
|
|
||||||
List<Supplier<ConfiguredFeature<?, ?>>> features = new ArrayList<>(featuresByStep.get(stepIndex));
|
|
||||||
features.add(() -> feature);
|
|
||||||
featuresByStep.set(stepIndex, features);
|
|
||||||
generationSettingsAccessor.setFeatures(featuresByStep);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
package eu.midnightdust.motschen.decorative.world;
|
|
||||||
|
|
||||||
import eu.midnightdust.motschen.decorative.DecorativeMain;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
import net.minecraft.util.registry.BuiltinRegistries;
|
|
||||||
import net.minecraft.util.registry.Registry;
|
|
||||||
import net.minecraft.world.gen.feature.ConfiguredFeature;
|
|
||||||
import net.minecraft.world.gen.feature.Feature;
|
|
||||||
import net.minecraft.world.gen.feature.OreFeatureConfig;
|
|
||||||
|
|
||||||
public class OreFeatures {
|
|
||||||
public static final ConfiguredFeature<?, ?> ROCKY_ASPHALT_FEATURE = Feature.ORE.configure(new OreFeatureConfig(OreFeatureConfig.Rules.BASE_STONE_OVERWORLD, DecorativeMain.RockyAsphalt.getDefaultState(), 7)).method_30377(200).spreadHorizontally().repeat(20);
|
|
||||||
|
|
||||||
public static void init() {
|
|
||||||
Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, new Identifier(DecorativeMain.MOD_ID, "rocky_asphalt"), ROCKY_ASPHALT_FEATURE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package eu.midnightdust.motschen.decorative.world;
|
||||||
|
|
||||||
|
import eu.midnightdust.motschen.decorative.DecorativeMain;
|
||||||
|
import net.fabricmc.fabric.api.event.registry.RegistryEntryAddedCallback;
|
||||||
|
import net.minecraft.util.registry.Registry;
|
||||||
|
import net.minecraft.world.biome.Biome;
|
||||||
|
import net.minecraft.world.gen.GenerationStep;
|
||||||
|
import net.minecraft.world.gen.decorator.Decorator;
|
||||||
|
import net.minecraft.world.gen.decorator.RangeDecoratorConfig;
|
||||||
|
import net.minecraft.world.gen.feature.Feature;
|
||||||
|
import net.minecraft.world.gen.feature.OreFeatureConfig;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class RockyAsphalt {
|
||||||
|
private static List<Biome> checkedBiomes = new ArrayList<>();
|
||||||
|
|
||||||
|
public static void initBiomeFeatures() {
|
||||||
|
for (Biome biome : Registry.BIOME) {
|
||||||
|
addToBiome(biome);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Handles modded biomes
|
||||||
|
RegistryEntryAddedCallback.event(Registry.BIOME).register((i, identifier, biome) -> addToBiome(biome));
|
||||||
|
}
|
||||||
|
private static void addToBiome(Biome biome){
|
||||||
|
if(checkedBiomes.contains(biome)){
|
||||||
|
//Just to be sure we dont add the stuff twice to the same biome
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
checkedBiomes.add(biome);
|
||||||
|
addOre(biome, OreFeatureConfig.Target.NATURAL_STONE, DecorativeMain.Ores.RockyAsphalt);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void addOre(Biome biome, OreFeatureConfig.Target canReplaceIn, DecorativeMain.Ores ore) {
|
||||||
|
biome.addFeature(GenerationStep.Feature.UNDERGROUND_ORES, Feature.ORE.configure(
|
||||||
|
new OreFeatureConfig(canReplaceIn, DecorativeMain.RockyAsphalt.getDefaultState(), ore.veinSize)).createDecoratedFeature(Decorator.COUNT_RANGE.configure(
|
||||||
|
new RangeDecoratorConfig(ore.veinsPerChunk, ore.minY, ore.minY, ore.maxY))));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
{
|
{
|
||||||
"variants": {
|
"variants": {
|
||||||
"": { "model": "block/acacia_log" }
|
"facing=south": { "model": "decorative:block/acacia_log_with_axe" },
|
||||||
|
"facing=west": { "model": "decorative:block/acacia_log_with_axe", "y": 90 },
|
||||||
|
"facing=north": { "model": "decorative:block/acacia_log_with_axe", "y": 180 },
|
||||||
|
"facing=east": { "model": "decorative:block/acacia_log_with_axe", "y": 270 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
{
|
{
|
||||||
"variants": {
|
"variants": {
|
||||||
"": { "model": "block/birch_log" }
|
"facing=south": { "model": "decorative:block/birch_log_with_axe" },
|
||||||
|
"facing=west": { "model": "decorative:block/birch_log_with_axe", "y": 90 },
|
||||||
|
"facing=north": { "model": "decorative:block/birch_log_with_axe", "y": 180 },
|
||||||
|
"facing=east": { "model": "decorative:block/birch_log_with_axe", "y": 270 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"variants": {
|
"variants": {
|
||||||
"": { "model": "decorative:block/ceilingfan" }
|
"lit=true": { "model": "decorative:block/ceilingfan_activated" },
|
||||||
|
"lit=false": { "model": "decorative:block/ceilingfan" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
{
|
{
|
||||||
"variants": {
|
"variants": {
|
||||||
"": { "model": "block/dark_oak_log" }
|
"facing=south": { "model": "decorative:block/dark_oak_log_with_axe" },
|
||||||
|
"facing=west": { "model": "decorative:block/dark_oak_log_with_axe", "y": 90 },
|
||||||
|
"facing=north": { "model": "decorative:block/dark_oak_log_with_axe", "y": 180 },
|
||||||
|
"facing=east": { "model": "decorative:block/dark_oak_log_with_axe", "y": 270 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
{
|
{
|
||||||
"variants": {
|
"variants": {
|
||||||
"": { "model": "block/jungle_log" }
|
"facing=south": { "model": "decorative:block/jungle_log_with_axe" },
|
||||||
|
"facing=west": { "model": "decorative:block/jungle_log_with_axe", "y": 90 },
|
||||||
|
"facing=north": { "model": "decorative:block/jungle_log_with_axe", "y": 180 },
|
||||||
|
"facing=east": { "model": "decorative:block/jungle_log_with_axe", "y": 270 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
{
|
{
|
||||||
"variants": {
|
"variants": {
|
||||||
"": { "model": "block/oak_log" }
|
"facing=south": { "model": "decorative:block/oak_log_with_axe" },
|
||||||
|
"facing=west": { "model": "decorative:block/oak_log_with_axe", "y": 90 },
|
||||||
|
"facing=north": { "model": "decorative:block/oak_log_with_axe", "y": 180 },
|
||||||
|
"facing=east": { "model": "decorative:block/oak_log_with_axe", "y": 270 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"variants": {
|
|
||||||
"facing=south": { "model": "decorative:block/pennant_chain", "uvlock": true },
|
|
||||||
"facing=west": { "model": "decorative:block/pennant_chain", "uvlock": true, "y": 90 },
|
|
||||||
"facing=north": { "model": "decorative:block/pennant_chain", "uvlock": true, "y": 180 },
|
|
||||||
"facing=east": { "model": "decorative:block/pennant_chain", "uvlock": true, "y": 270 }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"variants": {
|
|
||||||
"facing=south": { "model": "decorative:block/pool_sprinkler", "y": 270 },
|
|
||||||
"facing=west": { "model": "decorative:block/pool_sprinkler", "y": 0 },
|
|
||||||
"facing=north": { "model": "decorative:block/pool_sprinkler", "y": 90 },
|
|
||||||
"facing=east": { "model": "decorative:block/pool_sprinkler", "y": 180 }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"variants": {
|
|
||||||
"facing=east,shape=straight": { "model": "decorative:block/pool_wall" },
|
|
||||||
"facing=west,shape=straight": { "model": "decorative:block/pool_wall", "y": 180, "uvlock": true },
|
|
||||||
"facing=south,shape=straight": { "model": "decorative:block/pool_wall", "y": 90, "uvlock": true },
|
|
||||||
"facing=north,shape=straight": { "model": "decorative:block/pool_wall", "y": 270, "uvlock": true },
|
|
||||||
"facing=east,shape=inner_left": { "model": "decorative:block/pool_wall_corner" },
|
|
||||||
"facing=west,shape=inner_left": { "model": "decorative:block/pool_wall_corner", "y": 180, "uvlock": true },
|
|
||||||
"facing=south,shape=inner_left": { "model": "decorative:block/pool_wall_corner", "y": 90, "uvlock": true },
|
|
||||||
"facing=north,shape=inner_left": { "model": "decorative:block/pool_wall_corner", "y": 270, "uvlock": true },
|
|
||||||
"facing=east,shape=inner_right": { "model": "decorative:block/pool_wall_corner", "y": 90, "uvlock": true },
|
|
||||||
"facing=west,shape=inner_right": { "model": "decorative:block/pool_wall_corner", "y": 270, "uvlock": true },
|
|
||||||
"facing=south,shape=inner_right": { "model": "decorative:block/pool_wall_corner", "y": 180, "uvlock": true },
|
|
||||||
"facing=north,shape=inner_right": { "model": "decorative:block/pool_wall_corner" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"variants": {
|
|
||||||
"facing=south": { "model": "decorative:block/shower_head", "y": 90 },
|
|
||||||
"facing=west": { "model": "decorative:block/shower_head", "y": 180 },
|
|
||||||
"facing=north": { "model": "decorative:block/shower_head", "y": 270 },
|
|
||||||
"facing=east": { "model": "decorative:block/shower_head" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"variants": {
|
|
||||||
"facing=north,part=back": { "model": "decorative:block/springboard_back", "y": 90 },
|
|
||||||
"facing=north,part=front": { "model": "decorative:block/springboard_front", "y": 90 },
|
|
||||||
"facing=east,part=back": { "model": "decorative:block/springboard_back", "y": 180 },
|
|
||||||
"facing=east,part=front": { "model": "decorative:block/springboard_front", "y": 180 },
|
|
||||||
"facing=south,part=back": { "model": "decorative:block/springboard_back", "y": 270 },
|
|
||||||
"facing=south,part=front": { "model": "decorative:block/springboard_front", "y": 270 },
|
|
||||||
"facing=west,part=back": { "model": "decorative:block/springboard_back" },
|
|
||||||
"facing=west,part=front": { "model": "decorative:block/springboard_front" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
{
|
{
|
||||||
"variants": {
|
"variants": {
|
||||||
"": { "model": "block/spruce_log" }
|
"facing=south": { "model": "decorative:block/spruce_log_with_axe" },
|
||||||
|
"facing=west": { "model": "decorative:block/spruce_log_with_axe", "y": 90 },
|
||||||
|
"facing=north": { "model": "decorative:block/spruce_log_with_axe", "y": 180 },
|
||||||
|
"facing=east": { "model": "decorative:block/spruce_log_with_axe", "y": 270 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user