Add dark steel ladder, fix "<Hold Shift>" being displayed always

This commit is contained in:
tterrag1098 committed 2014-12-02 10:52:05 -05:00
1 parent 73ff84b407
commit 9a3be41dbf
8 files changed
+89 -3

No files matched your search

+3
View File
@@ -432,6 +432,9 @@ tile.blockDarkSteelAnvil.tooltip.common.line1=Damage Resistant
tile.blockDarkSteelAnvil.tooltip.detailed.line1=Lasts much longer than
tile.blockDarkSteelAnvil.tooltip.detailed.line2=the vanilla anvil
tile.blockDarkSteelLadder.name=Dark Steel Ladder
tile.blockDarkSteelLadder.tooltip.common.line1=Faster than regular ladders
//Travel
tile.blockTravelAnchor.name=Travel Anchor
tile.blockTravelAnchor.tooltip.detailed.line1=Allows teleportation between anchors
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@@ -38,6 +38,7 @@ import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.relauncher.Side;
import crazypants.enderio.api.IMC;
import crazypants.enderio.block.BlockDarkSteelAnvil;
import crazypants.enderio.block.BlockDarkSteelLadder;
import crazypants.enderio.block.BlockDarkSteelPressurePlate;
import crazypants.enderio.block.BlockReinforcedObsidian;
import crazypants.enderio.conduit.BlockConduitBundle;
@@ -246,6 +247,7 @@ public class EnderIO {
//Blocks
public static BlockDarkSteelPressurePlate blockDarkSteelPressurePlate;
public static BlockDarkSteelAnvil blockDarkSteelAnvil;
public static BlockDarkSteelLadder blockDarkSteelLadder;
public static BlockEndermanSkull blockEndermanSkull;
public static BlockReinforcedObsidian blockReinforcedObsidian;
@@ -346,6 +348,7 @@ public class EnderIO {
blockDarkSteelPressurePlate = BlockDarkSteelPressurePlate.create();
blockDarkSteelAnvil = BlockDarkSteelAnvil.create();
blockDarkSteelLadder = BlockDarkSteelLadder.create();
blockElectricLight = BlockElectricLight.create();
blockLightNode = BlockLightNode.create();
@@ -71,6 +71,7 @@ public enum ModObject {
//Blocks
blockDarkSteelPressurePlate,
blockDarkSteelAnvil,
blockDarkSteelLadder,
blockReinforcedObsidian,
blockIngotStorage,
@@ -0,0 +1,54 @@
package crazypants.enderio.block;
import net.minecraft.block.Block;
import net.minecraft.block.BlockLadder;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import cpw.mods.fml.common.registry.GameRegistry;
import crazypants.enderio.EnderIO;
import crazypants.enderio.EnderIOTab;
import crazypants.enderio.ModObject;
import crazypants.enderio.config.Config;
import crazypants.enderio.gui.IResourceTooltipProvider;
public class BlockDarkSteelLadder extends BlockLadder implements IResourceTooltipProvider {
public static BlockDarkSteelLadder create() {
BlockDarkSteelLadder res = new BlockDarkSteelLadder();
res.init();
return res;
}
protected BlockDarkSteelLadder() {
super();
setBlockName(ModObject.blockDarkSteelLadder.unlocalisedName);
setBlockTextureName(EnderIO.MODID + ":" + ModObject.blockDarkSteelLadder.unlocalisedName);
setStepSound(Block.soundTypeMetal);
setCreativeTab(EnderIOTab.tabEnderIO);
setHardness(0.4F);
}
protected void init() {
GameRegistry.registerBlock(this, ModObject.blockDarkSteelLadder.unlocalisedName);
}
@Override
public Material getMaterial() {
return Material.iron;
}
@Override
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
if(entity.motionY >= 0.1) {
entity.setPosition(entity.posX, entity.posY + Config.darkSteelLadderSpeedBoost, entity.posZ);
}
}
@Override
public String getUnlocalizedNameForTooltip(ItemStack itemStack) {
return getUnlocalizedName();
}
}
@@ -221,6 +221,8 @@ public final class Config {
public static float darkSteelAnvilDamageChance = 0.024f;
public static float darkSteelLadderSpeedBoost = 0.06f;
public static int hootchPowerPerCycleRF = 60;
public static int hootchPowerTotalBurnTime = 6000;
public static int rocketFuelPowerPerCycleRF = 160;
@@ -795,6 +797,8 @@ public final class Config {
darkSteelAnvilDamageChance = (float) config.get(sectionDarkSteel.name, "darkSteelAnvilDamageChance", darkSteelAnvilDamageChance, "Chance that the dark steel anvil will take damage after repairing something.").getDouble();
darkSteelLadderSpeedBoost = (float) config.get(sectionDarkSteel.name, "darkSteelLadderSpeedBoost", darkSteelLadderSpeedBoost, "Speed boost, in blocks per tick, that the DS ladder gives over the vanilla ladder.").getDouble();
hootchPowerPerCycleRF = config.get(sectionPower.name, "hootchPowerPerCycleRF", hootchPowerPerCycleRF,
"The amount of power generated per BC engine cycle. Examples: BC Oil = 30, BC Fuel = 60").getInt(hootchPowerPerCycleRF);
hootchPowerTotalBurnTime = config.get(sectionPower.name, "hootchPowerTotalBurnTime", hootchPowerTotalBurnTime,
@@ -1,5 +1,6 @@
package crazypants.enderio.gui;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
@@ -150,7 +151,9 @@ public class TooltipAddera {
} else {
addBasicTooltipFromResources(list, name);
addCommonTooltipFromResources(list, name);
addShowDetailsTooltip(list);
if (hasDetailedTooltip(tt, itemstack)) {
addShowDetailsTooltip(list);
}
}
}
@@ -160,10 +163,26 @@ public class TooltipAddera {
tt.addDetailedEntries(itemstack, entityplayer, list, flag);
} else {
tt.addBasicEntries(itemstack, entityplayer, list, flag);
addShowDetailsTooltip(list);
if(hasDetailedTooltip(tt, itemstack, entityplayer, flag)) {
addShowDetailsTooltip(list);
}
}
}
private static final List<String> throwaway = new ArrayList<String>();
private static boolean hasDetailedTooltip(IResourceTooltipProvider tt, ItemStack stack) {
throwaway.clear();
String name = tt.getUnlocalizedNameForTooltip(stack);
addDetailedTooltipFromResources(throwaway, name);
return !throwaway.isEmpty();
}
private static boolean hasDetailedTooltip(IAdvancedTooltipProvider tt, ItemStack stack, EntityPlayer player, boolean flag) {
throwaway.clear();
tt.addDetailedEntries(stack, player, throwaway, flag);
return !throwaway.isEmpty();
}
public static void addShowDetailsTooltip(List list) {
list.add(EnumChatFormatting.WHITE + "" + EnumChatFormatting.ITALIC + Lang.localize("item.tooltip.showDetails"));
}
@@ -169,6 +169,8 @@ public class MaterialRecipes {
'b', "blockDarkSteel",
'i', "ingotDarkSteel"
));
GameRegistry.addRecipe(new ItemStack(EnderIO.blockDarkSteelLadder, 12), "b", "b", "b", 'b', EnderIO.blockDarkIronBars);
for (Alloy alloy : Alloy.values()) {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(EnderIO.blockIngotStorage, 1, alloy.ordinal()), "iii", "iii", "iii", 'i', alloy.oredictIngotName));