Trying something. Not exactly successful yet though.. D:
This commit is contained in:
parent
aa99784891
commit
6c56798b96
26 changed files with 316 additions and 105 deletions
|
|
@ -6,7 +6,7 @@ import com.oitsjustjose.criss_cross.CrissCross;
|
|||
import com.oitsjustjose.criss_cross.gui.GUIHandler;
|
||||
import com.oitsjustjose.criss_cross.tileentity.TileCobblegen;
|
||||
import com.oitsjustjose.criss_cross.util.ClientProxy;
|
||||
import com.oitsjustjose.criss_cross.util.Reference;
|
||||
import com.oitsjustjose.criss_cross.util.Lib;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import com.oitsjustjose.criss_cross.CrissCross;
|
|||
import com.oitsjustjose.criss_cross.gui.GUIHandler;
|
||||
import com.oitsjustjose.criss_cross.tileentity.TileCropomator;
|
||||
import com.oitsjustjose.criss_cross.util.ClientProxy;
|
||||
import com.oitsjustjose.criss_cross.util.Reference;
|
||||
import com.oitsjustjose.criss_cross.util.Lib;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import com.oitsjustjose.criss_cross.CrissCross;
|
|||
import com.oitsjustjose.criss_cross.gui.GUIHandler;
|
||||
import com.oitsjustjose.criss_cross.tileentity.TileElectroextractor;
|
||||
import com.oitsjustjose.criss_cross.util.ClientProxy;
|
||||
import com.oitsjustjose.criss_cross.util.Reference;
|
||||
import com.oitsjustjose.criss_cross.util.Lib;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
|
|
|||
150
src/main/java/com/oitsjustjose/criss_cross/Blocks/BlockLamp.java
Normal file
150
src/main/java/com/oitsjustjose/criss_cross/Blocks/BlockLamp.java
Normal file
|
|
@ -0,0 +1,150 @@
|
|||
package com.oitsjustjose.criss_cross.blocks;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.oitsjustjose.criss_cross.CrissCross;
|
||||
import com.oitsjustjose.criss_cross.items.block.ItemBlockLamp;
|
||||
import com.oitsjustjose.criss_cross.util.Lib;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockLamp extends Block
|
||||
{
|
||||
public static final PropertyEnum<EnumDyeColor> COLOR = PropertyEnum.<EnumDyeColor> create("color", EnumDyeColor.class);
|
||||
public static final PropertyBool POWERED = PropertyBool.create("powered");
|
||||
private static String unlocalizedName = "smartLamp";
|
||||
|
||||
public BlockLamp()
|
||||
{
|
||||
super(Material.rock);
|
||||
this.setHardness(2.0F);
|
||||
this.setResistance(2.0F);
|
||||
this.setStepSound(soundTypeMetal);
|
||||
this.setUnlocalizedName(Lib.modid + "." + unlocalizedName);
|
||||
this.setCreativeTab(CrissCross.CCTab);
|
||||
this.setDefaultState(this.blockState.getBaseState().withProperty(COLOR, EnumDyeColor.WHITE).withProperty(POWERED, false));
|
||||
GameRegistry.registerBlock(this, ItemBlockLamp.class, unlocalizedName.toLowerCase());
|
||||
Lib.add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World world, BlockPos pos, IBlockState state)
|
||||
{
|
||||
int meta = state.getBlock().getMetaFromState(state);
|
||||
if (!world.isRemote)
|
||||
{
|
||||
if (meta > 15 && !world.isBlockPowered(pos))
|
||||
world.setBlockState(pos, CCBlocks.smartLamp.getStateFromMeta(meta - 16).withProperty(POWERED, false), 2);
|
||||
else if (meta < 16 && world.isBlockPowered(pos))
|
||||
world.setBlockState(pos, CCBlocks.smartLamp.getStateFromMeta(meta + 16).withProperty(POWERED, true));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block neighborBlock)
|
||||
{
|
||||
int meta = state.getBlock().getMetaFromState(state);
|
||||
if (!world.isRemote)
|
||||
{
|
||||
if (meta > 15 && !world.isBlockPowered(pos))
|
||||
world.scheduleUpdate(pos, this, 4);
|
||||
else if (meta < 16 && world.isBlockPowered(pos))
|
||||
world.setBlockState(pos, CCBlocks.smartLamp.getStateFromMeta(meta + 16).withProperty(POWERED, true));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, BlockPos pos, IBlockState state, Random rand)
|
||||
{
|
||||
int meta = state.getBlock().getMetaFromState(state);
|
||||
if (!world.isRemote)
|
||||
if (!world.isBlockPowered(pos) && meta > 15)
|
||||
{
|
||||
world.setBlockState(pos, CCBlocks.smartLamp.getStateFromMeta(meta - 16).withProperty(POWERED, false));
|
||||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public int getLightValue(IBlockAccess world, BlockPos pos)
|
||||
// {
|
||||
// Block block = world.getBlockState(pos).getBlock();
|
||||
// boolean p = world.getBlockState(pos).getProperties()
|
||||
//
|
||||
//
|
||||
// if (block != this)
|
||||
// return block.getLightValue(world, pos);
|
||||
// else if (meta > 15)
|
||||
// {
|
||||
// return 15;
|
||||
// }
|
||||
// return 0;
|
||||
// }
|
||||
|
||||
public int damageDropped(IBlockState state)
|
||||
{
|
||||
if (state.getBlock().getMetaFromState(state) > 15)
|
||||
return ((EnumDyeColor) state.getValue(COLOR)).getMetadata() - 16;
|
||||
else
|
||||
return ((EnumDyeColor) state.getValue(COLOR)).getMetadata();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list)
|
||||
{
|
||||
for (EnumDyeColor enumdyecolor : EnumDyeColor.values())
|
||||
list.add(new ItemStack(itemIn, 1, enumdyecolor.getMetadata()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapColor getMapColor(IBlockState state)
|
||||
{
|
||||
return ((EnumDyeColor) state.getValue(COLOR)).getMapColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getDefaultState().withProperty(COLOR, EnumDyeColor.byMetadata(meta));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{
|
||||
if (state.getValue(POWERED))
|
||||
return ((EnumDyeColor) state.getValue(COLOR)).getMetadata() + 16;
|
||||
else
|
||||
return ((EnumDyeColor) state.getValue(COLOR)).getMetadata();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
|
||||
{
|
||||
int meta = state.getBlock().getMetaFromState(state);
|
||||
return state.withProperty(POWERED, Boolean.valueOf(meta > 15)).withProperty(COLOR, EnumDyeColor.byMetadata(meta));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState()
|
||||
{
|
||||
return new BlockState(this, new IProperty[] { COLOR, POWERED });
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package com.oitsjustjose.criss_cross.blocks;
|
||||
|
||||
import com.oitsjustjose.criss_cross.CrissCross;
|
||||
import com.oitsjustjose.criss_cross.util.Reference;
|
||||
import com.oitsjustjose.criss_cross.util.Lib;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
|
|
@ -34,11 +34,11 @@ public class BlockMachineBase extends BlockContainer
|
|||
this.setHardness(2.0F);
|
||||
this.setResistance(2.0F);
|
||||
this.setStepSound(soundTypeMetal);
|
||||
this.setUnlocalizedName(Reference.modid + "." + unlocName);
|
||||
this.setUnlocalizedName(Lib.modid + "." + unlocName);
|
||||
this.setCreativeTab(CrissCross.CCTab);
|
||||
this.unlocalizedName = unlocName;
|
||||
this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
|
||||
Reference.add(this);
|
||||
this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
|
||||
Lib.add(this);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
|
@ -53,54 +53,54 @@ public class BlockMachineBase extends BlockContainer
|
|||
{
|
||||
setDefaultFacing(world, pos, state);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
||||
{
|
||||
return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite());
|
||||
}
|
||||
|
||||
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
||||
{
|
||||
return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IBlockState getStateForEntityRender(IBlockState state)
|
||||
{
|
||||
return this.getDefaultState().withProperty(FACING, EnumFacing.SOUTH);
|
||||
}
|
||||
public int getRenderType()
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
EnumFacing enumfacing = EnumFacing.getFront(meta);
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IBlockState getStateForEntityRender(IBlockState state)
|
||||
{
|
||||
return this.getDefaultState().withProperty(FACING, EnumFacing.SOUTH);
|
||||
}
|
||||
|
||||
if (enumfacing.getAxis() == EnumFacing.Axis.Y)
|
||||
{
|
||||
enumfacing = EnumFacing.NORTH;
|
||||
}
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
EnumFacing enumfacing = EnumFacing.getFront(meta);
|
||||
|
||||
return this.getDefaultState().withProperty(FACING, enumfacing);
|
||||
}
|
||||
if (enumfacing.getAxis() == EnumFacing.Axis.Y)
|
||||
{
|
||||
enumfacing = EnumFacing.NORTH;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{
|
||||
return ((EnumFacing)state.getValue(FACING)).getIndex();
|
||||
}
|
||||
return this.getDefaultState().withProperty(FACING, enumfacing);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState()
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {FACING});
|
||||
}
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{
|
||||
return ((EnumFacing) state.getValue(FACING)).getIndex();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState()
|
||||
{
|
||||
return new BlockState(this, new IProperty[] { FACING });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase entity, ItemStack itemstack)
|
||||
{
|
||||
world.setBlockState(pos, state.withProperty(FACING, entity.getHorizontalFacing().getOpposite()), 2);
|
||||
world.setBlockState(pos, state.withProperty(FACING, entity.getHorizontalFacing().getOpposite()), 2);
|
||||
|
||||
int l = MathHelper.floor_double((double) (entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
||||
|
||||
|
|
@ -124,7 +124,7 @@ public class BlockMachineBase extends BlockContainer
|
|||
world.setBlockState(pos, state.getBlock().getStateFromMeta(4), 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void setDefaultFacing(World world, BlockPos pos, IBlockState state)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
|
|
@ -138,21 +138,18 @@ public class BlockMachineBase extends BlockContainer
|
|||
{
|
||||
enumfacing = EnumFacing.SOUTH;
|
||||
}
|
||||
else
|
||||
if (enumfacing == EnumFacing.SOUTH && block1.isFullBlock() && !block.isFullBlock())
|
||||
{
|
||||
enumfacing = EnumFacing.NORTH;
|
||||
}
|
||||
else
|
||||
if (enumfacing == EnumFacing.WEST && block2.isFullBlock() && !block3.isFullBlock())
|
||||
{
|
||||
enumfacing = EnumFacing.EAST;
|
||||
}
|
||||
else
|
||||
if (enumfacing == EnumFacing.EAST && block3.isFullBlock() && !block2.isFullBlock())
|
||||
{
|
||||
enumfacing = EnumFacing.WEST;
|
||||
}
|
||||
else if (enumfacing == EnumFacing.SOUTH && block1.isFullBlock() && !block.isFullBlock())
|
||||
{
|
||||
enumfacing = EnumFacing.NORTH;
|
||||
}
|
||||
else if (enumfacing == EnumFacing.WEST && block2.isFullBlock() && !block3.isFullBlock())
|
||||
{
|
||||
enumfacing = EnumFacing.EAST;
|
||||
}
|
||||
else if (enumfacing == EnumFacing.EAST && block3.isFullBlock() && !block2.isFullBlock())
|
||||
{
|
||||
enumfacing = EnumFacing.WEST;
|
||||
}
|
||||
|
||||
world.setBlockState(pos, state.withProperty(FACING, enumfacing), 2);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import com.oitsjustjose.criss_cross.CrissCross;
|
|||
import com.oitsjustjose.criss_cross.gui.GUIHandler;
|
||||
import com.oitsjustjose.criss_cross.tileentity.TileWoodchipper;
|
||||
import com.oitsjustjose.criss_cross.util.ClientProxy;
|
||||
import com.oitsjustjose.criss_cross.util.Reference;
|
||||
import com.oitsjustjose.criss_cross.util.Lib;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
|
@ -32,7 +32,7 @@ public class BlockWoodchipper extends BlockMachineBase
|
|||
super(unlocName);
|
||||
GameRegistry.registerTileEntity(TileWoodchipper.class, unlocName);
|
||||
GameRegistry.registerBlock(this, unlocName.toLowerCase());
|
||||
Reference.add(this);
|
||||
Lib.add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package com.oitsjustjose.criss_cross.blocks;
|
|||
|
||||
import com.oitsjustjose.criss_cross.CrissCross;
|
||||
import com.oitsjustjose.criss_cross.gui.GUIHandler;
|
||||
import com.oitsjustjose.criss_cross.util.Reference;
|
||||
import com.oitsjustjose.criss_cross.util.Lib;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||
|
|
@ -14,6 +14,7 @@ public class CCBlocks
|
|||
public static Block woodchipper;
|
||||
public static Block cobblegen;
|
||||
public static Block stonegen;
|
||||
public static Block smartLamp;
|
||||
|
||||
public static void init()
|
||||
{
|
||||
|
|
@ -22,6 +23,7 @@ public class CCBlocks
|
|||
woodchipper = new BlockWoodchipper();
|
||||
cobblegen = new BlockCobblegen();
|
||||
stonegen = new BlockStonegen();
|
||||
smartLamp = new BlockLamp();
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(CrissCross.instance, new GUIHandler());
|
||||
}
|
||||
}
|
||||
|
|
@ -10,7 +10,7 @@ import com.oitsjustjose.criss_cross.util.ClientProxy;
|
|||
import com.oitsjustjose.criss_cross.util.CommonProxy;
|
||||
import com.oitsjustjose.criss_cross.util.ConfigHandler;
|
||||
import com.oitsjustjose.criss_cross.util.OreDictionaryAdder;
|
||||
import com.oitsjustjose.criss_cross.util.Reference;
|
||||
import com.oitsjustjose.criss_cross.util.Lib;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
|
|
@ -24,12 +24,12 @@ import net.minecraftforge.fml.common.SidedProxy;
|
|||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
|
||||
@Mod(modid = Reference.modid, version = Reference.version, guiFactory = Reference.guifactory)
|
||||
@Mod(modid = Lib.modid, version = Lib.version, guiFactory = Lib.guifactory)
|
||||
public class CrissCross
|
||||
{
|
||||
public static CreativeTabs CCTab;
|
||||
|
||||
@Instance(Reference.modid)
|
||||
@Instance(Lib.modid)
|
||||
public static CrissCross instance;
|
||||
|
||||
@SidedProxy(clientSide = "com.oitsjustjose.criss_cross.util.ClientProxy", serverSide = "com.oitsjustjose.criss_cross.util.CommonProxy")
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import org.lwjgl.opengl.GL11;
|
|||
|
||||
import com.oitsjustjose.criss_cross.container.ContainerCropomator;
|
||||
import com.oitsjustjose.criss_cross.tileentity.TileCropomator;
|
||||
import com.oitsjustjose.criss_cross.util.Reference;
|
||||
import com.oitsjustjose.criss_cross.util.Lib;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ public class GUIHandler implements IGuiHandler
|
|||
public static final int Woodchipper = 3;
|
||||
public static final int Cobblegen = 4;
|
||||
public static final int Stonegen = 5;
|
||||
public static final int Lamp = 6;
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.oitsjustjose.criss_cross.gui;
|
||||
|
||||
import com.oitsjustjose.criss_cross.util.ConfigHandler;
|
||||
import com.oitsjustjose.criss_cross.util.Reference;
|
||||
import com.oitsjustjose.criss_cross.util.Lib;
|
||||
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraftforge.common.config.ConfigElement;
|
||||
|
|
@ -12,7 +12,7 @@ public class ModGUIConfig extends GuiConfig
|
|||
{
|
||||
public ModGUIConfig(GuiScreen guiScreen)
|
||||
{
|
||||
super(guiScreen, new ConfigElement(ConfigHandler.config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(), Reference.modid,
|
||||
super(guiScreen, new ConfigElement(ConfigHandler.config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(), Lib.modid,
|
||||
false, true, GuiConfig.getAbridgedConfigPath(ConfigHandler.config.toString()));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.oitsjustjose.criss_cross.items;
|
||||
|
||||
import com.oitsjustjose.criss_cross.util.Reference;
|
||||
import com.oitsjustjose.criss_cross.util.Lib;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import java.util.List;
|
|||
|
||||
import com.oitsjustjose.criss_cross.CrissCross;
|
||||
import com.oitsjustjose.criss_cross.util.ClientProxy;
|
||||
import com.oitsjustjose.criss_cross.util.Reference;
|
||||
import com.oitsjustjose.criss_cross.util.Lib;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
|
|
@ -25,7 +25,7 @@ public class ItemDust extends Item
|
|||
this.setHasSubtypes(true);
|
||||
this.setCreativeTab(CrissCross.CCTab);
|
||||
GameRegistry.registerItem(this, "dust");
|
||||
Reference.add(this);
|
||||
Lib.add(this);
|
||||
}
|
||||
|
||||
public static ArrayList<String> getDusts()
|
||||
|
|
@ -75,7 +75,7 @@ public class ItemDust extends Item
|
|||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemStack)
|
||||
{
|
||||
return "item." + Reference.modid + ".dust";
|
||||
return "item." + Lib.modid + ".dust";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import java.util.List;
|
|||
|
||||
import com.oitsjustjose.criss_cross.CrissCross;
|
||||
import com.oitsjustjose.criss_cross.util.ClientProxy;
|
||||
import com.oitsjustjose.criss_cross.util.Reference;
|
||||
import com.oitsjustjose.criss_cross.util.Lib;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
|
@ -32,7 +32,7 @@ public class ItemModBuckets extends Item
|
|||
this.setCreativeTab(CrissCross.CCTab);
|
||||
this.setContainerItem(this);
|
||||
GameRegistry.registerItem(this, "magicBucket");
|
||||
Reference.add(this);
|
||||
Lib.add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -110,7 +110,7 @@ public class ItemModBuckets extends Item
|
|||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemStack)
|
||||
{
|
||||
return "item." + Reference.modid + "." + types[itemStack.getItemDamage()];
|
||||
return "item." + Lib.modid + "." + types[itemStack.getItemDamage()];
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
package com.oitsjustjose.criss_cross.items.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
public class ItemBlockLamp extends ItemBlock
|
||||
{
|
||||
public ItemBlockLamp(Block block)
|
||||
{
|
||||
super(block);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemStack)
|
||||
{
|
||||
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, 15);
|
||||
return super.getUnlocalizedName() + meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int par1)
|
||||
{
|
||||
return par1;
|
||||
}
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@ import java.util.ArrayList;
|
|||
import com.oitsjustjose.criss_cross.blocks.BlockStonegen;
|
||||
import com.oitsjustjose.criss_cross.container.ContainerCobblegen;
|
||||
import com.oitsjustjose.criss_cross.util.ConfigHandler;
|
||||
import com.oitsjustjose.criss_cross.util.Reference;
|
||||
import com.oitsjustjose.criss_cross.util.Lib;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
|
@ -176,7 +176,7 @@ public class TileCobblegen extends TileEntityLockable implements ITickable, ISid
|
|||
@Override
|
||||
public String getGuiID()
|
||||
{
|
||||
return Reference.modid + ":container.cobblestonegen";
|
||||
return Lib.modid + ":container.cobblestonegen";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import com.oitsjustjose.criss_cross.blocks.BlockCropomator;
|
|||
import com.oitsjustjose.criss_cross.container.ContainerCropomator;
|
||||
import com.oitsjustjose.criss_cross.recipes.CropomatorRecipes;
|
||||
import com.oitsjustjose.criss_cross.util.ConfigHandler;
|
||||
import com.oitsjustjose.criss_cross.util.Reference;
|
||||
import com.oitsjustjose.criss_cross.util.Lib;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
|
@ -179,7 +179,7 @@ public class TileCropomator extends TileEntityLockable implements ITickable, ISi
|
|||
@Override
|
||||
public String getGuiID()
|
||||
{
|
||||
return Reference.modid + ":container.cropomator";
|
||||
return Lib.modid + ":container.cropomator";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import com.oitsjustjose.criss_cross.blocks.BlockElectroextractor;
|
|||
import com.oitsjustjose.criss_cross.container.ContainerElectroextractor;
|
||||
import com.oitsjustjose.criss_cross.recipes.ElectroextractorRecipes;
|
||||
import com.oitsjustjose.criss_cross.util.ConfigHandler;
|
||||
import com.oitsjustjose.criss_cross.util.Reference;
|
||||
import com.oitsjustjose.criss_cross.util.Lib;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
|
@ -416,7 +416,7 @@ public class TileElectroextractor extends TileEntityLockable implements ITickabl
|
|||
@Override
|
||||
public String getGuiID()
|
||||
{
|
||||
return Reference.modid + ":container.electroextractor";
|
||||
return Lib.modid + ":container.electroextractor";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
package com.oitsjustjose.criss_cross.tileentity;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileLamp extends TileEntity
|
||||
{
|
||||
private static int lampColor = 15;
|
||||
private static boolean isPowered = false;
|
||||
|
||||
public void setColor(int color)
|
||||
{
|
||||
this.lampColor = color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tag)
|
||||
{
|
||||
super.readFromNBT(tag);
|
||||
this.lampColor = tag.getInteger("color");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tag)
|
||||
{
|
||||
super.writeToNBT(tag);
|
||||
tag.setInteger("color", this.lampColor);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@ import java.util.ArrayList;
|
|||
import com.oitsjustjose.criss_cross.blocks.BlockStonegen;
|
||||
import com.oitsjustjose.criss_cross.container.ContainerStonegen;
|
||||
import com.oitsjustjose.criss_cross.util.ConfigHandler;
|
||||
import com.oitsjustjose.criss_cross.util.Reference;
|
||||
import com.oitsjustjose.criss_cross.util.Lib;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
|
@ -178,7 +178,7 @@ public class TileStonegen extends TileEntityLockable implements ITickable, ISide
|
|||
@Override
|
||||
public String getGuiID()
|
||||
{
|
||||
return Reference.modid + ":container.stonegen";
|
||||
return Lib.modid + ":container.stonegen";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import com.oitsjustjose.criss_cross.blocks.BlockWoodchipper;
|
|||
import com.oitsjustjose.criss_cross.container.ContainerWoodchipper;
|
||||
import com.oitsjustjose.criss_cross.recipes.WoodchipperRecipes;
|
||||
import com.oitsjustjose.criss_cross.util.ConfigHandler;
|
||||
import com.oitsjustjose.criss_cross.util.Reference;
|
||||
import com.oitsjustjose.criss_cross.util.Lib;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
|
@ -178,7 +178,7 @@ public class TileWoodchipper extends TileEntityLockable implements ITickable, IS
|
|||
@Override
|
||||
public String getGuiID()
|
||||
{
|
||||
return Reference.modid + ":container.woodchipper";
|
||||
return Lib.modid + ":container.woodchipper";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import org.apache.logging.log4j.Logger;
|
|||
|
||||
public class CCLog
|
||||
{
|
||||
private static Logger LOGGER = LogManager.getLogger(Reference.modid);
|
||||
private static Logger LOGGER = LogManager.getLogger(Lib.modid);
|
||||
|
||||
public CCLog()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ public class CCTab extends CreativeTabs
|
|||
{
|
||||
public CCTab()
|
||||
{
|
||||
super(CreativeTabs.getNextID(), "tab" + Reference.modid);
|
||||
super(CreativeTabs.getNextID(), "tab" + Lib.modid);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ public class ClientProxy extends CommonProxy
|
|||
@SideOnly(Side.CLIENT)
|
||||
public static void init()
|
||||
{
|
||||
ArrayList<Block> blocks = Reference.getModBlocks();
|
||||
ArrayList<Item> items = Reference.getModItems();
|
||||
ArrayList<Block> blocks = Lib.getModBlocks();
|
||||
ArrayList<Item> items = Lib.getModItems();
|
||||
|
||||
for(Block b : blocks)
|
||||
register(b, "");
|
||||
|
|
@ -42,15 +42,15 @@ public class ClientProxy extends CommonProxy
|
|||
for(ItemStack sub : subItems)
|
||||
{
|
||||
String name = item.getUnlocalizedName(sub).substring(16).toLowerCase();
|
||||
ModelBakery.addVariantName(item, Reference.modid.toLowerCase() + ":" + name);
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, meta, new ModelResourceLocation(Reference.modid.toLowerCase() + ":" + name, "inventory"));
|
||||
ModelBakery.addVariantName(item, Lib.modid.toLowerCase() + ":" + name);
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, meta, new ModelResourceLocation(Lib.modid.toLowerCase() + ":" + name, "inventory"));
|
||||
meta++;
|
||||
}
|
||||
}
|
||||
else if(customName == "")
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, meta, new ModelResourceLocation(Reference.modid.toLowerCase() + ":" + item.getUnlocalizedName().substring(16).toLowerCase(), "inventory"));
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, meta, new ModelResourceLocation(Lib.modid.toLowerCase() + ":" + item.getUnlocalizedName().substring(16).toLowerCase(), "inventory"));
|
||||
else
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, meta, new ModelResourceLocation(Reference.modid.toLowerCase() + ":" + customName, "inventory"));
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, meta, new ModelResourceLocation(Lib.modid.toLowerCase() + ":" + customName, "inventory"));
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
|
@ -65,14 +65,14 @@ public class ClientProxy extends CommonProxy
|
|||
for(ItemStack sub : subItems)
|
||||
{
|
||||
String name = itemBlock.getUnlocalizedName(sub).substring(16).toLowerCase();
|
||||
ModelBakery.addVariantName(itemBlock, Reference.modid.toLowerCase() + ":" + name);
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(itemBlock, meta, new ModelResourceLocation(Reference.modid.toLowerCase() + ":" + name, "inventory"));
|
||||
ModelBakery.addVariantName(itemBlock, Lib.modid.toLowerCase() + ":" + name);
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(itemBlock, meta, new ModelResourceLocation(Lib.modid.toLowerCase() + ":" + name, "inventory"));
|
||||
meta++;
|
||||
}
|
||||
}
|
||||
else if(customName == "")
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(itemBlock, meta, new ModelResourceLocation(Reference.modid.toLowerCase() + ":" + block.getUnlocalizedName().substring(16).toLowerCase(), "inventory"));
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(itemBlock, meta, new ModelResourceLocation(Lib.modid.toLowerCase() + ":" + block.getUnlocalizedName().substring(16).toLowerCase(), "inventory"));
|
||||
else
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(itemBlock, meta, new ModelResourceLocation(Reference.modid.toLowerCase() + ":" + customName, "inventory"));
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(itemBlock, meta, new ModelResourceLocation(Lib.modid.toLowerCase() + ":" + customName, "inventory"));
|
||||
}
|
||||
}
|
||||
|
|
@ -114,7 +114,7 @@ public class ConfigHandler
|
|||
@SubscribeEvent
|
||||
public void onConfigurationChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event)
|
||||
{
|
||||
if (event.modID.equalsIgnoreCase(Reference.modid))
|
||||
if (event.modID.equalsIgnoreCase(Lib.modid))
|
||||
loadConfiguration();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import java.util.ArrayList;
|
|||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class Reference
|
||||
public class Lib
|
||||
{
|
||||
public static final String modid = "CrissCross";
|
||||
public static final String version = "1.3";
|
||||
Loading…
Reference in a new issue