unnerf Mining Wells, add shift-hover pipe tooltips, etc.

This commit is contained in:
asiekierka 2014-11-28 14:47:03 +01:00
parent 2b2660d245
commit b76846e971
7 changed files with 55 additions and 21 deletions

View file

@ -6,6 +6,6 @@
* License 1.0, or MMPL. Please check the contents of the license located in * License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt * http://www.mod-buildcraft.com/MMPL-1.0.txt
*/ */
@API(apiVersion = "1.1", owner = "BuildCraft|Core", provides = "BuildCraftAPI|core") @API(apiVersion = "1.2", owner = "BuildCraft|Core", provides = "BuildCraftAPI|core")
package buildcraft.api.core; package buildcraft.api.core;
import cpw.mods.fml.common.API; import cpw.mods.fml.common.API;

View file

@ -6,7 +6,7 @@
* License 1.0, or MMPL. Please check the contents of the license located in * License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt * http://www.mod-buildcraft.com/MMPL-1.0.txt
*/ */
@API(apiVersion = "1.0", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|tiles") @API(apiVersion = "1.1", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|tiles")
package buildcraft.api.tiles; package buildcraft.api.tiles;
import cpw.mods.fml.common.API; import cpw.mods.fml.common.API;

View file

@ -305,6 +305,7 @@ tip.gate.wires.emerald=Red, Blue, Green, Yellow
tip.gate.expansions=§9§oInstalled Expansions: tip.gate.expansions=§9§oInstalled Expansions:
tip.PipeFluidsCobblestone=Won't connect to Stone tip.PipeFluidsCobblestone=Won't connect to Stone
tip.PipeFluidsDiamond=Sorts fluids
tip.PipeFluidsEmerald=Extraction pipe tip.PipeFluidsEmerald=Extraction pipe
tip.PipeFluidsIron=Valve pipe tip.PipeFluidsIron=Valve pipe
tip.PipeFluidsSandstone=Only connects to other pipes tip.PipeFluidsSandstone=Only connects to other pipes
@ -316,6 +317,7 @@ tip.PipeItemsCobblestone=Basic pipe, high drag\nWon't connect to Stone or Quartz
tip.PipeItemsDaizuli=Routes painted items tip.PipeItemsDaizuli=Routes painted items
tip.PipeItemsDiamond=Sorts items tip.PipeItemsDiamond=Sorts items
tip.PipeItemsEmerald=Round-robin extraction pipe tip.PipeItemsEmerald=Round-robin extraction pipe
tip.PipeItemsEmzuli=Gate controlled extraction pipe
tip.PipeItemsGold=Speeds up items tip.PipeItemsGold=Speeds up items
tip.PipeItemsIron=Routes items tip.PipeItemsIron=Routes items
tip.PipeItemsLapis=Paints items tip.PipeItemsLapis=Paints items
@ -325,13 +327,21 @@ tip.PipeItemsSandstone=Only connects to other pipes
tip.PipeItemsStone=Basic pipe, medium drag\nWon't connect to Cobblestone or Quartz tip.PipeItemsStone=Basic pipe, medium drag\nWon't connect to Cobblestone or Quartz
tip.PipeItemsVoid=Destroys items tip.PipeItemsVoid=Destroys items
tip.PipeItemsWood=Extraction pipe tip.PipeItemsWood=Extraction pipe
tip.PipeItemsEmzuli=Gate controlled extraction pipe
tip.PipePowerEmerald=Power Input Pipe tip.PipePowerEmerald=Power Input Pipe
tip.PipePowerIron=Selectable Limiter Pipe tip.PipePowerIron=Selectable Limiter Pipe
tip.PipePowerSandstone=Only connects to other pipes tip.PipePowerSandstone=Only connects to other pipes
tip.PipePowerWood=Power Input Pipe tip.PipePowerWood=Power Input Pipe
tip.PipeStructureCobblestone=Support pipe tip.PipeStructureCobblestone=Support pipe
tip.shift.PipeFluidsDiamond=GUI accepts any fluid containers
tip.shift.PipeFluidsEmerald=GUI accepts any fluid container
tip.shift.PipeItemsClay=Prioritizes machines and chests\nover neighbouring pipes.
tip.shift.PipeItemsDaizuli=Sneak-click to change color
tip.shift.PipeItemsEmzuli=Set extraction preset filters in GUI\nA preset can paint extracted items\nSwitch extraction presets via gates
tip.shift.PipeItemsLapis=Sneak-click to change color
tip.shift.PipeItemsObsidian=Power with an engine\nMore power - greater distance
tip.shift.PipePowerIron=Change the limit with a wrench or gates
tip.tool.add=Add tip.tool.add=Add
tip.tool.remove=Remove tip.tool.remove=Remove

View file

