No textures though.
And lots of bugs.
This commit is contained in:
Ellpeck 2016-01-08 08:10:55 +01:00
parent b2a00d2c8d
commit 0ca8fc90c1
53 changed files with 323 additions and 252 deletions

View file

@ -69,7 +69,7 @@ public class ActuallyAdditionsAPI{
* @param outputTwoChance The chance of the second output (0 won't occur at all, 100 will all the time) * @param outputTwoChance The chance of the second output (0 won't occur at all, 100 will all the time)
*/ */
public static void addCrusherRecipe(String input, String outputOne, int outputOneAmount, String outputTwo, int outputTwoAmount, int outputTwoChance){ public static void addCrusherRecipe(String input, String outputOne, int outputOneAmount, String outputTwo, int outputTwoAmount, int outputTwoChance){
if(!OreDictionary.getOres(input, false).isEmpty() && !OreDictionary.getOres(outputOne, false).isEmpty() && (outputTwo == null || outputTwo.isEmpty() || !OreDictionary.getOres(outputTwo, false).isEmpty())){ if(!OreDictionary.getOres(input).isEmpty() && !OreDictionary.getOres(outputOne).isEmpty() && (outputTwo == null || outputTwo.isEmpty() || !OreDictionary.getOres(outputTwo).isEmpty())){
crusherRecipes.add(new CrusherRecipe(input, outputOne, outputOneAmount, outputTwo, outputTwoAmount, outputTwoChance)); crusherRecipes.add(new CrusherRecipe(input, outputOne, outputOneAmount, outputTwo, outputTwoAmount, outputTwoChance));
} }
} }
@ -107,7 +107,7 @@ public class ActuallyAdditionsAPI{
* @param outputOneAmount The amount of the first output * @param outputOneAmount The amount of the first output
*/ */
public static void addCrusherRecipe(ItemStack input, String outputOne, int outputOneAmount){ public static void addCrusherRecipe(ItemStack input, String outputOne, int outputOneAmount){
if(!OreDictionary.getOres(outputOne, false).isEmpty()){ if(!OreDictionary.getOres(outputOne).isEmpty()){
crusherRecipes.add(new CrusherRecipe(input, outputOne, outputOneAmount)); crusherRecipes.add(new CrusherRecipe(input, outputOne, outputOneAmount));
} }
} }

View file

@ -105,7 +105,8 @@ public class Position extends BlockPos{
} }
public static Position fromBlockPos(BlockPos pos){ public static Position fromBlockPos(BlockPos pos){
return (Position)pos; //TODO Make this less object creaty (Typecasting doesn't work?)
return new Position(pos.getX(), pos.getY(), pos.getZ());
} }
public boolean setBlockState(World world, IBlockState state, int flag){ public boolean setBlockState(World world, IBlockState state, int flag){

View file

@ -24,6 +24,7 @@ import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos; import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World; import net.minecraft.world.World;
public class BlockFluidCollector extends BlockContainerBase{ public class BlockFluidCollector extends BlockContainerBase{
@ -45,14 +46,14 @@ public class BlockFluidCollector extends BlockContainerBase{
} }
@Override @Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){
if(this.tryToggleRedstone(world, x, y, z, player)){ if(this.tryToggleRedstone(world, Position.fromBlockPos(pos), player)){
return true; return true;
} }
if(!world.isRemote){ if(!world.isRemote){
TileEntityFluidCollector collector = (TileEntityFluidCollector)world.getTileEntity(x, y, z); TileEntityFluidCollector collector = (TileEntityFluidCollector)world.getTileEntity(pos);
if(collector != null){ if(collector != null){
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.FLUID_COLLECTOR.ordinal(), world, x, y, z); player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.FLUID_COLLECTOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
} }
return true; return true;
} }

View file

@ -10,13 +10,13 @@
package de.ellpeck.actuallyadditions.mod.blocks; package de.ellpeck.actuallyadditions.mod.blocks;
import de.ellpeck.actuallyadditions.api.Position;
import de.ellpeck.actuallyadditions.api.block.IHudDisplay; import de.ellpeck.actuallyadditions.api.block.IHudDisplay;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityMiner; import de.ellpeck.actuallyadditions.mod.tile.TileEntityMiner;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
@ -70,18 +70,18 @@ public class BlockMiner extends BlockContainerBase implements IHudDisplay{
} }
@Override @Override
public void breakBlock(World world, int x, int y, int z, Block block, int par6){ public void breakBlock(World world, BlockPos pos, IBlockState state){
this.dropInventory(world, x, y, z); this.dropInventory(world, Position.fromBlockPos(pos));
super.breakBlock(world, x, y, z, block, par6); super.breakBlock(world, pos, state);
} }
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, MovingObjectPosition posHit, Profiler profiler, ScaledResolution resolution){ public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, MovingObjectPosition posHit, Profiler profiler, ScaledResolution resolution){
TileEntity tile = minecraft.theWorld.getTileEntity(posHit.blockX, posHit.blockY, posHit.blockZ); TileEntity tile = minecraft.theWorld.getTileEntity(posHit.getBlockPos());
if(tile instanceof TileEntityMiner){ if(tile instanceof TileEntityMiner){
String info = ((TileEntityMiner)tile).layerAt <= 0 ? "Done Mining!" : "Mining at Y = "+((TileEntityMiner)tile).layerAt+"."; String info = ((TileEntityMiner)tile).layerAt <= 0 ? "Done Mining!" : "Mining at Y = "+((TileEntityMiner)tile).layerAt+".";
minecraft.fontRenderer.drawStringWithShadow(info, resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2-20, StringUtil.DECIMAL_COLOR_WHITE); minecraft.fontRendererObj.drawStringWithShadow(info, resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2-20, StringUtil.DECIMAL_COLOR_WHITE);
} }
} }
} }

View file

@ -73,7 +73,7 @@ public class BlockTreasureChest extends BlockBase{
} }
@Override @Override
public boolean canSilkHarvest(){ public boolean canSilkHarvest(World world, BlockPos pos, IBlockState state, EntityPlayer player){
return false; return false;
} }

View file

@ -14,6 +14,9 @@ import de.ellpeck.actuallyadditions.mod.creative.CreativeTab;
import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.common.registry.GameRegistry;
@ -55,4 +58,21 @@ public class BlockBase extends Block{
public EnumRarity getRarity(ItemStack stack){ public EnumRarity getRarity(ItemStack stack){
return EnumRarity.COMMON; return EnumRarity.COMMON;
} }
public static final PropertyInteger META = PropertyInteger.create("metadata", 0, 15);
@Override
protected BlockState createBlockState(){
return new BlockState(this, META);
}
@Override
public IBlockState getStateFromMeta(int meta){
return getDefaultState().withProperty(META, meta);
}
@Override
public int getMetaFromState(IBlockState state){
return state.getValue(META);
}
} }

View file

@ -13,6 +13,9 @@ package de.ellpeck.actuallyadditions.mod.blocks.base;
import de.ellpeck.actuallyadditions.mod.creative.CreativeTab; import de.ellpeck.actuallyadditions.mod.creative.CreativeTab;
import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import net.minecraft.block.BlockBush; import net.minecraft.block.BlockBush;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.common.registry.GameRegistry;
@ -54,4 +57,21 @@ public class BlockBushBase extends BlockBush{
public EnumRarity getRarity(ItemStack stack){ public EnumRarity getRarity(ItemStack stack){
return EnumRarity.COMMON; return EnumRarity.COMMON;
} }
public static final PropertyInteger META = PropertyInteger.create("metadata", 0, 15);
@Override
protected BlockState createBlockState(){
return new BlockState(this, META);
}
@Override
public IBlockState getStateFromMeta(int meta){
return getDefaultState().withProperty(META, meta);
}
@Override
public int getMetaFromState(IBlockState state){
return state.getValue(META);
}
} }

View file

@ -19,6 +19,8 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockContainer;
import net.minecraft.block.BlockRedstoneTorch; import net.minecraft.block.BlockRedstoneTorch;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
@ -259,4 +261,20 @@ public abstract class BlockContainerBase extends BlockContainer{
return false; return false;
} }
public static final PropertyInteger META = PropertyInteger.create("metadata", 0, 15);
@Override
protected BlockState createBlockState(){
return new BlockState(this, META);
}
@Override
public IBlockState getStateFromMeta(int meta){
return getDefaultState().withProperty(META, meta);
}
@Override
public int getMetaFromState(IBlockState state){
return state.getValue(META);
}
} }

View file

