diff --git a/src/generated/resources/assets/naturesaura/blockstates/auto_crafter.json b/src/generated/resources/assets/naturesaura/blockstates/auto_crafter.json index dd7096d6..746e32f5 100644 --- a/src/generated/resources/assets/naturesaura/blockstates/auto_crafter.json +++ b/src/generated/resources/assets/naturesaura/blockstates/auto_crafter.json @@ -1,7 +1,19 @@ { "variants": { - "": { + "facing=north": { "model": "naturesaura:block/auto_crafter" + }, + "facing=south": { + "model": "naturesaura:block/auto_crafter", + "y": 180 + }, + "facing=west": { + "model": "naturesaura:block/auto_crafter", + "y": 270 + }, + "facing=east": { + "model": "naturesaura:block/auto_crafter", + "y": 90 } } } \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/blockstates/blast_furnace_booster.json b/src/generated/resources/assets/naturesaura/blockstates/blast_furnace_booster.json index 20a03600..a8336a0d 100644 --- a/src/generated/resources/assets/naturesaura/blockstates/blast_furnace_booster.json +++ b/src/generated/resources/assets/naturesaura/blockstates/blast_furnace_booster.json @@ -1,7 +1,19 @@ { "variants": { - "": { + "facing=north": { "model": "naturesaura:block/blast_furnace_booster" + }, + "facing=south": { + "model": "naturesaura:block/blast_furnace_booster", + "y": 180 + }, + "facing=west": { + "model": "naturesaura:block/blast_furnace_booster", + "y": 270 + }, + "facing=east": { + "model": "naturesaura:block/blast_furnace_booster", + "y": 90 } } } \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/blockstates/dimension_rail_end.json b/src/generated/resources/assets/naturesaura/blockstates/dimension_rail_end.json deleted file mode 100644 index 8be98bd1..00000000 --- a/src/generated/resources/assets/naturesaura/blockstates/dimension_rail_end.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "variants": { - "": { - "model": "naturesaura:block/dimension_rail_end" - } - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/blockstates/dimension_rail_nether.json b/src/generated/resources/assets/naturesaura/blockstates/dimension_rail_nether.json deleted file mode 100644 index fe9fde7c..00000000 --- a/src/generated/resources/assets/naturesaura/blockstates/dimension_rail_nether.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "variants": { - "": { - "model": "naturesaura:block/dimension_rail_nether" - } - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/blockstates/dimension_rail_overworld.json b/src/generated/resources/assets/naturesaura/blockstates/dimension_rail_overworld.json deleted file mode 100644 index 8ffef809..00000000 --- a/src/generated/resources/assets/naturesaura/blockstates/dimension_rail_overworld.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "variants": { - "": { - "model": "naturesaura:block/dimension_rail_overworld" - } - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/blockstates/furnace_heater.json b/src/generated/resources/assets/naturesaura/blockstates/furnace_heater.json index 209732fb..641884f2 100644 --- a/src/generated/resources/assets/naturesaura/blockstates/furnace_heater.json +++ b/src/generated/resources/assets/naturesaura/blockstates/furnace_heater.json @@ -1,7 +1,30 @@ { "variants": { - "": { + "facing=down": { + "model": "naturesaura:block/furnace_heater", + "x": 180 + }, + "facing=up": { "model": "naturesaura:block/furnace_heater" + }, + "facing=north": { + "model": "naturesaura:block/furnace_heater", + "x": 90 + }, + "facing=south": { + "model": "naturesaura:block/furnace_heater", + "x": 90, + "y": 180 + }, + "facing=west": { + "model": "naturesaura:block/furnace_heater", + "x": 90, + "y": 270 + }, + "facing=east": { + "model": "naturesaura:block/furnace_heater", + "x": 90, + "y": 90 } } } \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/block/animal_generator.json b/src/generated/resources/assets/naturesaura/models/block/animal_generator.json index 8ec2b4c7..6ff38d80 100644 --- a/src/generated/resources/assets/naturesaura/models/block/animal_generator.json +++ b/src/generated/resources/assets/naturesaura/models/block/animal_generator.json @@ -1,6 +1,8 @@ { - "parent": "block/cube_all", + "parent": "block/cube_bottom_top", "textures": { - "all": "naturesaura:block/animal_generator" + "side": "naturesaura:block/animal_generator", + "bottom": "naturesaura:block/animal_generator_bottom", + "top": "naturesaura:block/animal_generator_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/block/auto_crafter.json b/src/generated/resources/assets/naturesaura/models/block/auto_crafter.json index c6e2d604..04207933 100644 --- a/src/generated/resources/assets/naturesaura/models/block/auto_crafter.json +++ b/src/generated/resources/assets/naturesaura/models/block/auto_crafter.json @@ -1,6 +1,8 @@ { - "parent": "block/cube_all", + "parent": "block/cube_bottom_top", "textures": { - "all": "naturesaura:block/auto_crafter" + "side": "naturesaura:block/auto_crafter", + "bottom": "naturesaura:block/auto_crafter_bottom", + "top": "naturesaura:block/auto_crafter_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/block/dimension_rail_end.json b/src/generated/resources/assets/naturesaura/models/block/dimension_rail_end.json deleted file mode 100644 index 83f10281..00000000 --- a/src/generated/resources/assets/naturesaura/models/block/dimension_rail_end.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "naturesaura:block/dimension_rail_end" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/block/dimension_rail_nether.json b/src/generated/resources/assets/naturesaura/models/block/dimension_rail_nether.json deleted file mode 100644 index 9fa7c864..00000000 --- a/src/generated/resources/assets/naturesaura/models/block/dimension_rail_nether.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "naturesaura:block/dimension_rail_nether" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/block/dimension_rail_overworld.json b/src/generated/resources/assets/naturesaura/models/block/dimension_rail_overworld.json deleted file mode 100644 index a28f2b0a..00000000 --- a/src/generated/resources/assets/naturesaura/models/block/dimension_rail_overworld.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "naturesaura:block/dimension_rail_overworld" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/block/ender_crate.json b/src/generated/resources/assets/naturesaura/models/block/ender_crate.json index 92054a6d..3ca0a7c8 100644 --- a/src/generated/resources/assets/naturesaura/models/block/ender_crate.json +++ b/src/generated/resources/assets/naturesaura/models/block/ender_crate.json @@ -1,6 +1,8 @@ { - "parent": "block/cube_all", + "parent": "block/cube_bottom_top", "textures": { - "all": "naturesaura:block/ender_crate" + "side": "naturesaura:block/ender_crate", + "bottom": "naturesaura:block/ender_crate_bottom", + "top": "naturesaura:block/ender_crate_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/block/firework_generator.json b/src/generated/resources/assets/naturesaura/models/block/firework_generator.json index 454c490a..fccefa7d 100644 --- a/src/generated/resources/assets/naturesaura/models/block/firework_generator.json +++ b/src/generated/resources/assets/naturesaura/models/block/firework_generator.json @@ -1,6 +1,8 @@ { - "parent": "block/cube_all", + "parent": "block/cube_bottom_top", "textures": { - "all": "naturesaura:block/firework_generator" + "side": "naturesaura:block/firework_generator", + "bottom": "naturesaura:block/firework_generator_top", + "top": "naturesaura:block/firework_generator_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/block/flower_generator.json b/src/generated/resources/assets/naturesaura/models/block/flower_generator.json index 480865ce..664845cd 100644 --- a/src/generated/resources/assets/naturesaura/models/block/flower_generator.json +++ b/src/generated/resources/assets/naturesaura/models/block/flower_generator.json @@ -1,6 +1,8 @@ { - "parent": "block/cube_all", + "parent": "block/cube_bottom_top", "textures": { - "all": "naturesaura:block/flower_generator" + "side": "naturesaura:block/flower_generator", + "bottom": "naturesaura:block/flower_generator_top", + "top": "naturesaura:block/flower_generator_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/block/generator_limit_remover.json b/src/generated/resources/assets/naturesaura/models/block/generator_limit_remover.json index f805ef11..9b0027e6 100644 --- a/src/generated/resources/assets/naturesaura/models/block/generator_limit_remover.json +++ b/src/generated/resources/assets/naturesaura/models/block/generator_limit_remover.json @@ -1,6 +1,8 @@ { - "parent": "block/cube_all", + "parent": "block/cube_bottom_top", "textures": { - "all": "naturesaura:block/generator_limit_remover" + "side": "naturesaura:block/generator_limit_remover", + "bottom": "naturesaura:block/generator_limit_remover_top", + "top": "naturesaura:block/generator_limit_remover_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/block/oak_generator.json b/src/generated/resources/assets/naturesaura/models/block/oak_generator.json index ea6be76e..bba28c74 100644 --- a/src/generated/resources/assets/naturesaura/models/block/oak_generator.json +++ b/src/generated/resources/assets/naturesaura/models/block/oak_generator.json @@ -1,6 +1,8 @@ { - "parent": "block/cube_all", + "parent": "block/cube_bottom_top", "textures": { - "all": "naturesaura:block/oak_generator" + "side": "naturesaura:block/oak_generator", + "bottom": "naturesaura:block/oak_generator_bottom", + "top": "naturesaura:block/oak_generator_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/block/pickup_stopper.json b/src/generated/resources/assets/naturesaura/models/block/pickup_stopper.json index 9084b186..971fff9e 100644 --- a/src/generated/resources/assets/naturesaura/models/block/pickup_stopper.json +++ b/src/generated/resources/assets/naturesaura/models/block/pickup_stopper.json @@ -1,6 +1,8 @@ { - "parent": "block/cube_all", + "parent": "block/cube_bottom_top", "textures": { - "all": "naturesaura:block/pickup_stopper" + "side": "naturesaura:block/pickup_stopper", + "bottom": "naturesaura:block/pickup_stopper_top", + "top": "naturesaura:block/pickup_stopper_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/block/placer.json b/src/generated/resources/assets/naturesaura/models/block/placer.json index ddfefaae..3dec3b35 100644 --- a/src/generated/resources/assets/naturesaura/models/block/placer.json +++ b/src/generated/resources/assets/naturesaura/models/block/placer.json @@ -1,6 +1,8 @@ { - "parent": "block/cube_all", + "parent": "block/cube_bottom_top", "textures": { - "all": "naturesaura:block/placer" + "side": "naturesaura:block/placer", + "bottom": "naturesaura:block/placer_top", + "top": "naturesaura:block/placer_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/block/potion_generator.json b/src/generated/resources/assets/naturesaura/models/block/potion_generator.json index 720c7829..7dbafcee 100644 --- a/src/generated/resources/assets/naturesaura/models/block/potion_generator.json +++ b/src/generated/resources/assets/naturesaura/models/block/potion_generator.json @@ -1,6 +1,8 @@ { - "parent": "block/cube_all", + "parent": "block/cube_bottom_top", "textures": { - "all": "naturesaura:block/potion_generator" + "side": "naturesaura:block/potion_generator", + "bottom": "naturesaura:block/potion_generator_bottom", + "top": "naturesaura:block/potion_generator_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/block/projectile_generator.json b/src/generated/resources/assets/naturesaura/models/block/projectile_generator.json index 57c5180c..17af0a9a 100644 --- a/src/generated/resources/assets/naturesaura/models/block/projectile_generator.json +++ b/src/generated/resources/assets/naturesaura/models/block/projectile_generator.json @@ -1,6 +1,8 @@ { - "parent": "block/cube_all", + "parent": "block/cube_bottom_top", "textures": { - "all": "naturesaura:block/projectile_generator" + "side": "naturesaura:block/projectile_generator", + "bottom": "naturesaura:block/projectile_generator_top", + "top": "naturesaura:block/projectile_generator_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/block/time_changer.json b/src/generated/resources/assets/naturesaura/models/block/time_changer.json index bc7009f2..382e00e5 100644 --- a/src/generated/resources/assets/naturesaura/models/block/time_changer.json +++ b/src/generated/resources/assets/naturesaura/models/block/time_changer.json @@ -1,6 +1,8 @@ { - "parent": "block/cube_all", + "parent": "block/cube_bottom_top", "textures": { - "all": "naturesaura:block/time_changer" + "side": "naturesaura:block/time_changer", + "bottom": "naturesaura:block/time_changer_bottom", + "top": "naturesaura:block/time_changer_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/item/aura_bottle.json b/src/generated/resources/assets/naturesaura/models/item/aura_bottle.json index 8004f587..bf92d8ba 100644 --- a/src/generated/resources/assets/naturesaura/models/item/aura_bottle.json +++ b/src/generated/resources/assets/naturesaura/models/item/aura_bottle.json @@ -1,6 +1,7 @@ { "parent": "item/generated", "textures": { - "layer0": "naturesaura:item/aura_bottle" + "layer0": "naturesaura:item/aura_bottle", + "layer1": "naturesaura:item/aura_bottle_overlay" } } \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/item/dimension_rail_end.json b/src/generated/resources/assets/naturesaura/models/item/dimension_rail_end.json index 2aeb3589..9f34bc9c 100644 --- a/src/generated/resources/assets/naturesaura/models/item/dimension_rail_end.json +++ b/src/generated/resources/assets/naturesaura/models/item/dimension_rail_end.json @@ -1,3 +1,6 @@ { - "parent": "naturesaura:block/dimension_rail_end" + "parent": "item/generated", + "textures": { + "layer0": "naturesaura:block/dimension_rail_end" + } } \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/item/dimension_rail_nether.json b/src/generated/resources/assets/naturesaura/models/item/dimension_rail_nether.json index a7cb5183..b84e06e7 100644 --- a/src/generated/resources/assets/naturesaura/models/item/dimension_rail_nether.json +++ b/src/generated/resources/assets/naturesaura/models/item/dimension_rail_nether.json @@ -1,3 +1,6 @@ { - "parent": "naturesaura:block/dimension_rail_nether" + "parent": "item/generated", + "textures": { + "layer0": "naturesaura:block/dimension_rail_nether" + } } \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/item/dimension_rail_overworld.json b/src/generated/resources/assets/naturesaura/models/item/dimension_rail_overworld.json index 62390684..ea00ce07 100644 --- a/src/generated/resources/assets/naturesaura/models/item/dimension_rail_overworld.json +++ b/src/generated/resources/assets/naturesaura/models/item/dimension_rail_overworld.json @@ -1,3 +1,6 @@ { - "parent": "naturesaura:block/dimension_rail_overworld" + "parent": "item/generated", + "textures": { + "layer0": "naturesaura:block/dimension_rail_overworld" + } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockAncientSapling.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockAncientSapling.java index cea961b0..d854b817 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockAncientSapling.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockAncientSapling.java @@ -3,12 +3,10 @@ package de.ellpeck.naturesaura.blocks; import de.ellpeck.naturesaura.data.BlockStateGenerator; import de.ellpeck.naturesaura.data.ItemModelGenerator; import de.ellpeck.naturesaura.gen.WorldGenAncientTree; -import de.ellpeck.naturesaura.reg.ICustomBlockState; -import de.ellpeck.naturesaura.reg.ICustomItemModel; -import de.ellpeck.naturesaura.reg.IModItem; -import de.ellpeck.naturesaura.reg.ModRegistry; +import de.ellpeck.naturesaura.reg.*; import net.minecraft.block.*; import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.RenderType; import net.minecraft.state.StateContainer; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.shapes.ISelectionContext; @@ -19,8 +17,9 @@ import net.minecraft.world.server.ServerWorld; import net.minecraftforge.event.ForgeEventFactory; import java.util.Random; +import java.util.function.Supplier; -public class BlockAncientSapling extends BushBlock implements IGrowable, IModItem, ICustomBlockState, ICustomItemModel { +public class BlockAncientSapling extends BushBlock implements IGrowable, IModItem, ICustomBlockState, ICustomItemModel, ICustomRenderType { protected static final VoxelShape SHAPE = Block.makeCuboidShape(2.0D, 0.0D, 2.0D, 14.0D, 12.0D, 14.0D); public BlockAncientSapling() { @@ -82,4 +81,9 @@ public class BlockAncientSapling extends BushBlock implements IGrowable, IModIte public void generateCustomItemModel(ItemModelGenerator generator) { generator.withExistingParent(this.getBaseName(), "item/generated").texture("layer0", "block/" + this.getBaseName()); } + + @Override + public Supplier getRenderType() { + return RenderType::cutoutMipped; + } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockAnimalGenerator.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockAnimalGenerator.java index 2d300cef..216fa2c3 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockAnimalGenerator.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockAnimalGenerator.java @@ -4,8 +4,10 @@ import de.ellpeck.naturesaura.Helper; import de.ellpeck.naturesaura.NaturesAura; import de.ellpeck.naturesaura.api.render.IVisualizable; import de.ellpeck.naturesaura.blocks.tiles.TileEntityAnimalGenerator; +import de.ellpeck.naturesaura.data.BlockStateGenerator; import de.ellpeck.naturesaura.packet.PacketHandler; import de.ellpeck.naturesaura.packet.PacketParticles; +import de.ellpeck.naturesaura.reg.ICustomBlockState; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.entity.INPC; @@ -26,9 +28,9 @@ import net.minecraftforge.event.entity.living.LivingEvent; import net.minecraftforge.event.entity.living.LivingExperienceDropEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; -public class BlockAnimalGenerator extends BlockContainerImpl implements IVisualizable { +public class BlockAnimalGenerator extends BlockContainerImpl implements IVisualizable, ICustomBlockState { public BlockAnimalGenerator() { - super("animal_generator", () -> new TileEntityAnimalGenerator(), ModBlocks.prop(Material.ROCK).hardnessAndResistance(3F).sound(SoundType.STONE)); + super("animal_generator", TileEntityAnimalGenerator::new, ModBlocks.prop(Material.ROCK).hardnessAndResistance(3F).sound(SoundType.STONE)); MinecraftForge.EVENT_BUS.register(this); } @@ -107,4 +109,12 @@ public class BlockAnimalGenerator extends BlockContainerImpl implements IVisuali public int getVisualizationColor(World world, BlockPos pos) { return 0x11377a; } + + @Override + public void generateCustomBlockState(BlockStateGenerator generator) { + generator.simpleBlock(this, generator.models().cubeBottomTop(this.getBaseName(), + generator.modLoc("block/" + this.getBaseName()), + generator.modLoc("block/" + this.getBaseName() + "_bottom"), + generator.modLoc("block/" + this.getBaseName() + "_top"))); + } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockAutoCrafter.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockAutoCrafter.java index 309c5a4b..f46c4c1b 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockAutoCrafter.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockAutoCrafter.java @@ -1,7 +1,8 @@ package de.ellpeck.naturesaura.blocks; -import de.ellpeck.naturesaura.blocks.tiles.ModTileEntities; import de.ellpeck.naturesaura.blocks.tiles.TileEntityAutoCrafter; +import de.ellpeck.naturesaura.data.BlockStateGenerator; +import de.ellpeck.naturesaura.reg.ICustomBlockState; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.SoundType; @@ -11,7 +12,7 @@ import net.minecraft.state.DirectionProperty; import net.minecraft.state.StateContainer; import net.minecraft.state.properties.BlockStateProperties; -public class BlockAutoCrafter extends BlockContainerImpl { +public class BlockAutoCrafter extends BlockContainerImpl implements ICustomBlockState { public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING; public BlockAutoCrafter() { @@ -27,4 +28,12 @@ public class BlockAutoCrafter extends BlockContainerImpl { public BlockState getStateForPlacement(BlockItemUseContext context) { return this.getDefaultState().with(FACING, context.getPlayer().getHorizontalFacing()); } + + @Override + public void generateCustomBlockState(BlockStateGenerator generator) { + generator.horizontalBlock(this, generator.models().cubeBottomTop(this.getBaseName(), + generator.modLoc("block/" + this.getBaseName()), + generator.modLoc("block/" + this.getBaseName() + "_bottom"), + generator.modLoc("block/" + this.getBaseName() + "_top"))); + } } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockBlastFurnaceBooster.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockBlastFurnaceBooster.java index d3431917..30d4735c 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockBlastFurnaceBooster.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockBlastFurnaceBooster.java @@ -41,6 +41,6 @@ public class BlockBlastFurnaceBooster extends BlockContainerImpl implements ICus @Override public void generateCustomBlockState(BlockStateGenerator generator) { - generator.simpleBlock(this, generator.models().getExistingFile(generator.modLoc(this.getBaseName()))); + generator.horizontalBlock(this, generator.models().getExistingFile(generator.modLoc(this.getBaseName()))); } } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockDecayedLeaves.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockDecayedLeaves.java index 409d7fa5..56dcd3e1 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockDecayedLeaves.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockDecayedLeaves.java @@ -2,20 +2,23 @@ package de.ellpeck.naturesaura.blocks; import de.ellpeck.naturesaura.data.BlockStateGenerator; import de.ellpeck.naturesaura.reg.ICustomBlockState; +import de.ellpeck.naturesaura.reg.ICustomRenderType; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.RenderType; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockReader; import net.minecraft.world.server.ServerWorld; import java.util.Random; +import java.util.function.Supplier; -public class BlockDecayedLeaves extends BlockImpl implements ICustomBlockState { +public class BlockDecayedLeaves extends BlockImpl implements ICustomBlockState, ICustomRenderType { public BlockDecayedLeaves() { - super("decayed_leaves", ModBlocks.prop(Material.LEAVES).hardnessAndResistance(0.2F).sound(SoundType.PLANT).variableOpacity().notSolid().tickRandomly()); + super("decayed_leaves", ModBlocks.prop(Material.LEAVES).hardnessAndResistance(0.2F).sound(SoundType.PLANT).notSolid().tickRandomly()); } @Override @@ -34,4 +37,9 @@ public class BlockDecayedLeaves extends BlockImpl implements ICustomBlockState { public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { return 1; } + + @Override + public Supplier getRenderType() { + return RenderType::cutoutMipped; + } } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockDimensionRail.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockDimensionRail.java index 82f3443e..be096bcb 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockDimensionRail.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockDimensionRail.java @@ -1,16 +1,18 @@ package de.ellpeck.naturesaura.blocks; import de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk; +import de.ellpeck.naturesaura.data.BlockStateGenerator; +import de.ellpeck.naturesaura.data.ItemModelGenerator; import de.ellpeck.naturesaura.items.ModItems; import de.ellpeck.naturesaura.packet.PacketClient; import de.ellpeck.naturesaura.packet.PacketHandler; import de.ellpeck.naturesaura.packet.PacketParticles; -import de.ellpeck.naturesaura.reg.IModItem; -import de.ellpeck.naturesaura.reg.ModRegistry; +import de.ellpeck.naturesaura.reg.*; import net.minecraft.block.AbstractRailBlock; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; +import net.minecraft.client.renderer.RenderType; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.entity.item.minecart.AbstractMinecartEntity; import net.minecraft.entity.player.PlayerEntity; @@ -40,8 +42,9 @@ import net.minecraft.world.server.ServerWorld; import javax.annotation.Nullable; import java.util.List; +import java.util.function.Supplier; -public class BlockDimensionRail extends AbstractRailBlock implements IModItem { +public class BlockDimensionRail extends AbstractRailBlock implements IModItem, ICustomRenderType, ICustomBlockState, ICustomItemModel { public static final EnumProperty SHAPE = BlockStateProperties.RAIL_SHAPE; @@ -139,6 +142,7 @@ public class BlockDimensionRail extends AbstractRailBlock implements IModItem { return SHAPE; } + @Override public boolean isFlexibleRail(BlockState state, IBlockReader world, BlockPos pos) { return false; } @@ -157,4 +161,19 @@ public class BlockDimensionRail extends AbstractRailBlock implements IModItem { public String getBaseName() { return "dimension_rail_" + this.name; } + + @Override + public Supplier getRenderType() { + return RenderType::cutoutMipped; + } + + @Override + public void generateCustomBlockState(BlockStateGenerator generator) { + // noop + } + + @Override + public void generateCustomItemModel(ItemModelGenerator generator) { + generator.withExistingParent(this.getBaseName(), "item/generated").texture("layer0", "block/" + this.getBaseName()); + } } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockEndFlower.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockEndFlower.java index d8273855..804b75cb 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockEndFlower.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockEndFlower.java @@ -6,6 +6,7 @@ import de.ellpeck.naturesaura.data.ItemModelGenerator; import de.ellpeck.naturesaura.reg.*; import net.minecraft.block.*; import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.RenderType; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.boss.dragon.EnderDragonEntity; import net.minecraft.entity.player.PlayerEntity; @@ -29,8 +30,9 @@ import net.minecraftforge.eventbus.api.SubscribeEvent; import javax.annotation.Nullable; import java.util.List; +import java.util.function.Supplier; -public class BlockEndFlower extends BushBlock implements IModItem, ICustomBlockState, ICustomItemModel { +public class BlockEndFlower extends BushBlock implements IModItem, ICustomBlockState, ICustomItemModel, ICustomRenderType { protected static final VoxelShape SHAPE = Block.makeCuboidShape(5.0D, 0.0D, 5.0D, 11.0D, 10.0D, 11.0D); @@ -122,4 +124,9 @@ public class BlockEndFlower extends BushBlock implements IModItem, ICustomBlockS public void generateCustomItemModel(ItemModelGenerator generator) { generator.withExistingParent(this.getBaseName(), "item/generated").texture("layer0", "block/" + this.getBaseName()); } + + @Override + public Supplier getRenderType() { + return RenderType::cutout; + } } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockEnderCrate.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockEnderCrate.java index 4e51b60c..a3295587 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockEnderCrate.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockEnderCrate.java @@ -5,7 +5,9 @@ import de.ellpeck.naturesaura.api.misc.IWorldData; import de.ellpeck.naturesaura.blocks.tiles.ModTileEntities; import de.ellpeck.naturesaura.blocks.tiles.TileEntityEnderCrate; import de.ellpeck.naturesaura.blocks.tiles.render.RenderEnderCrate; +import de.ellpeck.naturesaura.data.BlockStateGenerator; import de.ellpeck.naturesaura.items.ModItems; +import de.ellpeck.naturesaura.reg.ICustomBlockState; import de.ellpeck.naturesaura.reg.ITESRProvider; import net.minecraft.block.AnvilBlock; import net.minecraft.block.BlockState; @@ -48,7 +50,7 @@ import java.util.Random; import java.util.function.Function; import java.util.function.Supplier; -public class BlockEnderCrate extends BlockContainerImpl implements ITESRProvider { +public class BlockEnderCrate extends BlockContainerImpl implements ITESRProvider, ICustomBlockState { // This is terrible but I can't see a better solution right now so oh well private static final ThreadLocal> CACHED_WORLD = new ThreadLocal<>(); @@ -149,4 +151,12 @@ public class BlockEnderCrate extends BlockContainerImpl implements ITESRProvider public Tuple, Supplier>>> getTESR() { return new Tuple<>(ModTileEntities.ENDER_CRATE, () -> RenderEnderCrate::new); } + + @Override + public void generateCustomBlockState(BlockStateGenerator generator) { + generator.simpleBlock(this, generator.models().cubeBottomTop(this.getBaseName(), + generator.modLoc("block/" + this.getBaseName()), + generator.modLoc("block/" + this.getBaseName() + "_bottom"), + generator.modLoc("block/" + this.getBaseName() + "_top"))); + } } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockFieldCreator.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockFieldCreator.java index 07cccf5c..3a65c4bc 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockFieldCreator.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockFieldCreator.java @@ -5,9 +5,11 @@ import de.ellpeck.naturesaura.api.NaturesAuraAPI; import de.ellpeck.naturesaura.blocks.tiles.TileEntityFieldCreator; import de.ellpeck.naturesaura.data.BlockStateGenerator; import de.ellpeck.naturesaura.reg.ICustomBlockState; +import de.ellpeck.naturesaura.reg.ICustomRenderType; import net.minecraft.block.BlockState; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.RenderType; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.TileEntity; @@ -22,8 +24,9 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import java.util.Random; +import java.util.function.Supplier; -public class BlockFieldCreator extends BlockContainerImpl implements ICustomBlockState { +public class BlockFieldCreator extends BlockContainerImpl implements ICustomBlockState, ICustomRenderType { public BlockFieldCreator() { super("field_creator", TileEntityFieldCreator::new, ModBlocks.prop(Material.ROCK).hardnessAndResistance(2F).sound(SoundType.STONE)); } @@ -100,4 +103,9 @@ public class BlockFieldCreator extends BlockContainerImpl implements ICustomBloc public void generateCustomBlockState(BlockStateGenerator generator) { generator.simpleBlock(this, generator.models().getExistingFile(generator.modLoc(this.getBaseName()))); } + + @Override + public Supplier getRenderType() { + return RenderType::cutoutMipped; + } } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockFireworkGenerator.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockFireworkGenerator.java index 7c5b4f37..16803093 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockFireworkGenerator.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockFireworkGenerator.java @@ -1,8 +1,9 @@ package de.ellpeck.naturesaura.blocks; import de.ellpeck.naturesaura.api.render.IVisualizable; -import de.ellpeck.naturesaura.blocks.tiles.ModTileEntities; import de.ellpeck.naturesaura.blocks.tiles.TileEntityFireworkGenerator; +import de.ellpeck.naturesaura.data.BlockStateGenerator; +import de.ellpeck.naturesaura.reg.ICustomBlockState; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.util.math.AxisAlignedBB; @@ -11,7 +12,7 @@ import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -public class BlockFireworkGenerator extends BlockContainerImpl implements IVisualizable { +public class BlockFireworkGenerator extends BlockContainerImpl implements IVisualizable, ICustomBlockState { public BlockFireworkGenerator() { super("firework_generator", TileEntityFireworkGenerator::new, ModBlocks.prop(Material.ROCK).hardnessAndResistance(3F).sound(SoundType.STONE)); } @@ -27,4 +28,12 @@ public class BlockFireworkGenerator extends BlockContainerImpl implements IVisua public int getVisualizationColor(World world, BlockPos pos) { return 0xa442f4; } + + @Override + public void generateCustomBlockState(BlockStateGenerator generator) { + generator.simpleBlock(this, generator.models().cubeBottomTop(this.getBaseName(), + generator.modLoc("block/" + this.getBaseName()), + generator.modLoc("block/" + this.getBaseName() + "_top"), + generator.modLoc("block/" + this.getBaseName() + "_top"))); + } } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockFlowerGenerator.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockFlowerGenerator.java index d0ae3345..2481924a 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockFlowerGenerator.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockFlowerGenerator.java @@ -2,6 +2,8 @@ package de.ellpeck.naturesaura.blocks; import de.ellpeck.naturesaura.api.render.IVisualizable; import de.ellpeck.naturesaura.blocks.tiles.TileEntityFlowerGenerator; +import de.ellpeck.naturesaura.data.BlockStateGenerator; +import de.ellpeck.naturesaura.reg.ICustomBlockState; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.util.math.AxisAlignedBB; @@ -10,7 +12,7 @@ import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -public class BlockFlowerGenerator extends BlockContainerImpl implements IVisualizable { +public class BlockFlowerGenerator extends BlockContainerImpl implements IVisualizable, ICustomBlockState { public BlockFlowerGenerator() { super("flower_generator", TileEntityFlowerGenerator::new, ModBlocks.prop(Material.WOOD).sound(SoundType.WOOD).hardnessAndResistance(2F)); @@ -27,4 +29,12 @@ public class BlockFlowerGenerator extends BlockContainerImpl implements IVisuali public int getVisualizationColor(World world, BlockPos pos) { return 0xffed2b; } + + @Override + public void generateCustomBlockState(BlockStateGenerator generator) { + generator.simpleBlock(this, generator.models().cubeBottomTop(this.getBaseName(), + generator.modLoc("block/" + this.getBaseName()), + generator.modLoc("block/" + this.getBaseName() + "_top"), + generator.modLoc("block/" + this.getBaseName() + "_top"))); + } } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockFurnaceHeater.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockFurnaceHeater.java index 76e274d3..5ae90a03 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockFurnaceHeater.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockFurnaceHeater.java @@ -97,6 +97,6 @@ public class BlockFurnaceHeater extends BlockContainerImpl implements ICustomBlo @Override public void generateCustomBlockState(BlockStateGenerator generator) { - generator.simpleBlock(this, generator.models().getExistingFile(generator.modLoc(this.getBaseName()))); - } + generator.directionalBlock(this, generator.models().getExistingFile(generator.modLoc(this.getBaseName()))); + } } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockGeneratorLimitRemover.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockGeneratorLimitRemover.java index 86c5f0d5..17d9d22e 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockGeneratorLimitRemover.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockGeneratorLimitRemover.java @@ -3,6 +3,8 @@ package de.ellpeck.naturesaura.blocks; import de.ellpeck.naturesaura.blocks.tiles.ModTileEntities; import de.ellpeck.naturesaura.blocks.tiles.TileEntityGeneratorLimitRemover; import de.ellpeck.naturesaura.blocks.tiles.render.RenderGeneratorLimitRemover; +import de.ellpeck.naturesaura.data.BlockStateGenerator; +import de.ellpeck.naturesaura.reg.ICustomBlockState; import de.ellpeck.naturesaura.reg.ITESRProvider; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; @@ -14,7 +16,7 @@ import net.minecraft.util.Tuple; import java.util.function.Function; import java.util.function.Supplier; -public class BlockGeneratorLimitRemover extends BlockContainerImpl implements ITESRProvider { +public class BlockGeneratorLimitRemover extends BlockContainerImpl implements ITESRProvider, ICustomBlockState { public BlockGeneratorLimitRemover() { super("generator_limit_remover", TileEntityGeneratorLimitRemover::new, ModBlocks.prop(Material.ROCK).hardnessAndResistance(2F).sound(SoundType.STONE)); @@ -24,4 +26,12 @@ public class BlockGeneratorLimitRemover extends BlockContainerImpl implements IT public Tuple, Supplier>>> getTESR() { return new Tuple<>(ModTileEntities.GENERATOR_LIMIT_REMOVER, () -> RenderGeneratorLimitRemover::new); } + + @Override + public void generateCustomBlockState(BlockStateGenerator generator) { + generator.simpleBlock(this, generator.models().cubeBottomTop(this.getBaseName(), + generator.modLoc("block/" + this.getBaseName()), + generator.modLoc("block/" + this.getBaseName() + "_top"), + generator.modLoc("block/" + this.getBaseName() + "_top"))); + } } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockGoldPowder.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockGoldPowder.java index 7eef799b..80e0002a 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockGoldPowder.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockGoldPowder.java @@ -5,10 +5,12 @@ import de.ellpeck.naturesaura.data.ItemModelGenerator; import de.ellpeck.naturesaura.reg.IColorProvidingBlock; import de.ellpeck.naturesaura.reg.ICustomBlockState; import de.ellpeck.naturesaura.reg.ICustomItemModel; +import de.ellpeck.naturesaura.reg.ICustomRenderType; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.RedstoneWireBlock; +import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.color.IBlockColor; import net.minecraft.item.BlockItemUseContext; import net.minecraft.state.EnumProperty; @@ -25,7 +27,9 @@ import net.minecraft.world.IWorld; import net.minecraft.world.IWorldReader; import net.minecraft.world.World; -public class BlockGoldPowder extends BlockImpl implements IColorProvidingBlock, ICustomBlockState, ICustomItemModel { +import java.util.function.Supplier; + +public class BlockGoldPowder extends BlockImpl implements IColorProvidingBlock, ICustomBlockState, ICustomItemModel, ICustomRenderType { public static final EnumProperty NORTH = BlockStateProperties.REDSTONE_NORTH; public static final EnumProperty EAST = BlockStateProperties.REDSTONE_EAST; @@ -228,4 +232,9 @@ public class BlockGoldPowder extends BlockImpl implements IColorProvidingBlock, public void generateCustomItemModel(ItemModelGenerator generator) { generator.withExistingParent(this.getBaseName(), "item/generated").texture("layer0", "item/" + this.getBaseName()); } + + @Override + public Supplier getRenderType() { + return RenderType::cutoutMipped; + } } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockOakGenerator.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockOakGenerator.java index 722ebf73..472c62e5 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockOakGenerator.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockOakGenerator.java @@ -6,6 +6,8 @@ import de.ellpeck.naturesaura.api.aura.type.IAuraType; import de.ellpeck.naturesaura.api.render.IVisualizable; import de.ellpeck.naturesaura.blocks.tiles.ModTileEntities; import de.ellpeck.naturesaura.blocks.tiles.TileEntityOakGenerator; +import de.ellpeck.naturesaura.data.BlockStateGenerator; +import de.ellpeck.naturesaura.reg.ICustomBlockState; import net.minecraft.block.SaplingBlock; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; @@ -21,7 +23,7 @@ import net.minecraftforge.eventbus.api.SubscribeEvent; import java.util.Random; -public class BlockOakGenerator extends BlockContainerImpl implements IVisualizable { +public class BlockOakGenerator extends BlockContainerImpl implements IVisualizable, ICustomBlockState { public BlockOakGenerator() { super("oak_generator", TileEntityOakGenerator::new, ModBlocks.prop(Material.WOOD).hardnessAndResistance(2F).sound(SoundType.WOOD)); @@ -67,4 +69,13 @@ public class BlockOakGenerator extends BlockContainerImpl implements IVisualizab public int getVisualizationColor(World world, BlockPos pos) { return 0x2e7a11; } + + + @Override + public void generateCustomBlockState(BlockStateGenerator generator) { + generator.simpleBlock(this, generator.models().cubeBottomTop(this.getBaseName(), + generator.modLoc("block/" + this.getBaseName()), + generator.modLoc("block/" + this.getBaseName() + "_bottom"), + generator.modLoc("block/" + this.getBaseName() + "_top"))); + } } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockPickupStopper.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockPickupStopper.java index 1c5003f7..872fe782 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockPickupStopper.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockPickupStopper.java @@ -3,8 +3,10 @@ package de.ellpeck.naturesaura.blocks; import de.ellpeck.naturesaura.Helper; import de.ellpeck.naturesaura.api.render.IVisualizable; import de.ellpeck.naturesaura.blocks.tiles.TileEntityPickupStopper; +import de.ellpeck.naturesaura.data.BlockStateGenerator; import de.ellpeck.naturesaura.packet.PacketHandler; import de.ellpeck.naturesaura.packet.PacketParticles; +import de.ellpeck.naturesaura.reg.ICustomBlockState; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.entity.item.ItemEntity; @@ -19,7 +21,7 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.EntityItemPickupEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; -public class BlockPickupStopper extends BlockContainerImpl implements IVisualizable { +public class BlockPickupStopper extends BlockContainerImpl implements IVisualizable, ICustomBlockState { public BlockPickupStopper() { super("pickup_stopper", TileEntityPickupStopper::new, ModBlocks.prop(Material.ROCK).hardnessAndResistance(2F).sound(SoundType.STONE)); @@ -70,4 +72,12 @@ public class BlockPickupStopper extends BlockContainerImpl implements IVisualiza public int getVisualizationColor(World world, BlockPos pos) { return 0xf4aa42; } + + @Override + public void generateCustomBlockState(BlockStateGenerator generator) { + generator.simpleBlock(this, generator.models().cubeBottomTop(this.getBaseName(), + generator.modLoc("block/" + this.getBaseName()), + generator.modLoc("block/" + this.getBaseName() + "_top"), + generator.modLoc("block/" + this.getBaseName() + "_top"))); + } } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockPlacer.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockPlacer.java index b5ffcb80..98692943 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockPlacer.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockPlacer.java @@ -1,8 +1,9 @@ package de.ellpeck.naturesaura.blocks; import de.ellpeck.naturesaura.api.render.IVisualizable; -import de.ellpeck.naturesaura.blocks.tiles.ModTileEntities; import de.ellpeck.naturesaura.blocks.tiles.TileEntityPlacer; +import de.ellpeck.naturesaura.data.BlockStateGenerator; +import de.ellpeck.naturesaura.reg.ICustomBlockState; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.util.math.AxisAlignedBB; @@ -11,7 +12,7 @@ import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -public class BlockPlacer extends BlockContainerImpl implements IVisualizable { +public class BlockPlacer extends BlockContainerImpl implements IVisualizable, ICustomBlockState { public BlockPlacer() { super("placer", TileEntityPlacer::new, ModBlocks.prop(Material.ROCK).hardnessAndResistance(2.5F).sound(SoundType.STONE)); @@ -28,4 +29,12 @@ public class BlockPlacer extends BlockContainerImpl implements IVisualizable { public int getVisualizationColor(World world, BlockPos pos) { return 0x078a93; } + + @Override + public void generateCustomBlockState(BlockStateGenerator generator) { + generator.simpleBlock(this, generator.models().cubeBottomTop(this.getBaseName(), + generator.modLoc("block/" + this.getBaseName()), + generator.modLoc("block/" + this.getBaseName() + "_top"), + generator.modLoc("block/" + this.getBaseName() + "_top"))); + } } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockPotionGenerator.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockPotionGenerator.java index 3cc9a589..3a4801e0 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockPotionGenerator.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockPotionGenerator.java @@ -1,12 +1,21 @@ package de.ellpeck.naturesaura.blocks; -import de.ellpeck.naturesaura.blocks.tiles.ModTileEntities; import de.ellpeck.naturesaura.blocks.tiles.TileEntityPotionGenerator; +import de.ellpeck.naturesaura.data.BlockStateGenerator; +import de.ellpeck.naturesaura.reg.ICustomBlockState; import net.minecraft.block.material.Material; import net.minecraftforge.common.ToolType; -public class BlockPotionGenerator extends BlockContainerImpl { +public class BlockPotionGenerator extends BlockContainerImpl implements ICustomBlockState { public BlockPotionGenerator() { super("potion_generator", TileEntityPotionGenerator::new, ModBlocks.prop(Material.ROCK).hardnessAndResistance(5F).harvestTool(ToolType.PICKAXE).harvestLevel(1)); } + + @Override + public void generateCustomBlockState(BlockStateGenerator generator) { + generator.simpleBlock(this, generator.models().cubeBottomTop(this.getBaseName(), + generator.modLoc("block/" + this.getBaseName()), + generator.modLoc("block/" + this.getBaseName() + "_bottom"), + generator.modLoc("block/" + this.getBaseName() + "_top"))); + } } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockProjectileGenerator.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockProjectileGenerator.java index 1b48554e..d5615d55 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockProjectileGenerator.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockProjectileGenerator.java @@ -5,8 +5,10 @@ import de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk; import de.ellpeck.naturesaura.blocks.tiles.ModTileEntities; import de.ellpeck.naturesaura.blocks.tiles.TileEntityProjectileGenerator; import de.ellpeck.naturesaura.blocks.tiles.render.RenderProjectileGenerator; +import de.ellpeck.naturesaura.data.BlockStateGenerator; import de.ellpeck.naturesaura.packet.PacketHandler; import de.ellpeck.naturesaura.packet.PacketParticles; +import de.ellpeck.naturesaura.reg.ICustomBlockState; import de.ellpeck.naturesaura.reg.ITESRProvider; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; @@ -28,7 +30,7 @@ import net.minecraftforge.eventbus.api.SubscribeEvent; import java.util.function.Function; import java.util.function.Supplier; -public class BlockProjectileGenerator extends BlockContainerImpl implements ITESRProvider { +public class BlockProjectileGenerator extends BlockContainerImpl implements ITESRProvider, ICustomBlockState { public BlockProjectileGenerator() { super("projectile_generator", TileEntityProjectileGenerator::new, ModBlocks.prop(Material.ROCK).hardnessAndResistance(2.5F).sound(SoundType.STONE)); @@ -77,4 +79,12 @@ public class BlockProjectileGenerator extends BlockContainerImpl implements ITES public Tuple, Supplier>>> getTESR() { return new Tuple<>(ModTileEntities.PROJECTILE_GENERATOR, () -> RenderProjectileGenerator::new); } + + @Override + public void generateCustomBlockState(BlockStateGenerator generator) { + generator.simpleBlock(this, generator.models().cubeBottomTop(this.getBaseName(), + generator.modLoc("block/" + this.getBaseName()), + generator.modLoc("block/" + this.getBaseName() + "_top"), + generator.modLoc("block/" + this.getBaseName() + "_top"))); + } } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockSpawnLamp.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockSpawnLamp.java index a65241a9..e411b243 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockSpawnLamp.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockSpawnLamp.java @@ -8,9 +8,11 @@ import de.ellpeck.naturesaura.data.BlockStateGenerator; import de.ellpeck.naturesaura.packet.PacketHandler; import de.ellpeck.naturesaura.packet.PacketParticles; import de.ellpeck.naturesaura.reg.ICustomBlockState; +import de.ellpeck.naturesaura.reg.ICustomRenderType; import net.minecraft.block.BlockState; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.RenderType; import net.minecraft.entity.MobEntity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.AxisAlignedBB; @@ -29,7 +31,9 @@ import net.minecraftforge.event.entity.living.LivingSpawnEvent; import net.minecraftforge.eventbus.api.Event; import net.minecraftforge.eventbus.api.SubscribeEvent; -public class BlockSpawnLamp extends BlockContainerImpl implements IVisualizable, ICustomBlockState { +import java.util.function.Supplier; + +public class BlockSpawnLamp extends BlockContainerImpl implements IVisualizable, ICustomBlockState, ICustomRenderType { private static final VoxelShape SHAPE = VoxelShapes.create(4 / 16F, 0F, 4 / 16F, 12 / 16F, 13 / 16F, 12 / 16F); @@ -97,4 +101,9 @@ public class BlockSpawnLamp extends BlockContainerImpl implements IVisualizable, public void generateCustomBlockState(BlockStateGenerator generator) { generator.simpleBlock(this, generator.models().getExistingFile(generator.modLoc(this.getBaseName()))); } + + @Override + public Supplier getRenderType() { + return RenderType::cutoutMipped; + } } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockTimeChanger.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockTimeChanger.java index fa809ed2..b91446cb 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockTimeChanger.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockTimeChanger.java @@ -1,12 +1,21 @@ package de.ellpeck.naturesaura.blocks; -import de.ellpeck.naturesaura.blocks.tiles.ModTileEntities; import de.ellpeck.naturesaura.blocks.tiles.TileEntityTimeChanger; +import de.ellpeck.naturesaura.data.BlockStateGenerator; +import de.ellpeck.naturesaura.reg.ICustomBlockState; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -public class BlockTimeChanger extends BlockContainerImpl { +public class BlockTimeChanger extends BlockContainerImpl implements ICustomBlockState { public BlockTimeChanger() { super("time_changer", TileEntityTimeChanger::new, ModBlocks.prop(Material.ROCK).hardnessAndResistance(2.5F).sound(SoundType.STONE)); } + + @Override + public void generateCustomBlockState(BlockStateGenerator generator) { + generator.simpleBlock(this, generator.models().cubeBottomTop(this.getBaseName(), + generator.modLoc("block/" + this.getBaseName()), + generator.modLoc("block/" + this.getBaseName() + "_bottom"), + generator.modLoc("block/" + this.getBaseName() + "_top"))); + } } diff --git a/src/main/java/de/ellpeck/naturesaura/items/ItemAuraBottle.java b/src/main/java/de/ellpeck/naturesaura/items/ItemAuraBottle.java index 5d84cb85..c2cd2292 100644 --- a/src/main/java/de/ellpeck/naturesaura/items/ItemAuraBottle.java +++ b/src/main/java/de/ellpeck/naturesaura/items/ItemAuraBottle.java @@ -4,7 +4,9 @@ import de.ellpeck.naturesaura.NaturesAura; import de.ellpeck.naturesaura.api.NaturesAuraAPI; import de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk; import de.ellpeck.naturesaura.api.aura.type.IAuraType; +import de.ellpeck.naturesaura.data.ItemModelGenerator; import de.ellpeck.naturesaura.reg.IColorProvidingItem; +import de.ellpeck.naturesaura.reg.ICustomItemModel; import net.minecraft.block.BlockState; import net.minecraft.block.DispenserBlock; import net.minecraft.client.renderer.color.IItemColor; @@ -27,7 +29,7 @@ import net.minecraftforge.eventbus.api.SubscribeEvent; import static net.minecraft.dispenser.DefaultDispenseItemBehavior.doDispense; -public class ItemAuraBottle extends ItemImpl implements IColorProvidingItem { +public class ItemAuraBottle extends ItemImpl implements IColorProvidingItem, ICustomItemModel { public ItemAuraBottle(Item emptyBottle) { super("aura_bottle", new Properties().group(NaturesAura.CREATIVE_TAB)); @@ -91,6 +93,13 @@ public class ItemAuraBottle extends ItemImpl implements IColorProvidingItem { return (stack, tintIndex) -> tintIndex > 0 ? getType(stack).getColor() : 0xFFFFFF; } + @Override + public void generateCustomItemModel(ItemModelGenerator generator) { + generator.withExistingParent(this.getBaseName(), "item/generated") + .texture("layer0", "item/" + this.getBaseName()) + .texture("layer1", "item/" + this.getBaseName() + "_overlay"); + } + private class EventHandler { @SubscribeEvent diff --git a/src/main/java/de/ellpeck/naturesaura/items/ItemColorChanger.java b/src/main/java/de/ellpeck/naturesaura/items/ItemColorChanger.java index c6e2d463..255eaf17 100644 --- a/src/main/java/de/ellpeck/naturesaura/items/ItemColorChanger.java +++ b/src/main/java/de/ellpeck/naturesaura/items/ItemColorChanger.java @@ -2,7 +2,9 @@ package de.ellpeck.naturesaura.items; import de.ellpeck.naturesaura.NaturesAura; import de.ellpeck.naturesaura.api.NaturesAuraAPI; +import de.ellpeck.naturesaura.data.ItemModelGenerator; import de.ellpeck.naturesaura.reg.IColorProvidingItem; +import de.ellpeck.naturesaura.reg.ICustomItemModel; import net.minecraft.block.BlockState; import net.minecraft.client.renderer.color.IItemColor; import net.minecraft.entity.player.PlayerEntity; @@ -16,7 +18,7 @@ import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -public class ItemColorChanger extends ItemImpl implements IColorProvidingItem { +public class ItemColorChanger extends ItemImpl implements IColorProvidingItem, ICustomItemModel { public ItemColorChanger() { super("color_changer", new Properties().maxStackSize(1).group(NaturesAura.CREATIVE_TAB)); @@ -40,6 +42,7 @@ public class ItemColorChanger extends ItemImpl implements IColorProvidingItem { private static boolean changeOrCopyColor(PlayerEntity player, ItemStack stack, World world, BlockPos pos, DyeColor firstColor) { BlockState state = world.getBlockState(pos); for (IProperty prop : state.getProperties()) { + // TODO Fix this since it's now not state-based anymore if (prop.getValueClass() == DyeColor.class) { DyeColor color = (DyeColor) state.get(prop); if (firstColor == null || color == firstColor) { @@ -130,4 +133,9 @@ public class ItemColorChanger extends ItemImpl implements IColorProvidingItem { return 0xFFFFFF; }; } + + @Override + public void generateCustomItemModel(ItemModelGenerator generator) { + // noop + } } diff --git a/src/main/java/de/ellpeck/naturesaura/proxy/ClientProxy.java b/src/main/java/de/ellpeck/naturesaura/proxy/ClientProxy.java index 040bd86b..c3bf674e 100644 --- a/src/main/java/de/ellpeck/naturesaura/proxy/ClientProxy.java +++ b/src/main/java/de/ellpeck/naturesaura/proxy/ClientProxy.java @@ -6,14 +6,13 @@ import de.ellpeck.naturesaura.gui.GuiEnderCrate; import de.ellpeck.naturesaura.gui.ModContainers; import de.ellpeck.naturesaura.particles.ParticleHandler; import de.ellpeck.naturesaura.particles.ParticleMagic; -import de.ellpeck.naturesaura.reg.IColorProvidingBlock; -import de.ellpeck.naturesaura.reg.IColorProvidingItem; -import de.ellpeck.naturesaura.reg.ITESRProvider; +import de.ellpeck.naturesaura.reg.*; import de.ellpeck.naturesaura.renderers.PlayerLayerTrinkets; import de.ellpeck.naturesaura.renderers.SupporterFancyHandler; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScreenManager; +import net.minecraft.client.renderer.RenderTypeLookup; import net.minecraft.client.renderer.color.IItemColor; import net.minecraft.client.renderer.color.ItemColors; import net.minecraft.client.renderer.entity.PlayerRenderer; @@ -55,7 +54,10 @@ public class ClientProxy implements IProxy { @Override public void postInit(FMLCommonSetupEvent event) { - + for (IModItem item : ModRegistry.ALL_ITEMS) { + if (item instanceof ICustomRenderType) + RenderTypeLookup.setRenderLayer((Block) item, ((ICustomRenderType) item).getRenderType().get()); + } } @Override diff --git a/src/main/java/de/ellpeck/naturesaura/reg/ICustomRenderType.java b/src/main/java/de/ellpeck/naturesaura/reg/ICustomRenderType.java new file mode 100644 index 00000000..73737c6c --- /dev/null +++ b/src/main/java/de/ellpeck/naturesaura/reg/ICustomRenderType.java @@ -0,0 +1,10 @@ +package de.ellpeck.naturesaura.reg; + +import net.minecraft.client.renderer.RenderType; + +import java.util.function.Supplier; + +public interface ICustomRenderType { + + Supplier getRenderType(); +} diff --git a/src/main/resources/assets/naturesaura/blockstates/dimension_rail_end.json b/src/main/resources/assets/naturesaura/blockstates/dimension_rail_end.json new file mode 100644 index 00000000..05714149 --- /dev/null +++ b/src/main/resources/assets/naturesaura/blockstates/dimension_rail_end.json @@ -0,0 +1,40 @@ +{ + "variants": { + "shape=north_south": { + "model": "naturesaura:block/dimension_rail_end" + }, + "shape=east_west": { + "model": "naturesaura:block/dimension_rail_end", + "y": 90 + }, + "shape=ascending_east": { + "model": "naturesaura:block/dimension_rail_end_raised_ne", + "y": 90 + }, + "shape=ascending_west": { + "model": "naturesaura:block/dimension_rail_end_raised_sw", + "y": 90 + }, + "shape=ascending_north": { + "model": "naturesaura:block/dimension_rail_end_raised_ne" + }, + "shape=ascending_south": { + "model": "naturesaura:block/dimension_rail_end_raised_sw" + }, + "shape=south_east": { + "model": "naturesaura:block/dimension_rail_end" + }, + "shape=south_west": { + "model": "naturesaura:block/dimension_rail_end", + "y": 90 + }, + "shape=north_west": { + "model": "naturesaura:block/dimension_rail_end", + "y": 180 + }, + "shape=north_east": { + "model": "naturesaura:block/dimension_rail_end", + "y": 270 + } + } +} diff --git a/src/main/resources/assets/naturesaura/blockstates/dimension_rail_nether.json b/src/main/resources/assets/naturesaura/blockstates/dimension_rail_nether.json new file mode 100644 index 00000000..f8652e26 --- /dev/null +++ b/src/main/resources/assets/naturesaura/blockstates/dimension_rail_nether.json @@ -0,0 +1,40 @@ +{ + "variants": { + "shape=north_south": { + "model": "naturesaura:block/dimension_rail_nether" + }, + "shape=east_west": { + "model": "naturesaura:block/dimension_rail_nether", + "y": 90 + }, + "shape=ascending_east": { + "model": "naturesaura:block/dimension_rail_nether_raised_ne", + "y": 90 + }, + "shape=ascending_west": { + "model": "naturesaura:block/dimension_rail_nether_raised_sw", + "y": 90 + }, + "shape=ascending_north": { + "model": "naturesaura:block/dimension_rail_nether_raised_ne" + }, + "shape=ascending_south": { + "model": "naturesaura:block/dimension_rail_nether_raised_sw" + }, + "shape=south_east": { + "model": "naturesaura:block/dimension_rail_end" + }, + "shape=south_west": { + "model": "naturesaura:block/dimension_rail_end", + "y": 90 + }, + "shape=north_west": { + "model": "naturesaura:block/dimension_rail_end", + "y": 180 + }, + "shape=north_east": { + "model": "naturesaura:block/dimension_rail_end", + "y": 270 + } + } +} diff --git a/src/main/resources/assets/naturesaura/blockstates/dimension_rail_overworld.json b/src/main/resources/assets/naturesaura/blockstates/dimension_rail_overworld.json new file mode 100644 index 00000000..e8f35ba6 --- /dev/null +++ b/src/main/resources/assets/naturesaura/blockstates/dimension_rail_overworld.json @@ -0,0 +1,40 @@ +{ + "variants": { + "shape=north_south": { + "model": "naturesaura:block/dimension_rail_overworld" + }, + "shape=east_west": { + "model": "naturesaura:block/dimension_rail_overworld", + "y": 90 + }, + "shape=ascending_east": { + "model": "naturesaura:block/dimension_rail_overworld_raised_ne", + "y": 90 + }, + "shape=ascending_west": { + "model": "naturesaura:block/dimension_rail_overworld_raised_sw", + "y": 90 + }, + "shape=ascending_north": { + "model": "naturesaura:block/dimension_rail_overworld_raised_ne" + }, + "shape=ascending_south": { + "model": "naturesaura:block/dimension_rail_overworld_raised_sw" + }, + "shape=south_east": { + "model": "naturesaura:block/dimension_rail_end" + }, + "shape=south_west": { + "model": "naturesaura:block/dimension_rail_end", + "y": 90 + }, + "shape=north_west": { + "model": "naturesaura:block/dimension_rail_end", + "y": 180 + }, + "shape=north_east": { + "model": "naturesaura:block/dimension_rail_end", + "y": 270 + } + } +} diff --git a/src/main/resources/assets/naturesaura/models/block/dimension_rail_end.json b/src/main/resources/assets/naturesaura/models/block/dimension_rail_end.json new file mode 100644 index 00000000..2f654652 --- /dev/null +++ b/src/main/resources/assets/naturesaura/models/block/dimension_rail_end.json @@ -0,0 +1,6 @@ +{ + "parent": "block/rail_flat", + "textures": { + "rail": "naturesaura:block/dimension_rail_end" + } +} diff --git a/src/main/resources/assets/naturesaura/models/block/dimension_rail_end_raised_ne.json b/src/main/resources/assets/naturesaura/models/block/dimension_rail_end_raised_ne.json new file mode 100644 index 00000000..039b748d --- /dev/null +++ b/src/main/resources/assets/naturesaura/models/block/dimension_rail_end_raised_ne.json @@ -0,0 +1,6 @@ +{ + "parent": "block/template_rail_raised_ne", + "textures": { + "rail": "naturesaura:block/dimension_rail_end" + } +} diff --git a/src/main/resources/assets/naturesaura/models/block/dimension_rail_end_raised_sw.json b/src/main/resources/assets/naturesaura/models/block/dimension_rail_end_raised_sw.json new file mode 100644 index 00000000..a2887495 --- /dev/null +++ b/src/main/resources/assets/naturesaura/models/block/dimension_rail_end_raised_sw.json @@ -0,0 +1,6 @@ +{ + "parent": "block/template_rail_raised_sw", + "textures": { + "rail": "naturesaura:block/dimension_rail_end" + } +} diff --git a/src/main/resources/assets/naturesaura/models/block/dimension_rail_nether.json b/src/main/resources/assets/naturesaura/models/block/dimension_rail_nether.json new file mode 100644 index 00000000..339a1d28 --- /dev/null +++ b/src/main/resources/assets/naturesaura/models/block/dimension_rail_nether.json @@ -0,0 +1,6 @@ +{ + "parent": "block/rail_flat", + "textures": { + "rail": "naturesaura:block/dimension_rail_nether" + } +} diff --git a/src/main/resources/assets/naturesaura/models/block/dimension_rail_nether_raised_ne.json b/src/main/resources/assets/naturesaura/models/block/dimension_rail_nether_raised_ne.json new file mode 100644 index 00000000..42f96230 --- /dev/null +++ b/src/main/resources/assets/naturesaura/models/block/dimension_rail_nether_raised_ne.json @@ -0,0 +1,6 @@ +{ + "parent": "block/template_rail_raised_ne", + "textures": { + "rail": "naturesaura:block/dimension_rail_nether" + } +} diff --git a/src/main/resources/assets/naturesaura/models/block/dimension_rail_nether_raised_sw.json b/src/main/resources/assets/naturesaura/models/block/dimension_rail_nether_raised_sw.json new file mode 100644 index 00000000..c96e5319 --- /dev/null +++ b/src/main/resources/assets/naturesaura/models/block/dimension_rail_nether_raised_sw.json @@ -0,0 +1,6 @@ +{ + "parent": "block/template_rail_raised_sw", + "textures": { + "rail": "naturesaura:block/dimension_rail_nether" + } +} diff --git a/src/main/resources/assets/naturesaura/models/block/dimension_rail_overworld.json b/src/main/resources/assets/naturesaura/models/block/dimension_rail_overworld.json new file mode 100644 index 00000000..d71c967a --- /dev/null +++ b/src/main/resources/assets/naturesaura/models/block/dimension_rail_overworld.json @@ -0,0 +1,6 @@ +{ + "parent": "block/rail_flat", + "textures": { + "rail": "naturesaura:block/dimension_rail_overworld" + } +} diff --git a/src/main/resources/assets/naturesaura/models/block/dimension_rail_overworld_raised_ne.json b/src/main/resources/assets/naturesaura/models/block/dimension_rail_overworld_raised_ne.json new file mode 100644 index 00000000..eb30bd86 --- /dev/null +++ b/src/main/resources/assets/naturesaura/models/block/dimension_rail_overworld_raised_ne.json @@ -0,0 +1,6 @@ +{ + "parent": "block/template_rail_raised_ne", + "textures": { + "rail": "naturesaura:block/dimension_rail_overworld" + } +} diff --git a/src/main/resources/assets/naturesaura/models/block/dimension_rail_overworld_raised_sw.json b/src/main/resources/assets/naturesaura/models/block/dimension_rail_overworld_raised_sw.json new file mode 100644 index 00000000..4396bf8a --- /dev/null +++ b/src/main/resources/assets/naturesaura/models/block/dimension_rail_overworld_raised_sw.json @@ -0,0 +1,6 @@ +{ + "parent": "block/template_rail_raised_sw", + "textures": { + "rail": "naturesaura:block/dimension_rail_overworld" + } +} diff --git a/src/main/resources/assets/naturesaura/models/item/color_changer.json b/src/main/resources/assets/naturesaura/models/item/color_changer.json new file mode 100644 index 00000000..c528a9a1 --- /dev/null +++ b/src/main/resources/assets/naturesaura/models/item/color_changer.json @@ -0,0 +1,20 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "naturesaura:item/color_changer" + }, + "overrides": [ + { + "predicate": { + "naturesaura:has_color": 1 + }, + "model": "naturesaura:item/color_changer_filled" + }, + { + "predicate": { + "naturesaura:fill_mode": 1 + }, + "model": "naturesaura:item/color_changer_fill_mode" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/naturesaura/models/item/color_changer_fill_mode.json b/src/main/resources/assets/naturesaura/models/item/color_changer_fill_mode.json new file mode 100644 index 00000000..957fb74a --- /dev/null +++ b/src/main/resources/assets/naturesaura/models/item/color_changer_fill_mode.json @@ -0,0 +1,7 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "naturesaura:item/color_changer_fill_mode", + "layer1": "naturesaura:item/color_changer_fill_mode_overlay" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/naturesaura/models/item/color_changer_filled.json b/src/main/resources/assets/naturesaura/models/item/color_changer_filled.json new file mode 100644 index 00000000..23e8337d --- /dev/null +++ b/src/main/resources/assets/naturesaura/models/item/color_changer_filled.json @@ -0,0 +1,7 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "naturesaura:item/color_changer", + "layer1": "naturesaura:item/color_changer_overlay" + } +} \ No newline at end of file