diff --git a/src/main/java/com/pahimar/ee3/block/BlockAlchemicalFuel.java b/src/main/java/com/pahimar/ee3/block/BlockAlchemicalFuel.java index e2fdab22..35b8d349 100644 --- a/src/main/java/com/pahimar/ee3/block/BlockAlchemicalFuel.java +++ b/src/main/java/com/pahimar/ee3/block/BlockAlchemicalFuel.java @@ -1,6 +1,6 @@ package com.pahimar.ee3.block; -import com.pahimar.ee3.block.base.BlockEnumBase; +import com.pahimar.ee3.block.base.BlockEnum; import com.pahimar.ee3.block.base.IEnumMeta; import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.BlockStateContainer; @@ -13,7 +13,7 @@ import java.util.List; -public class BlockAlchemicalFuel extends BlockEnumBase { +public class BlockAlchemicalFuel extends BlockEnum { public static final PropertyEnum VARIANT = PropertyEnum.create("variant", FuelVariant.class); diff --git a/src/main/java/com/pahimar/ee3/block/BlockCalciner.java b/src/main/java/com/pahimar/ee3/block/BlockCalciner.java index 9d62d6e0..cb727f46 100644 --- a/src/main/java/com/pahimar/ee3/block/BlockCalciner.java +++ b/src/main/java/com/pahimar/ee3/block/BlockCalciner.java @@ -1,6 +1,6 @@ package com.pahimar.ee3.block; -import com.pahimar.ee3.block.base.BlockContainerBase; +import com.pahimar.ee3.block.base.BlockTileEntity; import com.pahimar.ee3.tileentity.TileEntityCalciner; import net.minecraft.block.state.IBlockState; import net.minecraft.tileentity.TileEntity; @@ -12,7 +12,7 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public class BlockCalciner extends BlockContainerBase { +public class BlockCalciner extends BlockTileEntity { private static final AxisAlignedBB AABB_CALCINER = new AxisAlignedBB(0.1D, 0.0D, 0.1D, 0.9D, 1.0D, 0.9D); diff --git a/src/main/java/com/pahimar/ee3/block/BlockGlassBell.java b/src/main/java/com/pahimar/ee3/block/BlockGlassBell.java index e55bc233..6b23c310 100644 --- a/src/main/java/com/pahimar/ee3/block/BlockGlassBell.java +++ b/src/main/java/com/pahimar/ee3/block/BlockGlassBell.java @@ -1,6 +1,6 @@ package com.pahimar.ee3.block; -import com.pahimar.ee3.block.base.BlockContainerBase; +import com.pahimar.ee3.block.base.BlockTileEntity; import com.pahimar.ee3.tileentity.TileEntityGlassBell; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.BlockStateContainer; @@ -16,7 +16,7 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public class BlockGlassBell extends BlockContainerBase { +public class BlockGlassBell extends BlockTileEntity { private static final AxisAlignedBB AABB_FACING_UP = new AxisAlignedBB(0.125D, 0.0D, 0.125D, 0.875D, 0.66D, 0.875D); private static final AxisAlignedBB AABB_FACING_DOWN = new AxisAlignedBB(0.125D, 0.33D, 0.125D, 0.875D, 1.0D, 0.875D); diff --git a/src/main/java/com/pahimar/ee3/block/base/BlockBase.java b/src/main/java/com/pahimar/ee3/block/base/BlockBase.java index 6643524f..53a82e7b 100644 --- a/src/main/java/com/pahimar/ee3/block/base/BlockBase.java +++ b/src/main/java/com/pahimar/ee3/block/base/BlockBase.java @@ -11,7 +11,7 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public abstract class BlockBase extends Block implements IBlockEE { +public abstract class BlockBase extends Block { private final String BASE_NAME; diff --git a/src/main/java/com/pahimar/ee3/block/base/BlockContainerBase.java b/src/main/java/com/pahimar/ee3/block/base/BlockContainerBase.java deleted file mode 100644 index febba476..00000000 --- a/src/main/java/com/pahimar/ee3/block/base/BlockContainerBase.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.pahimar.ee3.block.base; - -import com.pahimar.ee3.EquivalentExchange3; -import com.pahimar.ee3.creativetab.CreativeTab; -import com.pahimar.ee3.init.ModBlocks; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; -import net.minecraft.item.Item; -import net.minecraft.util.EnumBlockRenderType; -import net.minecraftforge.client.model.ModelLoader; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -public abstract class BlockContainerBase extends BlockContainer implements IBlockEE { - - private final String BASE_NAME; - - public BlockContainerBase(String name) { - this(name, Material.ROCK); - } - - public BlockContainerBase(String name, Material material) { - super(material); - setRegistryName(name); - setUnlocalizedName(name); - setCreativeTab(CreativeTab.EE3_TAB); - BASE_NAME = name; - ModBlocks.register(this); - } - - @Override - public String getUnlocalizedName() { - return String.format("tile.%s:%s", EquivalentExchange3.MOD_ID, BASE_NAME); - } - - @SideOnly(Side.CLIENT) - public void initModelsAndVariants() { - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), 0, new ModelResourceLocation(getRegistryName().toString())); - } - - @Override - public EnumBlockRenderType getRenderType(IBlockState state) { - return EnumBlockRenderType.MODEL; - } -} diff --git a/src/main/java/com/pahimar/ee3/block/base/BlockEnumBase.java b/src/main/java/com/pahimar/ee3/block/base/BlockEnum.java similarity index 90% rename from src/main/java/com/pahimar/ee3/block/base/BlockEnumBase.java rename to src/main/java/com/pahimar/ee3/block/base/BlockEnum.java index 2e6b66ca..52477412 100644 --- a/src/main/java/com/pahimar/ee3/block/base/BlockEnumBase.java +++ b/src/main/java/com/pahimar/ee3/block/base/BlockEnum.java @@ -10,15 +10,15 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public abstract class BlockEnumBase extends BlockBase { +public abstract class BlockEnum extends BlockBase { private final IEnumMeta[] VARIANTS; - public BlockEnumBase(String name, IEnumMeta[] variants) { + public BlockEnum(String name, IEnumMeta[] variants) { this(name, Material.ROCK, variants); } - public BlockEnumBase(String name, Material material, IEnumMeta[] variants) { + public BlockEnum(String name, Material material, IEnumMeta[] variants) { super(name, material); if (variants.length > 0) { VARIANTS = variants; diff --git a/src/main/java/com/pahimar/ee3/block/base/BlockTileEntity.java b/src/main/java/com/pahimar/ee3/block/base/BlockTileEntity.java new file mode 100644 index 00000000..6d72abb9 --- /dev/null +++ b/src/main/java/com/pahimar/ee3/block/base/BlockTileEntity.java @@ -0,0 +1,15 @@ +package com.pahimar.ee3.block.base; + +import net.minecraft.block.ITileEntityProvider; +import net.minecraft.block.material.Material; + +public abstract class BlockTileEntity extends BlockBase implements ITileEntityProvider { + + public BlockTileEntity(String name) { + this(name, Material.ROCK); + } + + public BlockTileEntity(String name, Material material) { + super(name, material); + } +} diff --git a/src/main/java/com/pahimar/ee3/block/base/IBlockEE.java b/src/main/java/com/pahimar/ee3/block/base/IBlockEE.java deleted file mode 100644 index 86772dd6..00000000 --- a/src/main/java/com/pahimar/ee3/block/base/IBlockEE.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.pahimar.ee3.block.base; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -public interface IBlockEE { - - @SideOnly(Side.CLIENT) - void initModelsAndVariants(); -} diff --git a/src/main/java/com/pahimar/ee3/init/ModBlocks.java b/src/main/java/com/pahimar/ee3/init/ModBlocks.java index 740381e3..a6b9f639 100644 --- a/src/main/java/com/pahimar/ee3/init/ModBlocks.java +++ b/src/main/java/com/pahimar/ee3/init/ModBlocks.java @@ -4,8 +4,7 @@ import com.pahimar.ee3.block.BlockAlchemicalFuel; import com.pahimar.ee3.block.BlockCalciner; import com.pahimar.ee3.block.BlockGlassBell; -import com.pahimar.ee3.block.base.IBlockEE; -import net.minecraft.block.Block; +import com.pahimar.ee3.block.base.BlockBase; import net.minecraftforge.fml.common.registry.GameRegistry; import java.util.ArrayList; @@ -15,21 +14,19 @@ @GameRegistry.ObjectHolder(EquivalentExchange3.MOD_ID) public class ModBlocks { - private static final List BLOCKS = new ArrayList<>(); + private static final List BLOCKS = new ArrayList<>(); - public static final Block CALCINER = new BlockCalciner(); - public static final Block ALCHEMICAL_FUEL = new BlockAlchemicalFuel(); - public static final Block GLASS_BELL = new BlockGlassBell(); + public static final BlockBase CALCINER = new BlockCalciner(); + public static final BlockBase ALCHEMICAL_FUEL = new BlockAlchemicalFuel(); + public static final BlockBase GLASS_BELL = new BlockGlassBell(); private ModBlocks() {} - public static Collection getBlocks() { + public static Collection getBlocks() { return BLOCKS; } - public static void register(Block block) { - if (block instanceof IBlockEE) { - BLOCKS.add(block); - } + public static void register(BlockBase block) { + BLOCKS.add(block); } } diff --git a/src/main/java/com/pahimar/ee3/init/ModItems.java b/src/main/java/com/pahimar/ee3/init/ModItems.java index 71ef150f..b0ed35cb 100644 --- a/src/main/java/com/pahimar/ee3/init/ModItems.java +++ b/src/main/java/com/pahimar/ee3/init/ModItems.java @@ -2,7 +2,7 @@ import com.pahimar.ee3.EquivalentExchange3; import com.pahimar.ee3.item.*; -import com.pahimar.ee3.item.base.ItemEE; +import com.pahimar.ee3.item.base.ItemBase; import net.minecraftforge.fml.common.registry.GameRegistry; import java.util.ArrayList; @@ -12,21 +12,21 @@ @GameRegistry.ObjectHolder(EquivalentExchange3.MOD_ID) public class ModItems { - private static final List ITEMS = new ArrayList<>(); + private static final List ITEMS = new ArrayList<>(); - public static final ItemEE CHALK = new ItemChalk(); - public static final ItemEE ALCHEMICAL_FUEL = new ItemAlchemicalFuel(); - public static final ItemEE ALCHENOMICON = new ItemAlchenomicon(); - public static final ItemEE ALCHEMICAL_DUST = new ItemAlchemicalDust(); - public static final ItemEE ALCHEMICAL_BAG = new ItemAlchemicalBag(); + public static final ItemBase CHALK = new ItemChalk(); + public static final ItemBase ALCHEMICAL_FUEL = new ItemAlchemicalFuel(); + public static final ItemBase ALCHENOMICON = new ItemAlchenomicon(); + public static final ItemBase ALCHEMICAL_DUST = new ItemAlchemicalDust(); + public static final ItemBase ALCHEMICAL_BAG = new ItemAlchemicalBag(); private ModItems() {} - public static Collection getItems() { + public static Collection getItems() { return ITEMS; } - public static void register(ItemEE item) { + public static void register(ItemBase item) { ITEMS.add(item); } } diff --git a/src/main/java/com/pahimar/ee3/item/ItemAlchemicalBag.java b/src/main/java/com/pahimar/ee3/item/ItemAlchemicalBag.java index c8e72813..a7820782 100644 --- a/src/main/java/com/pahimar/ee3/item/ItemAlchemicalBag.java +++ b/src/main/java/com/pahimar/ee3/item/ItemAlchemicalBag.java @@ -1,6 +1,6 @@ package com.pahimar.ee3.item; -import com.pahimar.ee3.item.base.ItemEE; +import com.pahimar.ee3.item.base.ItemBase; import com.pahimar.ee3.reference.Messages; import com.pahimar.ee3.reference.Names; import com.pahimar.ee3.util.IOwnable; @@ -19,7 +19,7 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public class ItemAlchemicalBag extends ItemEE implements IOwnable, IItemColor { +public class ItemAlchemicalBag extends ItemBase implements IOwnable, IItemColor { private static final String[] VARIANTS = {"alchemical_bag_closed", "alchemical_bag_open"}; diff --git a/src/main/java/com/pahimar/ee3/item/ItemAlchemicalDust.java b/src/main/java/com/pahimar/ee3/item/ItemAlchemicalDust.java index b280c53c..e1e90f80 100644 --- a/src/main/java/com/pahimar/ee3/item/ItemAlchemicalDust.java +++ b/src/main/java/com/pahimar/ee3/item/ItemAlchemicalDust.java @@ -1,13 +1,13 @@ package com.pahimar.ee3.item; -import com.pahimar.ee3.item.base.ItemEE; +import com.pahimar.ee3.item.base.ItemBase; import com.pahimar.ee3.reference.Colors; import net.minecraft.client.renderer.color.IItemColor; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public class ItemAlchemicalDust extends ItemEE implements IItemColor { +public class ItemAlchemicalDust extends ItemBase implements IItemColor { public ItemAlchemicalDust() { super("alchemical_dust", "ash", "minium_dust"); diff --git a/src/main/java/com/pahimar/ee3/item/ItemAlchemicalFuel.java b/src/main/java/com/pahimar/ee3/item/ItemAlchemicalFuel.java index e5db4c7d..2f13957d 100644 --- a/src/main/java/com/pahimar/ee3/item/ItemAlchemicalFuel.java +++ b/src/main/java/com/pahimar/ee3/item/ItemAlchemicalFuel.java @@ -1,8 +1,8 @@ package com.pahimar.ee3.item; -import com.pahimar.ee3.item.base.ItemEE; +import com.pahimar.ee3.item.base.ItemBase; -public class ItemAlchemicalFuel extends ItemEE { +public class ItemAlchemicalFuel extends ItemBase { public ItemAlchemicalFuel() { super("alchemical_fuel", "alchemical_coal", "mobius_fuel", "aeternalis_fuel"); diff --git a/src/main/java/com/pahimar/ee3/item/ItemAlchenomicon.java b/src/main/java/com/pahimar/ee3/item/ItemAlchenomicon.java index 0b1f3b86..13db0246 100644 --- a/src/main/java/com/pahimar/ee3/item/ItemAlchenomicon.java +++ b/src/main/java/com/pahimar/ee3/item/ItemAlchenomicon.java @@ -1,7 +1,7 @@ package com.pahimar.ee3.item; import com.pahimar.ee3.EquivalentExchange3; -import com.pahimar.ee3.item.base.ItemEE; +import com.pahimar.ee3.item.base.ItemBase; import com.pahimar.ee3.reference.GUIs; import com.pahimar.ee3.reference.Messages; import com.pahimar.ee3.util.ItemStackUtils; @@ -13,7 +13,7 @@ import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.world.World; -public class ItemAlchenomicon extends ItemEE { +public class ItemAlchenomicon extends ItemBase { public ItemAlchenomicon() { super("alchenomicon"); diff --git a/src/main/java/com/pahimar/ee3/item/ItemChalk.java b/src/main/java/com/pahimar/ee3/item/ItemChalk.java index 8a5db530..fbc94f32 100644 --- a/src/main/java/com/pahimar/ee3/item/ItemChalk.java +++ b/src/main/java/com/pahimar/ee3/item/ItemChalk.java @@ -1,8 +1,8 @@ package com.pahimar.ee3.item; -import com.pahimar.ee3.item.base.ItemEE; +import com.pahimar.ee3.item.base.ItemBase; -public class ItemChalk extends ItemEE { +public class ItemChalk extends ItemBase { public ItemChalk() { super("chalk"); diff --git a/src/main/java/com/pahimar/ee3/item/base/IItemVariantHolder.java b/src/main/java/com/pahimar/ee3/item/base/IItemVariantHolder.java index 96b2712d..19f1958d 100644 --- a/src/main/java/com/pahimar/ee3/item/base/IItemVariantHolder.java +++ b/src/main/java/com/pahimar/ee3/item/base/IItemVariantHolder.java @@ -2,7 +2,7 @@ import net.minecraft.client.renderer.ItemMeshDefinition; -public interface IItemVariantHolder { +public interface IItemVariantHolder { T getItem(); diff --git a/src/main/java/com/pahimar/ee3/item/base/ItemEE.java b/src/main/java/com/pahimar/ee3/item/base/ItemBase.java similarity index 95% rename from src/main/java/com/pahimar/ee3/item/base/ItemEE.java rename to src/main/java/com/pahimar/ee3/item/base/ItemBase.java index 04571060..4e0ed8d3 100644 --- a/src/main/java/com/pahimar/ee3/item/base/ItemEE.java +++ b/src/main/java/com/pahimar/ee3/item/base/ItemBase.java @@ -16,12 +16,12 @@ import java.util.ArrayList; import java.util.List; -public class ItemEE extends Item implements IItemVariantHolder { +public class ItemBase extends Item implements IItemVariantHolder { private final String BASE_NAME; private final String[] VARIANTS; - public ItemEE(String name, String ... variants) { + public ItemBase(String name, String ... variants) { super(); setRegistryName(name); @@ -96,7 +96,7 @@ public void initModelsAndVariants() { } @Override - public ItemEE getItem() { + public ItemBase getItem() { return this; } diff --git a/src/main/java/com/pahimar/ee3/item/base/ItemBlockEnumEE.java b/src/main/java/com/pahimar/ee3/item/base/ItemBlockEnum.java similarity index 73% rename from src/main/java/com/pahimar/ee3/item/base/ItemBlockEnumEE.java rename to src/main/java/com/pahimar/ee3/item/base/ItemBlockEnum.java index 6c217054..0acf9408 100644 --- a/src/main/java/com/pahimar/ee3/item/base/ItemBlockEnumEE.java +++ b/src/main/java/com/pahimar/ee3/item/base/ItemBlockEnum.java @@ -1,14 +1,14 @@ package com.pahimar.ee3.item.base; -import com.pahimar.ee3.block.base.BlockEnumBase; +import com.pahimar.ee3.block.base.BlockEnum; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -public class ItemBlockEnumEE extends ItemBlock { +public class ItemBlockEnum extends ItemBlock { - protected final BlockEnumBase block; + protected final BlockEnum block; - public ItemBlockEnumEE(BlockEnumBase block) { + public ItemBlockEnum(BlockEnum block) { super(block); this.block = block; this.setMaxDamage(0); diff --git a/src/main/java/com/pahimar/ee3/proxy/ClientProxy.java b/src/main/java/com/pahimar/ee3/proxy/ClientProxy.java index 7f162da3..db58f7c5 100644 --- a/src/main/java/com/pahimar/ee3/proxy/ClientProxy.java +++ b/src/main/java/com/pahimar/ee3/proxy/ClientProxy.java @@ -1,14 +1,14 @@ package com.pahimar.ee3.proxy; import com.pahimar.ee3.EquivalentExchange3; -import com.pahimar.ee3.block.base.IBlockEE; +import com.pahimar.ee3.block.base.BlockBase; import com.pahimar.ee3.client.handler.ItemTooltipEventHandler; import com.pahimar.ee3.client.handler.KeyInputEventHandler; import com.pahimar.ee3.client.settings.Keybindings; import com.pahimar.ee3.client.util.ClientParticleHelper; import com.pahimar.ee3.init.ModBlocks; import com.pahimar.ee3.init.ModItems; -import com.pahimar.ee3.item.base.ItemEE; +import com.pahimar.ee3.item.base.ItemBase; import com.pahimar.ee3.settings.ChalkSettings; import net.minecraft.client.renderer.color.IItemColor; import net.minecraft.util.EnumParticleTypes; @@ -35,10 +35,8 @@ public void onPreInit(FMLPreInitializationEvent event) { super.onPreInit(event); // Initialize models and textures - ModItems.getItems().forEach(ItemEE::initModelsAndVariants); - ModBlocks.getBlocks().stream() - .filter(block -> block instanceof IBlockEE) - .forEach(block -> ((IBlockEE) block).initModelsAndVariants()); + ModItems.getItems().forEach(ItemBase::initModelsAndVariants); + ModBlocks.getBlocks().forEach(BlockBase::initModelsAndVariants); OBJLoader.INSTANCE.addDomain(EquivalentExchange3.MOD_ID); // Register keybindings diff --git a/src/main/java/com/pahimar/ee3/util/BlockUtils.java b/src/main/java/com/pahimar/ee3/util/BlockUtils.java index c9a634fd..9c14b8c9 100644 --- a/src/main/java/com/pahimar/ee3/util/BlockUtils.java +++ b/src/main/java/com/pahimar/ee3/util/BlockUtils.java @@ -1,7 +1,7 @@ package com.pahimar.ee3.util; -import com.pahimar.ee3.block.base.BlockEnumBase; -import com.pahimar.ee3.item.base.ItemBlockEnumEE; +import com.pahimar.ee3.block.base.BlockEnum; +import com.pahimar.ee3.item.base.ItemBlockEnum; import net.minecraft.block.Block; import net.minecraft.item.ItemBlock; @@ -10,6 +10,6 @@ public class BlockUtils { private BlockUtils() {} public static ItemBlock getItemBlockFor(Block block) { - return block instanceof BlockEnumBase ? new ItemBlockEnumEE((BlockEnumBase) block) : new ItemBlock(block); + return block instanceof BlockEnum ? new ItemBlockEnum((BlockEnum) block) : new ItemBlock(block); } } diff --git a/src/main/resources/assets/ee3/blockstates/calciner.json b/src/main/resources/assets/ee3/blockstates/calciner.json index 7e3a7cf7..1df9537f 100644 --- a/src/main/resources/assets/ee3/blockstates/calciner.json +++ b/src/main/resources/assets/ee3/blockstates/calciner.json @@ -6,7 +6,11 @@ "model": "ee3:calciner.obj" }, "variants": { - "normal": [{}], + "normal": [{ + "transform": { + "rotation": { "y": 45 } + } + }], "inventory": [{}] } } \ No newline at end of file