@ -14,16 +14,16 @@ import net.minecraft.item.EnumRarity;
public enum TheMiscBlocks{ public enum TheMiscBlocks{
QUARTZ_PILLAR("BlackQuartzPillar", EnumRarity.rare), QUARTZ_PILLAR("BlackQuartzPillar", EnumRarity.RARE),
QUARTZ_CHISELED("BlackQuartzChiseled", EnumRarity.rare), QUARTZ_CHISELED("BlackQuartzChiseled", EnumRarity.RARE),
QUARTZ("BlackQuartz", EnumRarity.rare), QUARTZ("BlackQuartz", EnumRarity.RARE),
ORE_QUARTZ("OreBlackQuartz", EnumRarity.epic), ORE_QUARTZ("OreBlackQuartz", EnumRarity.EPIC),
WOOD_CASING("WoodCasing", EnumRarity.common), WOOD_CASING("WoodCasing", EnumRarity.COMMON),
CHARCOAL_BLOCK("Charcoal", EnumRarity.common), CHARCOAL_BLOCK("Charcoal", EnumRarity.COMMON),
ENDERPEARL_BLOCK("Enderpearl", EnumRarity.rare), ENDERPEARL_BLOCK("Enderpearl", EnumRarity.RARE),
LAVA_FACTORY_CASE("LavaFactoryCase", EnumRarity.uncommon), LAVA_FACTORY_CASE("LavaFactoryCase", EnumRarity.UNCOMMON),
ENDER_CASING("EnderCasing", EnumRarity.epic), ENDER_CASING("EnderCasing", EnumRarity.EPIC),
IRON_CASING("IronCasing", EnumRarity.rare); IRON_CASING("IronCasing", EnumRarity.RARE);
public final String name; public final String name;
public final EnumRarity rarity; public final EnumRarity rarity;

View file

@ -16,10 +16,10 @@ import net.minecraft.item.EnumRarity;
public enum TheWildPlants{ public enum TheWildPlants{
CANOLA("Canola", EnumRarity.rare, InitBlocks.blockCanola), CANOLA("Canola", EnumRarity.RARE, InitBlocks.blockCanola),
FLAX("Flax", EnumRarity.rare, InitBlocks.blockFlax), FLAX("Flax", EnumRarity.RARE, InitBlocks.blockFlax),
RICE("Rice", EnumRarity.rare, InitBlocks.blockRice), RICE("Rice", EnumRarity.RARE, InitBlocks.blockRice),
COFFEE("Coffee", EnumRarity.rare, InitBlocks.blockCoffee); COFFEE("Coffee", EnumRarity.RARE, InitBlocks.blockCoffee);
public final String name; public final String name;
public final EnumRarity rarity; public final EnumRarity rarity;

View file

@ -75,7 +75,7 @@ public class ModelCompost extends ModelBaseAA{
@Override @Override
public void renderExtra(float f, TileEntity tile){ public void renderExtra(float f, TileEntity tile){
//Hehe //Hehe
if("ShadowfactsDev".equals(Minecraft.getMinecraft().thePlayer.getCommandSenderName())){ if("ShadowfactsDev".equals(Minecraft.getMinecraft().thePlayer.getName())){
GL11.glTranslatef(0F, 1F, 0F); GL11.glTranslatef(0F, 1F, 0F);
} }

View file

@ -81,7 +81,7 @@ public class BookletUtils{
booklet.getFontRenderer().drawString(strg, booklet.guiLeft+booklet.xSize/2-booklet.getFontRenderer().getStringWidth(strg)/2-3, booklet.guiTop+12+booklet.getFontRenderer().FONT_HEIGHT, 0); booklet.getFontRenderer().drawString(strg, booklet.guiLeft+booklet.xSize/2-booklet.getFontRenderer().getStringWidth(strg)/2-3, booklet.guiTop+12+booklet.getFontRenderer().FONT_HEIGHT, 0);
String version; String version;
String playerName = Minecraft.getMinecraft().thePlayer.getCommandSenderName(); String playerName = Minecraft.getMinecraft().thePlayer.getName();
if(playerName.equals("dqmhose")){ if(playerName.equals("dqmhose")){
version = "Pants Edition"; version = "Pants Edition";
} }
@ -184,7 +184,7 @@ public class BookletUtils{
public static void doHoverTexts(GuiBooklet booklet, int mouseX, int mouseY){ public static void doHoverTexts(GuiBooklet booklet, int mouseX, int mouseY){
//Update all of the buttons' hovering texts //Update all of the buttons' hovering texts
for(Object button : booklet.getButtonList()){ for(Object button : booklet.getButtonList()){
if(button instanceof GuiButton && ((GuiButton)button).visible && ((GuiButton)button).func_146115_a()){ if(button instanceof GuiButton && ((GuiButton)button).visible && ((GuiButton)button).isMouseOver()){
if(button instanceof BookmarkButton){ if(button instanceof BookmarkButton){
((BookmarkButton)button).drawHover(mouseX, mouseY); ((BookmarkButton)button).drawHover(mouseX, mouseY);
} }

View file

@ -42,6 +42,7 @@ import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse; import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@ -197,7 +198,7 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{
} }
@Override @Override
protected void mouseClicked(int par1, int par2, int par3){ protected void mouseClicked(int par1, int par2, int par3) throws IOException{
this.searchField.mouseClicked(par1, par2, par3); this.searchField.mouseClicked(par1, par2, par3);
//Left mouse button //Left mouse button
if(par3 == 0 && this.currentEntrySet.chapter != null){ if(par3 == 0 && this.currentEntrySet.chapter != null){
@ -212,12 +213,7 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{
BookletUtils.openIndexEntry(this, null, 1, true); BookletUtils.openIndexEntry(this, null, 1, true);
} }
} }
try{ super.mouseClicked(par1, par2, par3);
super.mouseClicked(par1, par2, par3);
}
catch(Exception e){
ModUtil.LOGGER.error("Something bad happened when trying to click a button in the booklet!", e);
}
} }
@Override @Override
@ -362,7 +358,7 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{
@Override @Override
//For scrolling through pages //For scrolling through pages
public void handleMouseInput(){ public void handleMouseInput() throws IOException{
int wheel = Mouse.getEventDWheel(); int wheel = Mouse.getEventDWheel();
if(wheel != 0){ if(wheel != 0){
if(wheel > 0){ if(wheel > 0){
@ -372,12 +368,7 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{
BookletUtils.handlePreviousPage(this); BookletUtils.handlePreviousPage(this);
} }
} }
try{ super.handleMouseInput();
super.handleMouseInput();
}
catch(Exception e){
ModUtil.LOGGER.error("Something bad happened when trying to click a button in the booklet!", e);
}
} }
@Override @Override

View file

@ -58,21 +58,21 @@ public class PageCrusherRecipe extends BookletPageAA{
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void render(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ public void render(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){
if(recipe == null){ if(recipe == null){
StringUtil.drawSplitString(Minecraft.getMinecraft().fontRenderer, EnumChatFormatting.DARK_RED+StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".recipeDisabled"), gui.getGuiLeft()+14, gui.getGuiTop()+15, 115, 0, false); StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, EnumChatFormatting.DARK_RED+StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".recipeDisabled"), gui.getGuiLeft()+14, gui.getGuiTop()+15, 115, 0, false);
} }
else{ else{
String strg = "Crusher Recipe"; String strg = "Crusher Recipe";
Minecraft.getMinecraft().fontRenderer.drawString(strg, gui.getGuiLeft()+gui.getXSize()/2-Minecraft.getMinecraft().fontRenderer.getStringWidth(strg)/2, gui.getGuiTop()+10, 0); Minecraft.getMinecraft().fontRendererObj.drawString(strg, gui.getGuiLeft()+gui.getXSize()/2-Minecraft.getMinecraft().fontRendererObj.getStringWidth(strg)/2, gui.getGuiTop()+10, 0);
} }
String text = gui.getCurrentEntrySet().page.getText(); String text = gui.getCurrentEntrySet().page.getText();
if(text != null && !text.isEmpty()){ if(text != null && !text.isEmpty()){
StringUtil.drawSplitString(Minecraft.getMinecraft().fontRenderer, text, gui.getGuiLeft()+14, gui.getGuiTop()+100, 115, 0, false); StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, text, gui.getGuiLeft()+14, gui.getGuiTop()+100, 115, 0, false);
} }
if(recipe != null){ if(recipe != null){
if(recipe.outputTwoChance > 0){ if(recipe.outputTwoChance > 0){
Minecraft.getMinecraft().fontRenderer.drawString(recipe.outputTwoChance+"%", gui.getGuiLeft()+37+62, gui.getGuiTop()+20+33, 0); Minecraft.getMinecraft().fontRendererObj.drawString(recipe.outputTwoChance+"%", gui.getGuiLeft()+37+62, gui.getGuiTop()+20+33, 0);
} }
if(recipe.getRecipeOutputOnes() != null){ if(recipe.getRecipeOutputOnes() != null){

View file

@ -62,16 +62,16 @@ public class PageFurnace extends BookletPageAA{
public void render(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ public void render(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){
ItemStack input = this.input != null ? this.input : this.getInputForOutput(this.result); ItemStack input = this.input != null ? this.input : this.getInputForOutput(this.result);
if(input == null){ if(input == null){
StringUtil.drawSplitString(Minecraft.getMinecraft().fontRenderer, EnumChatFormatting.DARK_RED+StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".recipeDisabled"), gui.getGuiLeft()+14, gui.getGuiTop()+15, 115, 0, false); StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, EnumChatFormatting.DARK_RED+StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".recipeDisabled"), gui.getGuiLeft()+14, gui.getGuiTop()+15, 115, 0, false);
} }
else{ else{
String strg = "Furnace Recipe"; String strg = "Furnace Recipe";
Minecraft.getMinecraft().fontRenderer.drawString(strg, gui.getGuiLeft()+gui.getXSize()/2-Minecraft.getMinecraft().fontRenderer.getStringWidth(strg)/2, gui.getGuiTop()+10, 0); Minecraft.getMinecraft().fontRendererObj.drawString(strg, gui.getGuiLeft()+gui.getXSize()/2-Minecraft.getMinecraft().fontRendererObj.getStringWidth(strg)/2, gui.getGuiTop()+10, 0);
} }
String text = gui.getCurrentEntrySet().page.getText(); String text = gui.getCurrentEntrySet().page.getText();
if(text != null && !text.isEmpty()){ if(text != null && !text.isEmpty()){
StringUtil.drawSplitString(Minecraft.getMinecraft().fontRenderer, text, gui.getGuiLeft()+14, gui.getGuiTop()+100, 115, 0, false); StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, text, gui.getGuiLeft()+14, gui.getGuiTop()+100, 115, 0, false);
} }
if(input != null){ if(input != null){
@ -99,10 +99,10 @@ public class PageFurnace extends BookletPageAA{
} }
private ItemStack getInputForOutput(ItemStack output){ private ItemStack getInputForOutput(ItemStack output){
for(Object o : FurnaceRecipes.smelting().getSmeltingList().entrySet()){ for(Map.Entry o : FurnaceRecipes.instance().getSmeltingList().entrySet()){
ItemStack stack = (ItemStack)((Map.Entry)o).getValue(); ItemStack stack = (ItemStack)(o).getValue();
if(stack.isItemEqual(output)){ if(stack.isItemEqual(output)){
return (ItemStack)((Map.Entry)o).getKey(); return (ItemStack)(o).getKey();
} }
} }
return null; return null;

View file

@ -391,7 +391,7 @@ public class ItemCrafting{
} }
//Resonant Rice //Resonant Rice
if(ConfigCrafting.RESONANT_RICE.isEnabled() && !OreDictionary.getOres("nuggetEnderium", false).isEmpty()){ if(ConfigCrafting.RESONANT_RICE.isEnabled() && !OreDictionary.getOres("nuggetEnderium").isEmpty()){
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemResonantRice), GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemResonantRice),
new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), "nuggetEnderium", Items.gunpowder)); new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), "nuggetEnderium", Items.gunpowder));
} }
@ -533,10 +533,10 @@ public class ItemCrafting{
public static void initMashedFoodRecipes(){ public static void initMashedFoodRecipes(){
if(ConfigCrafting.MASHED_FOOD.isEnabled()){ if(ConfigCrafting.MASHED_FOOD.isEnabled()){
for(Object item : Item.itemRegistry){ for(Item item : Item.itemRegistry){
if(item instanceof ItemFood || item instanceof IPlantable || item instanceof IGrowable){ if(item instanceof ItemFood || item instanceof IPlantable || item instanceof IGrowable){
if(!isBlacklisted(item)){ if(!isBlacklisted(item)){
ItemStack ingredient = new ItemStack((Item)item, 1, Util.WILDCARD); ItemStack ingredient = new ItemStack(item, 1, Util.WILDCARD);
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemMisc, 8, TheMiscItems.MASHED_FOOD.ordinal()), ingredient, ingredient, ingredient, ingredient, new ItemStack(InitItems.itemKnife, 1, Util.WILDCARD)); GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemMisc, 8, TheMiscItems.MASHED_FOOD.ordinal()), ingredient, ingredient, ingredient, ingredient, new ItemStack(InitItems.itemKnife, 1, Util.WILDCARD));
recipesMashedFood.add(Util.GetRecipes.lastIRecipe()); recipesMashedFood.add(Util.GetRecipes.lastIRecipe());
} }
@ -545,9 +545,9 @@ public class ItemCrafting{
} }
} }
private static boolean isBlacklisted(Object item){ private static boolean isBlacklisted(Item item){
for(String except : ConfigValues.mashedFoodCraftingExceptions){ for(String except : ConfigValues.mashedFoodCraftingExceptions){
if(Item.itemRegistry.getNameForObject(item).equals(except)){ if(item.getRegistryName().equals(except)){
return true; return true;
} }
} }

View file

@ -10,6 +10,7 @@
package de.ellpeck.actuallyadditions.mod.event; package de.ellpeck.actuallyadditions.mod.event;
import de.ellpeck.actuallyadditions.api.Position;
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.InitItems;
import net.minecraft.block.Block; import net.minecraft.block.Block;
@ -28,9 +29,9 @@ public class BucketFillEvent{
} }
private void fillBucket(FillBucketEvent event, Item item, Block fluid){ private void fillBucket(FillBucketEvent event, Item item, Block fluid){
Block block = event.world.getBlock(event.target.blockX, event.target.blockY, event.target.blockZ); Block block = Position.fromBlockPos(event.target.getBlockPos()).getBlock(event.world);
if(block == fluid){ if(block == fluid){
event.world.setBlockToAir(event.target.blockX, event.target.blockY, event.target.blockZ); event.world.setBlockToAir(event.target.getBlockPos());
event.result = new ItemStack(item); event.result = new ItemStack(item);
event.setResult(Event.Result.ALLOW); event.setResult(Event.Result.ALLOW);
} }

View file

@ -10,6 +10,7 @@
package de.ellpeck.actuallyadditions.mod.event; package de.ellpeck.actuallyadditions.mod.event;
import de.ellpeck.actuallyadditions.api.Position;
import de.ellpeck.actuallyadditions.api.block.IHudDisplay; import de.ellpeck.actuallyadditions.api.block.IHudDisplay;
import de.ellpeck.actuallyadditions.api.tile.IEnergyDisplay; import de.ellpeck.actuallyadditions.api.tile.IEnergyDisplay;
import de.ellpeck.actuallyadditions.mod.tile.IRedstoneToggle; import de.ellpeck.actuallyadditions.mod.tile.IRedstoneToggle;
@ -37,7 +38,7 @@ public class HudEvent{
Profiler profiler = minecraft.mcProfiler; Profiler profiler = minecraft.mcProfiler;
EntityPlayer player = minecraft.thePlayer; EntityPlayer player = minecraft.thePlayer;
MovingObjectPosition posHit = minecraft.objectMouseOver; MovingObjectPosition posHit = minecraft.objectMouseOver;
FontRenderer font = minecraft.fontRenderer; FontRenderer font = minecraft.fontRendererObj;
ItemStack stack = player.getCurrentEquippedItem(); ItemStack stack = player.getCurrentEquippedItem();
profiler.startSection(ModUtil.MOD_ID+"Hud"); profiler.startSection(ModUtil.MOD_ID+"Hud");
@ -51,8 +52,8 @@ public class HudEvent{
} }
if(posHit != null){ if(posHit != null){
Block blockHit = minecraft.theWorld.getBlock(posHit.blockX, posHit.blockY, posHit.blockZ); Block blockHit = Position.fromBlockPos(posHit.getBlockPos()).getBlock(minecraft.theWorld);
TileEntity tileHit = minecraft.theWorld.getTileEntity(posHit.blockX, posHit.blockY, posHit.blockZ); TileEntity tileHit = minecraft.theWorld.getTileEntity(posHit.getBlockPos());
if(blockHit instanceof IHudDisplay){ if(blockHit instanceof IHudDisplay){
profiler.startSection("BlockHudDisplay"); profiler.startSection("BlockHudDisplay");

View file

@ -20,7 +20,6 @@ import de.ellpeck.actuallyadditions.mod.util.playerdata.PersistentServerData;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
@ -37,8 +36,8 @@ public class PlayerObtainEvents{
if(ConfigBoolValues.GIVE_BOOKLET_ON_FIRST_CRAFT.isEnabled()){ if(ConfigBoolValues.GIVE_BOOKLET_ON_FIRST_CRAFT.isEnabled()){
if(!event.player.worldObj.isRemote && event.crafting.getItem() != InitItems.itemBooklet){ if(!event.player.worldObj.isRemote && event.crafting.getItem() != InitItems.itemBooklet){
String itemName = Item.itemRegistry.getNameForObject(event.crafting.getItem()); String itemName = event.crafting.getItem().getRegistryName();
String blockName = Block.blockRegistry.getNameForObject(Block.getBlockFromItem(event.crafting.getItem())); String blockName = Block.getBlockFromItem(event.crafting.getItem()).getRegistryName();
if((itemName != null && itemName.toLowerCase(Locale.ROOT).contains(ModUtil.MOD_ID_LOWER)) || (blockName != null && blockName.toLowerCase(Locale.ROOT).contains(ModUtil.MOD_ID_LOWER))){ if((itemName != null && itemName.toLowerCase(Locale.ROOT).contains(ModUtil.MOD_ID_LOWER)) || (blockName != null && blockName.toLowerCase(Locale.ROOT).contains(ModUtil.MOD_ID_LOWER))){
NBTTagCompound compound = PersistentServerData.getDataFromPlayer(event.player); NBTTagCompound compound = PersistentServerData.getDataFromPlayer(event.player);
@ -47,7 +46,7 @@ public class PlayerObtainEvents{
WorldData.makeDirty(); WorldData.makeDirty();
EntityItem entityItem = new EntityItem(event.player.worldObj, event.player.posX, event.player.posY, event.player.posZ, new ItemStack(InitItems.itemBooklet)); EntityItem entityItem = new EntityItem(event.player.worldObj, event.player.posX, event.player.posY, event.player.posZ, new ItemStack(InitItems.itemBooklet));
entityItem.delayBeforeCanPickup = 0; entityItem.setPickupDelay(0);
event.player.worldObj.spawnEntityInWorld(entityItem); event.player.worldObj.spawnEntityInWorld(entityItem);
} }
} }

View file

@ -10,20 +10,7 @@
package de.ellpeck.actuallyadditions.mod.gen; package de.ellpeck.actuallyadditions.mod.gen;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityChest;
import net.minecraft.util.WeightedRandomChestContent;
import net.minecraft.world.World;
import net.minecraft.world.gen.structure.StructureBoundingBox;
import net.minecraft.world.gen.structure.StructureComponent;
import net.minecraft.world.gen.structure.StructureVillagePieces; import net.minecraft.world.gen.structure.StructureVillagePieces;
import net.minecraftforge.common.ChestGenHooks;
import java.util.List;
import java.util.Random;
public class VillageComponentJamHouse extends StructureVillagePieces.House1{ public class VillageComponentJamHouse extends StructureVillagePieces.House1{
@ -38,7 +25,8 @@ public class VillageComponentJamHouse extends StructureVillagePieces.House1{
} }
public VillageComponentJamHouse(StructureBoundingBox boundingBox, int par5){ //TODO Fix village
/*public VillageComponentJamHouse(StructureBoundingBox boundingBox, int par5){
this.coordBaseMode = par5; this.coordBaseMode = par5;
this.boundingBox = boundingBox; this.boundingBox = boundingBox;
} }
@ -200,5 +188,5 @@ public class VillageComponentJamHouse extends StructureVillagePieces.House1{
@Override @Override
protected int getVillagerType(int par1){ protected int getVillagerType(int par1){
return ConfigIntValues.JAM_VILLAGER_ID.getValue(); return ConfigIntValues.JAM_VILLAGER_ID.getValue();
} }*/
} }

View file

@ -13,10 +13,10 @@ package de.ellpeck.actuallyadditions.mod.gen;
import net.minecraft.world.gen.structure.StructureVillagePieces; import net.minecraft.world.gen.structure.StructureVillagePieces;
import net.minecraftforge.fml.common.registry.VillagerRegistry; import net.minecraftforge.fml.common.registry.VillagerRegistry;
import java.util.List;
import java.util.Random; import java.util.Random;
public class VillageJamHouseHandler implements VillagerRegistry.IVillageCreationHandler{ //TODO Fix village
public abstract class VillageJamHouseHandler implements VillagerRegistry.IVillageCreationHandler{
@Override @Override
public StructureVillagePieces.PieceWeight getVillagePieceWeight(Random random, int i){ public StructureVillagePieces.PieceWeight getVillagePieceWeight(Random random, int i){
@ -28,8 +28,8 @@ public class VillageJamHouseHandler implements VillagerRegistry.IVillageCreation
return VillageComponentJamHouse.class; return VillageComponentJamHouse.class;
} }
@Override /*@Override
public Object buildComponent(StructureVillagePieces.PieceWeight villagePiece, StructureVillagePieces.Start startPiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5){ public Object buildComponent(StructureVillagePieces.PieceWeight villagePiece, StructureVillagePieces.Start startPiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5){
return VillageComponentJamHouse.buildComponent(pieces, p1, p2, p3, p4); return VillageComponentJamHouse.buildComponent(pieces, p1, p2, p3, p4);
} }*/
} }

View file

@ -21,6 +21,7 @@ import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot; import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IChatComponent;
@InventoryContainer @InventoryContainer
public class ContainerDrill extends Container{ public class ContainerDrill extends Container{
@ -72,7 +73,7 @@ public class ContainerDrill extends Container{
final int hotbarStart = inventoryEnd+1; final int hotbarStart = inventoryEnd+1;
final int hotbarEnd = hotbarStart+8; final int hotbarEnd = hotbarStart+8;
Slot theSlot = (Slot)this.inventorySlots.get(slot); Slot theSlot = this.inventorySlots.get(slot);
if(theSlot != null && theSlot.getHasStack()){ if(theSlot != null && theSlot.getHasStack()){
ItemStack newStack = theSlot.getStack(); ItemStack newStack = theSlot.getStack();
@ -149,15 +150,20 @@ public class ContainerDrill extends Container{
public ItemStack[] slots = new ItemStack[SLOT_AMOUNT]; public ItemStack[] slots = new ItemStack[SLOT_AMOUNT];
@Override @Override
public String getInventoryName(){ public String getName(){
return "drill"; return "drill";
} }
@Override @Override
public boolean hasCustomInventoryName(){ public boolean hasCustomName(){
return false; return false;
} }
@Override
public IChatComponent getDisplayName(){
return null;
}
@Override @Override
public int getInventoryStackLimit(){ public int getInventoryStackLimit(){
return 64; return 64;
@ -168,29 +174,44 @@ public class ContainerDrill extends Container{
} }
@Override
public void openInventory(){
}
@Override
public void closeInventory(){
}
@Override @Override
public boolean isItemValidForSlot(int slot, ItemStack stack){ public boolean isItemValidForSlot(int slot, ItemStack stack){
return true; return true;
} }
@Override
public int getField(int id){
return 0;
}
@Override
public void setField(int id, int value){
}
@Override
public int getFieldCount(){
return 0;
}
@Override
public void clear(){
this.slots = new ItemStack[this.slots.length];
}
@Override @Override
public boolean isUseableByPlayer(EntityPlayer player){ public boolean isUseableByPlayer(EntityPlayer player){
return true; return true;
} }
@Override @Override
public ItemStack getStackInSlotOnClosing(int i){ public void openInventory(EntityPlayer player){
return getStackInSlot(i);
}
@Override
public void closeInventory(EntityPlayer player){
} }
@Override @Override
@ -233,5 +254,12 @@ public class ContainerDrill extends Container{
} }
return null; return null;
} }
@Override
public ItemStack removeStackFromSlot(int index){
ItemStack stack = this.slots[index];
this.slots[index] = null;
return stack;
}
} }
} }

View file

@ -41,7 +41,7 @@ public class GuiBreaker extends GuiContainer{
@Override @Override
public void drawGuiContainerForegroundLayer(int x, int y){ public void drawGuiContainerForegroundLayer(int x, int y){
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.breaker.getInventoryName()); AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.breaker.getName());
} }
@Override @Override

View file

@ -66,22 +66,22 @@ public class GuiCoffeeMachine extends GuiContainer{
String text1 = this.machine.storage.getEnergyStored()+"/"+this.machine.storage.getMaxEnergyStored()+" RF"; String text1 = this.machine.storage.getEnergyStored()+"/"+this.machine.storage.getMaxEnergyStored()+" RF";
if(x >= guiLeft+16 && y >= guiTop+5 && x <= guiLeft+23 && y <= guiTop+89){ if(x >= guiLeft+16 && y >= guiTop+5 && x <= guiLeft+23 && y <= guiTop+89){
this.func_146283_a(Collections.singletonList(text1), x, y); this.drawHoveringText(Collections.singletonList(text1), x, y);
} }
String text3 = StringUtil.getFluidInfo(this.machine.tank); String text3 = StringUtil.getFluidInfo(this.machine.tank);
if(x >= guiLeft+27 && y >= guiTop+5 && x <= guiLeft+33 && y <= guiTop+70){ if(x >= guiLeft+27 && y >= guiTop+5 && x <= guiLeft+33 && y <= guiTop+70){
this.func_146283_a(Collections.singletonList(text3), x, y); this.drawHoveringText(Collections.singletonList(text3), x, y);
} }
String text2 = this.machine.coffeeCacheAmount+"/"+TileEntityCoffeeMachine.COFFEE_CACHE_MAX_AMOUNT+" "+StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.coffee"); String text2 = this.machine.coffeeCacheAmount+"/"+TileEntityCoffeeMachine.COFFEE_CACHE_MAX_AMOUNT+" "+StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.coffee");
if(x >= guiLeft+40 && y >= guiTop+25 && x <= guiLeft+49 && y <= guiTop+56){ if(x >= guiLeft+40 && y >= guiTop+25 && x <= guiLeft+49 && y <= guiTop+56){
this.func_146283_a(Collections.singletonList(text2), x, y); this.drawHoveringText(Collections.singletonList(text2), x, y);
} }
} }
@Override @Override
public void drawGuiContainerForegroundLayer(int x, int y){ public void drawGuiContainerForegroundLayer(int x, int y){
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.machine.getInventoryName()); AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.machine.getName());
} }
@Override @Override

View file

@ -41,7 +41,7 @@ public class GuiDropper extends GuiContainer{
@Override @Override
public void drawGuiContainerForegroundLayer(int x, int y){ public void drawGuiContainerForegroundLayer(int x, int y){
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.dropper.getInventoryName()); AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.dropper.getName());
} }
@Override @Override

View file

@ -41,13 +41,13 @@ public class GuiEnergizer extends GuiContainer{
super.drawScreen(x, y, f); super.drawScreen(x, y, f);
String text1 = this.energizer.storage.getEnergyStored()+"/"+this.energizer.storage.getMaxEnergyStored()+" RF"; String text1 = this.energizer.storage.getEnergyStored()+"/"+this.energizer.storage.getMaxEnergyStored()+" RF";
if(x >= guiLeft+57 && y >= guiTop+6 && x <= guiLeft+72 && y <= guiTop+88){ if(x >= guiLeft+57 && y >= guiTop+6 && x <= guiLeft+72 && y <= guiTop+88){
this.func_146283_a(Collections.singletonList(text1), x, y); this.drawHoveringText(Collections.singletonList(text1), x, y);
} }
} }
@Override @Override
public void drawGuiContainerForegroundLayer(int x, int y){ public void drawGuiContainerForegroundLayer(int x, int y){
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.energizer.getInventoryName()); AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.energizer.getName());
} }
@Override @Override

View file

@ -41,13 +41,13 @@ public class GuiEnervator extends GuiContainer{
super.drawScreen(x, y, f); super.drawScreen(x, y, f);
String text1 = this.enervator.storage.getEnergyStored()+"/"+this.enervator.storage.getMaxEnergyStored()+" RF"; String text1 = this.enervator.storage.getEnergyStored()+"/"+this.enervator.storage.getMaxEnergyStored()+" RF";
if(x >= guiLeft+57 && y >= guiTop+6 && x <= guiLeft+72 && y <= guiTop+88){ if(x >= guiLeft+57 && y >= guiTop+6 && x <= guiLeft+72 && y <= guiTop+88){
this.func_146283_a(Collections.singletonList(text1), x, y); this.drawHoveringText(Collections.singletonList(text1), x, y);
} }
} }
@Override @Override
public void drawGuiContainerForegroundLayer(int x, int y){ public void drawGuiContainerForegroundLayer(int x, int y){
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.enervator.getInventoryName()); AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.enervator.getName());
} }
@Override @Override

View file

@ -43,13 +43,13 @@ public class GuiFluidCollector extends GuiContainer{
String text2 = StringUtil.getFluidInfo(this.collector.tank); String text2 = StringUtil.getFluidInfo(this.collector.tank);
if(x >= guiLeft+68 && y >= guiTop+6 && x <= guiLeft+83 && y <= guiTop+88){ if(x >= guiLeft+68 && y >= guiTop+6 && x <= guiLeft+83 && y <= guiTop+88){
this.func_146283_a(Collections.singletonList(text2), x, y); this.drawHoveringText(Collections.singletonList(text2), x, y);
} }
} }
@Override @Override
public void drawGuiContainerForegroundLayer(int x, int y){ public void drawGuiContainerForegroundLayer(int x, int y){
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.collector.getInventoryName()); AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.collector.getName());
} }
@Override @Override

View file

@ -41,13 +41,13 @@ public class GuiFurnaceDouble extends GuiContainer{
super.drawScreen(x, y, f); super.drawScreen(x, y, f);
String text = this.tileFurnace.storage.getEnergyStored()+"/"+this.tileFurnace.storage.getMaxEnergyStored()+" RF"; String text = this.tileFurnace.storage.getEnergyStored()+"/"+this.tileFurnace.storage.getMaxEnergyStored()+" RF";
if(x >= guiLeft+28 && y >= guiTop+6 && x <= guiLeft+43 && y <= guiTop+88){ if(x >= guiLeft+28 && y >= guiTop+6 && x <= guiLeft+43 && y <= guiTop+88){
this.func_146283_a(Collections.singletonList(text), x, y); this.drawHoveringText(Collections.singletonList(text), x, y);
} }
} }
@Override @Override
public void drawGuiContainerForegroundLayer(int x, int y){ public void drawGuiContainerForegroundLayer(int x, int y){
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.tileFurnace.getInventoryName()); AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.tileFurnace.getName());
} }
@Override @Override

View file

@ -33,6 +33,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -80,17 +81,17 @@ public class GuiInputter extends GuiContainer{
public void initGui(){ public void initGui(){
super.initGui(); super.initGui();
this.fieldPullStart = new GuiTextField(this.fontRendererObj, guiLeft+13, guiTop+80+(isAdvanced ? OFFSET_ADVANCED : 0), 27, 8); this.fieldPullStart = new GuiTextField(3000, this.fontRendererObj, guiLeft+13, guiTop+80+(isAdvanced ? OFFSET_ADVANCED : 0), 27, 8);
this.fieldPullStart.setMaxStringLength(4); this.fieldPullStart.setMaxStringLength(4);
this.fieldPullStart.setEnableBackgroundDrawing(false); this.fieldPullStart.setEnableBackgroundDrawing(false);
this.fieldPullEnd = new GuiTextField(this.fontRendererObj, guiLeft+50, guiTop+80+(isAdvanced ? OFFSET_ADVANCED : 0), 27, 8); this.fieldPullEnd = new GuiTextField(3001, this.fontRendererObj, guiLeft+50, guiTop+80+(isAdvanced ? OFFSET_ADVANCED : 0), 27, 8);
this.fieldPullEnd.setMaxStringLength(4); this.fieldPullEnd.setMaxStringLength(4);
this.fieldPullEnd.setEnableBackgroundDrawing(false); this.fieldPullEnd.setEnableBackgroundDrawing(false);
this.fieldPutStart = new GuiTextField(this.fontRendererObj, guiLeft+98, guiTop+80+(isAdvanced ? OFFSET_ADVANCED : 0), 27, 8); this.fieldPutStart = new GuiTextField(3002, this.fontRendererObj, guiLeft+98, guiTop+80+(isAdvanced ? OFFSET_ADVANCED : 0), 27, 8);
this.fieldPutStart.setMaxStringLength(4); this.fieldPutStart.setMaxStringLength(4);
this.fieldPutStart.setEnableBackgroundDrawing(false); this.fieldPutStart.setEnableBackgroundDrawing(false);
this.fieldPutEnd = new GuiTextField(this.fontRendererObj, guiLeft+135, guiTop+80+(isAdvanced ? OFFSET_ADVANCED : 0), 27, 8); this.fieldPutEnd = new GuiTextField(3004, this.fontRendererObj, guiLeft+135, guiTop+80+(isAdvanced ? OFFSET_ADVANCED : 0), 27, 8);
this.fieldPutEnd.setMaxStringLength(4); this.fieldPutEnd.setMaxStringLength(4);
this.fieldPutEnd.setEnableBackgroundDrawing(false); this.fieldPutEnd.setEnableBackgroundDrawing(false);
@ -130,36 +131,36 @@ public class GuiInputter extends GuiContainer{
ArrayList list = new ArrayList(); ArrayList list = new ArrayList();
list.add(EnumChatFormatting.BOLD+text1); list.add(EnumChatFormatting.BOLD+text1);
list.addAll(infoList); list.addAll(infoList);
this.func_146283_a(list, x, y); this.drawHoveringText(list, x, y);
} }
String text2 = this.tileInputter.isPutWhitelist ? StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.whitelist") : StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.blacklist"); String text2 = this.tileInputter.isPutWhitelist ? StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.whitelist") : StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.blacklist");
if(x >= guiLeft+157 && y >= guiTop+16 && x <= guiLeft+172 && y <= guiTop+31){ if(x >= guiLeft+157 && y >= guiTop+16 && x <= guiLeft+172 && y <= guiTop+31){
ArrayList list = new ArrayList(); ArrayList list = new ArrayList();
list.add(EnumChatFormatting.BOLD+text2); list.add(EnumChatFormatting.BOLD+text2);
list.addAll(infoList); list.addAll(infoList);
this.func_146283_a(list, x, y); this.drawHoveringText(list, x, y);
} }
} }
int newTopOffset = this.guiTop+(this.isAdvanced ? OFFSET_ADVANCED : 0); int newTopOffset = this.guiTop+(this.isAdvanced ? OFFSET_ADVANCED : 0);
//Info Mode on! //Info Mode on!
if(x >= guiLeft+11 && y >= newTopOffset+65 && x <= guiLeft+11+31 && y <= newTopOffset+65+12){ if(x >= guiLeft+11 && y >= newTopOffset+65 && x <= guiLeft+11+31 && y <= newTopOffset+65+12){
this.func_146283_a(this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID_LOWER+".inputter.info.1").replace("<p>", StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.pull")), 200), x, y); this.drawHoveringText(this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID_LOWER+".inputter.info.1").replace("<p>", StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.pull")), 200), x, y);
} }
if(x >= guiLeft+96 && y >= newTopOffset+65 && x <= guiLeft+96+31 && y <= newTopOffset+65+12){ if(x >= guiLeft+96 && y >= newTopOffset+65 && x <= guiLeft+96+31 && y <= newTopOffset+65+12){
this.func_146283_a(this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID_LOWER+".inputter.info.1").replace("<p>", StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.put")), 200), x, y); this.drawHoveringText(this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID_LOWER+".inputter.info.1").replace("<p>", StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.put")), 200), x, y);
} }
if(x >= guiLeft+48 && y >= newTopOffset+65 && x <= guiLeft+48+31 && y <= newTopOffset+65+12){ if(x >= guiLeft+48 && y >= newTopOffset+65 && x <= guiLeft+48+31 && y <= newTopOffset+65+12){
this.func_146283_a(this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID_LOWER+".inputter.info.2").replace("<p>", StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.pull")), 200), x, y); this.drawHoveringText(this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID_LOWER+".inputter.info.2").replace("<p>", StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.pull")), 200), x, y);
} }
if(x >= guiLeft+133 && y >= newTopOffset+65 && x <= guiLeft+133+31 && y <= newTopOffset+65+12){ if(x >= guiLeft+133 && y >= newTopOffset+65 && x <= guiLeft+133+31 && y <= newTopOffset+65+12){
this.func_146283_a(this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID_LOWER+".inputter.info.2").replace("<p>", StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.put")), 200), x, y); this.drawHoveringText(this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID_LOWER+".inputter.info.2").replace("<p>", StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.put")), 200), x, y);
} }
} }
@Override @Override
public void drawGuiContainerForegroundLayer(int x, int y){ public void drawGuiContainerForegroundLayer(int x, int y){
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.tileInputter.getInventoryName()); AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.tileInputter.getName());
} }
@Override @Override
@ -190,7 +191,7 @@ public class GuiInputter extends GuiContainer{
} }
@Override @Override
protected void mouseClicked(int par1, int par2, int par3){ protected void mouseClicked(int par1, int par2, int par3) throws IOException{
this.fieldPutStart.mouseClicked(par1, par2, par3); this.fieldPutStart.mouseClicked(par1, par2, par3);
this.fieldPutEnd.mouseClicked(par1, par2, par3); this.fieldPutEnd.mouseClicked(par1, par2, par3);
this.fieldPullStart.mouseClicked(par1, par2, par3); this.fieldPullStart.mouseClicked(par1, par2, par3);
@ -200,7 +201,7 @@ public class GuiInputter extends GuiContainer{
} }
@Override @Override
public void keyTyped(char theChar, int key){ public void keyTyped(char theChar, int key) throws IOException{
if(key == Keyboard.KEY_RETURN || key == Keyboard.KEY_NUMPADENTER){ if(key == Keyboard.KEY_RETURN || key == Keyboard.KEY_NUMPADENTER){
if(this.fieldPutStart.isFocused()){ if(this.fieldPutStart.isFocused()){
this.setVariable(this.fieldPutStart, 0); this.setVariable(this.fieldPutStart, 0);
@ -282,8 +283,8 @@ public class GuiInputter extends GuiContainer{
if(this.visible){ if(this.visible){
mc.getTextureManager().bindTexture(resLoc); mc.getTextureManager().bindTexture(resLoc);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.field_146123_n = x >= this.xPosition && y >= this.yPosition && x < this.xPosition+this.width && y < this.yPosition+this.height; this.hovered = x >= this.xPosition && y >= this.yPosition && x < this.xPosition+this.width && y < this.yPosition+this.height;
int k = this.getHoverState(this.field_146123_n); int k = this.getHoverState(this.hovered);
GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(770, 771, 1, 0); OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
@ -297,11 +298,11 @@ public class GuiInputter extends GuiContainer{
else if(!this.enabled){ else if(!this.enabled){
color = 10526880; color = 10526880;
} }
else if(this.field_146123_n){ else if(this.hovered){
color = 16777120; color = 16777120;
} }
this.drawCenteredString(mc.fontRenderer, this.displayString, this.xPosition+this.width/2, this.yPosition+(this.height-8)/2, color); this.drawCenteredString(mc.fontRendererObj, this.displayString, this.xPosition+this.width/2, this.yPosition+(this.height-8)/2, color);
} }
} }
} }
@ -319,8 +320,8 @@ public class GuiInputter extends GuiContainer{
if(this.visible){ if(this.visible){
mc.getTextureManager().bindTexture(resLoc); mc.getTextureManager().bindTexture(resLoc);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.field_146123_n = x >= this.xPosition && y >= this.yPosition && x < this.xPosition+this.width && y < this.yPosition+this.height; this.hovered = x >= this.xPosition && y >= this.yPosition && x < this.xPosition+this.width && y < this.yPosition+this.height;
int k = this.getHoverState(this.field_146123_n); int k = this.getHoverState(this.hovered);
GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(770, 771, 1, 0); OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

View file

@ -41,7 +41,7 @@ public class GuiPhantomPlacer extends GuiContainer{
@Override @Override
public void drawGuiContainerForegroundLayer(int x, int y){ public void drawGuiContainerForegroundLayer(int x, int y){
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.placer.getInventoryName()); AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.placer.getName());
} }
@Override @Override

View file

@ -72,13 +72,13 @@ public class GuiRangedCollector extends GuiContainer{
String text1 = this.collector.isWhitelist ? StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.whitelist") : StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.blacklist"); String text1 = this.collector.isWhitelist ? StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.whitelist") : StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.blacklist");
if(x >= guiLeft+3 && y >= guiTop+16 && x <= guiLeft+18 && y <= guiTop+31){ if(x >= guiLeft+3 && y >= guiTop+16 && x <= guiLeft+18 && y <= guiTop+31){
this.func_146283_a(Collections.singletonList(text1), x, y); this.drawHoveringText(Collections.singletonList(text1), x, y);
} }
} }
@Override @Override
public void drawGuiContainerForegroundLayer(int x, int y){ public void drawGuiContainerForegroundLayer(int x, int y){
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.collector.getInventoryName()); AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.collector.getName());
} }
@Override @Override

View file

@ -29,6 +29,8 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import java.io.IOException;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GuiSmileyCloud extends GuiContainer{ public class GuiSmileyCloud extends GuiContainer{
@ -59,7 +61,7 @@ public class GuiSmileyCloud extends GuiContainer{
public void initGui(){ public void initGui(){
super.initGui(); super.initGui();
this.nameField = new GuiTextField(this.fontRendererObj, guiLeft+5, guiTop+6, 114, 8); this.nameField = new GuiTextField(4000, this.fontRendererObj, guiLeft+5, guiTop+6, 114, 8);
this.nameField.setMaxStringLength(20); this.nameField.setMaxStringLength(20);
this.nameField.setEnableBackgroundDrawing(false); this.nameField.setEnableBackgroundDrawing(false);
this.nameField.setFocused(true); this.nameField.setFocused(true);
@ -89,13 +91,13 @@ public class GuiSmileyCloud extends GuiContainer{
} }
@Override @Override
protected void mouseClicked(int par1, int par2, int par3){ protected void mouseClicked(int par1, int par2, int par3) throws IOException{
this.nameField.mouseClicked(par1, par2, par3); this.nameField.mouseClicked(par1, par2, par3);
super.mouseClicked(par1, par2, par3); super.mouseClicked(par1, par2, par3);
} }
@Override @Override
public void keyTyped(char theChar, int key){ public void keyTyped(char theChar, int key) throws IOException{
if(key != 1 && this.nameField.isFocused()){ if(key != 1 && this.nameField.isFocused()){
if(key == Keyboard.KEY_RETURN || key == Keyboard.KEY_NUMPADENTER){ if(key == Keyboard.KEY_RETURN || key == Keyboard.KEY_NUMPADENTER){
this.setVariable(this.nameField); this.setVariable(this.nameField);

View file

@ -276,29 +276,29 @@ public class InitItems{
CompatUtil.registerMFRSeed(itemFlaxSeed); CompatUtil.registerMFRSeed(itemFlaxSeed);
itemCoffeeSeed = new ItemSeed("itemCoffeeSeed", "seedCoffeeBeans", InitBlocks.blockCoffee, itemCoffeeBean, 0); itemCoffeeSeed = new ItemSeed("itemCoffeeSeed", "seedCoffeeBeans", InitBlocks.blockCoffee, itemCoffeeBean, 0);
CompatUtil.registerMFRSeed(itemCoffeeSeed); CompatUtil.registerMFRSeed(itemCoffeeSeed);
itemPickaxeEmerald = new ItemPickaxeAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemPickaxeEmerald", EnumRarity.epic); itemPickaxeEmerald = new ItemPickaxeAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemPickaxeEmerald", EnumRarity.EPIC);
itemAxeEmerald = new ItemAxeAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemAxeEmerald", EnumRarity.epic); itemAxeEmerald = new ItemAxeAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemAxeEmerald", EnumRarity.EPIC);
itemShovelEmerald = new ItemShovelAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemShovelEmerald", EnumRarity.epic); itemShovelEmerald = new ItemShovelAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemShovelEmerald", EnumRarity.EPIC);
itemSwordEmerald = new ItemSwordAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemSwordEmerald", EnumRarity.epic); itemSwordEmerald = new ItemSwordAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemSwordEmerald", EnumRarity.EPIC);
itemHoeEmerald = new ItemHoeAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemHoeEmerald", EnumRarity.epic); itemHoeEmerald = new ItemHoeAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemHoeEmerald", EnumRarity.EPIC);
itemPickaxeObsidian = new ItemPickaxeAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemPickaxeObsidian", EnumRarity.uncommon); itemPickaxeObsidian = new ItemPickaxeAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemPickaxeObsidian", EnumRarity.UNCOMMON);
itemAxeObsidian = new ItemAxeAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemAxeObsidian", EnumRarity.uncommon); itemAxeObsidian = new ItemAxeAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemAxeObsidian", EnumRarity.UNCOMMON);
itemShovelObsidian = new ItemShovelAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemShovelObsidian", EnumRarity.uncommon); itemShovelObsidian = new ItemShovelAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemShovelObsidian", EnumRarity.UNCOMMON);
itemSwordObsidian = new ItemSwordAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemSwordObsidian", EnumRarity.uncommon); itemSwordObsidian = new ItemSwordAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemSwordObsidian", EnumRarity.UNCOMMON);
itemHoeObsidian = new ItemHoeAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemHoeObsidian", EnumRarity.uncommon); itemHoeObsidian = new ItemHoeAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemHoeObsidian", EnumRarity.UNCOMMON);
itemPickaxeQuartz = new ItemPickaxeAA(InitToolMaterials.toolMaterialQuartz, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "itemPickaxeQuartz", EnumRarity.rare); itemPickaxeQuartz = new ItemPickaxeAA(InitToolMaterials.toolMaterialQuartz, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "itemPickaxeQuartz", EnumRarity.RARE);
itemAxeQuartz = new ItemAxeAA(InitToolMaterials.toolMaterialQuartz, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "itemAxeQuartz", EnumRarity.rare); itemAxeQuartz = new ItemAxeAA(InitToolMaterials.toolMaterialQuartz, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "itemAxeQuartz", EnumRarity.RARE);
itemShovelQuartz = new ItemShovelAA(InitToolMaterials.toolMaterialQuartz, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "itemShovelQuartz", EnumRarity.rare); itemShovelQuartz = new ItemShovelAA(InitToolMaterials.toolMaterialQuartz, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "itemShovelQuartz", EnumRarity.RARE);
itemSwordQuartz = new ItemSwordAA(InitToolMaterials.toolMaterialQuartz, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "itemSwordQuartz", EnumRarity.rare); itemSwordQuartz = new ItemSwordAA(InitToolMaterials.toolMaterialQuartz, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "itemSwordQuartz", EnumRarity.RARE);
itemHoeQuartz = new ItemHoeAA(InitToolMaterials.toolMaterialQuartz, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "itemHoeQuartz", EnumRarity.rare); itemHoeQuartz = new ItemHoeAA(InitToolMaterials.toolMaterialQuartz, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "itemHoeQuartz", EnumRarity.RARE);
woodenPaxel = new ItemAllToolAA(Item.ToolMaterial.WOOD, "plankWood", "woodenPaxel", EnumRarity.uncommon, 5192733); woodenPaxel = new ItemAllToolAA(Item.ToolMaterial.WOOD, "plankWood", "woodenPaxel", EnumRarity.UNCOMMON, 5192733);
stonePaxel = new ItemAllToolAA(Item.ToolMaterial.STONE, new ItemStack(Blocks.cobblestone), "stonePaxel", EnumRarity.uncommon, 7040621); stonePaxel = new ItemAllToolAA(Item.ToolMaterial.STONE, new ItemStack(Blocks.cobblestone), "stonePaxel", EnumRarity.UNCOMMON, 7040621);
ironPaxel = new ItemAllToolAA(Item.ToolMaterial.IRON, new ItemStack(Items.iron_ingot), "ironPaxel", EnumRarity.rare, 10920613); ironPaxel = new ItemAllToolAA(Item.ToolMaterial.IRON, new ItemStack(Items.iron_ingot), "ironPaxel", EnumRarity.RARE, 10920613);
goldPaxel = new ItemAllToolAA(Item.ToolMaterial.GOLD, new ItemStack(Items.gold_ingot), "goldPaxel", EnumRarity.rare, 16770048); goldPaxel = new ItemAllToolAA(Item.ToolMaterial.GOLD, new ItemStack(Items.gold_ingot), "goldPaxel", EnumRarity.RARE, 16770048);
diamondPaxel = new ItemAllToolAA(Item.ToolMaterial.EMERALD, new ItemStack(Items.diamond), "diamondPaxel", EnumRarity.epic, 3250376); diamondPaxel = new ItemAllToolAA(Item.ToolMaterial.EMERALD, new ItemStack(Items.diamond), "diamondPaxel", EnumRarity.EPIC, 3250376);
emeraldPaxel = new ItemAllToolAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "emeraldPaxel", EnumRarity.epic, 7723338); emeraldPaxel = new ItemAllToolAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "emeraldPaxel", EnumRarity.EPIC, 7723338);
obsidianPaxel = new ItemAllToolAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "obsidianPaxel", EnumRarity.epic, 4166); obsidianPaxel = new ItemAllToolAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "obsidianPaxel", EnumRarity.EPIC, 4166);
quartzPaxel = new ItemAllToolAA(InitToolMaterials.toolMaterialQuartz, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "quartzPaxel", EnumRarity.rare, 1710103); quartzPaxel = new ItemAllToolAA(InitToolMaterials.toolMaterialQuartz, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "quartzPaxel", EnumRarity.RARE, 1710103);
itemPickaxeCrystalRed = new ItemPickaxeAA(InitToolMaterials.toolMaterialCrystalRed, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), "itemPickaxeCrystalRed", Util.CRYSTAL_RED_RARITY); itemPickaxeCrystalRed = new ItemPickaxeAA(InitToolMaterials.toolMaterialCrystalRed, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), "itemPickaxeCrystalRed", Util.CRYSTAL_RED_RARITY);
itemAxeCrystalRed = new ItemAxeAA(InitToolMaterials.toolMaterialCrystalRed, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), "itemAxeCrystalRed", Util.CRYSTAL_RED_RARITY); itemAxeCrystalRed = new ItemAxeAA(InitToolMaterials.toolMaterialCrystalRed, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), "itemAxeCrystalRed", Util.CRYSTAL_RED_RARITY);