@ -8,6 +8,7 @@
*/ */
package buildcraft.factory; package buildcraft.factory;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
@ -15,9 +16,11 @@ import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@ -49,17 +52,13 @@ public class BlockPlainPipe extends Block implements IFramePipeConnection {
return false; return false;
} }
public boolean isACube() { @Override
public boolean isNormalCube() {
return false; return false;
} }
public int idDropped(int i, Random random) {
return 0;
}
@Override @Override
public boolean isPipeConnected(IBlockAccess blockAccess, int x1, int y1, int z1, int x2, int y2, int z2) { public boolean isPipeConnected(IBlockAccess blockAccess, int x1, int y1, int z1, int x2, int y2, int z2) {
return false; return false;
} }
@ -73,9 +72,24 @@ public class BlockPlainPipe extends Block implements IFramePipeConnection {
list.add(new ItemStack(this)); list.add(new ItemStack(this));
} }
@Override
public Item getItemDropped(int i, Random random, int j) {
return null;
}
@Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
return new ArrayList<ItemStack>();
}
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister par1IconRegister) { public void registerBlockIcons(IIconRegister par1IconRegister) {
this.blockIcon = par1IconRegister.registerIcon("buildcraft:blockPlainPipe"); this.blockIcon = par1IconRegister.registerIcon("buildcraft:blockPlainPipe");
} }
@Override
public boolean isLadder(IBlockAccess world, int x, int y, int z, EntityLivingBase entity) {
return true;
}
} }

View file

@ -25,7 +25,7 @@ public class TileMiningWell extends TileBuildCraft implements IHasWork, IPipeCon
public TileMiningWell() { public TileMiningWell() {
super(); super();
this.setBattery(new RFBattery(2 * 64 * BuilderAPI.BREAK_ENERGY, BuilderAPI.BREAK_ENERGY, 0)); this.setBattery(new RFBattery(2 * 64 * BuilderAPI.BREAK_ENERGY, BuilderAPI.BREAK_ENERGY * 4 + BuilderAPI.BUILD_ENERGY, 0));
} }
/** /**
@ -66,7 +66,9 @@ public class TileMiningWell extends TileBuildCraft implements IHasWork, IPipeCon
} else { } else {
miner = new BlockMiner(world, this, xCoord, depth, zCoord); miner = new BlockMiner(world, this, xCoord, depth, zCoord);
} }
} else { }
if (miner != null) {
int usedEnergy = miner.acceptEnergy(getBattery().getEnergyStored()); int usedEnergy = miner.acceptEnergy(getBattery().getEnergyStored());
getBattery().useEnergy(usedEnergy, usedEnergy, false); getBattery().useEnergy(usedEnergy, usedEnergy, false);

View file

@ -155,7 +155,7 @@ public class ItemPipe extends ItemBuildCraft implements IItemPipe {
list.add(ColorUtils.getFormattingTooltip(color) + EnumChatFormatting.ITALIC + StringUtils.localize("color." + ColorUtils.getName(color))); list.add(ColorUtils.getFormattingTooltip(color) + EnumChatFormatting.ITALIC + StringUtils.localize("color." + ColorUtils.getName(color)));
} }
Class<? extends Pipe> pipe = BlockGenericPipe.pipes.get(this); Class<? extends Pipe> pipe = BlockGenericPipe.pipes.get(this);
List<String> toolTip = PipeToolTipManager.getToolTip(pipe); List<String> toolTip = PipeToolTipManager.getToolTip(pipe, advanced);
list.addAll(toolTip); list.addAll(toolTip);
} }
} }

View file

@ -13,6 +13,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import net.minecraft.client.gui.GuiScreen;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@ -39,24 +40,31 @@ public final class PipeToolTipManager {
private PipeToolTipManager() { private PipeToolTipManager() {
} }
private static void addTipToList(String tipTag, List<String> tips) {
if (StringUtils.canLocalize(tipTag)) {
String localized = StringUtils.localize(tipTag);
if (localized != null) {
List<String> lines = StringUtils.newLineSplitter.splitToList(localized);
tips.addAll(lines);
}
}
}
public static void addToolTip(Class<? extends Pipe<?>> pipe, String toolTip) { public static void addToolTip(Class<? extends Pipe<?>> pipe, String toolTip) {
toolTips.put(pipe, toolTip); toolTips.put(pipe, toolTip);
} }
public static List<String> getToolTip(Class<? extends Pipe> pipe) { public static List<String> getToolTip(Class<? extends Pipe> pipe, boolean advanced) {
List<String> tips = new ArrayList<String>(); List<String> tips = new ArrayList<String>();
String tipTag = "tip." + pipe.getSimpleName(); addTipToList("tip." + pipe.getSimpleName(), tips);
if (StringUtils.canLocalize(tipTag)) {
String localized = StringUtils.localize(tipTag);
if (localized != null) {
List<String> lines = StringUtils.newLineSplitter.splitToList(localized);
tips.addAll(lines);
}
}
String tip = toolTips.get(pipe); String tip = toolTips.get(pipe);
if (tip != null) { if (tip != null) {
tips.add(tip); tips.add(tip);
} }
if (GuiScreen.isShiftKeyDown()) {
addTipToList("tip.shift." + pipe.getSimpleName(), tips);
}
return tips; return tips;
} }
} }