Merge pull request #409 from Rushmead/1.9

Closes #402,#404,406
This commit is contained in:
Gigabit101 2016-03-27 17:45:09 +01:00
commit 99f9fc4903
16 changed files with 149 additions and 163 deletions

View file

@ -1,7 +1,5 @@
package techreborn.client.gui; package techreborn.client.gui;
import java.io.IOException;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
@ -19,6 +17,8 @@ import techreborn.init.ModBlocks;
import techreborn.proxies.ClientProxy; import techreborn.proxies.ClientProxy;
import techreborn.tiles.TileBlastFurnace; import techreborn.tiles.TileBlastFurnace;
import java.io.IOException;
public class GuiBlastFurnace extends GuiContainer public class GuiBlastFurnace extends GuiContainer
{ {
@ -28,7 +28,7 @@ public class GuiBlastFurnace extends GuiContainer
TileBlastFurnace blastfurnace; TileBlastFurnace blastfurnace;
ContainerBlastFurnace containerBlastFurnace; ContainerBlastFurnace containerBlastFurnace;
boolean hasMultiBlock;
public GuiBlastFurnace(EntityPlayer player, TileBlastFurnace tileblastfurnace) public GuiBlastFurnace(EntityPlayer player, TileBlastFurnace tileblastfurnace)
{ {
super(new ContainerBlastFurnace(tileblastfurnace, player)); super(new ContainerBlastFurnace(tileblastfurnace, player));
@ -41,6 +41,8 @@ public class GuiBlastFurnace extends GuiContainer
@Override @Override
public void initGui() public void initGui()
{ {
hasMultiBlock = containerBlastFurnace.heat != 0;
int k = (this.width - this.xSize) / 2; int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2; int l = (this.height - this.ySize) / 2;
GuiButton button = new GuiButton(212, k + 4, l + 6, 20, 20, ""); GuiButton button = new GuiButton(212, k + 4, l + 6, 20, 20, "");
@ -69,7 +71,7 @@ public class GuiBlastFurnace extends GuiContainer
int l = (this.height - this.ySize) / 2; int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
if (containerBlastFurnace.heat == 0) if (hasMultiBlock)
{ {
GuiUtil.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10); GuiUtil.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10);
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38,

View file

@ -17,6 +17,7 @@ public class GuiIndustrialGrinder extends GuiContainer
TileIndustrialGrinder grinder; TileIndustrialGrinder grinder;
ContainerIndustrialGrinder containerGrinder; ContainerIndustrialGrinder containerGrinder;
boolean hasMultiBlock;
public GuiIndustrialGrinder(EntityPlayer player, TileIndustrialGrinder tilegrinder) public GuiIndustrialGrinder(EntityPlayer player, TileIndustrialGrinder tilegrinder)
{ {
super(new ContainerIndustrialGrinder(tilegrinder, player)); super(new ContainerIndustrialGrinder(tilegrinder, player));
@ -25,7 +26,12 @@ public class GuiIndustrialGrinder extends GuiContainer
grinder = tilegrinder; grinder = tilegrinder;
containerGrinder = (ContainerIndustrialGrinder) this.inventorySlots; containerGrinder = (ContainerIndustrialGrinder) this.inventorySlots;
} }
@Override
public void initGui()
{
hasMultiBlock = containerGrinder.connectionStatus != 1;
}
@Override @Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{ {
@ -36,7 +42,12 @@ public class GuiIndustrialGrinder extends GuiContainer
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
int j = 0; int j = 0;
if (hasMultiBlock)
{
// GuiDraw.drawTooltipBox(k + 30, l + 50 + 12 - j, 114, 10);
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38,
l + 52 + 12 - j, -1);
}
j = grinder.getProgressScaled(24); j = grinder.getProgressScaled(24);
if (j > 0) if (j > 0)
{ {
@ -49,12 +60,7 @@ public class GuiIndustrialGrinder extends GuiContainer
this.drawTexturedModalRect(k + 132, l + 63 + 12 - j, 176, 12 - j, 14, j + 2); this.drawTexturedModalRect(k + 132, l + 63 + 12 - j, 176, 12 - j, 14, j + 2);
} }
if (containerGrinder.connectionStatus != 1)
{
// GuiDraw.drawTooltipBox(k + 30, l + 50 + 12 - j, 114, 10);
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38,
l + 52 + 12 - j, -1);
}
// TODO 1.8 nope // TODO 1.8 nope
// if (grinder.tank.getFluidAmount() != 0) { // if (grinder.tank.getFluidAmount() != 0) {

View file

@ -10,7 +10,7 @@ public class ItemAdvancedDrill extends ItemDrill
public ItemAdvancedDrill() public ItemAdvancedDrill()
{ {
super(ToolMaterial.DIAMOND, "techreborn.advancedDrill", ConfigTechReborn.AdvancedDrillCharge, super(ToolMaterial.DIAMOND, "techreborn.advancedDrill", ConfigTechReborn.AdvancedDrillCharge,
ConfigTechReborn.AdvancedDrillTier, 4.0F); ConfigTechReborn.AdvancedDrillTier, 4.0F, 20F);
this.cost = 250; this.cost = 250;
} }

View file

@ -10,7 +10,7 @@ public class ItemDiamondDrill extends ItemDrill
public ItemDiamondDrill() public ItemDiamondDrill()
{ {
super(ToolMaterial.DIAMOND, "techreborn.diamondDrill", ConfigTechReborn.DiamondDrillCharge, super(ToolMaterial.DIAMOND, "techreborn.diamondDrill", ConfigTechReborn.DiamondDrillCharge,
ConfigTechReborn.DiamondDrillTier, 2.5F); ConfigTechReborn.DiamondDrillTier, 2.5F, 15F);
this.cost = 250; this.cost = 250;
} }

View file

@ -1,12 +1,14 @@
package techreborn.items.tools; package techreborn.items.tools;
import java.util.List;
import me.modmuss50.jsonDestroyer.api.ITexturedItem; import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -24,6 +26,9 @@ import reborncore.common.util.TorchHelper;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo; import techreborn.lib.ModInfo;
import java.util.List;
import java.util.Random;
public class ItemDrill extends ItemPickaxe implements IEnergyItemInfo, ITexturedItem public class ItemDrill extends ItemPickaxe implements IEnergyItemInfo, ITexturedItem
{ {
@ -33,10 +38,10 @@ public class ItemDrill extends ItemPickaxe implements IEnergyItemInfo, ITextured
public float unpoweredSpeed = 2.0F; public float unpoweredSpeed = 2.0F;
public double transferLimit = 100; public double transferLimit = 100;
public ItemDrill(ToolMaterial material, String unlocalizedName, int energyCapacity, int tier, float unpoweredSpeed) public ItemDrill(ToolMaterial material, String unlocalizedName, int energyCapacity, int tier, float unpoweredSpeed, float efficiencyOnProperMaterial)
{ {
super(material); super(material);
efficiencyOnProperMaterial = 20F; this.efficiencyOnProperMaterial = efficiencyOnProperMaterial;
setCreativeTab(TechRebornCreativeTab.instance); setCreativeTab(TechRebornCreativeTab.instance);
setMaxStackSize(1); setMaxStackSize(1);
setMaxDamage(240); setMaxDamage(240);
@ -47,83 +52,77 @@ public class ItemDrill extends ItemPickaxe implements IEnergyItemInfo, ITextured
this.unpoweredSpeed = unpoweredSpeed; this.unpoweredSpeed = unpoweredSpeed;
} }
// @Override @Override public boolean onBlockDestroyed(ItemStack stack, World worldIn, IBlockState blockIn, BlockPos pos,
// public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block EntityLivingBase entityLiving)
// blockIn, BlockPos pos, EntityLivingBase playerIn) { {
// Random rand = new Random(); Random rand = new Random();
// if if (rand.nextInt(EnchantmentHelper.getEnchantmentLevel(Enchantment.getEnchantmentByID(34), stack) + 1) == 0)
// (rand.nextInt(EnchantmentHelper.getEnchantmentLevel(Enchantment.unbreaking.effectId, {
// stack)+1) == 0) { PoweredItem.useEnergy(cost, stack);
// PoweredItem.useEnergy(cost, stack); }
// } return true;
// return true; }
// }
//
// @Override
// public float getDigSpeed(ItemStack stack, IBlockState state) {
// if (!PoweredItem.canUseEnergy(cost, stack)) {
// return unpoweredSpeed;
// }
// if (Items.wooden_pickaxe.getDigSpeed(stack, state) > 1.0F ||
// Items.wooden_shovel.getDigSpeed(stack, state) > 1.0F) {
// return efficiencyOnProperMaterial;
// } else {
// return super.getDigSpeed(stack, state);
// }
// }
@Override @Override public float getStrVsBlock(ItemStack stack, IBlockState state)
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase entityliving1) {
if (!PoweredItem.canUseEnergy(cost, stack))
{
return unpoweredSpeed;
}
if (Items.wooden_pickaxe.getStrVsBlock(stack, state) > 1.0F
|| Items.wooden_shovel.getStrVsBlock(stack, state) > 1.0F)
{
return efficiencyOnProperMaterial;
} else
{
return super.getStrVsBlock(stack, state);
}
}
@Override public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving,
EntityLivingBase entityliving1)
{ {
return true; return true;
} }
@Override @Override public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos,
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos,
EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
{ {
return TorchHelper.placeTorch(stack, playerIn, worldIn, pos, facing, hitX, hitY, hitZ, hand); return TorchHelper.placeTorch(stack, playerIn, worldIn, pos, facing, hitX, hitY, hitZ, hand);
} }
@Override @Override public boolean isRepairable()
public boolean isRepairable()
{ {
return false; return false;
} }
@Override @Override public double getMaxPower(ItemStack stack)
public double getMaxPower(ItemStack stack)
{ {
return maxCharge; return maxCharge;
} }
@Override @Override public boolean canAcceptEnergy(ItemStack stack)
public boolean canAcceptEnergy(ItemStack stack)
{ {
return true; return true;
} }
@Override @Override public boolean canProvideEnergy(ItemStack stack)
public boolean canProvideEnergy(ItemStack stack)
{ {
return false; return false;
} }
@Override @Override public double getMaxTransfer(ItemStack stack)
public double getMaxTransfer(ItemStack stack)
{ {
return transferLimit; return transferLimit;
} }
@Override @Override public int getStackTier(ItemStack stack)
public int getStackTier(ItemStack stack)
{ {
return tier; return tier;
} }
@SuppressWarnings({ "rawtypes", "unchecked" }) @SuppressWarnings({ "rawtypes", "unchecked" }) @SideOnly(Side.CLIENT) public void getSubItems(Item item,
@SideOnly(Side.CLIENT) CreativeTabs par2CreativeTabs, List itemList)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList)
{ {
ItemStack itemStack = new ItemStack(this, 1); ItemStack itemStack = new ItemStack(this, 1);
itemList.add(itemStack); itemList.add(itemStack);
@ -133,35 +132,30 @@ public class ItemDrill extends ItemPickaxe implements IEnergyItemInfo, ITextured
itemList.add(charged); itemList.add(charged);
} }
@Override @Override public double getDurabilityForDisplay(ItemStack stack)
public double getDurabilityForDisplay(ItemStack stack)
{ {
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
return 1 - charge; return 1 - charge;
} }
@Override @Override public boolean showDurabilityBar(ItemStack stack)
public boolean showDurabilityBar(ItemStack stack)
{ {
return true; return true;
} }
@Override @Override public String getTextureName(int damage)
public String getTextureName(int damage)
{ {
return "techreborn:items/tool/nullDrill"; return "techreborn:items/tool/nullDrill";
} }
@Override @Override public int getMaxMeta()
public int getMaxMeta()
{ {
return 1; return 1;
} }
@Override @Override @SideOnly(Side.CLIENT) public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player,
@SideOnly(Side.CLIENT) int useRemaining)
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining)
{ {
return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory"); return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory");
} }

View file

@ -10,7 +10,7 @@ public class ItemIronDrill extends ItemDrill
public ItemIronDrill() public ItemIronDrill()
{ {
super(ToolMaterial.IRON, "techreborn.ironDrill", ConfigTechReborn.IronDrillCharge, super(ToolMaterial.IRON, "techreborn.ironDrill", ConfigTechReborn.IronDrillCharge,
ConfigTechReborn.IronDrillTier, 2.0F); ConfigTechReborn.IronDrillTier, 2.0F, 10F);
this.cost = 50; this.cost = 50;
} }

View file

@ -1,11 +1,11 @@
package techreborn.items.tools; package techreborn.items.tools;
import java.util.List;
import me.modmuss50.jsonDestroyer.api.ITexturedItem; import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
@ -26,6 +26,9 @@ import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo; import techreborn.lib.ModInfo;
import techreborn.utils.OreDictUtils; import techreborn.utils.OreDictUtils;
import java.util.List;
import java.util.Random;
public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo, ITexturedItem public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo, ITexturedItem
{ {
@ -47,17 +50,16 @@ public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo, ITex
this.tier = tier; this.tier = tier;
} }
// @Override @Override public boolean onBlockDestroyed(ItemStack stack, World worldIn, IBlockState blockIn, BlockPos pos,
// public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block EntityLivingBase entityLiving)
// blockIn, BlockPos pos, EntityLivingBase playerIn) { {
// Random rand = new Random(); Random rand = new Random();
// if if (rand.nextInt(EnchantmentHelper.getEnchantmentLevel(Enchantment.getEnchantmentByID(34), stack) + 1) == 0)
// (rand.nextInt(EnchantmentHelper.getEnchantmentLevel(Enchantment.unbreaking.effectId, {
// stack) + 1) == 0) { PoweredItem.useEnergy(cost, stack);
// PoweredItem.useEnergy(cost, stack); }
// } return true;
// return true; }
// }
@Override @Override
public boolean canHarvestBlock(IBlockState state) public boolean canHarvestBlock(IBlockState state)
@ -70,15 +72,15 @@ public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo, ITex
return false; return false;
} }
// @Override @Override
// public float getDigSpeed(ItemStack stack, IBlockState state) { public float getStrVsBlock(ItemStack stack, IBlockState state) {
// if (OreDictUtils.isOre(state, "stone") && PoweredItem.canUseEnergy(cost, if (OreDictUtils.isOre(state, "stone") && PoweredItem.canUseEnergy(cost,
// stack)) { stack)) {
// return efficiencyOnProperMaterial; return efficiencyOnProperMaterial;
// } else { } else {
// return 0.5F; return 0.5F;
// } }
// } }
@Override @Override
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase entityliving1) public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase entityliving1)

