mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-22 19:39:24 +01:00
Changing stuff!
This commit is contained in:
parent
763ddfb718
commit
4bb53b5510
39 changed files with 98 additions and 1714 deletions
14
build.gradle
14
build.gradle
|
@ -17,12 +17,12 @@ buildscript {
|
|||
|
||||
apply plugin: 'forge'
|
||||
|
||||
version = "1.7.10-1.0.1"
|
||||
version = "1.7.10-0.0.1"
|
||||
group = "ellpeck.someprettytechystuff"
|
||||
archivesBaseName = "SomePrettyTechyStuff"
|
||||
|
||||
minecraft {
|
||||
version = "1.7.10-10.13.2.1264"
|
||||
version = "1.7.10-10.13.2.1277"
|
||||
runDir = "idea"
|
||||
}
|
||||
|
||||
|
@ -30,8 +30,8 @@ dependencies {
|
|||
|
||||
}
|
||||
|
||||
processResources
|
||||
{
|
||||
processResources{
|
||||
|
||||
inputs.property "version", project.version
|
||||
inputs.property "mcversion", project.minecraft.version
|
||||
|
||||
|
@ -45,3 +45,9 @@ processResources
|
|||
exclude 'mcmod.info'
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
output.resourcesDir = output.classesDir
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@ import cpw.mods.fml.common.event.FMLInitializationEvent;
|
|||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import ellpeck.someprettytechystuff.blocks.InitBlocks;
|
||||
import ellpeck.someprettytechystuff.booklet.ChapterList;
|
||||
import ellpeck.someprettytechystuff.crafting.InitCrafting;
|
||||
import ellpeck.someprettytechystuff.gen.OreGen;
|
||||
import ellpeck.someprettytechystuff.inventory.GuiHandler;
|
||||
|
@ -18,10 +17,10 @@ import ellpeck.someprettytechystuff.tile.TileEntityBase;
|
|||
import ellpeck.someprettytechystuff.util.Util;
|
||||
|
||||
@Mod(modid = Util.MOD_ID, name = Util.NAME, version = Util.VERSION)
|
||||
public class Gemification{
|
||||
public class SPTS{
|
||||
|
||||
@Instance(Util.MOD_ID)
|
||||
public static Gemification instance;
|
||||
public static SPTS instance;
|
||||
|
||||
@SidedProxy(clientSide = "ellpeck.someprettytechystuff.proxy.ClientProxy", serverSide = "ellpeck.someprettytechystuff.proxy.ServerProxy")
|
||||
public static IProxy proxy;
|
||||
|
@ -29,7 +28,6 @@ public class Gemification{
|
|||
@SuppressWarnings("unused")
|
||||
@EventHandler()
|
||||
public void preInit(FMLPreInitializationEvent event){
|
||||
ChapterList.init();
|
||||
InitBlocks.init();
|
||||
InitItems.init();
|
||||
proxy.preInit();
|
|
@ -1,61 +0,0 @@
|
|||
package ellpeck.someprettytechystuff.blocks;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import ellpeck.someprettytechystuff.Gemification;
|
||||
import ellpeck.someprettytechystuff.creative.CreativeTab;
|
||||
import ellpeck.someprettytechystuff.inventory.GuiHandler;
|
||||
import ellpeck.someprettytechystuff.tile.TileEntityCrucible;
|
||||
import ellpeck.someprettytechystuff.tile.TileEntityInventoryBase;
|
||||
import ellpeck.someprettytechystuff.util.Util;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockCrucible extends BlockContainerBase{
|
||||
|
||||
protected BlockCrucible(){
|
||||
super(Material.rock);
|
||||
this.setBlockName("blockCrucible");
|
||||
this.setCreativeTab(CreativeTab.instance);
|
||||
this.setHardness(3.0F);
|
||||
this.setResistance(5.0F);
|
||||
this.setHarvestLevel("pickaxe", 2);
|
||||
}
|
||||
|
||||
public TileEntity createNewTileEntity(World world, int i){
|
||||
return new TileEntityCrucible();
|
||||
}
|
||||
|
||||
@SuppressWarnings("static-access")
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ){
|
||||
if (!world.isRemote){
|
||||
player.openGui(Gemification.instance, GuiHandler.guiCrucible, world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getRenderType(){
|
||||
return RenderingRegistry.getNextAvailableRenderId();
|
||||
}
|
||||
|
||||
public boolean isOpaqueCube(){
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean renderAsNormalBlock(){
|
||||
return false;
|
||||
}
|
||||
|
||||
public void registerBlockIcons(IIconRegister iconReg){
|
||||
this.blockIcon = Blocks.hopper.getIcon(0, 0);
|
||||
}
|
||||
|
||||
public TileEntityInventoryBase dropInventory(World world, int x, int y, int z){
|
||||
TileEntityCrucible tileEntity = (TileEntityCrucible)super.dropInventory(world, x, y, z);
|
||||
if(tileEntity.currentFluid != Util.fluidNone) world.setBlock(x, y, z, Blocks.flowing_water);
|
||||
return tileEntity;
|
||||
}
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
package ellpeck.someprettytechystuff.blocks;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.someprettytechystuff.Gemification;
|
||||
import ellpeck.someprettytechystuff.creative.CreativeTab;
|
||||
import ellpeck.someprettytechystuff.inventory.GuiHandler;
|
||||
import ellpeck.someprettytechystuff.tile.TileEntityCrucibleFire;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockCrucibleFire extends BlockContainerBase{
|
||||
|
||||
protected BlockCrucibleFire(){
|
||||
super(Material.rock);
|
||||
this.setBlockName("blockCrucibleFire");
|
||||
this.setCreativeTab(CreativeTab.instance);
|
||||
this.setTickRandomly(true);
|
||||
this.setHardness(3.0F);
|
||||
this.setResistance(5.0F);
|
||||
this.setHarvestLevel("pickaxe", 2);
|
||||
}
|
||||
|
||||
public TileEntity createNewTileEntity(World world, int i){
|
||||
return new TileEntityCrucibleFire();
|
||||
}
|
||||
|
||||
@SuppressWarnings("static-access")
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ){
|
||||
if (!world.isRemote){
|
||||
player.openGui(Gemification.instance, GuiHandler.guiCrucibleFire, world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getRenderType(){
|
||||
return RenderingRegistry.getNextAvailableRenderId();
|
||||
}
|
||||
|
||||
public boolean isOpaqueCube(){
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean renderAsNormalBlock(){
|
||||
return false;
|
||||
}
|
||||
|
||||
public void registerBlockIcons(IIconRegister iconReg){
|
||||
this.blockIcon = Blocks.hopper.getIcon(0, 0);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand){
|
||||
if(((TileEntityCrucibleFire)world.getTileEntity(x, y, z)).isBurning()){
|
||||
for(int i = 0; i < 8; i++){
|
||||
world.spawnParticle("flame", (double) x + rand.nextFloat() * 0.5F + 0.25F, (double) y + 0.55F, (double) z + rand.nextFloat() * 0.5F + 0.25F, 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("smoke", (double) x + rand.nextFloat() * 0.5F + 0.25F, (double) y + 0.55F, (double) z + rand.nextFloat() * 0.5F + 0.25F, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,39 +1,9 @@
|
|||
package ellpeck.someprettytechystuff.blocks;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public class InitBlocks{
|
||||
|
||||
public static Block oreGem;
|
||||
public static Block blockCrucible;
|
||||
public static Block blockCrucibleFire;
|
||||
|
||||
public static Block blockCropIron;
|
||||
public static Block blockCropGold;
|
||||
public static Block blockCropRedstone;
|
||||
public static Block blockCropDiamond;
|
||||
|
||||
public static void init(){
|
||||
|
||||
oreGem = new OreGem();
|
||||
blockCrucible = new BlockCrucible();
|
||||
blockCrucibleFire = new BlockCrucibleFire();
|
||||
|
||||
blockCropIron = new BlockCrop("blockCropIron", 4);
|
||||
blockCropGold = new BlockCrop("blockCropGold", 4);
|
||||
blockCropRedstone = new BlockCrop("blockCropRedstone", 4);
|
||||
blockCropDiamond = new BlockCrop("blockCropDiamond", 4);
|
||||
|
||||
GameRegistry.registerBlock(oreGem, OreGem.ItemBlockOreGem.class, oreGem.getUnlocalizedName().substring(5));
|
||||
GameRegistry.registerBlock(blockCrucible, DefaultItemBlock.class, blockCrucible.getUnlocalizedName().substring(5));
|
||||
GameRegistry.registerBlock(blockCrucibleFire, DefaultItemBlock.class, blockCrucibleFire.getUnlocalizedName().substring(5));
|
||||
|
||||
GameRegistry.registerBlock(blockCropIron, blockCropIron.getUnlocalizedName().substring(5));
|
||||
GameRegistry.registerBlock(blockCropGold, blockCropGold.getUnlocalizedName().substring(5));
|
||||
GameRegistry.registerBlock(blockCropRedstone, blockCropRedstone.getUnlocalizedName().substring(5));
|
||||
GameRegistry.registerBlock(blockCropDiamond, blockCropDiamond.getUnlocalizedName().substring(5));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,95 +0,0 @@
|
|||
package ellpeck.someprettytechystuff.blocks;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.someprettytechystuff.creative.CreativeTab;
|
||||
import ellpeck.someprettytechystuff.items.InitItems;
|
||||
import ellpeck.someprettytechystuff.util.Util;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class OreGem extends Block{
|
||||
|
||||
public final IIcon[] textures;
|
||||
|
||||
public OreGem() {
|
||||
super(Material.rock);
|
||||
textures = new IIcon[Util.gemList.size()];
|
||||
this.setHardness(3.0F);
|
||||
this.setResistance(5.0F);
|
||||
this.setStepSound(soundTypeStone);
|
||||
this.setCreativeTab(CreativeTab.instance);
|
||||
this.setBlockName("oreGem");
|
||||
this.setHarvestLevel("pickaxe", 2);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void getSubBlocks(Item stack, CreativeTabs tab, List list) {
|
||||
for (int i = 0; i < Util.gemList.size(); i++) {
|
||||
list.add(new ItemStack(stack, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
public Item getItemDropped(int par1, Random rand, int par3){
|
||||
return InitItems.itemGem;
|
||||
}
|
||||
|
||||
public int damageDropped(int i){
|
||||
return i;
|
||||
}
|
||||
|
||||
public int quantityDropped(Random rand){
|
||||
return 1 + rand.nextInt(5);
|
||||
}
|
||||
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return textures[meta];
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconReg) {
|
||||
for (int i = 0; i < Util.gemList.size(); i++) {
|
||||
textures[i] = iconReg.registerIcon(Util.MOD_ID + ":" + this.getUnlocalizedName().substring(5) + Util.gemList.get(i).name.substring(5));
|
||||
}
|
||||
}
|
||||
|
||||
public static class ItemBlockOreGem extends ItemBlock {
|
||||
|
||||
public ItemBlockOreGem(Block block){
|
||||
super(block);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return this.getUnlocalizedName() + Util.gemList.get(stack.getItemDamage()).name.substring(5);
|
||||
}
|
||||
|
||||
public int getMetadata(int i) {
|
||||
return i;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||
if(Util.isShiftPressed()){
|
||||
for(int i = 0; i < Util.gemList.size(); i++){
|
||||
if(this.getDamage(stack) == i) list.add(StatCollector.translateToLocal("tooltip.gem" + Util.gemList.get(i).name.substring(5) + ".desc"));
|
||||
}
|
||||
list.add(EnumChatFormatting.BOLD + StatCollector.translateToLocal("tooltip.gemIsOre.desc"));
|
||||
}
|
||||
else list.add(Util.shiftForInfo());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,7 +2,7 @@ package ellpeck.someprettytechystuff.blocks.models;
|
|||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
|
||||
public class ModelBaseG extends ModelBase{
|
||||
public class ModelBaseSPTS extends ModelBase{
|
||||
|
||||
public void render(float f){
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
package ellpeck.someprettytechystuff.blocks.models;
|
||||
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
public class ModelCrucible extends ModelBaseG{
|
||||
public ModelRenderer floor, rimOne, rimTwo, rimThree, rimFour, wallOne, wallTwo, wallThree, wallFour, supportOne, supportTwo, supportThree, supportFour;
|
||||
|
||||
public ModelCrucible() {
|
||||
this.textureWidth = 64;
|
||||
this.textureHeight = 64;
|
||||
this.supportTwo = new ModelRenderer(this, 0, 0);
|
||||
this.supportTwo.setRotationPoint(-6.5F, 21.0F, 4.5F);
|
||||
this.supportTwo.addBox(0.0F, 0.0F, 0.0F, 2, 3, 2);
|
||||
this.wallTwo = new ModelRenderer(this, 0, 0);
|
||||
this.wallTwo.setRotationPoint(7.0F, 9.5F, -8.0F);
|
||||
this.wallTwo.addBox(0.0F, 0.0F, 0.0F, 1, 9, 16);
|
||||
this.floor = new ModelRenderer(this, 0, 0);
|
||||
this.floor.setRotationPoint(-6.0F, 21.5F, -6.0F);
|
||||
this.floor.addBox(0.0F, 0.0F, 0.0F, 12, 1, 12);
|
||||
this.rimThree = new ModelRenderer(this, 0, 0);
|
||||
this.rimThree.setRotationPoint(6.0F, 18.5F, -6.0F);
|
||||
this.rimThree.addBox(0.0F, 0.0F, 0.0F, 1, 3, 12);
|
||||
this.wallThree = new ModelRenderer(this, 0, 0);
|
||||
this.wallThree.setRotationPoint(-7.0F, 9.5F, 7.0F);
|
||||
this.wallThree.addBox(0.0F, 0.0F, 0.0F, 14, 9, 1);
|
||||
this.rimTwo = new ModelRenderer(this, 0, 0);
|
||||
this.rimTwo.setRotationPoint(-7.0F, 18.5F, 6.0F);
|
||||
this.rimTwo.addBox(0.0F, 0.0F, 0.0F, 14, 3, 1);
|
||||
this.rimOne = new ModelRenderer(this, 0, 0);
|
||||
this.rimOne.setRotationPoint(-7.0F, 18.5F, -7.0F);
|
||||
this.rimOne.addBox(0.0F, 0.0F, 0.0F, 14, 3, 1);
|
||||
this.supportOne = new ModelRenderer(this, 0, 0);
|
||||
this.supportOne.setRotationPoint(4.5F, 21.0F, 4.5F);
|
||||
this.supportOne.addBox(0.0F, 0.0F, 0.0F, 2, 3, 2);
|
||||
this.wallOne = new ModelRenderer(this, 0, 0);
|
||||
this.wallOne.setRotationPoint(-8.0F, 9.5F, -8.0F);
|
||||
this.wallOne.addBox(0.0F, 0.0F, 0.0F, 1, 9, 16);
|
||||
this.supportFour = new ModelRenderer(this, 0, 0);
|
||||
this.supportFour.setRotationPoint(-6.5F, 21.0F, -6.5F);
|
||||
this.supportFour.addBox(0.0F, 0.0F, 0.0F, 2, 3, 2);
|
||||
this.wallFour = new ModelRenderer(this, 0, 0);
|
||||
this.wallFour.setRotationPoint(-7.0F, 9.5F, -8.0F);
|
||||
this.wallFour.addBox(0.0F, 0.0F, 0.0F, 14, 9, 1);
|
||||
this.rimFour = new ModelRenderer(this, 0, 0);
|
||||
this.rimFour.setRotationPoint(-7.0F, 18.5F, -6.0F);
|
||||
this.rimFour.addBox(0.0F, 0.0F, 0.0F, 1, 3, 12);
|
||||
this.supportThree = new ModelRenderer(this, 0, 0);
|
||||
this.supportThree.setRotationPoint(4.5F, 21.0F, -6.5F);
|
||||
this.supportThree.addBox(0.0F, 0.0F, 0.0F, 2, 3, 2);
|
||||
}
|
||||
|
||||
public void render(float f){
|
||||
this.supportTwo.render(f);
|
||||
this.wallTwo.render(f);
|
||||
this.floor.render(f);
|
||||
this.rimThree.render(f);
|
||||
this.wallThree.render(f);
|
||||
this.rimTwo.render(f);
|
||||
this.rimOne.render(f);
|
||||
this.supportOne.render(f);
|
||||
this.wallOne.render(f);
|
||||
this.supportFour.render(f);
|
||||
this.wallFour.render(f);
|
||||
this.rimFour.render(f);
|
||||
this.supportThree.render(f);
|
||||
}
|
||||
}
|
|
@ -1,76 +0,0 @@
|
|||
package ellpeck.someprettytechystuff.blocks.models;
|
||||
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
public class ModelCrucibleFire extends ModelBaseG{
|
||||
public ModelRenderer floor, wallOne, wallTwo, wallThree, wallFour, supportOne, supportTwo, supportThree, supportFour, outsideSupOne, outsideSupTwo, outsideSupThree, outsideSupFour, topFloor, floorBlock;
|
||||
|
||||
public ModelCrucibleFire() {
|
||||
this.textureWidth = 64;
|
||||
this.textureHeight = 64;
|
||||
this.wallFour = new ModelRenderer(this, 0, 0);
|
||||
this.wallFour.setRotationPoint(-4.5F, 15.0F, 4.5F);
|
||||
this.wallFour.addBox(0.0F, 0.0F, 0.0F, 9, 3, 1);
|
||||
this.outsideSupFour = new ModelRenderer(this, 0, 30);
|
||||
this.outsideSupFour.setRotationPoint(-8.0F, 9.0F, 6.0F);
|
||||
this.outsideSupFour.addBox(0.0F, 0.0F, 0.0F, 2, 15, 2);
|
||||
this.supportFour = new ModelRenderer(this, 0, 0);
|
||||
this.supportFour.setRotationPoint(3.5F, 19.0F, -4.5F);
|
||||
this.supportFour.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1);
|
||||
this.outsideSupThree = new ModelRenderer(this, 0, 30);
|
||||
this.outsideSupThree.setRotationPoint(-8.0F, 9.0F, -8.0F);
|
||||
this.outsideSupThree.addBox(0.0F, 0.0F, 0.0F, 2, 15, 2);
|
||||
this.outsideSupOne = new ModelRenderer(this, 0, 30);
|
||||
this.outsideSupOne.setRotationPoint(6.0F, 9.0F, 6.0F);
|
||||
this.outsideSupOne.addBox(0.0F, 0.0F, 0.0F, 2, 15, 2);
|
||||
this.floorBlock = new ModelRenderer(this, 0, 17);
|
||||
this.floorBlock.setRotationPoint(-5.0F, 21.0F, -5.0F);
|
||||
this.floorBlock.addBox(0.0F, 0.0F, 0.0F, 10, 3, 10);
|
||||
this.wallOne = new ModelRenderer(this, 0, 0);
|
||||
this.wallOne.setRotationPoint(4.5F, 15.0F, -5.5F);
|
||||
this.wallOne.addBox(0.0F, 0.0F, 0.0F, 1, 3, 11);
|
||||
this.wallTwo = new ModelRenderer(this, 0, 0);
|
||||
this.wallTwo.setRotationPoint(-5.5F, 15.0F, -5.5F);
|
||||
this.wallTwo.addBox(0.0F, 0.0F, 0.0F, 1, 3, 11);
|
||||
this.supportOne = new ModelRenderer(this, 0, 0);
|
||||
this.supportOne.setRotationPoint(3.5F, 19.0F, 3.5F);
|
||||
this.supportOne.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1);
|
||||
this.wallThree = new ModelRenderer(this, 0, 0);
|
||||
this.wallThree.setRotationPoint(-4.5F, 15.0F, -5.5F);
|
||||
this.wallThree.addBox(0.0F, 0.0F, 0.0F, 9, 3, 1);
|
||||
this.outsideSupTwo = new ModelRenderer(this, 0, 30);
|
||||
this.outsideSupTwo.setRotationPoint(6.0F, 9.0F, -8.0F);
|
||||
this.outsideSupTwo.addBox(0.0F, 0.0F, 0.0F, 2, 15, 2);
|
||||
this.floor = new ModelRenderer(this, 0, 0);
|
||||
this.floor.mirror = true;
|
||||
this.floor.setRotationPoint(-4.5F, 18.0F, -4.5F);
|
||||
this.floor.addBox(0.0F, 0.0F, 0.0F, 9, 1, 9);
|
||||
this.supportThree = new ModelRenderer(this, 0, 0);
|
||||
this.supportThree.setRotationPoint(-4.5F, 19.0F, -4.5F);
|
||||
this.supportThree.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1);
|
||||
this.topFloor = new ModelRenderer(this, 0, 30);
|
||||
this.topFloor.setRotationPoint(-8.0F, 8.0F, -8.0F);
|
||||
this.topFloor.addBox(0.0F, 0.0F, 0.0F, 16, 1, 16);
|
||||
this.supportTwo = new ModelRenderer(this, 0, 0);
|
||||
this.supportTwo.setRotationPoint(-4.5F, 19.0F, 3.5F);
|
||||
this.supportTwo.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1);
|
||||
}
|
||||
|
||||
public void render(float f){
|
||||
this.wallFour.render(f);
|
||||
this.outsideSupFour.render(f);
|
||||
this.supportFour.render(f);
|
||||
this.outsideSupThree.render(f);
|
||||
this.outsideSupOne.render(f);
|
||||
this.floorBlock.render(f);
|
||||
this.wallOne.render(f);
|
||||
this.wallTwo.render(f);
|
||||
this.supportOne.render(f);
|
||||
this.wallThree.render(f);
|
||||
this.outsideSupTwo.render(f);
|
||||
this.floor.render(f);
|
||||
this.supportThree.render(f);
|
||||
this.topFloor.render(f);
|
||||
this.supportTwo.render(f);
|
||||
}
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
package ellpeck.someprettytechystuff.blocks.models;
|
||||
|
||||
import ellpeck.someprettytechystuff.util.Util;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class RendererCrucible extends TileEntitySpecialRenderer{
|
||||
|
||||
public static final ResourceLocation resLoc = new ResourceLocation(Util.MOD_ID, "textures/blocks/models/modelCrucible.png");
|
||||
private ModelCrucible model;
|
||||
|
||||
public RendererCrucible(){
|
||||
this.model = new ModelCrucible();
|
||||
}
|
||||
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float par5) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
||||
GL11.glRotatef(180, 0F, 0F, 1F);
|
||||
this.bindTexture(resLoc);
|
||||
GL11.glPushMatrix();
|
||||
this.model.render(0.0625F);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
package ellpeck.someprettytechystuff.blocks.models;
|
||||
|
||||
import ellpeck.someprettytechystuff.util.Util;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class RendererCrucibleFire extends TileEntitySpecialRenderer{
|
||||
|
||||
public static final ResourceLocation resLoc = new ResourceLocation(Util.MOD_ID, "textures/blocks/models/modelCrucibleFire.png");
|
||||
private ModelCrucibleFire model;
|
||||
|
||||
public RendererCrucibleFire(){
|
||||
this.model = new ModelCrucibleFire();
|
||||
}
|
||||
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float par5) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
||||
GL11.glRotatef(180, 0F, 0F, 1F);
|
||||
this.bindTexture(resLoc);
|
||||
GL11.glPushMatrix();
|
||||
this.model.render(0.0625F);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
|
@ -1,73 +0,0 @@
|
|||
package ellpeck.someprettytechystuff.blocks.models;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class RendererHoldingTileEntity implements IItemRenderer {
|
||||
|
||||
ModelBaseG model;
|
||||
ResourceLocation texture;
|
||||
|
||||
public RendererHoldingTileEntity(ModelBaseG model, ResourceLocation res){
|
||||
this.model = model;
|
||||
texture = res;
|
||||
}
|
||||
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data){
|
||||
switch(type){
|
||||
case INVENTORY:
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glTranslatef(-0.5F, -1.27F, 0.5F);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
model.render(0.0625F);
|
||||
GL11.glPopMatrix();
|
||||
break;
|
||||
|
||||
case EQUIPPED:
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glTranslatef(0.6F, -1.2F, -0.0F);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
model.render(0.0625F);
|
||||
GL11.glPopMatrix();
|
||||
break;
|
||||
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(1.2F, 1.2F, 1.2F);
|
||||
GL11.glRotatef(180, 2F, -0F, 0.1F);
|
||||
GL11.glTranslatef(1.5F, -1.2F, -0.3F);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
model.render(0.0625F);
|
||||
GL11.glPopMatrix();
|
||||
break;
|
||||
|
||||
default:
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(1.2F, 1.2F, 1.2F);
|
||||
GL11.glRotatef(180, 2F, -0F, 0.1F);
|
||||
GL11.glTranslatef(0F, -1.2F, 0F);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
model.render(0.0625F);
|
||||
GL11.glPopMatrix();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
package ellpeck.someprettytechystuff.booklet;
|
||||
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
public class Chapter{
|
||||
|
||||
public final int ID;
|
||||
public final String name;
|
||||
public final int pageAmount;
|
||||
public final boolean hasCraftingRecipe;
|
||||
public String[] pageTexts;
|
||||
|
||||
public Chapter(int ID, String name, int pageAmount, boolean hasCraftingRecipe){
|
||||
this.ID = ID;
|
||||
this.name = name + "Chapter";
|
||||
this.pageAmount = pageAmount;
|
||||
this.hasCraftingRecipe = hasCraftingRecipe;
|
||||
this.pageTexts = new String[pageAmount];
|
||||
for(int i = 0; i < pageTexts.length; i++){
|
||||
this.pageTexts[i] = StatCollector.translateToLocal("infoBook." + this.name + ".page" + i + ".text");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
package ellpeck.someprettytechystuff.booklet;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class ChapterList{
|
||||
|
||||
public static ArrayList<Chapter> chapterList = new ArrayList<Chapter>();
|
||||
|
||||
public static void init(){
|
||||
chapterList.add(new Chapter(0, "crucible", 1, false));
|
||||
chapterList.add(new Chapter(1, "crucibleFire", 2, false));
|
||||
chapterList.add(new Chapter(2, "gems", 4, false));
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package ellpeck.someprettytechystuff.booklet;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
|
||||
public class ContainerInfoBook extends Container {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public ContainerInfoBook(EntityPlayer player){
|
||||
|
||||
}
|
||||
|
||||
public boolean canInteractWith(EntityPlayer player){
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,163 +0,0 @@
|
|||
package ellpeck.someprettytechystuff.booklet;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.someprettytechystuff.util.Util;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class GuiInfoBook extends GuiScreen{
|
||||
|
||||
public static final ResourceLocation resLoc = new ResourceLocation(Util.MOD_ID, "textures/gui/guiInfoBook.png");
|
||||
public static final ResourceLocation fontLocation = new ResourceLocation("textures/font/ascii.png");
|
||||
|
||||
public final int xSize = 180;
|
||||
public final int ySize = 180;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public final FontRenderer thisRenderer = new FontRenderer(Minecraft.getMinecraft().gameSettings, fontLocation, Minecraft.getMinecraft().renderEngine, true);
|
||||
|
||||
public Chapter mainChapter = new Chapter(-1, "main", 1, false);
|
||||
|
||||
public int currentPage = 0;
|
||||
public Chapter currentChapter = mainChapter;
|
||||
|
||||
public ChangePageButton nextPageButton;
|
||||
public ChangePageButton prevPageButton;
|
||||
public ChangePageButton mainPageButton;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public GuiInfoBook(EntityPlayer player){
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public void initGui(){
|
||||
this.buttonList.clear();
|
||||
|
||||
int xPos = (this.width-this.xSize)/2;
|
||||
int yPos = (this.height-this.ySize)/2;
|
||||
|
||||
this.addMainChapterButtons();
|
||||
this.nextPageButton = new ChangePageButton(-3, xPos+180, yPos+170);
|
||||
this.prevPageButton = new ChangePageButton(-2, xPos-18, yPos+170);
|
||||
this.mainPageButton = new ChangePageButton(-1, xPos, yPos-15);
|
||||
this.buttonList.add(nextPageButton);
|
||||
this.buttonList.add(prevPageButton);
|
||||
this.buttonList.add(mainPageButton);
|
||||
|
||||
this.updateButtons();
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public void addMainChapterButtons(){
|
||||
int xPos = (this.width-this.xSize)/2;
|
||||
int yPos = (this.height-this.ySize)/2;
|
||||
|
||||
int size = ChapterList.chapterList.size();
|
||||
for(int i = 0; i < size; i++) {
|
||||
this.buttonList.add(new InvisiButton(i, xPos + 20, yPos + 15 + 11 * i, 145, 10, StatCollector.translateToLocal("infoBook." + ChapterList.chapterList.get(i).name + ".title"), this.thisRenderer));
|
||||
}
|
||||
}
|
||||
|
||||
public void updateButtons(){
|
||||
this.nextPageButton.visible = this.currentPage < this.currentChapter.pageAmount-1;
|
||||
this.prevPageButton.visible = this.currentPage > 0;
|
||||
this.mainPageButton.visible = this.currentChapter != this.mainChapter;
|
||||
for(int i = 0; i < ChapterList.chapterList.size(); i++){
|
||||
((GuiButton)this.buttonList.get(i)).visible = this.currentChapter == mainChapter;
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("static-access")
|
||||
public void actionPerformed(GuiButton button){
|
||||
if(button == this.nextPageButton) this.currentPage++;
|
||||
else if(button == this.prevPageButton) this.currentPage--;
|
||||
else if(button == this.mainPageButton){
|
||||
this.currentPage = 0;
|
||||
this.currentChapter = this.mainChapter;
|
||||
}
|
||||
else this.currentChapter = ChapterList.chapterList.get(button.id);
|
||||
this.updateButtons();
|
||||
}
|
||||
|
||||
public void drawScreen(int x, int y, float f){
|
||||
this.drawDefaultBackground();
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
|
||||
int xPos = (this.width-this.xSize)/2;
|
||||
int yPos = (this.height-this.ySize)/2;
|
||||
|
||||
this.mc.getTextureManager().bindTexture(resLoc);
|
||||
this.drawTexturedModalRect(xPos, yPos, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
this.drawPageContents();
|
||||
|
||||
super.drawScreen(x, y, f);
|
||||
}
|
||||
|
||||
public void drawPageContents(){
|
||||
int xPos = (this.width-this.xSize)/2;
|
||||
int yPos = (this.height-this.ySize)/2;
|
||||
|
||||
if(this.currentChapter != this.mainChapter) this.thisRenderer.drawSplitString(this.currentChapter.pageTexts[this.currentPage], xPos + 15, yPos + 14, 150, 0);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
static class ChangePageButton extends GuiButton{
|
||||
/**
|
||||
* Type of the button
|
||||
* -3: Next Page
|
||||
* -2: Previous Page
|
||||
* -1: Back to main Page
|
||||
*/
|
||||
private final int buttonType;
|
||||
|
||||
public ChangePageButton(int ID, int x, int y){
|
||||
super(ID, x, y, 18, ID == -1 ? 14 : 10, "");
|
||||
this.buttonType = ID;
|
||||
}
|
||||
|
||||
public void drawButton(Minecraft mc, int mouseX, int mouseY){
|
||||
if (this.visible){
|
||||
boolean isHoverOver = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
mc.getTextureManager().bindTexture(GuiInfoBook.resLoc);
|
||||
|
||||
int posX = 0;
|
||||
int posY = 180;
|
||||
if(this.buttonType == -2) posY += 10;
|
||||
else if(this.buttonType == -1) posY += 20;
|
||||
if(isHoverOver) posX += 18;
|
||||
this.drawTexturedModalRect(this.xPosition, this.yPosition, posX, posY, 18, this.buttonType == -1 ? 14 : 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
static class InvisiButton extends GuiButton{
|
||||
private FontRenderer renderer;
|
||||
public InvisiButton(int ID, int x, int y, int width, int height, String text, FontRenderer renderer){
|
||||
super(ID, x, y, width, height, text);
|
||||
this.renderer = renderer;
|
||||
}
|
||||
|
||||
public void drawButton(Minecraft mc, int mouseX, int mouseY){
|
||||
if (this.visible){
|
||||
boolean isHoverOver = false;
|
||||
if(mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height) isHoverOver = true;
|
||||
this.renderer.drawString((isHoverOver ? ((char) 167 + "2" + (char) 167 + "n") : "") + this.displayString, this.xPosition, this.yPosition + (this.height - 8) / 2, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean doesGuiPauseGame(){
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
package ellpeck.someprettytechystuff.booklet;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.someprettytechystuff.Gemification;
|
||||
import ellpeck.someprettytechystuff.creative.CreativeTab;
|
||||
import ellpeck.someprettytechystuff.inventory.GuiHandler;
|
||||
import ellpeck.someprettytechystuff.util.Util;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemInfoBook extends Item {
|
||||
|
||||
public ItemInfoBook(){
|
||||
this.setCreativeTab(CreativeTab.instance);
|
||||
this.setUnlocalizedName("itemInfoBook");
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||
if(Util.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + this.getUnlocalizedName().substring(5) + ".desc"));
|
||||
else list.add(Util.shiftForInfo());
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(ItemStack stack){
|
||||
return this.getUnlocalizedName();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconReg){
|
||||
this.itemIcon = iconReg.registerIcon(Util.MOD_ID + ":" + this.getUnlocalizedName().substring(5));
|
||||
}
|
||||
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){
|
||||
if (!world.isRemote){
|
||||
player.openGui(Gemification.instance, GuiHandler.guiInfoBook, world, (int)player.posX, (int)player.posY, (int)player.posZ);
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
}
|
|
@ -1,109 +0,0 @@
|
|||
package ellpeck.someprettytechystuff.crafting;
|
||||
|
||||
import ellpeck.someprettytechystuff.util.GemType;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class CrucibleCraftingManager{
|
||||
|
||||
public static final CrucibleCraftingManager instance = new CrucibleCraftingManager();
|
||||
public static ArrayList<CrucibleRecipe> recipes = new ArrayList<CrucibleRecipe>();
|
||||
|
||||
@SuppressWarnings("unchecked, static-access")
|
||||
public void addRecipe(ItemStack output, GemType fluidNeeded, int processTimeNeeded, Object ... recipe){
|
||||
String s = "";
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
int k = 0;
|
||||
|
||||
if (recipe[i] instanceof String[]){
|
||||
String[] strg = ((String[])recipe[i++]);
|
||||
for(String s1 : strg) {
|
||||
k++;
|
||||
j = s1.length();
|
||||
s = s + s1;
|
||||
}
|
||||
}
|
||||
else{
|
||||
while (recipe[i] instanceof String){
|
||||
String s2 = (String)recipe[i++];
|
||||
k++;
|
||||
j = s2.length();
|
||||
s = s + s2;
|
||||
}
|
||||
}
|
||||
|
||||
HashMap map;
|
||||
for (map = new HashMap(); i < recipe.length; i += 2){
|
||||
Character character = (Character)recipe[i];
|
||||
ItemStack stack1 = null;
|
||||
|
||||
if (recipe[i + 1] instanceof Item){
|
||||
stack1 = new ItemStack((Item)recipe[i + 1], 1, OreDictionary.WILDCARD_VALUE);
|
||||
}
|
||||
else if (recipe[i + 1] instanceof Block){
|
||||
stack1 = new ItemStack((Block)recipe[i + 1], 1, OreDictionary.WILDCARD_VALUE);
|
||||
}
|
||||
else if (recipe[i + 1] instanceof ItemStack){
|
||||
stack1 = (ItemStack)recipe[i + 1];
|
||||
}
|
||||
map.put(character, stack1);
|
||||
}
|
||||
|
||||
ItemStack[] stack2 = new ItemStack[j * k];
|
||||
for (int i1 = 0; i1 < j * k; ++i1){
|
||||
char c0 = s.charAt(i1);
|
||||
if (map.containsKey(Character.valueOf(c0))){
|
||||
stack2[i1] = ((ItemStack)map.get(Character.valueOf(c0))).copy();
|
||||
}
|
||||
else{
|
||||
stack2[i1] = null;
|
||||
}
|
||||
}
|
||||
this.recipes.add(new CrucibleRecipe(stack2, output, fluidNeeded, processTimeNeeded));
|
||||
}
|
||||
|
||||
@SuppressWarnings("static-access")
|
||||
public ItemStack getCraftingResult(ItemStack[] slots, int minSlot, int maxSlot, GemType currentFluid){
|
||||
CrucibleRecipe matchingRecipe = this.matchingRecipe(slots, minSlot, maxSlot);
|
||||
if(matchingRecipe != null){
|
||||
if (currentFluid == matchingRecipe.fluidNeeded){
|
||||
return matchingRecipe.recipeOutput;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@SuppressWarnings("static-access")
|
||||
public int getProcessTimeNeeded(ItemStack[] slots, int minSlot, int maxSlot){
|
||||
CrucibleRecipe matchingRecipe = this.matchingRecipe(slots, minSlot, maxSlot);
|
||||
if(matchingRecipe != null){
|
||||
return matchingRecipe.processTimeNeeded;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@SuppressWarnings("static-access")
|
||||
public CrucibleRecipe matchingRecipe(ItemStack[] slots, int minSlot, int maxSlot){
|
||||
for (CrucibleRecipe recipe : this.recipes){
|
||||
ItemStack[] inputs = recipe.recipeItems;
|
||||
int k = 0;
|
||||
for (int j = 0; j < maxSlot - minSlot + 1; j++){
|
||||
if (slots[minSlot + j] != null && inputs[j] != null && slots[minSlot + j].getItem() == inputs[j].getItem()){
|
||||
if(inputs[j].getItemDamage() == OreDictionary.WILDCARD_VALUE || inputs[j].getItemDamage() == slots[minSlot + j].getItemDamage()) {
|
||||
k++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (k == maxSlot - minSlot + 1){
|
||||
return recipe;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package ellpeck.someprettytechystuff.crafting;
|
||||
|
||||
import ellpeck.someprettytechystuff.util.GemType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class CrucibleRecipe{
|
||||
|
||||
public final ItemStack[] recipeItems;
|
||||
public final ItemStack recipeOutput;
|
||||
public final GemType fluidNeeded;
|
||||
public final int processTimeNeeded;
|
||||
|
||||
public CrucibleRecipe(ItemStack[] items, ItemStack output, GemType fluid, int processTimeNeeded){
|
||||
this.recipeItems = items;
|
||||
this.recipeOutput = output;
|
||||
this.fluidNeeded = fluid;
|
||||
this.processTimeNeeded = processTimeNeeded;
|
||||
}
|
||||
}
|
|
@ -1,38 +1,9 @@
|
|||
package ellpeck.someprettytechystuff.crafting;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import ellpeck.someprettytechystuff.blocks.InitBlocks;
|
||||
import ellpeck.someprettytechystuff.items.InitItems;
|
||||
import ellpeck.someprettytechystuff.util.Util;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class InitCrafting {
|
||||
|
||||
public static void init(){
|
||||
GameRegistry.addRecipe(new ItemStack(InitBlocks.blockCrucible), "i i", "gcg", "iii", 'i', Items.iron_ingot, 'g', new ItemStack(InitItems.itemGem, 1, OreDictionary.WILDCARD_VALUE), 'c', Items.cauldron);
|
||||
GameRegistry.addRecipe(new ItemStack(InitBlocks.blockCrucibleFire), "ccc", "cac", "csc", 'c', Blocks.cobblestone, 'a', Items.cauldron, 's', Blocks.stone_slab);
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemInfoBook), new ItemStack(Items.book), new ItemStack(InitItems.itemGem, 1, OreDictionary.WILDCARD_VALUE));
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Items.iron_ingot), "xx", "xx", 'x', new ItemStack(InitItems.itemPile, 1, 0));
|
||||
GameRegistry.addRecipe(new ItemStack(Items.gold_ingot), "xx", "xx", 'x', new ItemStack(InitItems.itemPile, 1, 1));
|
||||
GameRegistry.addRecipe(new ItemStack(Items.redstone), "xx", "xx", 'x', new ItemStack(InitItems.itemPile, 1, 2));
|
||||
GameRegistry.addRecipe(new ItemStack(Items.diamond), "xx", "xx", 'x', new ItemStack(InitItems.itemPile, 1, 3));
|
||||
GameRegistry.addRecipe(new ItemStack(InitItems.itemPile, 8, 0), "x", "x", 'x', new ItemStack(Items.iron_ingot));
|
||||
GameRegistry.addRecipe(new ItemStack(InitItems.itemPile, 8, 1), "x", "x", 'x', new ItemStack(Items.gold_ingot));
|
||||
GameRegistry.addRecipe(new ItemStack(InitItems.itemPile, 8, 2), "x", "x", 'x', new ItemStack(Items.redstone));
|
||||
GameRegistry.addRecipe(new ItemStack(InitItems.itemPile, 8, 3), "x", "x", 'x', new ItemStack(Items.diamond));
|
||||
|
||||
CrucibleCraftingManager.instance.addRecipe(new ItemStack(Blocks.acacia_stairs), Util.chromeDiopside, 200, "ccc", "cgc", "ccc", 'c', Blocks.cobblestone, 'g', Items.stick);
|
||||
|
||||
CrucibleCraftingManager.instance.addRecipe(new ItemStack(InitItems.itemInfusedIronIngot), Util.goshenite, 500, "gig", "idi", "gig", 'g', new ItemStack(InitItems.itemGem, 1, OreDictionary.WILDCARD_VALUE), 'i', Items.iron_ingot, 'd', Items.diamond);
|
||||
CrucibleCraftingManager.instance.addRecipe(new ItemStack(InitItems.itemInfusedIronAxe), Util.chromeDiopside, 1000, "gig", "iai", "gig", 'g', new ItemStack(InitItems.itemGem, 1, OreDictionary.WILDCARD_VALUE), 'i', InitItems.itemInfusedIronIngot, 'a', Items.iron_axe);
|
||||
CrucibleCraftingManager.instance.addRecipe(new ItemStack(InitItems.itemInfusedIronHoe), Util.jasper, 1000, "gig", "iai", "gig", 'g', new ItemStack(InitItems.itemGem, 1, OreDictionary.WILDCARD_VALUE), 'i', InitItems.itemInfusedIronIngot, 'a', Items.iron_hoe);
|
||||
CrucibleCraftingManager.instance.addRecipe(new ItemStack(InitItems.itemInfusedIronPickaxe), Util.hematite, 1000, "gig", "iai", "gig", 'g', new ItemStack(InitItems.itemGem, 1, OreDictionary.WILDCARD_VALUE), 'i', InitItems.itemInfusedIronIngot, 'a', Items.iron_pickaxe);
|
||||
CrucibleCraftingManager.instance.addRecipe(new ItemStack(InitItems.itemInfusedIronShovel), Util.tourmaline, 1000, "gig", "iai", "gig", 'g', new ItemStack(InitItems.itemGem, 1, OreDictionary.WILDCARD_VALUE), 'i', InitItems.itemInfusedIronIngot, 'a', Items.iron_shovel);
|
||||
CrucibleCraftingManager.instance.addRecipe(new ItemStack(InitItems.itemInfusedIronSword), Util.almandineGarnet, 1000, "gig", "iai", "gig", 'g', new ItemStack(InitItems.itemGem, 1, OreDictionary.WILDCARD_VALUE), 'i', InitItems.itemInfusedIronIngot, 'a', Items.iron_sword);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,10 +2,7 @@ package ellpeck.someprettytechystuff.gen;
|
|||
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import ellpeck.someprettytechystuff.blocks.InitBlocks;
|
||||
import ellpeck.someprettytechystuff.util.Util;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
|
@ -31,9 +28,7 @@ public class OreGen implements IWorldGenerator {
|
|||
}
|
||||
|
||||
private void generateSurface(World world, Random random, int x, int z){
|
||||
for(int i = 0; i < Util.gemList.size(); i++) {
|
||||
this.addOreSpawn(InitBlocks.oreGem, i, Blocks.stone, world, random, x, z, 4 + random.nextInt(3), 6, 1, 70);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
|
|
|
@ -2,35 +2,16 @@ package ellpeck.someprettytechystuff.inventory;
|
|||
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import ellpeck.someprettytechystuff.Gemification;
|
||||
import ellpeck.someprettytechystuff.booklet.ContainerInfoBook;
|
||||
import ellpeck.someprettytechystuff.booklet.GuiInfoBook;
|
||||
import ellpeck.someprettytechystuff.inventory.container.ContainerCrucible;
|
||||
import ellpeck.someprettytechystuff.inventory.container.ContainerCrucibleFire;
|
||||
import ellpeck.someprettytechystuff.inventory.gui.GuiCrucible;
|
||||
import ellpeck.someprettytechystuff.inventory.gui.GuiCrucibleFire;
|
||||
import ellpeck.someprettytechystuff.SPTS;
|
||||
import ellpeck.someprettytechystuff.tile.TileEntityBase;
|
||||
import ellpeck.someprettytechystuff.tile.TileEntityCrucible;
|
||||
import ellpeck.someprettytechystuff.tile.TileEntityCrucibleFire;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class GuiHandler implements IGuiHandler {
|
||||
|
||||
public static final int guiCrucible = 0;
|
||||
public static final int guiCrucibleFire = 1;
|
||||
public static final int guiInfoBook = 2;
|
||||
|
||||
public Object getServerGuiElement(int id, EntityPlayer entityPlayer, World world, int x, int y, int z) {
|
||||
TileEntityBase tile = (TileEntityBase)world.getTileEntity(x, y, z);
|
||||
switch (id) {
|
||||
case guiCrucible:
|
||||
return new ContainerCrucible(entityPlayer.inventory, (TileEntityCrucible)tile);
|
||||
case guiCrucibleFire:
|
||||
return new ContainerCrucibleFire(entityPlayer.inventory, (TileEntityCrucibleFire)tile);
|
||||
case guiInfoBook:
|
||||
return new ContainerInfoBook(entityPlayer);
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
@ -39,19 +20,12 @@ public class GuiHandler implements IGuiHandler {
|
|||
public Object getClientGuiElement(int id, EntityPlayer entityPlayer, World world, int x, int y, int z) {
|
||||
TileEntityBase tile = (TileEntityBase)world.getTileEntity(x, y, z);
|
||||
switch (id) {
|
||||
case guiCrucible:
|
||||
return new GuiCrucible(entityPlayer.inventory, (TileEntityCrucible)tile);
|
||||
case guiCrucibleFire:
|
||||
return new GuiCrucibleFire(entityPlayer.inventory, (TileEntityCrucibleFire)tile);
|
||||
case guiInfoBook:
|
||||
return new GuiInfoBook(entityPlayer);
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static void init(){
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(Gemification.instance, new GuiHandler());
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(SPTS.instance, new GuiHandler());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,101 +0,0 @@
|
|||
package ellpeck.someprettytechystuff.inventory.container;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.someprettytechystuff.tile.TileEntityCrucible;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.inventory.SlotFurnace;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerCrucible extends Container {
|
||||
|
||||
private TileEntityCrucible tileCrucible;
|
||||
|
||||
private int lastCurrentFluidID;
|
||||
private int lastProcessTime;
|
||||
private int lastProcessTimeNeeded;
|
||||
private int lastBurnTime;
|
||||
private int lastBurnTimeOfItem;
|
||||
|
||||
public ContainerCrucible(InventoryPlayer inventoryPlayer, TileEntityCrucible tileCrucible) {
|
||||
this.tileCrucible = tileCrucible;
|
||||
|
||||
this.addSlotToContainer(new Slot(this.tileCrucible, tileCrucible.slotMainInput-4, 32, 23));
|
||||
this.addSlotToContainer(new Slot(this.tileCrucible, tileCrucible.slotMainInput-3, 57, 18));
|
||||
this.addSlotToContainer(new Slot(this.tileCrucible, tileCrucible.slotMainInput-2, 82, 23));
|
||||
this.addSlotToContainer(new Slot(this.tileCrucible, tileCrucible.slotMainInput-1, 27, 48));
|
||||
this.addSlotToContainer(new Slot(this.tileCrucible, tileCrucible.slotMainInput, 57, 48));
|
||||
this.addSlotToContainer(new Slot(this.tileCrucible, tileCrucible.slotMainInput+1, 87, 48));
|
||||
this.addSlotToContainer(new Slot(this.tileCrucible, tileCrucible.slotMainInput+2, 32, 73));
|
||||
this.addSlotToContainer(new Slot(this.tileCrucible, tileCrucible.slotMainInput+3, 57, 78));
|
||||
this.addSlotToContainer(new Slot(this.tileCrucible, tileCrucible.slotMainInput+4, 82, 73));
|
||||
|
||||
this.addSlotToContainer(new Slot(tileCrucible, tileCrucible.slotSmeltGem, 129, 37));
|
||||
this.addSlotToContainer(new Slot(tileCrucible, tileCrucible.slotWater, 149, 37));
|
||||
|
||||
this.addSlotToContainer(new SlotFurnace(inventoryPlayer.player, this.tileCrucible, tileCrucible.slotOutput, 146, 85));
|
||||
|
||||
for (int i = 0; i < 3; ++i){
|
||||
for (int j = 0; j < 9; ++j){
|
||||
this.addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 113 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 9; ++i){
|
||||
this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 171));
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return tileCrucible.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
public void addCraftingToCrafters(ICrafting iCraft){
|
||||
super.addCraftingToCrafters(iCraft);
|
||||
|
||||
iCraft.sendProgressBarUpdate(this, 0, this.tileCrucible.currentFluidID);
|
||||
iCraft.sendProgressBarUpdate(this, 1, this.tileCrucible.currentProcessTime);
|
||||
iCraft.sendProgressBarUpdate(this, 2, this.tileCrucible.processTimeNeeded);
|
||||
iCraft.sendProgressBarUpdate(this, 3, this.tileCrucible.burnTime);
|
||||
iCraft.sendProgressBarUpdate(this, 4, this.tileCrucible.burnTimeOfItem);
|
||||
}
|
||||
|
||||
public void detectAndSendChanges(){
|
||||
super.detectAndSendChanges();
|
||||
for (Object crafter : this.crafters) {
|
||||
ICrafting iCraft = (ICrafting) crafter;
|
||||
|
||||
if (this.lastCurrentFluidID != this.tileCrucible.currentFluidID) iCraft.sendProgressBarUpdate(this, 0, this.tileCrucible.currentFluidID);
|
||||
if (this.lastProcessTime != this.tileCrucible.currentProcessTime) iCraft.sendProgressBarUpdate(this, 1, this.tileCrucible.currentProcessTime);
|
||||
if (this.lastProcessTimeNeeded != this.tileCrucible.processTimeNeeded) iCraft.sendProgressBarUpdate(this, 2, this.tileCrucible.processTimeNeeded);
|
||||
if (this.lastBurnTime != this.tileCrucible.burnTime) iCraft.sendProgressBarUpdate(this, 3, this.tileCrucible.burnTime);
|
||||
if (this.lastBurnTimeOfItem != this.tileCrucible.burnTimeOfItem) iCraft.sendProgressBarUpdate(this, 4, this.tileCrucible.burnTimeOfItem);
|
||||
}
|
||||
|
||||
this.lastCurrentFluidID = this.tileCrucible.currentFluidID;
|
||||
this.lastProcessTime = this.tileCrucible.currentProcessTime;
|
||||
this.lastProcessTimeNeeded = this.tileCrucible.processTimeNeeded;
|
||||
this.lastBurnTime = this.tileCrucible.burnTime;
|
||||
this.lastBurnTimeOfItem = this.tileCrucible.burnTimeOfItem;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void updateProgressBar(int par1, int par2){
|
||||
if (par1 == 0) this.tileCrucible.currentFluidID = par2;
|
||||
if (par1 == 1) this.tileCrucible.currentProcessTime = par2;
|
||||
if (par1 == 2) this.tileCrucible.processTimeNeeded = par2;
|
||||
if (par1 == 3) this.tileCrucible.burnTime = par2;
|
||||
if (par1 == 4) this.tileCrucible.burnTimeOfItem = par2;
|
||||
}
|
||||
|
||||
//TODO Add transferStackInSlot()
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int slotNumber) {
|
||||
Slot slot = (Slot)this.inventorySlots.get(slotNumber);
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
package ellpeck.someprettytechystuff.inventory.container;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.someprettytechystuff.tile.TileEntityCrucibleFire;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerCrucibleFire extends Container {
|
||||
|
||||
private TileEntityCrucibleFire tileCrucibleFire;
|
||||
|
||||
private int lastBurnTime;
|
||||
private int lastBurnTimeOfItem;
|
||||
|
||||
public ContainerCrucibleFire(InventoryPlayer inventoryPlayer, TileEntityCrucibleFire tileCrucibleFire) {
|
||||
this.tileCrucibleFire = tileCrucibleFire;
|
||||
|
||||
this.addSlotToContainer(new Slot(this.tileCrucibleFire, 0, 70, 9));
|
||||
|
||||
for (int i = 0; i < 3; ++i){
|
||||
for (int j = 0; j < 9; ++j){
|
||||
this.addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 34 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 9; ++i){
|
||||
this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 92));
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return tileCrucibleFire.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
public void addCraftingToCrafters(ICrafting iCraft){
|
||||
super.addCraftingToCrafters(iCraft);
|
||||
|
||||
iCraft.sendProgressBarUpdate(this, 0, this.tileCrucibleFire.burnTime);
|
||||
iCraft.sendProgressBarUpdate(this, 1, this.tileCrucibleFire.burnTimeOfItem);
|
||||
}
|
||||
|
||||
public void detectAndSendChanges(){
|
||||
super.detectAndSendChanges();
|
||||
for (Object crafter : this.crafters) {
|
||||
ICrafting iCraft = (ICrafting) crafter;
|
||||
|
||||
if (this.lastBurnTime != this.tileCrucibleFire.burnTime) iCraft.sendProgressBarUpdate(this, 0, this.tileCrucibleFire.burnTime);
|
||||
if (this.lastBurnTimeOfItem != this.tileCrucibleFire.burnTimeOfItem) iCraft.sendProgressBarUpdate(this, 1, this.tileCrucibleFire.burnTimeOfItem);
|
||||
}
|
||||
|
||||
this.lastBurnTime = tileCrucibleFire.burnTime;
|
||||
this.lastBurnTimeOfItem = tileCrucibleFire.burnTimeOfItem;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void updateProgressBar(int par1, int par2){
|
||||
if (par1 == 0) this.tileCrucibleFire.burnTime = par2;
|
||||
if (par1 == 1) this.tileCrucibleFire.burnTimeOfItem = par2;
|
||||
}
|
||||
|
||||
//TODO Add transferStackInSlot()
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int slotNumber) {
|
||||
Slot slot = (Slot)this.inventorySlots.get(slotNumber);
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
package ellpeck.someprettytechystuff.inventory.gui;
|
||||
|
||||
import ellpeck.someprettytechystuff.inventory.container.ContainerCrucible;
|
||||
import ellpeck.someprettytechystuff.tile.TileEntityCrucible;
|
||||
import ellpeck.someprettytechystuff.util.Util;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class GuiCrucible extends GuiContainer{
|
||||
|
||||
private TileEntityCrucible tileCrucible;
|
||||
|
||||
public static final ResourceLocation resLoc = new ResourceLocation(Util.MOD_ID, "textures/gui/guiCrucible.png");
|
||||
|
||||
public GuiCrucible(InventoryPlayer inventoryPlayer, TileEntityCrucible tileCrucible){
|
||||
super(new ContainerCrucible(inventoryPlayer, tileCrucible));
|
||||
this.tileCrucible = tileCrucible;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 195;
|
||||
}
|
||||
|
||||
public void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(resLoc);
|
||||
this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
if(this.tileCrucible.currentProcessTime > 0){
|
||||
int i = this.tileCrucible.getCraftProcessScaled(32);
|
||||
this.drawTexturedModalRect(guiLeft + 107, guiTop + 55, 176, 0, i, 45);
|
||||
}
|
||||
|
||||
if(this.tileCrucible.burnTime > 0 && this.tileCrucible.burnTimeOfItem > 0) {
|
||||
int i = this.tileCrucible.getBurnTimeRemainingScaled(13);
|
||||
this.drawTexturedModalRect(guiLeft + 141, guiTop + 21 + 12 - i, 188, 45 + 12 - i, 14, i + 1);
|
||||
}
|
||||
|
||||
if(this.tileCrucible.currentFluidID == Util.fluidWater.ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 176, 47, 12, 12);
|
||||
else if(this.tileCrucible.currentFluidID == Util.gemList.get(0).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 176, 59, 12, 12);
|
||||
else if(this.tileCrucible.currentFluidID == Util.gemList.get(1).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 188, 59, 12, 12);
|
||||
else if(this.tileCrucible.currentFluidID == Util.gemList.get(2).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 200, 59, 12, 12);
|
||||
else if(this.tileCrucible.currentFluidID == Util.gemList.get(3).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 176, 59+12, 12, 12);
|
||||
else if(this.tileCrucible.currentFluidID == Util.gemList.get(4).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 188, 59+12, 12, 12);
|
||||
else if(this.tileCrucible.currentFluidID == Util.gemList.get(5).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 200, 59+12, 12, 12);
|
||||
else if(this.tileCrucible.currentFluidID == Util.gemList.get(6).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 176, 59+24, 12, 12);
|
||||
else if(this.tileCrucible.currentFluidID == Util.gemList.get(7).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 188, 59+24, 12, 12);
|
||||
else if(this.tileCrucible.currentFluidID == Util.gemList.get(8).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 200, 59+24, 12, 12);
|
||||
else if(this.tileCrucible.currentFluidID == Util.gemList.get(9).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 176, 59+36, 12, 12);
|
||||
else if(this.tileCrucible.currentFluidID == Util.gemList.get(10).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 188, 59+36, 12, 12);
|
||||
else if(this.tileCrucible.currentFluidID == Util.gemList.get(11).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 200, 59+36, 12, 12);
|
||||
else if(this.tileCrucible.currentFluidID == Util.gemList.get(12).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 176, 59+48, 12, 12);
|
||||
else if(this.tileCrucible.currentFluidID == Util.gemList.get(13).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 188, 59+48, 12, 12);
|
||||
else if(this.tileCrucible.currentFluidID == Util.gemList.get(14).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 200, 59+48, 12, 12);
|
||||
else if(this.tileCrucible.currentFluidID == Util.gemList.get(15).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 176, 59+60, 12, 12);
|
||||
}
|
||||
|
||||
@SuppressWarnings("static-access, unchecked")
|
||||
public void drawScreen(int par1, int par2, float par3){
|
||||
super.drawScreen(par1, par2, par3);
|
||||
|
||||
if(tileCrucible.output != null){
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
itemRender.renderItemAndEffectIntoGUI(fontRendererObj, mc.getTextureManager(), tileCrucible.output.copy(), guiLeft + 112, guiTop + 65);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
if(par1 >= 112 + guiLeft && par2 >= 65 + guiTop && par1 <= 112 + 16 + guiLeft && par2 <= 65 + 16 + guiTop){
|
||||
this.drawHoveringText(tileCrucible.output.copy().getTooltip(mc.thePlayer, true), par1, par2, mc.fontRenderer);
|
||||
}
|
||||
}
|
||||
if(par1 >= 141 + guiLeft && par2 >= 7 + guiTop && par1 <= 141+12 + guiLeft && par2 <= 7+12 + guiTop){
|
||||
String fluidType;
|
||||
if(tileCrucible.currentFluidID == Util.fluidWater.ID) fluidType = Util.fluidWater.name.substring(5);
|
||||
else if(tileCrucible.currentFluidID == Util.fluidNone.ID) fluidType = Util.fluidNone.name.substring(5);
|
||||
else fluidType = Util.gemList.get(tileCrucible.currentFluidID).name.substring(5);
|
||||
this.drawHoveringText(Arrays.asList(StatCollector.translateToLocal("tooltip.fluid" + fluidType + ".name")), par1, par2, mc.fontRenderer);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
package ellpeck.someprettytechystuff.inventory.gui;
|
||||
|
||||
import ellpeck.someprettytechystuff.inventory.container.ContainerCrucibleFire;
|
||||
import ellpeck.someprettytechystuff.tile.TileEntityCrucibleFire;
|
||||
import ellpeck.someprettytechystuff.util.Util;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class GuiCrucibleFire extends GuiContainer{
|
||||
|
||||
@SuppressWarnings("all")
|
||||
private TileEntityCrucibleFire tileCrucibleFire;
|
||||
|
||||
public static final ResourceLocation resLoc = new ResourceLocation(Util.MOD_ID, "textures/gui/guiCrucibleFire.png");
|
||||
|
||||
public GuiCrucibleFire(InventoryPlayer inventoryPlayer, TileEntityCrucibleFire tileCrucibleFire){
|
||||
super(new ContainerCrucibleFire(inventoryPlayer, tileCrucibleFire));
|
||||
this.tileCrucibleFire = tileCrucibleFire;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 116;
|
||||
}
|
||||
|
||||
public void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(resLoc);
|
||||
this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
if(this.tileCrucibleFire.burnTime > 0 && this.tileCrucibleFire.burnTimeOfItem > 0) {
|
||||
int i = this.tileCrucibleFire.getBurnTimeRemainingScaled(13);
|
||||
this.drawTexturedModalRect(guiLeft + 96, guiTop + 10 + 12 - i, 176, 12 - i, 14, i + 1);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,67 +1,8 @@
|
|||
package ellpeck.someprettytechystuff.items;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import ellpeck.someprettytechystuff.blocks.InitBlocks;
|
||||
import ellpeck.someprettytechystuff.booklet.ItemInfoBook;
|
||||
import ellpeck.someprettytechystuff.items.tools.*;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Item.ToolMaterial;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
public class InitItems {
|
||||
|
||||
public static Item itemInfoBook;
|
||||
public static Item itemGem;
|
||||
public static Item itemPile;
|
||||
|
||||
public static Item itemSeedIron;
|
||||
public static Item itemSeedGold;
|
||||
public static Item itemSeedRedstone;
|
||||
public static Item itemSeedDiamond;
|
||||
|
||||
public static Item itemInfusedIronIngot;
|
||||
public static Item itemInfusedIronAxe;
|
||||
public static Item itemInfusedIronHoe;
|
||||
public static Item itemInfusedIronPickaxe;
|
||||
public static Item itemInfusedIronShovel;
|
||||
public static Item itemInfusedIronSword;
|
||||
|
||||
public static ToolMaterial infusedIronMaterial = EnumHelper.addToolMaterial("INFUSED_IRON", 3, 2000, 20.0F, 6.0F, 10);
|
||||
|
||||
public static void init(){
|
||||
|
||||
itemInfoBook = new ItemInfoBook();
|
||||
itemGem = new ItemGem();
|
||||
itemPile = new ItemPile();
|
||||
|
||||
itemInfusedIronIngot = new ItemInfusedIron();
|
||||
itemSeedIron = new ItemSeed(InitBlocks.blockCropIron, new ItemStack(itemPile, 1, 0), "itemSeedIron");
|
||||
itemSeedGold = new ItemSeed(InitBlocks.blockCropGold, new ItemStack(itemPile, 1, 1), "itemSeedGold");
|
||||
itemSeedRedstone = new ItemSeed(InitBlocks.blockCropRedstone, new ItemStack(itemPile, 1, 2), "itemSeedRedstone");
|
||||
itemSeedDiamond = new ItemSeed(InitBlocks.blockCropDiamond, new ItemStack(itemPile, 1, 3), "itemSeedDiamond");
|
||||
|
||||
itemInfusedIronAxe = new ItemAxeG(infusedIronMaterial, "itemInfusedIronAxe");
|
||||
itemInfusedIronHoe = new ItemHoeG(infusedIronMaterial, "itemInfusedIronHoe");
|
||||
itemInfusedIronPickaxe = new ItemPickaxeG(infusedIronMaterial, "itemInfusedIronPickaxe");
|
||||
itemInfusedIronShovel = new ItemShovelG(infusedIronMaterial, "itemInfusedIronShovel");
|
||||
itemInfusedIronSword = new ItemSwordG(infusedIronMaterial, "itemInfusedIronSword");
|
||||
|
||||
GameRegistry.registerItem(itemInfoBook, itemInfoBook.getUnlocalizedName().substring(5));
|
||||
GameRegistry.registerItem(itemGem, itemGem.getUnlocalizedName().substring(5));
|
||||
GameRegistry.registerItem(itemPile, itemPile.getUnlocalizedName().substring(5));
|
||||
|
||||
GameRegistry.registerItem(itemSeedIron, itemSeedIron.getUnlocalizedName().substring(5));
|
||||
GameRegistry.registerItem(itemSeedGold, itemSeedGold.getUnlocalizedName().substring(5));
|
||||
GameRegistry.registerItem(itemSeedRedstone, itemSeedRedstone.getUnlocalizedName().substring(5));
|
||||
GameRegistry.registerItem(itemSeedDiamond, itemSeedDiamond.getUnlocalizedName().substring(5));
|
||||
|
||||
GameRegistry.registerItem(itemInfusedIronIngot, itemInfusedIronIngot.getUnlocalizedName().substring(5));
|
||||
GameRegistry.registerItem(itemInfusedIronAxe, itemInfusedIronAxe.getUnlocalizedName().substring(5));
|
||||
GameRegistry.registerItem(itemInfusedIronHoe, itemInfusedIronHoe.getUnlocalizedName().substring(5));
|
||||
GameRegistry.registerItem(itemInfusedIronPickaxe, itemInfusedIronPickaxe.getUnlocalizedName().substring(5));
|
||||
GameRegistry.registerItem(itemInfusedIronShovel, itemInfusedIronShovel.getUnlocalizedName().substring(5));
|
||||
GameRegistry.registerItem(itemInfusedIronSword, itemInfusedIronSword.getUnlocalizedName().substring(5));
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,63 +0,0 @@
|
|||
package ellpeck.someprettytechystuff.items;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.someprettytechystuff.creative.CreativeTab;
|
||||
import ellpeck.someprettytechystuff.util.Util;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemGem extends Item {
|
||||
|
||||
public final IIcon[] textures;
|
||||
|
||||
public ItemGem(){
|
||||
textures = new IIcon[Util.gemList.size()];
|
||||
this.setHasSubtypes(true);
|
||||
this.setCreativeTab(CreativeTab.instance);
|
||||
this.setUnlocalizedName("itemGem");
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||
if(Util.isShiftPressed()){
|
||||
for(int i = 0; i < Util.gemList.size(); i++){
|
||||
if(this.getDamage(stack) == i) list.add(StatCollector.translateToLocal("tooltip.gem" + Util.gemList.get(i).name.substring(5) + ".desc"));
|
||||
}
|
||||
}
|
||||
else list.add(Util.shiftForInfo());
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(ItemStack stack){
|
||||
return this.getUnlocalizedName() + Util.gemList.get(stack.getItemDamage()).name.substring(5);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tabs, List list){
|
||||
for (int i = 0; i < Util.gemList.size(); i++) {
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1){
|
||||
return textures[par1];
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconReg){
|
||||
for (int i = 0; i < Util.gemList.size(); i++) {
|
||||
textures[i] = iconReg.registerIcon(Util.MOD_ID + ":" + this.getUnlocalizedName().substring(5) + Util.gemList.get(i).name.substring(5));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -8,13 +8,12 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemAxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemAxeG extends ItemAxe{
|
||||
public class ItemAxeSPTS extends ItemAxe{
|
||||
|
||||
public ItemAxeG(ToolMaterial toolMat, String unlocalizedName){
|
||||
public ItemAxeSPTS(ToolMaterial toolMat, String unlocalizedName){
|
||||
super(toolMat);
|
||||
this.setUnlocalizedName(unlocalizedName);
|
||||
this.setCreativeTab(CreativeTab.instance);
|
||||
|
@ -23,8 +22,7 @@ public class ItemAxeG extends ItemAxe{
|
|||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||
if(Util.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + this.getUnlocalizedName().substring(5) + ".desc"));
|
||||
else list.add(Util.shiftForInfo());
|
||||
Util.addStandardInformation(this);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
|
@ -0,0 +1,32 @@
|
|||
package ellpeck.someprettytechystuff.items.tools;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.someprettytechystuff.creative.CreativeTab;
|
||||
import ellpeck.someprettytechystuff.util.Util;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemHoe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemHoeSPTS extends ItemHoe{
|
||||
|
||||
public ItemHoeSPTS(ToolMaterial toolMat, String unlocalizedName){
|
||||
super(toolMat);
|
||||
this.setUnlocalizedName(unlocalizedName);
|
||||
this.setCreativeTab(CreativeTab.instance);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){
|
||||
Util.addStandardInformation(this);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconReg){
|
||||
this.itemIcon = iconReg.registerIcon(Util.MOD_ID + ":" + this.getUnlocalizedName().substring(5));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package ellpeck.someprettytechystuff.items.tools;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.someprettytechystuff.creative.CreativeTab;
|
||||
import ellpeck.someprettytechystuff.util.Util;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemPickaxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemPickaxeSPTS extends ItemPickaxe{
|
||||
|
||||
public ItemPickaxeSPTS(ToolMaterial toolMat, String unlocalizedName){
|
||||
super(toolMat);
|
||||
this.setUnlocalizedName(unlocalizedName);
|
||||
this.setCreativeTab(CreativeTab.instance);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||
Util.addStandardInformation(this);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconReg){
|
||||
this.itemIcon = iconReg.registerIcon(Util.MOD_ID + ":" + this.getUnlocalizedName().substring(5));
|
||||
}
|
||||
}
|
|
@ -8,13 +8,12 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemSpade;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemShovelG extends ItemSpade{
|
||||
public class ItemShovelSPTS extends ItemSpade{
|
||||
|
||||
public ItemShovelG(ToolMaterial toolMat, String unlocalizedName){
|
||||
public ItemShovelSPTS(ToolMaterial toolMat, String unlocalizedName){
|
||||
super(toolMat);
|
||||
this.setUnlocalizedName(unlocalizedName);
|
||||
this.setCreativeTab(CreativeTab.instance);
|
||||
|
@ -23,8 +22,7 @@ public class ItemShovelG extends ItemSpade{
|
|||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||
if(Util.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + this.getUnlocalizedName().substring(5) + ".desc"));
|
||||
else list.add(Util.shiftForInfo());
|
||||
Util.addStandardInformation(this);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
|
@ -1,4 +1,4 @@
|
|||
package ellpeck.someprettytechystuff.items;
|
||||
package ellpeck.someprettytechystuff.items.tools;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
@ -6,27 +6,27 @@ import ellpeck.someprettytechystuff.creative.CreativeTab;
|
|||
import ellpeck.someprettytechystuff.util.Util;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemInfusedIron extends Item{
|
||||
public class ItemSwordSPTS extends ItemSword{
|
||||
|
||||
public ItemInfusedIron(){
|
||||
public ItemSwordSPTS(ToolMaterial toolMat, String unlocalizedName){
|
||||
super(toolMat);
|
||||
this.setUnlocalizedName(unlocalizedName);
|
||||
this.setCreativeTab(CreativeTab.instance);
|
||||
this.setUnlocalizedName("itemInfusedIronIngot");
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||
list.add(Util.addStandardInformation(this));
|
||||
Util.addStandardInformation(this);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconReg){
|
||||
this.itemIcon = iconReg.registerIcon(Util.MOD_ID + ":" + this.getUnlocalizedName().substring(5));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,13 +1,5 @@
|
|||
package ellpeck.someprettytechystuff.proxy;
|
||||
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import ellpeck.someprettytechystuff.blocks.InitBlocks;
|
||||
import ellpeck.someprettytechystuff.blocks.models.*;
|
||||
import ellpeck.someprettytechystuff.tile.TileEntityCrucible;
|
||||
import ellpeck.someprettytechystuff.tile.TileEntityCrucibleFire;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class ClientProxy implements IProxy{
|
||||
|
||||
|
@ -16,10 +8,7 @@ public class ClientProxy implements IProxy{
|
|||
}
|
||||
|
||||
public void init() {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCrucible.class, new RendererCrucible());
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(InitBlocks.blockCrucible), new RendererHoldingTileEntity(new ModelCrucible(), RendererCrucible.resLoc));
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCrucibleFire.class, new RendererCrucibleFire());
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(InitBlocks.blockCrucibleFire), new RendererHoldingTileEntity(new ModelCrucibleFire(), RendererCrucibleFire.resLoc));
|
||||
|
||||
}
|
||||
|
||||
public void postInit() {
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package ellpeck.someprettytechystuff.tile;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import ellpeck.someprettytechystuff.util.Util;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
|
@ -22,7 +20,6 @@ public class TileEntityBase extends TileEntity{
|
|||
}
|
||||
|
||||
public static void init(){
|
||||
GameRegistry.registerTileEntity(TileEntityCrucible.class, Util.MOD_ID + "tileEntityCrucible");
|
||||
GameRegistry.registerTileEntity(TileEntityCrucibleFire.class, Util.MOD_ID + "tileEntityCrucibleFire");
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,165 +0,0 @@
|
|||
package ellpeck.someprettytechystuff.tile;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.someprettytechystuff.blocks.InitBlocks;
|
||||
import ellpeck.someprettytechystuff.crafting.CrucibleCraftingManager;
|
||||
import ellpeck.someprettytechystuff.items.ItemGem;
|
||||
import ellpeck.someprettytechystuff.util.GemType;
|
||||
import ellpeck.someprettytechystuff.util.Util;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntityCrucible extends TileEntityInventoryBase{
|
||||
|
||||
public final int slotOutput = 11;
|
||||
public final int slotMainInput = 4;
|
||||
public final int slotWater = 9;
|
||||
public final int slotSmeltGem = 10;
|
||||
|
||||
/*
|
||||
Variables that need to be saved to and loaded from NBT
|
||||
*/
|
||||
public GemType currentFluid = Util.fluidNone;
|
||||
public int currentFluidID;
|
||||
public int currentProcessTime;
|
||||
public int processTimeNeeded;
|
||||
public int burnTime;
|
||||
public int burnTimeOfItem;
|
||||
|
||||
public ItemStack output;
|
||||
|
||||
public TileEntityCrucible(){
|
||||
/**
|
||||
* 0-3: Inputs
|
||||
* 4: Main Input
|
||||
* 5-8: Inputs
|
||||
* 9: Water
|
||||
* 10: Gem
|
||||
* 11: Output
|
||||
*/
|
||||
this.slots = new ItemStack[12];
|
||||
}
|
||||
|
||||
@SuppressWarnings("static-access")
|
||||
public void updateEntity(){
|
||||
boolean isCraftingFlag = this.isCrafting();
|
||||
if(!worldObj.isRemote){
|
||||
if(!this.isCrafting()) this.output = CrucibleCraftingManager.instance.getCraftingResult(slots, 0, 8, currentFluid);
|
||||
this.getBurnFromBelow();
|
||||
this.addWaterByWaterSlot();
|
||||
this.colorGemWater();
|
||||
this.craft();
|
||||
this.currentFluidID = this.currentFluid.ID;
|
||||
}
|
||||
if(isCraftingFlag != this.isCrafting()){
|
||||
this.markDirty();
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isCrafting(){
|
||||
return this.currentProcessTime > 0;
|
||||
}
|
||||
|
||||
public void craft(){
|
||||
if(this.burnTime > 0){
|
||||
if (!this.isCrafting()){
|
||||
if (output != null && (this.slots[slotOutput] == null || this.slots[slotOutput].isItemEqual(output))) {
|
||||
this.processTimeNeeded = this.currentProcessTime = CrucibleCraftingManager.instance.getProcessTimeNeeded(slots, 0, 8);
|
||||
for (int i = 0; i <= 8; i++){
|
||||
this.slots[i].stackSize--;
|
||||
if (this.slots[i].stackSize == 0) {
|
||||
this.slots[i] = slots[i].getItem().getContainerItem(slots[i]);
|
||||
}
|
||||
}
|
||||
this.currentFluid = Util.fluidNone;
|
||||
}
|
||||
}
|
||||
if(this.isCrafting()){
|
||||
this.currentProcessTime--;
|
||||
if (this.currentProcessTime <= 0){
|
||||
if (this.slots[slotOutput] == null) this.slots[slotOutput] = output.copy();
|
||||
else if(this.slots[slotOutput].isItemEqual(output)) this.slots[slotOutput].stackSize += output.stackSize;
|
||||
this.currentProcessTime = 0;
|
||||
this.processTimeNeeded = 0;
|
||||
this.output = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void getBurnFromBelow(){
|
||||
TileEntity tileDown = worldObj.getTileEntity(this.xCoord, this.yCoord - 1, this.zCoord);
|
||||
if(tileDown instanceof TileEntityCrucibleFire){
|
||||
this.burnTime = ((TileEntityCrucibleFire)tileDown).burnTime;
|
||||
this.burnTimeOfItem = ((TileEntityCrucibleFire)tileDown).burnTimeOfItem;
|
||||
}
|
||||
else{
|
||||
this.burnTime = 0;
|
||||
this.burnTimeOfItem = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public void colorGemWater(){
|
||||
ItemStack stack = this.slots[slotSmeltGem];
|
||||
if(stack != null && stack.getItem() instanceof ItemGem){
|
||||
if(this.currentFluid == Util.fluidWater) {
|
||||
this.currentFluid = Util.gemList.get(stack.getItemDamage());
|
||||
stack.stackSize--;
|
||||
if(stack.stackSize == 0) this.slots[slotSmeltGem] = stack.getItem().getContainerItem(stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void addWaterByWaterSlot(){
|
||||
if(this.slots[this.slotWater] != null && this.slots[this.slotWater].getItem() == Items.water_bucket && this.currentFluid == Util.fluidNone){
|
||||
this.currentFluid = Util.fluidWater;
|
||||
this.slots[this.slotWater] = new ItemStack(Items.bucket);
|
||||
}
|
||||
}
|
||||
|
||||
public String getInventoryName() {
|
||||
return InitBlocks.blockCrucible.getUnlocalizedName().substring(5);
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
super.writeToNBT(compound);
|
||||
|
||||
compound.setInteger("CurrentFluidID", this.currentFluidID);
|
||||
compound.setInteger("ProcessTime", this.currentProcessTime);
|
||||
compound.setInteger("ProcessTimeNeeded", this.processTimeNeeded);
|
||||
|
||||
if(output != null) {
|
||||
NBTTagCompound compoundOutput = new NBTTagCompound();
|
||||
compoundOutput = output.writeToNBT(compoundOutput);
|
||||
compound.setTag("Output", compoundOutput);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("static-access")
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
super.readFromNBT(compound);
|
||||
|
||||
this.currentFluidID = compound.getInteger("CurrentFluidID");
|
||||
this.currentProcessTime = compound.getInteger("ProcessTime");
|
||||
this.processTimeNeeded = compound.getInteger("ProcessTimeNeeded");
|
||||
this.output = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("Output"));
|
||||
|
||||
if(this.currentFluidID == Util.fluidWater.ID) this.currentFluid = Util.fluidWater;
|
||||
else if(this.currentFluidID == Util.fluidNone.ID) this.currentFluid = Util.fluidNone;
|
||||
else this.currentFluid = Util.gemList.get(this.currentFluidID);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getCraftProcessScaled(int par1){
|
||||
return (this.processTimeNeeded-this.currentProcessTime) * par1 / this.processTimeNeeded;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getBurnTimeRemainingScaled(int i){
|
||||
return this.burnTime * i / this.burnTimeOfItem;
|
||||
}
|
||||
}
|
|
@ -1,73 +0,0 @@
|
|||
package ellpeck.someprettytechystuff.tile;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.someprettytechystuff.blocks.InitBlocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
|
||||
public class TileEntityCrucibleFire extends TileEntityInventoryBase{
|
||||
|
||||
public int burnTime;
|
||||
public int burnTimeOfItem;
|
||||
|
||||
public TileEntityCrucibleFire(){
|
||||
this.slots = new ItemStack[1];
|
||||
}
|
||||
|
||||
public void updateEntity(){
|
||||
boolean isBurningFlag = this.isBurning();
|
||||
if(!worldObj.isRemote){
|
||||
this.burnFuel();
|
||||
}
|
||||
if(isBurningFlag != this.isBurning()){
|
||||
this.markDirty();
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
public void burnFuel(){
|
||||
if(this.burnTime <= 0){
|
||||
if (this.slots[0] != null) {
|
||||
this.burnTimeOfItem = this.burnTime = TileEntityFurnace.getItemBurnTime(this.slots[0]);
|
||||
this.slots[0].stackSize--;
|
||||
if (this.slots[0].stackSize == 0){
|
||||
this.slots[0] = slots[0].getItem().getContainerItem(slots[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(this.burnTime > 0){
|
||||
this.burnTime--;
|
||||
if(this.burnTime <= 0){
|
||||
this.burnTimeOfItem = 0;
|
||||
this.burnTime = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getInventoryName() {
|
||||
return InitBlocks.blockCrucibleFire.getUnlocalizedName().substring(5);
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
super.writeToNBT(compound);
|
||||
compound.setInteger("BurnTime", this.burnTime);
|
||||
compound.setInteger("BurnTimeOfItem", this.burnTimeOfItem);
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
super.readFromNBT(compound);
|
||||
this.burnTime = compound.getInteger("BurnTime");
|
||||
this.burnTimeOfItem = compound.getInteger("BurnTimeOfItem");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getBurnTimeRemainingScaled(int i){
|
||||
return this.burnTime * i / this.burnTimeOfItem;
|
||||
}
|
||||
|
||||
public boolean isBurning(){
|
||||
return this.burnTime > 0;
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
package ellpeck.someprettytechystuff.util;
|
||||
|
||||
public class GemType{
|
||||
|
||||
public final int ID;
|
||||
public final String name;
|
||||
|
||||
public GemType(int ID, String name, boolean shouldAddToList){
|
||||
this.ID = ID;
|
||||
this.name = "fluid" + name;
|
||||
if(shouldAddToList) Util.gemList.add(ID, this);
|
||||
}
|
||||
}
|
|
@ -4,35 +4,12 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.util.StatCollector;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class Util{
|
||||
|
||||
public static final String MOD_ID = "someprettytechystuff";
|
||||
public static final String NAME = "Gemification";
|
||||
public static final String VERSION = "1.7.10-1.0.1";
|
||||
|
||||
public static ArrayList<GemType> gemList = new ArrayList<GemType>();
|
||||
|
||||
public static final GemType onyx = new GemType(0, "Onyx", true);
|
||||
public static final GemType almandineGarnet = new GemType(1, "AlmandineGarnet", true);
|
||||
public static final GemType chromeDiopside = new GemType(2, "ChromeDiopside", true);
|
||||
public static final GemType jasper = new GemType(3, "Jasper", true);
|
||||
public static final GemType sodalite = new GemType(4, "Sodalite", true);
|
||||
public static final GemType iolite = new GemType(5, "Iolite", true);
|
||||
public static final GemType smithsonite = new GemType(6, "Smithsonite", true);
|
||||
public static final GemType danburite = new GemType(7, "Danburite", true);
|
||||
public static final GemType hematite = new GemType(8, "Hematite", true);
|
||||
public static final GemType lepidolite = new GemType(9, "Lepidolite", true);
|
||||
public static final GemType tourmaline = new GemType(10, "Tourmaline", true);
|
||||
public static final GemType sphene = new GemType(11, "Sphene", true);
|
||||
public static final GemType paraibaTourlamine = new GemType(12, "ParaibaTourlamine", true);
|
||||
public static final GemType rhodochrosite = new GemType(13, "Rhodochrosite", true);
|
||||
public static final GemType clinohumite = new GemType(14, "Clinohumite", true);
|
||||
public static final GemType goshenite = new GemType(15, "Goshenite", true);
|
||||
public static final GemType fluidWater = new GemType(16, "Water", false);
|
||||
public static final GemType fluidNone = new GemType(17, "None", false);
|
||||
public static final String NAME = "SomePrettyTechyStuff";
|
||||
public static final String VERSION = "1.7.10-0.0.1";
|
||||
|
||||
public static boolean isShiftPressed(){
|
||||
return Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT);
|
||||
|
|
Loading…
Reference in a new issue