Consistency Fixes, and Pouches! :D
This commit is contained in:
parent
08f79f8f51
commit
81886f8d34
23 changed files with 529 additions and 73 deletions
|
|
@ -27,7 +27,7 @@ public class CrissCross
|
||||||
@Instance(Lib.modid)
|
@Instance(Lib.modid)
|
||||||
public static CrissCross instance;
|
public static CrissCross instance;
|
||||||
|
|
||||||
@SidedProxy(clientSide = "com.oitsjustjose.criss_cross.util.ClientProxy", serverSide = "com.oitsjustjose.criss_cross.util.CommonProxy")
|
@SidedProxy(clientSide = Lib.clientProxy, serverSide = Lib.commonProxy)
|
||||||
public static CommonProxy proxy;
|
public static CommonProxy proxy;
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,299 @@
|
||||||
|
package com.oitsjustjose.criss_cross.blocks;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.BlockDirectional;
|
||||||
|
import net.minecraft.block.BlockRedstoneWire;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.BlockPos;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraft.util.EnumWorldBlockLayer;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
public abstract class BlockTimer extends BlockDirectional
|
||||||
|
{
|
||||||
|
protected final boolean isRepeaterPowered;
|
||||||
|
|
||||||
|
protected BlockTimer(boolean powered)
|
||||||
|
{
|
||||||
|
super(Material.circuits);
|
||||||
|
this.isRepeaterPowered = powered;
|
||||||
|
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isFullCube()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||||
|
{
|
||||||
|
return World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) ? super.canPlaceBlockAt(worldIn, pos) : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean canBlockStay(World worldIn, BlockPos pos)
|
||||||
|
{
|
||||||
|
return World.doesBlockHaveSolidTopSurface(worldIn, pos.down());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.)
|
||||||
|
*/
|
||||||
|
public void randomTick(World worldIn, BlockPos pos, IBlockState state, Random random)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
|
||||||
|
{
|
||||||
|
if (!this.isLocked(worldIn, pos, state))
|
||||||
|
{
|
||||||
|
boolean flag = this.shouldBePowered(worldIn, pos, state);
|
||||||
|
|
||||||
|
if (this.isRepeaterPowered && !flag)
|
||||||
|
{
|
||||||
|
worldIn.setBlockState(pos, this.getUnpoweredState(state), 2);
|
||||||
|
}
|
||||||
|
else if (!this.isRepeaterPowered)
|
||||||
|
{
|
||||||
|
worldIn.setBlockState(pos, this.getPoweredState(state), 2);
|
||||||
|
|
||||||
|
if (!flag)
|
||||||
|
{
|
||||||
|
worldIn.updateBlockTick(pos, this.getPoweredState(state).getBlock(), this.getTickDelay(state), -1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side)
|
||||||
|
{
|
||||||
|
return side.getAxis() != EnumFacing.Axis.Y;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean isPowered(IBlockState state)
|
||||||
|
{
|
||||||
|
return this.isRepeaterPowered;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int isProvidingStrongPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side)
|
||||||
|
{
|
||||||
|
return this.isProvidingWeakPower(worldIn, pos, state, side);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int isProvidingWeakPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side)
|
||||||
|
{
|
||||||
|
return !this.isPowered(state) ? 0 : (state.getValue(FACING) == side ? this.getActiveSignal(worldIn, pos, state) : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a neighboring block changes.
|
||||||
|
*/
|
||||||
|
public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock)
|
||||||
|
{
|
||||||
|
if (this.canBlockStay(worldIn, pos))
|
||||||
|
{
|
||||||
|
this.updateState(worldIn, pos, state);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.dropBlockAsItem(worldIn, pos, state, 0);
|
||||||
|
worldIn.setBlockToAir(pos);
|
||||||
|
|
||||||
|
for (EnumFacing enumfacing : EnumFacing.values())
|
||||||
|
{
|
||||||
|
worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing), this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void updateState(World worldIn, BlockPos pos, IBlockState state)
|
||||||
|
{
|
||||||
|
if (!this.isLocked(worldIn, pos, state))
|
||||||
|
{
|
||||||
|
boolean flag = this.shouldBePowered(worldIn, pos, state);
|
||||||
|
|
||||||
|
if ((this.isRepeaterPowered && !flag || !this.isRepeaterPowered && flag) && !worldIn.isBlockTickPending(pos, this))
|
||||||
|
{
|
||||||
|
int i = -1;
|
||||||
|
|
||||||
|
if (this.isFacingTowardsRepeater(worldIn, pos, state))
|
||||||
|
{
|
||||||
|
i = -3;
|
||||||
|
}
|
||||||
|
else if (this.isRepeaterPowered)
|
||||||
|
{
|
||||||
|
i = -2;
|
||||||
|
}
|
||||||
|
|
||||||
|
worldIn.updateBlockTick(pos, this, this.getDelay(state), i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isLocked(IBlockAccess worldIn, BlockPos pos, IBlockState state)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean shouldBePowered(World worldIn, BlockPos pos, IBlockState state)
|
||||||
|
{
|
||||||
|
return this.calculateInputStrength(worldIn, pos, state) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected int calculateInputStrength(World worldIn, BlockPos pos, IBlockState state)
|
||||||
|
{
|
||||||
|
EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
|
||||||
|
BlockPos blockpos = pos.offset(enumfacing);
|
||||||
|
int i = worldIn.getRedstonePower(blockpos, enumfacing);
|
||||||
|
|
||||||
|
if (i >= 15)
|
||||||
|
{
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IBlockState iblockstate = worldIn.getBlockState(blockpos);
|
||||||
|
return Math.max(i, iblockstate.getBlock() == Blocks.redstone_wire ? ((Integer)iblockstate.getValue(BlockRedstoneWire.POWER)).intValue() : 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected int getPowerOnSides(IBlockAccess worldIn, BlockPos pos, IBlockState state)
|
||||||
|
{
|
||||||
|
EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
|
||||||
|
EnumFacing enumfacing1 = enumfacing.rotateY();
|
||||||
|
EnumFacing enumfacing2 = enumfacing.rotateYCCW();
|
||||||
|
return Math.max(this.getPowerOnSide(worldIn, pos.offset(enumfacing1), enumfacing1), this.getPowerOnSide(worldIn, pos.offset(enumfacing2), enumfacing2));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected int getPowerOnSide(IBlockAccess worldIn, BlockPos pos, EnumFacing side)
|
||||||
|
{
|
||||||
|
IBlockState iblockstate = worldIn.getBlockState(pos);
|
||||||
|
Block block = iblockstate.getBlock();
|
||||||
|
return this.canPowerSide(block) ? (block == Blocks.redstone_wire ? ((Integer)iblockstate.getValue(BlockRedstoneWire.POWER)).intValue() : worldIn.getStrongPower(pos, side)) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Can this block provide power. Only wire currently seems to have this change based on its state.
|
||||||
|
*/
|
||||||
|
public boolean canProvidePower()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the
|
||||||
|
* IBlockstate
|
||||||
|
*/
|
||||||
|
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());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called by ItemBlocks after a block is set in the world, to allow post-place logic
|
||||||
|
*/
|
||||||
|
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
|
||||||
|
{
|
||||||
|
if (this.shouldBePowered(worldIn, pos, state))
|
||||||
|
{
|
||||||
|
worldIn.scheduleUpdate(pos, this, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state)
|
||||||
|
{
|
||||||
|
this.notifyNeighbors(worldIn, pos, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void notifyNeighbors(World worldIn, BlockPos pos, IBlockState state)
|
||||||
|
{
|
||||||
|
EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
|
||||||
|
BlockPos blockpos = pos.offset(enumfacing.getOpposite());
|
||||||
|
if(net.minecraftforge.event.ForgeEventFactory.onNeighborNotify(worldIn, pos, worldIn.getBlockState(pos), java.util.EnumSet.of(enumfacing.getOpposite())).isCanceled())
|
||||||
|
return;
|
||||||
|
worldIn.notifyBlockOfStateChange(blockpos, this);
|
||||||
|
worldIn.notifyNeighborsOfStateExcept(blockpos, this, enumfacing);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a player destroys this Block
|
||||||
|
*/
|
||||||
|
public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, IBlockState state)
|
||||||
|
{
|
||||||
|
if (this.isRepeaterPowered)
|
||||||
|
{
|
||||||
|
for (EnumFacing enumfacing : EnumFacing.values())
|
||||||
|
{
|
||||||
|
worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing), this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
super.onBlockDestroyedByPlayer(worldIn, pos, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used to determine ambient occlusion and culling when rebuilding chunks for render
|
||||||
|
*/
|
||||||
|
public boolean isOpaqueCube()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean canPowerSide(Block blockIn)
|
||||||
|
{
|
||||||
|
return blockIn.canProvidePower();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected int getActiveSignal(IBlockAccess worldIn, BlockPos pos, IBlockState state)
|
||||||
|
{
|
||||||
|
return 15;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isRedstoneRepeaterBlockID(Block blockIn)
|
||||||
|
{
|
||||||
|
return Blocks.unpowered_repeater.isAssociated(blockIn) || Blocks.unpowered_comparator.isAssociated(blockIn);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isAssociated(Block other)
|
||||||
|
{
|
||||||
|
return other == this.getPoweredState(this.getDefaultState()).getBlock() || other == this.getUnpoweredState(this.getDefaultState()).getBlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isFacingTowardsRepeater(World worldIn, BlockPos pos, IBlockState state)
|
||||||
|
{
|
||||||
|
EnumFacing enumfacing = ((EnumFacing)state.getValue(FACING)).getOpposite();
|
||||||
|
BlockPos blockpos = pos.offset(enumfacing);
|
||||||
|
return isRedstoneRepeaterBlockID(worldIn.getBlockState(blockpos).getBlock()) ? worldIn.getBlockState(blockpos).getValue(FACING) != enumfacing : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected int getTickDelay(IBlockState state)
|
||||||
|
{
|
||||||
|
return this.getDelay(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract int getDelay(IBlockState state);
|
||||||
|
|
||||||
|
protected abstract IBlockState getPoweredState(IBlockState unpoweredState);
|
||||||
|
|
||||||
|
protected abstract IBlockState getUnpoweredState(IBlockState poweredState);
|
||||||
|
|
||||||
|
public boolean isAssociatedBlock(Block other)
|
||||||
|
{
|
||||||
|
return this.isAssociated(other);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public EnumWorldBlockLayer getBlockLayer()
|
||||||
|
{
|
||||||
|
return EnumWorldBlockLayer.CUTOUT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -50,8 +50,6 @@ public class ContainerPouch extends Container
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer par4EntityPlayer)
|
public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer par4EntityPlayer)
|
||||||
{
|
{
|
||||||
if ((par3 == 2) && (par2 == this.currentFilter))
|
if ((par3 == 2) && (par2 == this.currentFilter))
|
||||||
|
|
|
||||||
|
|
@ -11,13 +11,13 @@ public class ToolEfficiencyEvent
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void registerEvent(BreakSpeed event)
|
public void registerEvent(BreakSpeed event)
|
||||||
{
|
{
|
||||||
if(event.entityPlayer == null || event.entityPlayer.getHeldItem() == null)
|
if (event.entityPlayer == null || event.entityPlayer.getHeldItem() == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Material m = event.entityPlayer.worldObj.getBlockState(event.pos).getBlock().getMaterial();
|
Material m = event.entityPlayer.worldObj.getBlockState(event.pos).getBlock().getMaterial();
|
||||||
|
|
||||||
if(event.entityPlayer.getHeldItem().getItem() instanceof ItemMantleSmasher)
|
if (event.entityPlayer.getHeldItem().getItem() instanceof ItemMantleSmasher)
|
||||||
if(m == Material.ground || m == Material.grass || m == Material.sand)
|
if (m == Material.ground || m == Material.grass || m == Material.sand)
|
||||||
event.newSpeed = event.originalSpeed * 5;
|
event.newSpeed = event.originalSpeed * 5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class GUIPouch extends GuiContainer
|
public class GUIPouch extends GuiContainer
|
||||||
{
|
{
|
||||||
private static final ResourceLocation texture = new ResourceLocation("textures/gui/container/generic_54.png");
|
private static final ResourceLocation texture = new ResourceLocation("textures/gui/container/generic_54.png");
|
||||||
private EntityPlayer player;
|
private EntityPlayer player;
|
||||||
private int currentFilter = -1;
|
private int currentFilter = -1;
|
||||||
private String name;
|
private String name;
|
||||||
|
|
@ -31,7 +31,7 @@ public class GUIPouch extends GuiContainer
|
||||||
|
|
||||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||||
{
|
{
|
||||||
this.fontRendererObj.drawString(name, 7, 9, 4210752);
|
this.fontRendererObj.drawString(name, 7, 8, 4210752);
|
||||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 7, this.ySize - 92, 4210752);
|
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 7, this.ySize - 92, 4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ public class ModGUIConfig extends GuiConfig
|
||||||
{
|
{
|
||||||
public ModGUIConfig(GuiScreen guiScreen)
|
public ModGUIConfig(GuiScreen guiScreen)
|
||||||
{
|
{
|
||||||
super(guiScreen, new ConfigElement(ConfigHandler.config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(), Lib.modid, false, true, GuiConfig.getAbridgedConfigPath(
|
super(guiScreen, new ConfigElement(ConfigHandler.config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(), Lib.modid, false, true, GuiConfig.getAbridgedConfigPath(ConfigHandler.config.toString()));
|
||||||
ConfigHandler.config.toString()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -38,9 +38,9 @@ public class ItemMantleSmasher extends ItemPickaxe
|
||||||
Material m = world.getBlockState(pos).getBlock().getMaterial();
|
Material m = world.getBlockState(pos).getBlock().getMaterial();
|
||||||
|
|
||||||
if (m != Material.ground)
|
if (m != Material.ground)
|
||||||
if(m != Material.grass)
|
if (m != Material.grass)
|
||||||
if(m != Material.sand)
|
if (m != Material.sand)
|
||||||
if(m != Material.rock)
|
if (m != Material.rock)
|
||||||
return super.onBlockStartBreak(itemstack, pos, player);
|
return super.onBlockStartBreak(itemstack, pos, player);
|
||||||
|
|
||||||
EnumFacing side = this.getMovingObjectPositionFromPlayer(world, player, true).sideHit;
|
EnumFacing side = this.getMovingObjectPositionFromPlayer(world, player, true).sideHit;
|
||||||
|
|
|
||||||
|
|
@ -1,31 +1,71 @@
|
||||||
package com.oitsjustjose.criss_cross.items;
|
package com.oitsjustjose.criss_cross.items;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.oitsjustjose.criss_cross.CrissCross;
|
import com.oitsjustjose.criss_cross.CrissCross;
|
||||||
import com.oitsjustjose.criss_cross.gui.GUIHandler;
|
import com.oitsjustjose.criss_cross.gui.GUIHandler;
|
||||||
import com.oitsjustjose.criss_cross.lib.Lib;
|
import com.oitsjustjose.criss_cross.lib.Lib;
|
||||||
|
import com.oitsjustjose.criss_cross.util.ColorUtils;
|
||||||
|
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.EnumDyeColor;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.StatCollector;
|
||||||
import net.minecraft.util.EnumFacing;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ItemPouch extends Item
|
public class ItemPouch extends Item
|
||||||
{
|
{
|
||||||
public ItemPouch()
|
public ItemPouch()
|
||||||
{
|
{
|
||||||
|
this.setMaxStackSize(1);
|
||||||
|
this.setHasSubtypes(true);
|
||||||
this.setUnlocalizedName(Lib.modid + ".pouch");
|
this.setUnlocalizedName(Lib.modid + ".pouch");
|
||||||
this.setCreativeTab(CrissCross.CCTab);
|
this.setCreativeTab(CrissCross.CCTab);
|
||||||
GameRegistry.registerItem(this, this.getUnlocalizedName());
|
GameRegistry.registerItem(this, this.getUnlocalizedName());
|
||||||
Lib.add(this);
|
Lib.add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player)
|
@Override
|
||||||
{
|
@SideOnly(Side.CLIENT)
|
||||||
if(!world.isRemote)
|
public int getColorFromItemStack(ItemStack stack, int pass)
|
||||||
player.openGui(CrissCross.instance, GUIHandler.Pouch, world, player.inventory.currentItem, 0, 0);
|
{
|
||||||
return itemstack;
|
return ColorUtils.getColorMultiplierFromMeta(stack.getMetadata());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player)
|
||||||
|
{
|
||||||
|
if (!world.isRemote)
|
||||||
|
player.openGui(CrissCross.instance, GUIHandler.Pouch, world, player.inventory.currentItem, 0, 0);
|
||||||
|
return itemstack;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedNameInefficiently(ItemStack itemstack)
|
||||||
|
{
|
||||||
|
String unlocName = StatCollector.translateToLocal("item.CrissCross.pouch.name");
|
||||||
|
String colorName = EnumDyeColor.byDyeDamage(itemstack.getItemDamage()).getUnlocalizedName();
|
||||||
|
colorName = colorName.substring(0, 1).toUpperCase() + colorName.substring(1, colorName.length());
|
||||||
|
|
||||||
|
return ColorUtils.findFormatForMeta(itemstack.getItemDamage()) + colorName + " " + unlocName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getItemStackDisplayName(ItemStack itemstack)
|
||||||
|
{
|
||||||
|
return this.getUnlocalizedNameInefficiently(itemstack);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void getSubItems(Item item, CreativeTabs tab, List list)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 16; i++)
|
||||||
|
list.add(new ItemStack(item, 1, i));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.oitsjustjose.criss_cross.items;
|
||||||
|
|
||||||
|
import com.oitsjustjose.criss_cross.lib.LibBlocks;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemReed;
|
||||||
|
|
||||||
|
public class ItemTimer extends ItemReed
|
||||||
|
{
|
||||||
|
public ItemTimer()
|
||||||
|
{
|
||||||
|
super(LibBlocks.timer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -16,8 +16,7 @@ public class ConfigHandler
|
||||||
public static String cropomatorRecipeItem;
|
public static String cropomatorRecipeItem;
|
||||||
public static String[] cropomatorInputs;
|
public static String[] cropomatorInputs;
|
||||||
public static String[] cropomatorCatalysts;
|
public static String[] cropomatorCatalysts;
|
||||||
public static String[] defaultCropomatorInputs = new String[] { "minecraft:apple", "minecraft:reeds", "minecraft:nether_wart", "minecraft:carrot", "minecraft:cactus", "minecraft:potato",
|
public static String[] defaultCropomatorInputs = new String[] { "minecraft:apple", "minecraft:reeds", "minecraft:nether_wart", "minecraft:carrot", "minecraft:cactus", "minecraft:potato", "minecraft:sapling:0", "minecraft:sapling:1", "minecraft:sapling:2", "minecraft:sapling:3", "minecraft:sapling:4", "minecraft:sapling:5", "minecraft:melon", "minecraft:brown_mushroom",
|
||||||
"minecraft:sapling:0", "minecraft:sapling:1", "minecraft:sapling:2", "minecraft:sapling:3", "minecraft:sapling:4", "minecraft:sapling:5", "minecraft:melon", "minecraft:brown_mushroom",
|
|
||||||
"minecraft:red_mushroom", "minecraft:dye:3", "minecraft:pumpkin", "minecraft:wheat", "minecraft:wheat_seeds" };
|
"minecraft:red_mushroom", "minecraft:dye:3", "minecraft:pumpkin", "minecraft:wheat", "minecraft:wheat_seeds" };
|
||||||
public static String[] defaultCropomatorCatalystItems = new String[] { "minecraft:dye:15" };
|
public static String[] defaultCropomatorCatalystItems = new String[] { "minecraft:dye:15" };
|
||||||
|
|
||||||
|
|
@ -26,8 +25,7 @@ public class ConfigHandler
|
||||||
public static String electroextractorRecipeItem;
|
public static String electroextractorRecipeItem;
|
||||||
public static String[] electroextractorEnergySources;
|
public static String[] electroextractorEnergySources;
|
||||||
public static String[] electroextractorOreDictInputs;
|
public static String[] electroextractorOreDictInputs;
|
||||||
public static String[] defaultElectroextractorOreDictInputs = new String[] { "Iron:12428902", "Gold:15400704", "Aluminum:15987699", "Cobalt:17663", "Ardite:13938485", "Copper:16751872",
|
public static String[] defaultElectroextractorOreDictInputs = new String[] { "Iron:12428902", "Gold:15400704", "Aluminum:15987699", "Cobalt:17663", "Ardite:13938485", "Copper:16751872", "Tin:15132390", "Silver:13297640", "Lead:5722979", "Platinum:11067903", "Mithril:4433113", "Nickel:16580553" };
|
||||||
"Tin:15132390", "Silver:13297640", "Lead:5722979", "Platinum:11067903", "Mithril:4433113", "Nickel:16580553" };
|
|
||||||
public static String[] defaultElectroextractorEnergySources = new String[] { "minecraft:redstone_block" };
|
public static String[] defaultElectroextractorEnergySources = new String[] { "minecraft:redstone_block" };
|
||||||
|
|
||||||
public static int woodchipperProcessTime;
|
public static int woodchipperProcessTime;
|
||||||
|
|
@ -51,51 +49,39 @@ public class ConfigHandler
|
||||||
private static void loadConfiguration()
|
private static void loadConfiguration()
|
||||||
{
|
{
|
||||||
// Cropomator Configs
|
// Cropomator Configs
|
||||||
cropomatorInputs = config.get(config.CATEGORY_GENERAL, "Cropomator's Recipe Items.", defaultCropomatorInputs,
|
cropomatorInputs = config.get(config.CATEGORY_GENERAL, "Cropomator's Recipe Items.", defaultCropomatorInputs, "A list of items to be added to the Cropomator's recipe list. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.").getStringList();
|
||||||
"A list of items to be added to the Cropomator's recipe list. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.").getStringList();
|
|
||||||
|
|
||||||
cropomatorCatalysts = config.get(config.CATEGORY_GENERAL, "Cropomator's Catalyst Items.", defaultCropomatorCatalystItems,
|
cropomatorCatalysts = config.get(config.CATEGORY_GENERAL, "Cropomator's Catalyst Items.", defaultCropomatorCatalystItems, "A list of items to be added to the Cropomator's catalyst list. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.").getStringList();
|
||||||
"A list of items to be added to the Cropomator's catalyst list. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.").getStringList();
|
|
||||||
|
|
||||||
cropomatorProcessTime = config.getInt("Cropomator Processing Time", config.CATEGORY_GENERAL, 150, 1, Short.MAX_VALUE,
|
cropomatorProcessTime = config.getInt("Cropomator Processing Time", config.CATEGORY_GENERAL, 150, 1, Short.MAX_VALUE, "Control how many ticks it takes the Cropomator to process an item. Default is 150; furnaces are 200.");
|
||||||
"Control how many ticks it takes the Cropomator to process an item. Default is 150; furnaces are 200.");
|
|
||||||
|
|
||||||
cropomatorOutput = config.getInt("Cropomator Output Quantity", config.CATEGORY_GENERAL, 3, 0, 64, "Control how many of the input item you get as the output item. Default is 3.");
|
cropomatorOutput = config.getInt("Cropomator Output Quantity", config.CATEGORY_GENERAL, 3, 0, 64, "Control how many of the input item you get as the output item. Default is 3.");
|
||||||
|
|
||||||
cropomatorRecipeItem = config.getString("Cropomator Crafting Item.", config.CATEGORY_GENERAL, "minecraft:diamond_block",
|
cropomatorRecipeItem = config.getString("Cropomator Crafting Item.", config.CATEGORY_GENERAL, "minecraft:diamond_block", "This is the item located in the center of the crafting recipe for the Cropomator. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.");
|
||||||
"This is the item located in the center of the crafting recipe for the Cropomator. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.");
|
|
||||||
|
|
||||||
// Electroextractor's Configs
|
// Electroextractor's Configs
|
||||||
electroextractorEnergySources = config.get(config.CATEGORY_GENERAL, "Electroextractor's Fuel Items.", defaultElectroextractorEnergySources,
|
electroextractorEnergySources = config.get(config.CATEGORY_GENERAL, "Electroextractor's Fuel Items.", defaultElectroextractorEnergySources, "A list of items to be added as the Electroextractor's energy sources. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.").getStringList();
|
||||||
"A list of items to be added as the Electroextractor's energy sources. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.").getStringList();
|
|
||||||
|
|
||||||
electroextractorProcessTime = config.getInt("Electroextractor Processing Time", config.CATEGORY_GENERAL, 250, 0, Short.MAX_VALUE,
|
electroextractorProcessTime = config.getInt("Electroextractor Processing Time", config.CATEGORY_GENERAL, 250, 0, Short.MAX_VALUE, "Control how many ticks it takes the Electroextractor to process an item. Default is 250; furnaces are 200.");
|
||||||
"Control how many ticks it takes the Electroextractor to process an item. Default is 250; furnaces are 200.");
|
|
||||||
|
|
||||||
electroextractorOutput = config.getInt("Electroextractor Output Quantity", config.CATEGORY_GENERAL, 2, 0, 64, "Control how many dusts you get as the output. Default is 2.");
|
electroextractorOutput = config.getInt("Electroextractor Output Quantity", config.CATEGORY_GENERAL, 2, 0, 64, "Control how many dusts you get as the output. Default is 2.");
|
||||||
|
|
||||||
electroextractorRecipeItem = config.getString("Electroextractor Crafting Item.", config.CATEGORY_GENERAL, "minecraft:diamond_block",
|
electroextractorRecipeItem = config.getString("Electroextractor Crafting Item.", config.CATEGORY_GENERAL, "minecraft:diamond_block", "This is the item located in the center of the crafting recipe for the Electroextractor. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.");
|
||||||
"This is the item located in the center of the crafting recipe for the Electroextractor. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.");
|
|
||||||
|
|
||||||
electroextractorOreDictInputs = config.get(config.CATEGORY_GENERAL, "Electroextractor OreDictionary Entries.", defaultElectroextractorOreDictInputs,
|
electroextractorOreDictInputs = config.get(config.CATEGORY_GENERAL, "Electroextractor OreDictionary Entries.", defaultElectroextractorOreDictInputs, "Formatted as <OreDictName>:<DecimalColorYouWant>." + "\n" + " Remove the 'ore' part of the oredict name (i.e. 'oreIron' should be entered as 'Iron')" + "\n"
|
||||||
"Formatted as <OreDictName>:<DecimalColorYouWant>." + "\n" + " Remove the 'ore' part of the oredict name (i.e. 'oreIron' should be entered as 'Iron')" + "\n"
|
+ "Use http://www.colorpicker.com/ to find a color and http://bit.ly/1RhPhcX to convert it from Hex to Decimal.").getStringList();
|
||||||
+ "Use http://www.colorpicker.com/ to find a color and http://bit.ly/1RhPhcX to convert it from Hex to Decimal.").getStringList();
|
|
||||||
|
|
||||||
// Woodchipper's Configs
|
// Woodchipper's Configs
|
||||||
woodchipperFuels = config.get(config.CATEGORY_GENERAL, "Woodchipper Fuel Items", defaultWoodchipperFuels,
|
woodchipperFuels = config.get(config.CATEGORY_GENERAL, "Woodchipper Fuel Items", defaultWoodchipperFuels, "A list of items to be added as the Woodchipper's 'fuels'. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.").getStringList();
|
||||||
"A list of items to be added as the Woodchipper's 'fuels'. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.").getStringList();
|
|
||||||
|
|
||||||
woodchipperProcessTime = config.getInt("Woodchipper Process Time", config.CATEGORY_GENERAL, 400, 0, Short.MAX_VALUE,
|
woodchipperProcessTime = config.getInt("Woodchipper Process Time", config.CATEGORY_GENERAL, 400, 0, Short.MAX_VALUE, "Control how many ticks it takes the Woodchipper to process an item. Default is 400; furnaces are 200.");
|
||||||
"Control how many ticks it takes the Woodchipper to process an item. Default is 400; furnaces are 200.");
|
|
||||||
|
|
||||||
woodchipperOutput = config.getInt("Woodchipper Output Quantity", config.CATEGORY_GENERAL, 6, 0, 64, "Control how many planks are yielded from processing a log. Default is 6.");
|
woodchipperOutput = config.getInt("Woodchipper Output Quantity", config.CATEGORY_GENERAL, 6, 0, 64, "Control how many planks are yielded from processing a log. Default is 6.");
|
||||||
|
|
||||||
woodchipperRecipeItem = config.getString("Woodchipper Crafting Item", config.CATEGORY_GENERAL, "minecraft:diamond_block",
|
woodchipperRecipeItem = config.getString("Woodchipper Crafting Item", config.CATEGORY_GENERAL, "minecraft:diamond_block", "This is the item located in the center of the crafting recipe for the Woodchipper. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.");
|
||||||
"This is the item located in the center of the crafting recipe for the Woodchipper. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.");
|
|
||||||
|
|
||||||
// Autosmith's Configs
|
// Autosmith's Configs
|
||||||
blockGeneratorProcessTimes = config.getInt("Stone Generators' Process Times", config.CATEGORY_GENERAL, 20, 0, Short.MAX_VALUE,
|
blockGeneratorProcessTimes = config.getInt("Stone Generators' Process Times", config.CATEGORY_GENERAL, 20, 0, Short.MAX_VALUE, "Control how many ticks it takes a stone generator to process an item. Default is 20; furnaces are 200.");
|
||||||
"Control how many ticks it takes a stone generator to process an item. Default is 20; furnaces are 200.");
|
|
||||||
|
|
||||||
if (config.hasChanged())
|
if (config.hasChanged())
|
||||||
config.save();
|
config.save();
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,9 @@ public class Lib
|
||||||
public static final String name = "CrissCross";
|
public static final String name = "CrissCross";
|
||||||
public static final String version = "@VERSION@";
|
public static final String version = "@VERSION@";
|
||||||
public static final String guifactory = "com.oitsjustjose.criss_cross.gui.GUIFactory";
|
public static final String guifactory = "com.oitsjustjose.criss_cross.gui.GUIFactory";
|
||||||
|
public static final String clientProxy = "com.oitsjustjose.criss_cross.util.ClientProxy";
|
||||||
|
public static final String commonProxy = "com.oitsjustjose.criss_cross.util.CommonProxy";
|
||||||
|
|
||||||
|
|
||||||
private static final ArrayList<Item> allItems = new ArrayList<Item>();
|
private static final ArrayList<Item> allItems = new ArrayList<Item>();
|
||||||
private static final ArrayList<Block> allBlocks = new ArrayList<Block>();
|
private static final ArrayList<Block> allBlocks = new ArrayList<Block>();
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import com.oitsjustjose.criss_cross.blocks.BlockCobblegen;
|
||||||
import com.oitsjustjose.criss_cross.blocks.BlockCropomator;
|
import com.oitsjustjose.criss_cross.blocks.BlockCropomator;
|
||||||
import com.oitsjustjose.criss_cross.blocks.BlockElectroextractor;
|
import com.oitsjustjose.criss_cross.blocks.BlockElectroextractor;
|
||||||
import com.oitsjustjose.criss_cross.blocks.BlockStonegen;
|
import com.oitsjustjose.criss_cross.blocks.BlockStonegen;
|
||||||
|
import com.oitsjustjose.criss_cross.blocks.BlockTimer;
|
||||||
import com.oitsjustjose.criss_cross.blocks.BlockWoodchipper;
|
import com.oitsjustjose.criss_cross.blocks.BlockWoodchipper;
|
||||||
import com.oitsjustjose.criss_cross.gui.GUIHandler;
|
import com.oitsjustjose.criss_cross.gui.GUIHandler;
|
||||||
|
|
||||||
|
|
@ -19,6 +20,7 @@ public class LibBlocks
|
||||||
public static Block cobblegen;
|
public static Block cobblegen;
|
||||||
public static Block stonegen;
|
public static Block stonegen;
|
||||||
public static Block mobGrinder;
|
public static Block mobGrinder;
|
||||||
|
public static Block timer;
|
||||||
|
|
||||||
public static void init()
|
public static void init()
|
||||||
{
|
{
|
||||||
|
|
@ -27,6 +29,7 @@ public class LibBlocks
|
||||||
woodchipper = new BlockWoodchipper();
|
woodchipper = new BlockWoodchipper();
|
||||||
cobblegen = new BlockCobblegen();
|
cobblegen = new BlockCobblegen();
|
||||||
stonegen = new BlockStonegen();
|
stonegen = new BlockStonegen();
|
||||||
|
timer = new BlockTimer();
|
||||||
// mobGrinder = new BlockMobGrinder();
|
// mobGrinder = new BlockMobGrinder();
|
||||||
NetworkRegistry.INSTANCE.registerGuiHandler(CrissCross.instance, new GUIHandler());
|
NetworkRegistry.INSTANCE.registerGuiHandler(CrissCross.instance, new GUIHandler());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import com.oitsjustjose.criss_cross.items.ItemInfiniApple;
|
||||||
import com.oitsjustjose.criss_cross.items.ItemMantleSmasher;
|
import com.oitsjustjose.criss_cross.items.ItemMantleSmasher;
|
||||||
import com.oitsjustjose.criss_cross.items.ItemModBuckets;
|
import com.oitsjustjose.criss_cross.items.ItemModBuckets;
|
||||||
import com.oitsjustjose.criss_cross.items.ItemPouch;
|
import com.oitsjustjose.criss_cross.items.ItemPouch;
|
||||||
|
import com.oitsjustjose.criss_cross.items.ItemTimer;
|
||||||
|
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
|
@ -20,6 +21,7 @@ public class LibItems
|
||||||
public static Item pouch;
|
public static Item pouch;
|
||||||
public static Item mantleSmasherMkI;
|
public static Item mantleSmasherMkI;
|
||||||
public static Item mantleSmasherMkII;
|
public static Item mantleSmasherMkII;
|
||||||
|
public static Item timer;
|
||||||
|
|
||||||
public static ToolMaterial mkI;
|
public static ToolMaterial mkI;
|
||||||
public static ToolMaterial mkII;
|
public static ToolMaterial mkII;
|
||||||
|
|
@ -36,5 +38,6 @@ public class LibItems
|
||||||
pouch = new ItemPouch();
|
pouch = new ItemPouch();
|
||||||
mantleSmasherMkI = new ItemMantleSmasher(mkI);
|
mantleSmasherMkI = new ItemMantleSmasher(mkI);
|
||||||
mantleSmasherMkII = new ItemMantleSmasher(mkII);
|
mantleSmasherMkII = new ItemMantleSmasher(mkII);
|
||||||
|
timer = new ItemTimer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -45,10 +45,10 @@ public class CCMachineRecipes
|
||||||
|
|
||||||
ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.diamond_ore), new ItemStack(Items.diamond, electroQTY));
|
ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.diamond_ore), new ItemStack(Items.diamond, electroQTY));
|
||||||
ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.emerald_ore), new ItemStack(Items.emerald, electroQTY));
|
ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.emerald_ore), new ItemStack(Items.emerald, electroQTY));
|
||||||
ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.coal_ore), new ItemStack(Items.coal, electroQTY));
|
ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.coal_ore), new ItemStack(Items.coal, electroQTY));
|
||||||
ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.gravel), new ItemStack(Items.flint));
|
ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.gravel), new ItemStack(Items.flint));
|
||||||
ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.cobblestone, 16), new ItemStack(Blocks.sand, 16));
|
ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.cobblestone, 16), new ItemStack(Blocks.sand, 16));
|
||||||
ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.sandstone, 1, Short.MAX_VALUE), new ItemStack(Blocks.sand, 4));
|
ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.sandstone, 1, Short.MAX_VALUE), new ItemStack(Blocks.sand, 4));
|
||||||
ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.red_sandstone, 1, Short.MAX_VALUE), new ItemStack(Blocks.sand, 4, 1));
|
ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.red_sandstone, 1, Short.MAX_VALUE), new ItemStack(Blocks.sand, 4, 1));
|
||||||
|
|
||||||
registerOreDict();
|
registerOreDict();
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.oitsjustjose.criss_cross.lib.ConfigHandler;
|
||||||
import com.oitsjustjose.criss_cross.lib.LibBlocks;
|
import com.oitsjustjose.criss_cross.lib.LibBlocks;
|
||||||
import com.oitsjustjose.criss_cross.lib.LibItems;
|
import com.oitsjustjose.criss_cross.lib.LibItems;
|
||||||
import com.oitsjustjose.criss_cross.util.CCLog;
|
import com.oitsjustjose.criss_cross.util.CCLog;
|
||||||
|
import com.oitsjustjose.criss_cross.util.ColorUtils;
|
||||||
|
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.init.Items;
|
import net.minecraft.init.Items;
|
||||||
|
|
@ -34,8 +35,9 @@ public class VanillaRecipes
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(LibItems.buckets, 1, 1), "OGO", "GBG", "OGO", 'B', Items.bucket, 'G', "blockGlass", 'O', Blocks.obsidian));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(LibItems.buckets, 1, 1), "OGO", "GBG", "OGO", 'B', Items.bucket, 'G', "blockGlass", 'O', Blocks.obsidian));
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(LibItems.infiniApple, 1, 0), "###", "#N#", "###", '#', new ItemStack(Items.golden_apple, 1, 1), 'N', Items.nether_star));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(LibItems.infiniApple, 1, 0), "###", "#N#", "###", '#', new ItemStack(Items.golden_apple, 1, 1), 'N', Items.nether_star));
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(LibItems.mantleSmasherMkI), "## ", "#PI", " II", '#', "blockEmerald", 'I', "blockIron", 'P', Items.diamond_pickaxe));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(LibItems.mantleSmasherMkI), "## ", "#PI", " II", '#', "blockEmerald", 'I', "blockIron", 'P', Items.diamond_pickaxe));
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(LibItems.mantleSmasherMkII), "## ", "#PI", " IN", '#', "blockDiamond", 'I', "blockGold", 'P', LibItems.mantleSmasherMkI, 'N',
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(LibItems.mantleSmasherMkII), "## ", "#PI", " IN", '#', "blockDiamond", 'I', "blockGold", 'P', LibItems.mantleSmasherMkI, 'N', Items.nether_star));
|
||||||
Items.nether_star));
|
for (int i = 0; i < 16; i++)
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(LibItems.pouch, 1, i), "SDS", "WCW", "BWB", 'W', new ItemStack(Blocks.wool, 1, Short.MAX_VALUE), 'S', Items.string, 'D', ColorUtils.getOreDictFromMeta(i), 'C', Blocks.chest, 'B', Items.diamond));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void woodChipperRecipe()
|
static void woodChipperRecipe()
|
||||||
|
|
|
||||||
|
|
@ -68,8 +68,7 @@ public class ClientProxy extends CommonProxy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (customName == "")
|
else if (customName == "")
|
||||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(itemBlock, 0, new ModelResourceLocation(Lib.modid.toLowerCase() + ":" + block.getUnlocalizedName().substring(16)
|
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(itemBlock, 0, new ModelResourceLocation(Lib.modid.toLowerCase() + ":" + block.getUnlocalizedName().substring(16).toLowerCase(), "inventory"));
|
||||||
.toLowerCase(), "inventory"));
|
|
||||||
else
|
else
|
||||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(itemBlock, 0, new ModelResourceLocation(Lib.modid.toLowerCase() + ":" + customName, "inventory"));
|
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(itemBlock, 0, new ModelResourceLocation(Lib.modid.toLowerCase() + ":" + customName, "inventory"));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,95 @@
|
||||||
|
package com.oitsjustjose.criss_cross.util;
|
||||||
|
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
|
||||||
|
public class ColorUtils
|
||||||
|
{
|
||||||
|
public static String[] dyes = { "Black", "Red", "Green", "Brown", "Blue", "Purple", "Cyan", "LightGray", "Gray", "Pink", "Lime", "Yellow", "LightBlue", "Magenta", "Orange", "White" };
|
||||||
|
|
||||||
|
public static EnumChatFormatting findFormatForMeta(int meta)
|
||||||
|
{
|
||||||
|
switch (meta)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
return EnumChatFormatting.BLACK;
|
||||||
|
case 1:
|
||||||
|
return EnumChatFormatting.DARK_RED;
|
||||||
|
case 2:
|
||||||
|
return EnumChatFormatting.DARK_GREEN;
|
||||||
|
case 3:
|
||||||
|
return EnumChatFormatting.GOLD;
|
||||||
|
case 4:
|
||||||
|
return EnumChatFormatting.BLUE;
|
||||||
|
case 5:
|
||||||
|
return EnumChatFormatting.DARK_PURPLE;
|
||||||
|
case 6:
|
||||||
|
return EnumChatFormatting.DARK_AQUA;
|
||||||
|
case 7:
|
||||||
|
return EnumChatFormatting.GRAY;
|
||||||
|
case 8:
|
||||||
|
return EnumChatFormatting.DARK_GRAY;
|
||||||
|
case 9:
|
||||||
|
return EnumChatFormatting.RED;
|
||||||
|
case 10:
|
||||||
|
return EnumChatFormatting.GREEN;
|
||||||
|
case 11:
|
||||||
|
return EnumChatFormatting.YELLOW;
|
||||||
|
case 12:
|
||||||
|
return EnumChatFormatting.AQUA;
|
||||||
|
case 13:
|
||||||
|
return EnumChatFormatting.LIGHT_PURPLE;
|
||||||
|
case 14:
|
||||||
|
return EnumChatFormatting.GOLD;
|
||||||
|
case 15:
|
||||||
|
return EnumChatFormatting.WHITE;
|
||||||
|
default:
|
||||||
|
return EnumChatFormatting.RESET;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getColorMultiplierFromMeta(int meta)
|
||||||
|
{
|
||||||
|
switch (meta)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
return 4342338;
|
||||||
|
case 1:
|
||||||
|
return 15204352;
|
||||||
|
case 2:
|
||||||
|
return 4175157;
|
||||||
|
case 3:
|
||||||
|
return 6046976;
|
||||||
|
case 4:
|
||||||
|
return 7935;
|
||||||
|
case 5:
|
||||||
|
return 6962352;
|
||||||
|
case 6:
|
||||||
|
return 3057097;
|
||||||
|
case 7:
|
||||||
|
return 13224393;
|
||||||
|
case 8:
|
||||||
|
return 8882055;
|
||||||
|
case 9:
|
||||||
|
return 16295679;
|
||||||
|
case 10:
|
||||||
|
return 65331;
|
||||||
|
case 11:
|
||||||
|
return 16775936;
|
||||||
|
case 12:
|
||||||
|
return 3721215;
|
||||||
|
case 13:
|
||||||
|
return 16711927;
|
||||||
|
case 14:
|
||||||
|
return 16751872;
|
||||||
|
case 15:
|
||||||
|
return 16777215;
|
||||||
|
default:
|
||||||
|
return 16777215;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getOreDictFromMeta(int meta)
|
||||||
|
{
|
||||||
|
return "dye" + dyes[meta];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -10,9 +10,7 @@ import net.minecraft.item.crafting.IRecipe;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author TeamCoFH All credit goes to TeamCoFH, this was required for proper woodchipper recipes :)
|
* @author TeamCoFH All credit goes to TeamCoFH, this was required for proper woodchipper recipes :)
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class ItemHelper
|
public class ItemHelper
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@
|
||||||
},
|
},
|
||||||
"display": {
|
"display": {
|
||||||
"thirdperson": {
|
"thirdperson": {
|
||||||
"rotation": [ 0, 90, -35 ],
|
"rotation": [ -90, 0, 0 ],
|
||||||
"translation": [ 0, 1.25, -3.5 ],
|
"translation": [ 0, 1, -3 ],
|
||||||
"scale": [ 0.85, 0.85, 0.85 ]
|
"scale": [ 0.55, 0.55, 0.55 ]
|
||||||
},
|
},
|
||||||
"firstperson": {
|
"firstperson": {
|
||||||
"rotation": [ 0, -135, 25 ],
|
"rotation": [ 0, -135, 25 ],
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@
|
||||||
},
|
},
|
||||||
"display": {
|
"display": {
|
||||||
"thirdperson": {
|
"thirdperson": {
|
||||||
"rotation": [ 0, 90, -35 ],
|
"rotation": [ -90, 0, 0 ],
|
||||||
"translation": [ 0, 1.25, -3.5 ],
|
"translation": [ 0, 1, -3 ],
|
||||||
"scale": [ 0.85, 0.85, 0.85 ]
|
"scale": [ 0.55, 0.55, 0.55 ]
|
||||||
},
|
},
|
||||||
"firstperson": {
|
"firstperson": {
|
||||||
"rotation": [ 0, -135, 25 ],
|
"rotation": [ 0, -135, 25 ],
|
||||||
|
|
|
||||||
18
src/main/resources/assets/crisscross/models/item/pouch.json
Normal file
18
src/main/resources/assets/crisscross/models/item/pouch.json
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"parent": "builtin/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "crisscross:items/pouch"
|
||||||
|
},
|
||||||
|
"display": {
|
||||||
|
"thirdperson": {
|
||||||
|
"rotation": [ -90, 0, 0 ],
|
||||||
|
"translation": [ 0, 1, -3 ],
|
||||||
|
"scale": [ 0.55, 0.55, 0.55 ]
|
||||||
|
},
|
||||||
|
"firstperson": {
|
||||||
|
"rotation": [ 0, -135, 25 ],
|
||||||
|
"translation": [ 0, 4, 2 ],
|
||||||
|
"scale": [ 1.7, 1.7, 1.7 ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -5,9 +5,9 @@
|
||||||
},
|
},
|
||||||
"display": {
|
"display": {
|
||||||
"thirdperson": {
|
"thirdperson": {
|
||||||
"rotation": [ 0, 90, -35 ],
|
"rotation": [ -90, 0, 0 ],
|
||||||
"translation": [ 0, 1.25, -3.5 ],
|
"translation": [ 0, 1, -3 ],
|
||||||
"scale": [ 0.85, 0.85, 0.85 ]
|
"scale": [ 0.55, 0.55, 0.55 ]
|
||||||
},
|
},
|
||||||
"firstperson": {
|
"firstperson": {
|
||||||
"rotation": [ 0, -135, 25 ],
|
"rotation": [ 0, -135, 25 ],
|
||||||
|
|
|
||||||
BIN
src/main/resources/assets/crisscross/textures/items/pouch.png
Normal file
BIN
src/main/resources/assets/crisscross/textures/items/pouch.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
Loading…
Reference in a new issue