View file

@ -1,11 +1,10 @@
package techreborn.items.tools; package techreborn.items.tools;
import java.util.List;
import me.modmuss50.jsonDestroyer.api.ITexturedItem; import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.Item; import net.minecraft.item.Item;
@ -21,6 +20,8 @@ import techreborn.client.TechRebornCreativeTab;
import techreborn.config.ConfigTechReborn; import techreborn.config.ConfigTechReborn;
import techreborn.lib.ModInfo; import techreborn.lib.ModInfo;
import java.util.List;
public class ItemRockCutter extends ItemPickaxe implements IEnergyItemInfo, ITexturedItem public class ItemRockCutter extends ItemPickaxe implements IEnergyItemInfo, ITexturedItem
{ {
@ -59,29 +60,29 @@ public class ItemRockCutter extends ItemPickaxe implements IEnergyItemInfo, ITex
{ {
if (Items.diamond_pickaxe.canHarvestBlock(state)) if (Items.diamond_pickaxe.canHarvestBlock(state))
{ {
// if (PoweredItem.canUseEnergy(cost, stack)) { // if (PoweredItem.canUseEnergy(cost, stack)) {
// PoweredItem.useEnergy(cost, stack); // PoweredItem.useEnergy(cost, stack);
// return true; // return true;
// } // }
} }
return false; return false;
} }
// @Override @Override
// public int getHarvestLevel(ItemStack stack, String toolClass) { public int getHarvestLevel(ItemStack stack, String toolClass) {
// if (!stack.isItemEnchanted()) { if (!stack.isItemEnchanted()) {
// stack.addEnchantment(Enchantment.silkTouch, 1); stack.addEnchantment(Enchantment.getEnchantmentByID(33), 1);
// } }
// return super.getHarvestLevel(stack, toolClass); return super.getHarvestLevel(stack, toolClass);
// } }
//
// @Override @Override
// public float getStrVsBlock(ItemStack stack, Block block) { public float getStrVsBlock(ItemStack stack, IBlockState block) {
// if (!stack.isItemEnchanted()) { if (!stack.isItemEnchanted()) {
// stack.addEnchantment(Enchantment.silkTouch, 1); stack.addEnchantment(Enchantment.getEnchantmentByID(33), 1);
// } }
// return super.getStrVsBlock(stack, block); return super.getStrVsBlock(stack, block);
// } }
@Override @Override
public boolean isRepairable() public boolean isRepairable()

View file

@ -1,7 +1,5 @@
package techreborn.manual; package techreborn.manual;
import java.io.IOException;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiScreen;
@ -10,22 +8,15 @@ import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12; import org.lwjgl.opengl.GL12;
import techreborn.init.ModBlocks; import techreborn.init.ModBlocks;
import techreborn.init.ModItems; import techreborn.init.ModItems;
import techreborn.items.ItemParts; import techreborn.items.ItemParts;
import techreborn.items.ItemPlates; import techreborn.items.ItemPlates;
import techreborn.manual.pages.AdvancedMachines; import techreborn.manual.pages.*;
import techreborn.manual.pages.BasicMachinesPage;
import techreborn.manual.pages.ContentsPage; import java.io.IOException;
import techreborn.manual.pages.CraftingInfoPage;
import techreborn.manual.pages.DescriptionPage;
import techreborn.manual.pages.GeneratingPowerPage;
import techreborn.manual.pages.GettingStartedPage;
import techreborn.manual.pages.ToolsPage;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GuiManual extends GuiScreen public class GuiManual extends GuiScreen
@ -40,7 +31,7 @@ public class GuiManual extends GuiScreen
public GuiManual() public GuiManual()
{ {
this.xSize = 146; this.xSize = 200;
this.ySize = 180; this.ySize = 180;
root = createRoot(); root = createRoot();
} }

View file

@ -1,7 +1,5 @@
package techreborn.manual.pages; package techreborn.manual.pages;
import java.io.IOException;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiScreen;
@ -10,12 +8,14 @@ import net.minecraft.util.text.translation.I18n;
import techreborn.manual.PageCollection; import techreborn.manual.PageCollection;
import techreborn.manual.Reference; import techreborn.manual.Reference;
import java.io.IOException;
public class BasePage extends GuiScreen public class BasePage extends GuiScreen
{ {
public static final ResourceLocation PAGE_TEXTURE = new ResourceLocation( public static final ResourceLocation PAGE_TEXTURE = new ResourceLocation(
"techreborn:textures/manual/gui/manual.png"); "techreborn:textures/manual/gui/manual.png");
private final int xSize = 146; private final int xSize = 200;
private final int ySize = 180; private final int ySize = 180;
// Name Displayed in the index page // Name Displayed in the index page
public String INDEX_NAME; public String INDEX_NAME;

View file

@ -1,7 +1,5 @@
package techreborn.manual.pages; package techreborn.manual.pages;
import java.awt.*;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -12,6 +10,8 @@ import techreborn.manual.PageCollection;
import techreborn.manual.Reference; import techreborn.manual.Reference;
import techreborn.manual.util.GuiButtonItemTexture; import techreborn.manual.util.GuiButtonItemTexture;
import java.awt.*;
public class ContentsPage extends TitledPage public class ContentsPage extends TitledPage
{ {
public ContentsPage(String name, PageCollection collection) public ContentsPage(String name, PageCollection collection)

View file

@ -1,12 +1,9 @@
package techreborn.manual.pages; package techreborn.manual.pages;
import java.awt.*; import com.google.common.base.Objects;
import java.lang.reflect.Field; import com.google.common.base.Strings;
import java.util.ArrayList; import com.google.common.collect.ImmutableList;
import java.util.Iterator; import com.google.common.collect.Lists;
import java.util.List;
import java.util.Map;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
@ -14,26 +11,22 @@ import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.RenderItem; import net.minecraft.client.renderer.RenderItem;
import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.*;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.ShapedRecipes;
import net.minecraft.item.crafting.ShapelessRecipes;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import techreborn.manual.PageCollection; import techreborn.manual.PageCollection;
import techreborn.manual.util.ButtonUtil; import techreborn.manual.util.ButtonUtil;
import com.google.common.base.Objects; import java.awt.*;
import com.google.common.base.Strings; import java.lang.reflect.Field;
import com.google.common.collect.ImmutableList; import java.util.ArrayList;
import com.google.common.collect.Lists; import java.util.Iterator;
import java.util.List;
import java.util.Map;
public class CraftingInfoPage extends TitledPage public class CraftingInfoPage extends TitledPage
{ {
@ -82,7 +75,7 @@ public class CraftingInfoPage extends TitledPage
{ {
if (hasRecipe) if (hasRecipe)
{ {
renderImage(offsetX, offsetY + 10, "craftingtable"); renderImage(offsetX + (offsetX/ 2) , offsetY + 10, "craftingtable");
} else } else
{ {
drawString(fontRendererObj, "No Crafting Recipe", offsetX + 40, offsetY + 22, Color.black.getRGB()); drawString(fontRendererObj, "No Crafting Recipe", offsetX + 40, offsetY + 22, Color.black.getRGB());
@ -149,7 +142,7 @@ public class CraftingInfoPage extends TitledPage
GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glColor4f(1F, 1F, 1F, 1F); GL11.glColor4f(1F, 1F, 1F, 1F);
drawTexturedModalRect(offsetX, offsetY - 14, 0, 0, 140, this.height); drawTexturedModalRect(offsetX + 16, offsetY + 9, 0, 0, 116, 54);
GL11.glDisable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_BLEND);
} }

View file

@ -1,15 +1,14 @@
package techreborn.manual.util; package techreborn.manual.util;
import java.awt.*;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.RenderItem; import net.minecraft.client.renderer.RenderItem;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.client.config.GuiButtonExt; import net.minecraftforge.fml.client.config.GuiButtonExt;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import java.awt.*;
public class GuiButtonItemTexture extends GuiButtonExt public class GuiButtonItemTexture extends GuiButtonExt
{ {
@ -39,13 +38,13 @@ public class GuiButtonItemTexture extends GuiButtonExt
mc.getTextureManager().bindTexture(buttonTextures); mc.getTextureManager().bindTexture(buttonTextures);
int u = textureU; int u = textureU;
int v = textureV; int v = textureV;
if (flag) if (flag)
{ {
u += width; u += mc.fontRendererObj.getStringWidth(this.NAME) + 25;
v += mc.fontRendererObj.getStringWidth(this.NAME) + 25;
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glColor4f(0f, 0f, 0f, 1f); GL11.glColor4f(0f, 0f, 0f, 1f);
this.drawTexturedModalRect(this.xPosition, this.yPosition, u, v, width, height); this.drawTexturedModalRect(this.xPosition, this.yPosition, u, v, mc.fontRendererObj.getStringWidth(this.NAME) + 25, height);
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

View file

@ -319,14 +319,12 @@ public class TileMatterFabricator extends TilePowerAcceptor implements IWrenchab
return 100000000; return 100000000;
} }
@Override @Override public boolean canAcceptEnergy(EnumFacing direction)
public boolean canAcceptEnergy(EnumFacing direction)
{ {
return true; return true;
} }
@Override @Override public boolean canProvideEnergy(EnumFacing direction)
public boolean canProvideEnergy(EnumFacing direction)
{ {
return false; return false;
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 34 KiB