Skip to content
This repository has been archived by the owner on Apr 22, 2019. It is now read-only.

Commit

Permalink
Remove IBlockEE, rename some mroe classes to use Base instead of EE a…
Browse files Browse the repository at this point in the history
…s a suffix (when its a base class)
  • Loading branch information
pahimar committed Oct 18, 2016
1 parent 1dc790d commit 5b0017a
Show file tree
Hide file tree
Showing 21 changed files with 72 additions and 115 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/pahimar/ee3/block/BlockAlchemicalFuel.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -13,7 +13,7 @@

import java.util.List;

public class BlockAlchemicalFuel extends BlockEnumBase {
public class BlockAlchemicalFuel extends BlockEnum {

public static final PropertyEnum<FuelVariant> VARIANT = PropertyEnum.create("variant", FuelVariant.class);

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/pahimar/ee3/block/BlockCalciner.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/pahimar/ee3/block/BlockGlassBell.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/pahimar/ee3/block/base/BlockBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
47 changes: 0 additions & 47 deletions src/main/java/com/pahimar/ee3/block/base/BlockContainerBase.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/com/pahimar/ee3/block/base/BlockTileEntity.java
Original file line number Diff line number Diff line change
@@ -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);
}
}
10 changes: 0 additions & 10 deletions src/main/java/com/pahimar/ee3/block/base/IBlockEE.java

This file was deleted.

19 changes: 8 additions & 11 deletions src/main/java/com/pahimar/ee3/init/ModBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -15,21 +14,19 @@
@GameRegistry.ObjectHolder(EquivalentExchange3.MOD_ID)
public class ModBlocks {

private static final List<Block> BLOCKS = new ArrayList<>();
private static final List<BlockBase> 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<Block> getBlocks() {
public static Collection<BlockBase> 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);
}
}
18 changes: 9 additions & 9 deletions src/main/java/com/pahimar/ee3/init/ModItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -12,21 +12,21 @@
@GameRegistry.ObjectHolder(EquivalentExchange3.MOD_ID)
public class ModItems {

private static final List<ItemEE> ITEMS = new ArrayList<>();
private static final List<ItemBase> 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<ItemEE> getItems() {
public static Collection<ItemBase> getItems() {
return ITEMS;
}

public static void register(ItemEE item) {
public static void register(ItemBase item) {
ITEMS.add(item);
}
}
4 changes: 2 additions & 2 deletions src/main/java/com/pahimar/ee3/item/ItemAlchemicalBag.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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"};

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/pahimar/ee3/item/ItemAlchemicalDust.java
Original file line number Diff line number Diff line change
@@ -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");
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/pahimar/ee3/item/ItemAlchemicalFuel.java
Original file line number Diff line number Diff line change
@@ -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");
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/pahimar/ee3/item/ItemAlchenomicon.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/pahimar/ee3/item/ItemChalk.java
Original file line number Diff line number Diff line change
@@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import net.minecraft.client.renderer.ItemMeshDefinition;

public interface IItemVariantHolder<T extends ItemEE> {
public interface IItemVariantHolder<T extends ItemBase> {

T getItem();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
import java.util.ArrayList;
import java.util.List;

public class ItemEE extends Item implements IItemVariantHolder<ItemEE> {
public class ItemBase extends Item implements IItemVariantHolder<ItemBase> {

private final String BASE_NAME;
private final String[] VARIANTS;

public ItemEE(String name, String ... variants) {
public ItemBase(String name, String ... variants) {

super();
setRegistryName(name);
Expand Down Expand Up @@ -96,7 +96,7 @@ public void initModelsAndVariants() {
}

@Override
public ItemEE getItem() {
public ItemBase getItem() {
return this;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
10 changes: 4 additions & 6 deletions src/main/java/com/pahimar/ee3/proxy/ClientProxy.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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
Expand Down
Loading

0 comments on commit 5b0017a

Please sign in to comment.