View file

@ -13,7 +13,6 @@ package de.ellpeck.actuallyadditions.mod.items.base;
import de.ellpeck.actuallyadditions.mod.creative.CreativeTab; import de.ellpeck.actuallyadditions.mod.creative.CreativeTab;
import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import net.minecraft.entity.Entity;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -23,15 +22,12 @@ public class ItemArmorAA extends ItemArmor{
private ItemStack repairItem; private ItemStack repairItem;
private String name; private String name;
private String[] textures;
private EnumRarity rarity; private EnumRarity rarity;
public ItemArmorAA(String name, ArmorMaterial material, int type, ItemStack repairItem, String textureBase, EnumRarity rarity){ public ItemArmorAA(String name, ArmorMaterial material, int type, ItemStack repairItem, String textureBase, EnumRarity rarity){
super(material, 0, type); super(material, 0, type);
this.repairItem = repairItem; this.repairItem = repairItem;
this.name = name; this.name = name;
String texture = ModUtil.MOD_ID_LOWER+":textures/armor/"+textureBase;
textures = new String[]{texture+"1.png", texture+"2.png"};
this.rarity = rarity; this.rarity = rarity;
this.register(); this.register();
@ -65,11 +61,6 @@ public class ItemArmorAA extends ItemArmor{
return this.rarity; return this.rarity;
} }
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type){
return this.textures[slot == 2 ? 1 : 0];
}
@Override @Override
public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack){ public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack){
return ItemUtil.areItemsEqual(this.repairItem, stack, false); return ItemUtil.areItemsEqual(this.repairItem, stack, false);

View file

@ -56,18 +56,18 @@ public class LensColor extends Lens{
@Override @Override
public boolean invoke(Position hitBlock, IAtomicReconstructor tile){ public boolean invoke(Position hitBlock, IAtomicReconstructor tile){
if(hitBlock != null){ if(hitBlock != null){
if(Util.arrayContains(CONVERTABLE_BLOCKS, hitBlock.getBlock(tile.getWorld())) >= 0 && tile.getEnergy() >= ENERGY_USE){ if(Util.arrayContains(CONVERTABLE_BLOCKS, hitBlock.getBlock(tile.getWorldObject())) >= 0 && tile.getEnergy() >= ENERGY_USE){
int meta = hitBlock.getMetadata(tile.getWorld()); int meta = hitBlock.getMetadata(tile.getWorldObject());
if(meta >= 15){ if(meta >= 15){
hitBlock.setMetadata(tile.getWorld(), 0, 2); hitBlock.setMetadata(tile.getWorldObject(), 0, 2);
} }
else{ else{
hitBlock.setMetadata(tile.getWorld(), meta+1, 2); hitBlock.setMetadata(tile.getWorldObject(), meta+1, 2);
} }
tile.extractEnergy(ENERGY_USE); tile.extractEnergy(ENERGY_USE);
} }
ArrayList<EntityItem> items = (ArrayList<EntityItem>)tile.getWorld().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(hitBlock.getX(), hitBlock.getY(), hitBlock.getZ(), hitBlock.getX()+1, hitBlock.getY()+1, hitBlock.getZ()+1)); ArrayList<EntityItem> items = (ArrayList<EntityItem>)tile.getWorldObject().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.fromBounds(hitBlock.getX(), hitBlock.getY(), hitBlock.getZ(), hitBlock.getX()+1, hitBlock.getY()+1, hitBlock.getZ()+1));
for(EntityItem item : items){ for(EntityItem item : items){
if(item.getEntityItem() != null && tile.getEnergy() >= ENERGY_USE){ if(item.getEntityItem() != null && tile.getEnergy() >= ENERGY_USE){
if(Util.arrayContains(CONVERTABLE_BLOCKS, item.getEntityItem().getItem()) >= 0 || Util.arrayContains(CONVERTABLE_BLOCKS, Block.getBlockFromItem(item.getEntityItem().getItem())) >= 0){ if(Util.arrayContains(CONVERTABLE_BLOCKS, item.getEntityItem().getItem()) >= 0 || Util.arrayContains(CONVERTABLE_BLOCKS, Block.getBlockFromItem(item.getEntityItem().getItem())) >= 0){

View file

@ -28,7 +28,7 @@ public class LensNone extends Lens{
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public boolean invoke(Position hitBlock, IAtomicReconstructor tile){ public boolean invoke(Position hitBlock, IAtomicReconstructor tile){
if(hitBlock != null && !hitBlock.getBlock(tile.getWorld()).isAir(tile.getWorld(), hitBlock.getX(), hitBlock.getY(), hitBlock.getZ())){ if(hitBlock != null && !hitBlock.getBlock(tile.getWorldObject()).isAir(tile.getWorldObject(), hitBlock)){
int range = 2; int range = 2;
//Converting the Blocks //Converting the Blocks
@ -36,19 +36,19 @@ public class LensNone extends Lens{
for(int reachZ = -range; reachZ < range+1; reachZ++){ for(int reachZ = -range; reachZ < range+1; reachZ++){
for(int reachY = -range; reachY < range+1; reachY++){ for(int reachY = -range; reachY < range+1; reachY++){
Position pos = new Position(hitBlock.getX()+reachX, hitBlock.getY()+reachY, hitBlock.getZ()+reachZ); Position pos = new Position(hitBlock.getX()+reachX, hitBlock.getY()+reachY, hitBlock.getZ()+reachZ);
List<LensNoneRecipe> recipes = LensNoneRecipeHandler.getRecipesFor(new ItemStack(pos.getBlock(tile.getWorld()), 1, pos.getMetadata(tile.getWorld()))); List<LensNoneRecipe> recipes = LensNoneRecipeHandler.getRecipesFor(new ItemStack(pos.getBlock(tile.getWorldObject()), 1, pos.getMetadata(tile.getWorldObject())));
for(LensNoneRecipe recipe : recipes){ for(LensNoneRecipe recipe : recipes){
if(recipe != null && tile.getEnergy() >= recipe.energyUse){ if(recipe != null && tile.getEnergy() >= recipe.energyUse){
List<ItemStack> outputs = recipe.getOutputs(); List<ItemStack> outputs = recipe.getOutputs();
if(outputs != null && !outputs.isEmpty()){ if(outputs != null && !outputs.isEmpty()){
ItemStack output = outputs.get(0); ItemStack output = outputs.get(0);
if(output.getItem() instanceof ItemBlock){ if(output.getItem() instanceof ItemBlock){
tile.getWorld().playAuxSFX(2001, pos.getX(), pos.getY(), pos.getZ(), Block.getIdFromBlock(pos.getBlock(tile.getWorld()))+(pos.getMetadata(tile.getWorld()) << 12)); tile.getWorldObject().playAuxSFX(2001, pos, Block.getIdFromBlock(pos.getBlock(tile.getWorldObject()))+(pos.getMetadata(tile.getWorldObject()) << 12));
pos.setBlock(tile.getWorld(), Block.getBlockFromItem(output.getItem()), output.getItemDamage(), 2); pos.setBlock(tile.getWorldObject(), Block.getBlockFromItem(output.getItem()), output.getItemDamage(), 2);
} }
else{ else{
EntityItem item = new EntityItem(tile.getWorld(), pos.getX()+0.5, pos.getY()+0.5, pos.getZ()+0.5, output.copy()); EntityItem item = new EntityItem(tile.getWorldObject(), pos.getX()+0.5, pos.getY()+0.5, pos.getZ()+0.5, output.copy());
tile.getWorld().spawnEntityInWorld(item); tile.getWorldObject().spawnEntityInWorld(item);
} }
tile.extractEnergy(recipe.energyUse); tile.extractEnergy(recipe.energyUse);
break; break;
@ -60,7 +60,7 @@ public class LensNone extends Lens{
} }
//Converting the Items //Converting the Items
ArrayList<EntityItem> items = (ArrayList<EntityItem>)tile.getWorld().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(hitBlock.getX()-range, hitBlock.getY()-range, hitBlock.getZ()-range, hitBlock.getX()+range, hitBlock.getY()+range, hitBlock.getZ()+range)); ArrayList<EntityItem> items = (ArrayList<EntityItem>)tile.getWorldObject().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.fromBounds(hitBlock.getX()-range, hitBlock.getY()-range, hitBlock.getZ()-range, hitBlock.getX()+range, hitBlock.getY()+range, hitBlock.getZ()+range));
for(EntityItem item : items){ for(EntityItem item : items){
ItemStack stack = item.getEntityItem(); ItemStack stack = item.getEntityItem();
if(stack != null){ if(stack != null){

View file

@ -30,15 +30,16 @@ public class InitArmorMaterials{
public static void init(){ public static void init(){
ModUtil.LOGGER.info("Initializing Armor Materials..."); ModUtil.LOGGER.info("Initializing Armor Materials...");
armorMaterialEmerald = EnumHelper.addArmorMaterial("armorMaterialEmerald", 50, new int[]{5, 9, 8, 5}, 15); //TODO Fix armor textures
armorMaterialObsidian = EnumHelper.addArmorMaterial("armorMaterialObsidian", 120, new int[]{3, 4, 3, 1}, 10); armorMaterialEmerald = EnumHelper.addArmorMaterial("armorMaterialEmerald", "TODO", 50, new int[]{5, 9, 8, 5}, 15);
armorMaterialQuartz = EnumHelper.addArmorMaterial("armorMaterialQuartz", 20, new int[]{3, 6, 5, 3}, 8); armorMaterialObsidian = EnumHelper.addArmorMaterial("armorMaterialObsidian", "TODO", 120, new int[]{3, 4, 3, 1}, 10);
armorMaterialQuartz = EnumHelper.addArmorMaterial("armorMaterialQuartz", "TODO", 20, new int[]{3, 6, 5, 3}, 8);
armorMaterialCrystalRed = EnumHelper.addArmorMaterial("armorMaterialCrystalRed", 18, new int[]{3, 7, 6, 3}, 9); armorMaterialCrystalRed = EnumHelper.addArmorMaterial("armorMaterialCrystalRed", "TODO", 18, new int[]{3, 7, 6, 3}, 9);
armorMaterialCrystalBlue = EnumHelper.addArmorMaterial("armorMaterialCrystalBlue", 18, new int[]{3, 7, 6, 3}, 10); armorMaterialCrystalBlue = EnumHelper.addArmorMaterial("armorMaterialCrystalBlue", "TODO", 18, new int[]{3, 7, 6, 3}, 10);
armorMaterialCrystalLightBlue = EnumHelper.addArmorMaterial("armorMaterialCrystalLightBlue", 35, new int[]{7, 9, 7, 5}, 12); armorMaterialCrystalLightBlue = EnumHelper.addArmorMaterial("armorMaterialCrystalLightBlue", "TODO", 35, new int[]{7, 9, 7, 5}, 12);
armorMaterialCrystalBlack = EnumHelper.addArmorMaterial("armorMaterialCrystalBlack", 12, new int[]{1, 4, 3, 1}, 13); armorMaterialCrystalBlack = EnumHelper.addArmorMaterial("armorMaterialCrystalBlack", "TODO", 12, new int[]{1, 4, 3, 1}, 13);
armorMaterialCrystalGreen = EnumHelper.addArmorMaterial("armorMaterialCrystalGreen", 60, new int[]{7, 10, 9, 6}, 18); armorMaterialCrystalGreen = EnumHelper.addArmorMaterial("armorMaterialCrystalGreen", "TODO", 60, new int[]{7, 10, 9, 6}, 18);
armorMaterialCrystalWhite = EnumHelper.addArmorMaterial("armorMaterialCrystalWhite", 18, new int[]{4, 7, 6, 4}, 11); armorMaterialCrystalWhite = EnumHelper.addArmorMaterial("armorMaterialCrystalWhite", "TODO", 18, new int[]{4, 7, 6, 4}, 11);
} }
} }

View file

@ -30,8 +30,8 @@ public class DamageSources extends DamageSource{
} }
@Override @Override
public IChatComponent func_151519_b(EntityLivingBase entity){ public IChatComponent getDeathMessage(EntityLivingBase entity){
String locTag = "death."+ModUtil.MOD_ID_LOWER+"."+this.damageType+"."+(Util.RANDOM.nextInt(this.messageCount)+1); String locTag = "death."+ModUtil.MOD_ID_LOWER+"."+this.damageType+"."+(Util.RANDOM.nextInt(this.messageCount)+1);
return new ChatComponentText(StringUtil.localizeFormatted(locTag, entity.getCommandSenderName())); return new ChatComponentText(StringUtil.localizeFormatted(locTag, entity.getName()));
} }
} }

View file

@ -10,6 +10,7 @@
package de.ellpeck.actuallyadditions.mod.misc; package de.ellpeck.actuallyadditions.mod.misc;
import de.ellpeck.actuallyadditions.api.Position;
import net.minecraft.block.BlockDispenser; import net.minecraft.block.BlockDispenser;
import net.minecraft.dispenser.BehaviorDefaultDispenseItem; import net.minecraft.dispenser.BehaviorDefaultDispenseItem;
import net.minecraft.dispenser.IBlockSource; import net.minecraft.dispenser.IBlockSource;
@ -21,13 +22,14 @@ public class DispenserHandlerFertilize extends BehaviorDefaultDispenseItem{
@Override @Override
public ItemStack dispenseStack(IBlockSource source, ItemStack stack){ public ItemStack dispenseStack(IBlockSource source, ItemStack stack){
EnumFacing facing = BlockDispenser.func_149937_b(source.getBlockMetadata()); EnumFacing facing = BlockDispenser.getFacing(source.getBlockMetadata());
int x = source.getXInt()+facing.getFrontOffsetX(); int x = source.getBlockTileEntity().getPos().getX()+facing.getFrontOffsetX();
int y = source.getYInt()+facing.getFrontOffsetY(); int y = source.getBlockTileEntity().getPos().getY()+facing.getFrontOffsetY();
int z = source.getZInt()+facing.getFrontOffsetZ(); int z = source.getBlockTileEntity().getPos().getZ()+facing.getFrontOffsetZ();
Position pos = new Position(x, y, z);
if(ItemDye.applyBonemeal(stack, source.getWorld(), x, y, z, null)){ if(ItemDye.applyBonemeal(stack, source.getWorld(), pos, null)){
source.getWorld().playAuxSFX(2005, x, y, z, 0); source.getWorld().playAuxSFX(2005, pos, 0);
} }
return stack; return stack;
} }

View file

@ -68,7 +68,7 @@ public class SpecialRenderInit{
} }
@SubscribeEvent(priority = EventPriority.HIGHEST) @SubscribeEvent(priority = EventPriority.HIGHEST)
public void onPlayerRender(RenderPlayerEvent.Specials.Pre event){ public void onPlayerRender(RenderPlayerEvent.Pre event){
if(!specialList.isEmpty()){ if(!specialList.isEmpty()){
for(Map.Entry<String, RenderSpecial> entry : specialList.entrySet()){ for(Map.Entry<String, RenderSpecial> entry : specialList.entrySet()){
//Does the player have one of the names from the list? //Does the player have one of the names from the list?

View file

@ -48,7 +48,7 @@ public class NEIBookletRecipe extends TemplateRecipeHandler implements INEIRecip
@Override @Override
public void loadTransferRects(){ public void loadTransferRects(){
transferRects.add(new RecipeTransferRect(new Rectangle(0, 18, 165, Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT), NAME)); transferRects.add(new RecipeTransferRect(new Rectangle(0, 18, 165, Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT), NAME));
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@ -107,17 +107,17 @@ public class NEIBookletRecipe extends TemplateRecipeHandler implements INEIRecip
public void drawExtras(int recipe){ public void drawExtras(int recipe){
CachedInfoStack stack = (CachedInfoStack)this.arecipes.get(recipe); CachedInfoStack stack = (CachedInfoStack)this.arecipes.get(recipe);
if(stack.theStack != null){ if(stack.theStack != null){
List header = Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".booklet.header").replaceAll("<item>", EnumChatFormatting.BLUE+"").replaceAll("<r>", EnumChatFormatting.BLACK+""), 165); List header = Minecraft.getMinecraft().fontRendererObj.listFormattedStringToWidth(StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".booklet.header").replaceAll("<item>", EnumChatFormatting.BLUE+"").replaceAll("<r>", EnumChatFormatting.BLACK+""), 165);
for(int i = 0; i < header.size(); i++){ for(int i = 0; i < header.size(); i++){
GuiDraw.drawString((String)header.get(i), 0, 18+i*(Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT+1), 0, false); GuiDraw.drawString((String)header.get(i), 0, 18+i*(Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT+1), 0, false);
} }
int maxLines = 5; int maxLines = 5;
IBookletChapter chapter = stack.thePage.getChapter(); IBookletChapter chapter = stack.thePage.getChapter();
String aText = (chapter.getPages()[0] instanceof PagePicture && chapter.getPages().length > 1 ? chapter.getPages()[1] : chapter.getPages()[0]).getText(); String aText = (chapter.getPages()[0] instanceof PagePicture && chapter.getPages().length > 1 ? chapter.getPages()[1] : chapter.getPages()[0]).getText();
List text = Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(aText != null ? aText : EnumChatFormatting.DARK_RED+StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".booklet.noText"), 165); List text = Minecraft.getMinecraft().fontRendererObj.listFormattedStringToWidth(aText != null ? aText : EnumChatFormatting.DARK_RED+StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".booklet.noText"), 165);
for(int i = 0; i < Math.min(maxLines, text.size()); i++){ for(int i = 0; i < Math.min(maxLines, text.size()); i++){
GuiDraw.drawString(text.get(i)+(i == maxLines-1 && text.size() > maxLines ? EnumChatFormatting.RESET+""+EnumChatFormatting.BLACK+"..." : ""), 0, 18+25+i*(Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT+1), 0, false); GuiDraw.drawString(text.get(i)+(i == maxLines-1 && text.size() > maxLines ? EnumChatFormatting.RESET+""+EnumChatFormatting.BLACK+"..." : ""), 0, 18+25+i*(Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT+1), 0, false);
} }
GuiDraw.drawString(EnumChatFormatting.ITALIC+chapter.getLocalizedName(), 0, 97, 0, false); GuiDraw.drawString(EnumChatFormatting.ITALIC+chapter.getLocalizedName(), 0, 97, 0, false);
GuiDraw.drawString(EnumChatFormatting.ITALIC+"Page "+stack.thePage.getID(), 0, 107, 0, false); GuiDraw.drawString(EnumChatFormatting.ITALIC+"Page "+stack.thePage.getID(), 0, 107, 0, false);

View file

@ -55,7 +55,7 @@ public class NEIFurnaceDoubleRecipe extends TemplateRecipeHandler implements INE
@Override @Override
public void loadCraftingRecipes(String outputId, Object... results){ public void loadCraftingRecipes(String outputId, Object... results){
if(outputId.equals(NAME) && getClass() == NEIFurnaceDoubleRecipe.class){ if(outputId.equals(NAME) && getClass() == NEIFurnaceDoubleRecipe.class){
Map<ItemStack, ItemStack> recipes = (Map<ItemStack, ItemStack>)FurnaceRecipes.smelting().getSmeltingList(); Map<ItemStack, ItemStack> recipes = FurnaceRecipes.instance().getSmeltingList();
for(Map.Entry<ItemStack, ItemStack> recipe : recipes.entrySet()){ for(Map.Entry<ItemStack, ItemStack> recipe : recipes.entrySet()){
arecipes.add(new CachedFurn(recipe.getKey(), recipe.getValue())); arecipes.add(new CachedFurn(recipe.getKey(), recipe.getValue()));
} }
@ -68,7 +68,7 @@ public class NEIFurnaceDoubleRecipe extends TemplateRecipeHandler implements INE
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public void loadCraftingRecipes(ItemStack result){ public void loadCraftingRecipes(ItemStack result){
Map<ItemStack, ItemStack> recipes = (Map<ItemStack, ItemStack>)FurnaceRecipes.smelting().getSmeltingList(); Map<ItemStack, ItemStack> recipes = FurnaceRecipes.instance().getSmeltingList();
for(Map.Entry<ItemStack, ItemStack> recipe : recipes.entrySet()){ for(Map.Entry<ItemStack, ItemStack> recipe : recipes.entrySet()){
if(NEIServerUtils.areStacksSameType(recipe.getValue(), result)){ if(NEIServerUtils.areStacksSameType(recipe.getValue(), result)){
arecipes.add(new CachedFurn(recipe.getKey(), recipe.getValue())); arecipes.add(new CachedFurn(recipe.getKey(), recipe.getValue()));
@ -79,7 +79,7 @@ public class NEIFurnaceDoubleRecipe extends TemplateRecipeHandler implements INE
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public void loadUsageRecipes(ItemStack ingredient){ public void loadUsageRecipes(ItemStack ingredient){
Map<ItemStack, ItemStack> recipes = (Map<ItemStack, ItemStack>)FurnaceRecipes.smelting().getSmeltingList(); Map<ItemStack, ItemStack> recipes = FurnaceRecipes.instance().getSmeltingList();
for(Map.Entry<ItemStack, ItemStack> recipe : recipes.entrySet()){ for(Map.Entry<ItemStack, ItemStack> recipe : recipes.entrySet()){
if(NEIServerUtils.areStacksSameTypeCrafting(recipe.getKey(), ingredient)){ if(NEIServerUtils.areStacksSameTypeCrafting(recipe.getKey(), ingredient)){
CachedFurn theRecipe = new CachedFurn(recipe.getKey(), recipe.getValue()); CachedFurn theRecipe = new CachedFurn(recipe.getKey(), recipe.getValue());

View file

@ -44,9 +44,9 @@ public class NEIScreenEvents{
@Override @Override
public void drawButton(Minecraft minecraft, int x, int y){ public void drawButton(Minecraft minecraft, int x, int y){
super.drawButton(minecraft, x, y); super.drawButton(minecraft, x, y);
if(this.visible && this.field_146123_n){ if(this.visible && this.hovered){
String text = StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".clickToSeeRecipe"); String text = StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".clickToSeeRecipe");
Minecraft.getMinecraft().fontRenderer.drawString(text, this.xPosition-Minecraft.getMinecraft().fontRenderer.getStringWidth(text)-1, this.yPosition+this.height/2-Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT/2, StringUtil.DECIMAL_COLOR_WHITE, true); Minecraft.getMinecraft().fontRendererObj.drawString(text, this.xPosition-Minecraft.getMinecraft().fontRendererObj.getStringWidth(text)-1, this.yPosition+this.height/2-Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT/2, StringUtil.DECIMAL_COLOR_WHITE, true);
} }
} }
}; };

View file

@ -11,6 +11,7 @@
package de.ellpeck.actuallyadditions.mod.network; package de.ellpeck.actuallyadditions.mod.network;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.Position;
import de.ellpeck.actuallyadditions.api.internal.EntrySet; import de.ellpeck.actuallyadditions.api.internal.EntrySet;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBookletStand; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBookletStand;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
@ -46,7 +47,7 @@ public class PacketBookletStandButton implements IMessage{
this.tileX = x; this.tileX = x;
this.tileY = y; this.tileY = y;
this.tileZ = z; this.tileZ = z;
this.worldID = world.provider.dimensionId; this.worldID = world.provider.getDimensionId();
this.playerID = player.getEntityId(); this.playerID = player.getEntityId();
this.entryID = set.entry == null ? -1 : ActuallyAdditionsAPI.bookletEntries.indexOf(set.entry); this.entryID = set.entry == null ? -1 : ActuallyAdditionsAPI.bookletEntries.indexOf(set.entry);
@ -88,11 +89,11 @@ public class PacketBookletStandButton implements IMessage{
@Override @Override
public IMessage onMessage(PacketBookletStandButton message, MessageContext ctx){ public IMessage onMessage(PacketBookletStandButton message, MessageContext ctx){
World world = DimensionManager.getWorld(message.worldID); World world = DimensionManager.getWorld(message.worldID);
TileEntity tile = world.getTileEntity(message.tileX, message.tileY, message.tileZ); TileEntity tile = world.getTileEntity(new Position(message.tileX, message.tileY, message.tileZ));
EntityPlayer player = (EntityPlayer)world.getEntityByID(message.playerID); EntityPlayer player = (EntityPlayer)world.getEntityByID(message.playerID);
if(tile instanceof TileEntityBookletStand){ if(tile instanceof TileEntityBookletStand){
if(Objects.equals(player.getCommandSenderName(), ((TileEntityBookletStand)tile).assignedPlayer)){ if(Objects.equals(player.getName(), ((TileEntityBookletStand)tile).assignedPlayer)){
EntrySet theSet = ((TileEntityBookletStand)tile).assignedEntry; EntrySet theSet = ((TileEntityBookletStand)tile).assignedEntry;
theSet.entry = message.entryID == -1 ? null : ActuallyAdditionsAPI.bookletEntries.get(message.entryID); theSet.entry = message.entryID == -1 ? null : ActuallyAdditionsAPI.bookletEntries.get(message.entryID);
theSet.chapter = message.chapterID == -1 || message.entryID == -1 || theSet.entry.getChapters().size() <= message.chapterID ? null : theSet.entry.getChapters().get(message.chapterID); theSet.chapter = message.chapterID == -1 || message.entryID == -1 || theSet.entry.getChapters().size() <= message.chapterID ? null : theSet.entry.getChapters().get(message.chapterID);

View file

@ -18,7 +18,7 @@ import java.util.List;
public class VanillaPacketSyncer{ public class VanillaPacketSyncer{
public static void sendTileToNearbyPlayers(TileEntity tile){ public static void sendTileToNearbyPlayers(TileEntity tile){
List allPlayers = tile.getWorldObj().playerEntities; List allPlayers = tile.getWorld().playerEntities;
for(Object player : allPlayers){ for(Object player : allPlayers){
if(player instanceof EntityPlayerMP){ if(player instanceof EntityPlayerMP){
sendTileToPlayer(tile, (EntityPlayerMP)player, 64); sendTileToPlayer(tile, (EntityPlayerMP)player, 64);
@ -27,7 +27,7 @@ public class VanillaPacketSyncer{
} }
public static void sendTileToPlayer(TileEntity tile, EntityPlayerMP player, int maxDistance){ public static void sendTileToPlayer(TileEntity tile, EntityPlayerMP player, int maxDistance){
if(player.getDistance(tile.xCoord, tile.yCoord, tile.zCoord) <= maxDistance){ if(player.getDistance(tile.getPos().getX(), tile.getPos().getY(), tile.getPos().getZ()) <= maxDistance){
sendTileToPlayer(tile, player); sendTileToPlayer(tile, player);
} }
} }

View file

@ -10,6 +10,7 @@
package de.ellpeck.actuallyadditions.mod.network.gui; package de.ellpeck.actuallyadditions.mod.network.gui;
import de.ellpeck.actuallyadditions.api.Position;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
@ -37,7 +38,7 @@ public class PacketGuiButton implements IMessage{
this.tileX = x; this.tileX = x;
this.tileY = y; this.tileY = y;
this.tileZ = z; this.tileZ = z;
this.worldID = world.provider.dimensionId; this.worldID = world.provider.getDimensionId();
this.buttonID = buttonID; this.buttonID = buttonID;
this.playerID = player.getEntityId(); this.playerID = player.getEntityId();
} }
@ -67,7 +68,7 @@ public class PacketGuiButton implements IMessage{
@Override @Override
public IMessage onMessage(PacketGuiButton message, MessageContext ctx){ public IMessage onMessage(PacketGuiButton message, MessageContext ctx){
World world = DimensionManager.getWorld(message.worldID); World world = DimensionManager.getWorld(message.worldID);
TileEntity tile = world.getTileEntity(message.tileX, message.tileY, message.tileZ); TileEntity tile = world.getTileEntity(new Position(message.tileX, message.tileY, message.tileZ));
if(tile instanceof IButtonReactor){ if(tile instanceof IButtonReactor){
IButtonReactor reactor = (IButtonReactor)tile; IButtonReactor reactor = (IButtonReactor)tile;

View file

@ -17,7 +17,6 @@ import de.ellpeck.actuallyadditions.mod.blocks.render.RenderSmileyCloud;
import de.ellpeck.actuallyadditions.mod.blocks.render.RenderTileEntity; import de.ellpeck.actuallyadditions.mod.blocks.render.RenderTileEntity;
import de.ellpeck.actuallyadditions.mod.blocks.render.model.*; import de.ellpeck.actuallyadditions.mod.blocks.render.model.*;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
import de.ellpeck.actuallyadditions.mod.event.InitEvents; import de.ellpeck.actuallyadditions.mod.event.InitEvents;
import de.ellpeck.actuallyadditions.mod.misc.special.SpecialRenderInit; import de.ellpeck.actuallyadditions.mod.misc.special.SpecialRenderInit;
import de.ellpeck.actuallyadditions.mod.tile.*; import de.ellpeck.actuallyadditions.mod.tile.*;
@ -26,12 +25,10 @@ import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.playerdata.PersistentClientData; import de.ellpeck.actuallyadditions.mod.util.playerdata.PersistentClientData;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.registry.VillagerRegistry;
import java.io.File; import java.io.File;
import java.util.Calendar; import java.util.Calendar;
@ -76,7 +73,8 @@ public class ClientProxy implements IProxy{
registerRenderer(TileEntityBookletStand.class, new RenderTileEntity(new ModelBookletStand()), AssetUtil.bookletStandRenderId); registerRenderer(TileEntityBookletStand.class, new RenderTileEntity(new ModelBookletStand()), AssetUtil.bookletStandRenderId);
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAtomicReconstructor.class, new RenderReconstructorLens()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAtomicReconstructor.class, new RenderReconstructorLens());
VillagerRegistry.instance().registerVillagerSkin(ConfigIntValues.JAM_VILLAGER_ID.getValue(), new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/entity/villager/jamVillager.png")); //TODO Fix villager
//VillagerRegistry.instance().registerVillagerSkin(ConfigIntValues.JAM_VILLAGER_ID.getValue(), new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/entity/villager/jamVillager.png"));
} }
@Override @Override

View file

@ -10,6 +10,7 @@
package de.ellpeck.actuallyadditions.mod.tile; package de.ellpeck.actuallyadditions.mod.tile;
import de.ellpeck.actuallyadditions.api.Position;
import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor; import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor;
import de.ellpeck.actuallyadditions.mod.network.gui.INumberReactor; import de.ellpeck.actuallyadditions.mod.network.gui.INumberReactor;
import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
@ -19,6 +20,7 @@ import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
public class TileEntityInputter extends TileEntityInventoryBase implements IButtonReactor, INumberReactor{ public class TileEntityInputter extends TileEntityInventoryBase implements IButtonReactor, INumberReactor{
@ -121,7 +123,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
if(theSided != null){ if(theSided != null){
//Check if Item can be inserted from any Side (Because Sidedness gets ignored!) //Check if Item can be inserted from any Side (Because Sidedness gets ignored!)
for(int j = 0; j <= 5; j++){ for(int j = 0; j <= 5; j++){
if(theSided.canExtractItem(i, tempStack, j)){ if(theSided.canExtractItem(i, tempStack, EnumFacing.values()[j])){
theStack = tempStack; theStack = tempStack;
theSlotToPull = i; theSlotToPull = i;
can = true; can = true;
@ -208,7 +210,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
if(theInventory.isItemValidForSlot(i, this.slots[0]) && (tempStack == null || (tempStack.isItemEqual(this.slots[0]) && tempStack.stackSize < maxSize)) && this.checkBothFilters(this.slots[0])){ if(theInventory.isItemValidForSlot(i, this.slots[0]) && (tempStack == null || (tempStack.isItemEqual(this.slots[0]) && tempStack.stackSize < maxSize)) && this.checkBothFilters(this.slots[0])){
if(theSided != null){ if(theSided != null){
for(int j = 0; j <= 5; j++){ for(int j = 0; j <= 5; j++){
if(theSided.canInsertItem(i, this.slots[0], j)){ if(theSided.canInsertItem(i, this.slots[0], EnumFacing.values()[j])){
theStack = tempStack; theStack = tempStack;
theSlotToPut = i; theSlotToPut = i;
can = true; can = true;
@ -301,8 +303,8 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
public void initVars(){ public void initVars(){
//Gets the Place to put and Pull //Gets the Place to put and Pull
this.placeToPull = WorldUtil.getTileEntityFromSide(WorldUtil.getDirectionBySidesInOrder(this.sideToPull), this.worldObj, this.xCoord, this.yCoord, this.zCoord); this.placeToPull = WorldUtil.getTileEntityFromSide(WorldUtil.getDirectionBySidesInOrder(this.sideToPull), this.worldObj, Position.fromTileEntity(this));
this.placeToPut = WorldUtil.getTileEntityFromSide(WorldUtil.getDirectionBySidesInOrder(this.sideToPut), this.worldObj, this.xCoord, this.yCoord, this.zCoord); this.placeToPut = WorldUtil.getTileEntityFromSide(WorldUtil.getDirectionBySidesInOrder(this.sideToPut), this.worldObj, Position.fromTileEntity(this));
//Resets the Variables //Resets the Variables
if(this.placeToPull instanceof IInventory){ if(this.placeToPull instanceof IInventory){
@ -427,7 +429,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
} }
@Override @Override
public boolean canInsertItem(int slot, ItemStack stack, int side){ public boolean canInsertItem(int slot, ItemStack stack, EnumFacing side){
return this.isItemValidForSlot(slot, stack); return this.isItemValidForSlot(slot, stack);
} }
@ -437,7 +439,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
} }
@Override @Override
public boolean canExtractItem(int slot, ItemStack stack, int side){ public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){
return slot == 0; return slot == 0;
} }

View file

@ -12,8 +12,4 @@ package de.ellpeck.actuallyadditions.mod.tile;
public class TileEntityPhantomBooster extends TileEntityBase{ public class TileEntityPhantomBooster extends TileEntityBase{
@Override
public boolean canUpdate(){
return false;
}
} }

View file

@ -15,6 +15,7 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory; import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
public class TileEntityPhantomItemface extends TileEntityPhantomface{ public class TileEntityPhantomItemface extends TileEntityPhantomface{
@ -24,10 +25,10 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface{
} }
@Override @Override
public int[] getAccessibleSlotsFromSide(int side){ public int[] getSlotsForFace(EnumFacing side){
if(this.isBoundThingInRange()){ if(this.isBoundThingInRange()){
if(this.getSided() != null){ if(this.getSided() != null){
return this.getSided().getAccessibleSlotsFromSide(side); return this.getSided().getSlotsForFace(side);
} }
else{ else{
int[] theInt = new int[this.getSizeInventory()]; int[] theInt = new int[this.getSizeInventory()];
@ -45,11 +46,6 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface{
return this.isBoundThingInRange() ? this.getInventory().getInventoryStackLimit() : 0; return this.isBoundThingInRange() ? this.getInventory().getInventoryStackLimit() : 0;
} }
@Override
public ItemStack getStackInSlotOnClosing(int i){
return this.isBoundThingInRange() ? this.getInventory().getStackInSlotOnClosing(i) : null;
}
@Override @Override
public void setInventorySlotContents(int i, ItemStack stack){ public void setInventorySlotContents(int i, ItemStack stack){
if(this.isBoundThingInRange()){ if(this.isBoundThingInRange()){
@ -74,13 +70,13 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface{
} }
@Override @Override
public String getInventoryName(){ public String getName(){
return this.name; return this.name;
} }
@Override @Override
public boolean isBoundThingInRange(){ public boolean isBoundThingInRange(){
return super.isBoundThingInRange() && worldObj.getTileEntity(boundPosition.getX(), boundPosition.getY(), boundPosition.getZ()) instanceof IInventory; return super.isBoundThingInRange() && worldObj.getTileEntity(boundPosition) instanceof IInventory;
} }
public ISidedInventory getSided(){ public ISidedInventory getSided(){
@ -89,7 +85,7 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface{
public IInventory getInventory(){ public IInventory getInventory(){
if(this.boundPosition != null){ if(this.boundPosition != null){
TileEntity tile = worldObj.getTileEntity(boundPosition.getX(), boundPosition.getY(), boundPosition.getZ()); TileEntity tile = worldObj.getTileEntity(boundPosition);
if(tile instanceof IInventory){ if(tile instanceof IInventory){
return (IInventory)tile; return (IInventory)tile;
} }
@ -98,12 +94,12 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface{
} }
@Override @Override
public boolean canInsertItem(int slot, ItemStack stack, int side){ public boolean canInsertItem(int slot, ItemStack stack, EnumFacing side){
return this.isBoundThingInRange() && (this.getSided() == null || this.getSided().canInsertItem(slot, stack, side)); return this.isBoundThingInRange() && (this.getSided() == null || this.getSided().canInsertItem(slot, stack, side));
} }
@Override @Override
public boolean canExtractItem(int slot, ItemStack stack, int side){ public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){
return this.isBoundThingInRange() && (this.getSided() == null || this.getSided().canExtractItem(slot, stack, side)); return this.isBoundThingInRange() && (this.getSided() == null || this.getSided().canExtractItem(slot, stack, side));
} }
@ -112,4 +108,18 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface{
return this.isBoundThingInRange() && this.getInventory().isItemValidForSlot(i, stack); return this.isBoundThingInRange() && this.getInventory().isItemValidForSlot(i, stack);
} }
@Override
public ItemStack removeStackFromSlot(int index){
if(this.isBoundThingInRange()){
return this.getInventory().removeStackFromSlot(index);
}
return null;
}
@Override
public void clear(){
if(this.isBoundThingInRange()){
this.getInventory().clear();
}
}
} }

View file

@ -23,14 +23,14 @@ public class CompatUtil{
FMLInterModComms.sendMessage("MineFactoryReloaded", "registerHarvestable_Crop", new ItemStack(block, 1, 7)); FMLInterModComms.sendMessage("MineFactoryReloaded", "registerHarvestable_Crop", new ItemStack(block, 1, 7));
NBTTagCompound compound = new NBTTagCompound(); NBTTagCompound compound = new NBTTagCompound();
compound.setString("plant", Block.blockRegistry.getNameForObject(block)); compound.setString("plant", block.getRegistryName());
FMLInterModComms.sendMessage("MineFactoryReloaded", "registerFertilizable_Crop", compound); FMLInterModComms.sendMessage("MineFactoryReloaded", "registerFertilizable_Crop", compound);
} }
public static void registerMFRSeed(Item item){ public static void registerMFRSeed(Item item){
NBTTagCompound compound = new NBTTagCompound(); NBTTagCompound compound = new NBTTagCompound();
compound.setString("seed", Item.itemRegistry.getNameForObject(item)); compound.setString("seed", item.getRegistryName());
compound.setString("crop", Block.blockRegistry.getNameForObject(((ItemSeed)item).plant)); compound.setString("crop", ((ItemSeed)item).plant.getRegistryName());
FMLInterModComms.sendMessage("MineFactoryReloaded", "registerPlantable_Crop", compound); FMLInterModComms.sendMessage("MineFactoryReloaded", "registerPlantable_Crop", compound);
} }

View file

@ -22,7 +22,6 @@ import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary;
import java.util.List; import java.util.List;
@ -45,7 +44,6 @@ public class Util{
public static void registerEvent(Object o){ public static void registerEvent(Object o){
MinecraftForge.EVENT_BUS.register(o); MinecraftForge.EVENT_BUS.register(o);
FMLCommonHandler.instance().bus().register(o);
} }
public static boolean isDevVersion(){ public static boolean isDevVersion(){