From 0c39a29bc0bee06e27cc91b789af2efff9454737 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 2 Aug 2015 01:52:12 +0200 Subject: [PATCH] Did some more stuff with the OreDictionary, added Config Stuff, Localizing, Createive Tab adding --- build.gradle | 2 +- .../actuallyadditions/blocks/BlockOreMagnet.java | 4 ++-- .../config/values/ConfigIntValues.java | 7 ++++++- .../actuallyadditions/creative/CreativeTab.java | 2 ++ .../actuallyadditions/event/TooltipEvent.java | 8 +++++--- .../actuallyadditions/items/ItemGrowthRing.java | 2 +- .../items/ItemWaterRemovalRing.java | 2 +- .../tile/TileEntityOreMagnet.java | 13 +++++++------ .../ellpeck/actuallyadditions/util/ModUtil.java | 2 +- .../assets/actuallyadditions/lang/en_US.lang | 14 ++++++++++++++ .../textures/gui/guiOreMagnet.png | Bin 0 -> 1919 bytes 11 files changed, 40 insertions(+), 16 deletions(-) create mode 100644 src/main/resources/assets/actuallyadditions/textures/gui/guiOreMagnet.png diff --git a/build.gradle b/build.gradle index e5492766a..e7c952a74 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ buildscript { apply plugin: 'forge' apply plugin: 'maven' -version = "1.7.10-0.0.7.6" +version = "1.7.10-0.0.8.0" group = "ellpeck.actuallyadditions" archivesBaseName = "ActuallyAdditions" diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockOreMagnet.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockOreMagnet.java index 419fa569b..18896e6d1 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockOreMagnet.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockOreMagnet.java @@ -92,10 +92,10 @@ public class BlockOreMagnet extends BlockContainerBase implements INameableItem{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ - BlockUtil.addInformation(theBlock, list, 1, ""); + BlockUtil.addInformation(theBlock, list, 3, ""); BlockUtil.addPowerUsageInfo(list, TileEntityOreMagnet.energyUsePerTick); if(KeyUtil.isShiftPressed()){ - list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".uses.desc")+" "+TileEntityOreMagnet.oilUsePerTick+" mB/t"); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".uses.desc")+" "+TileEntityOreMagnet.oilUsePerTick+" mB "+StringUtil.localize(InitBlocks.fluidOil.getUnlocalizedName())+"/"+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".block.desc")); } } diff --git a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java index 891cb24f8..cdaa11614 100644 --- a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java +++ b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java @@ -145,7 +145,12 @@ public enum ConfigIntValues{ MAGNET_RING_ENERGY_USE("Magnet Ring: Energy Used", ConfigCategories.MACHINE_VALUES, 30, 0, 500, "The Amount of Energy the Magnet Ring uses per tick"), WATER_RING_RANGE("Water Ring: Range", ConfigCategories.MACHINE_VALUES, 3, 1, 10, "The Range of the Water Ring"), - WATER_RING_ENERGY_USE("Magnet Ring: Energy Used", ConfigCategories.MACHINE_VALUES, 30, 0, 500, "The Amount of Energy the Water Ring uses per Block"); + WATER_RING_ENERGY_USE("Magnet Ring: Energy Used", ConfigCategories.MACHINE_VALUES, 30, 0, 500, "The Amount of Energy the Water Ring uses per Block"), + + ORE_MAGNET_MAX_TIMER("Ore Magnet: Max Timer", ConfigCategories.MACHINE_VALUES, 15, 1, 2000, "The approximate Time it takes for the Ore Magnet to search for a new block to mine"), + ORE_MAGNET_RANGE("Ore Magnet: Range", ConfigCategories.MACHINE_VALUES, 10, 1, 60, "The range of the Ore Magnet"), + ORE_MAGNET_OIL_USE("Ore Magnet: Oil Use", ConfigCategories.MACHINE_VALUES, 50, 0, 5000, "The amount of oil the Ore Magnet uses every Block"), + ORE_MAGNET_ENERGY_USE("Ore Magnet: Energy USe", ConfigCategories.MACHINE_VALUES, 500, 10, 10000, "The amount of Energy the Ore Magnet uses every tick"); public final String name; public final String category; diff --git a/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java b/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java index db470dec2..6b4254aea 100644 --- a/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java +++ b/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java @@ -38,6 +38,8 @@ public class CreativeTab extends CreativeTabs{ add(InitBlocks.blockCoffeeMachine); add(InitBlocks.blockXPSolidifier); + add(InitBlocks.blockOreMagnet); + add(InitBlocks.blockGreenhouseGlass); add(InitBlocks.blockGrinder); add(InitBlocks.blockGrinderDouble); diff --git a/src/main/java/ellpeck/actuallyadditions/event/TooltipEvent.java b/src/main/java/ellpeck/actuallyadditions/event/TooltipEvent.java index 1d0551545..f7f978918 100644 --- a/src/main/java/ellpeck/actuallyadditions/event/TooltipEvent.java +++ b/src/main/java/ellpeck/actuallyadditions/event/TooltipEvent.java @@ -39,12 +39,14 @@ public class TooltipEvent{ //Base Item's Unlocalized Name String baseName = event.itemStack.getItem().getUnlocalizedName(); - event.toolTip.add(HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".baseUnlocName.desc")+":"); - event.toolTip.add(TEXT_PRE+baseName); + if(baseName != null){ + event.toolTip.add(HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".baseUnlocName.desc")+":"); + event.toolTip.add(TEXT_PRE+baseName); + } //Unlocalized Name String metaName = event.itemStack.getItem().getUnlocalizedName(event.itemStack); - if(!metaName.equals(baseName)){ + if(metaName != null && baseName != null && !metaName.equals(baseName)){ event.toolTip.add(HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".unlocName.desc")+":"); event.toolTip.add(TEXT_PRE+metaName); } diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemGrowthRing.java b/src/main/java/ellpeck/actuallyadditions/items/ItemGrowthRing.java index addfbeddb..34dbe72ca 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemGrowthRing.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemGrowthRing.java @@ -33,7 +33,7 @@ public class ItemGrowthRing extends ItemEnergy implements INameableItem{ private static final int GROWTH_TICKS_PER_CYCLE = ConfigIntValues.GROWTH_RING_GROWTH_PER_CYCLE.getValue(); public ItemGrowthRing(){ - super(1000000, 5000, 2); + super(1000000, 5000, 1); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemWaterRemovalRing.java b/src/main/java/ellpeck/actuallyadditions/items/ItemWaterRemovalRing.java index 413356f0b..3e0a11994 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemWaterRemovalRing.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemWaterRemovalRing.java @@ -21,7 +21,7 @@ public class ItemWaterRemovalRing extends ItemEnergy implements INameableItem{ private static final int ENERGY_USED_PER_BLOCK = ConfigIntValues.WATER_RING_ENERGY_USE.getValue(); public ItemWaterRemovalRing(){ - super(1000000, 5000, 2); + super(1000000, 5000, 1); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityOreMagnet.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityOreMagnet.java index c5cf0aad3..301829259 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityOreMagnet.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityOreMagnet.java @@ -6,6 +6,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.blocks.InitBlocks; import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks; +import ellpeck.actuallyadditions.config.values.ConfigIntValues; import ellpeck.actuallyadditions.network.sync.IPacketSyncerToClient; import ellpeck.actuallyadditions.network.sync.PacketSyncerToClient; import ellpeck.actuallyadditions.util.WorldPos; @@ -35,10 +36,10 @@ public class TileEntityOreMagnet extends TileEntityInventoryBase implements IEne private int currentWorkTimer; - private int maxWorkTimer = 10; - private int range = 10; - public static int oilUsePerTick = 50; - public static int energyUsePerTick = 400; + private int maxWorkTimer = ConfigIntValues.ORE_MAGNET_MAX_TIMER.getValue(); + private int range = ConfigIntValues.ORE_MAGNET_RANGE.getValue(); + public static int oilUsePerTick = ConfigIntValues.ORE_MAGNET_OIL_USE.getValue(); + public static int energyUsePerTick = ConfigIntValues.ORE_MAGNET_ENERGY_USE.getValue(); public TileEntityOreMagnet(){ super(3, "oreMagnet"); @@ -83,10 +84,10 @@ public class TileEntityOreMagnet extends TileEntityInventoryBase implements IEne int z = randomPlacingPos.getZ(); int toPlaceY = randomPlacingPos.getY(); //Find the first available block - for(int y = this.yCoord-1; y > 0; y--){ + for(int y = this.yCoord-2; y > 0; y--){ Block block = worldObj.getBlock(xCoord+x, y, zCoord+z); int meta = worldObj.getBlockMetadata(xCoord+x, y, zCoord+z); - if(!block.hasTileEntity(meta) && block.getBlockHardness(worldObj, xCoord+x, y, zCoord+z) >= 0.0F && (block.getMaterial().isToolNotRequired() || (block.getHarvestTool(meta).equals("pickaxe") && block.getHarvestLevel(meta) <= 3))){ + if(block != null && !block.isAir(worldObj, xCoord+x, y, zCoord+z) && !block.hasTileEntity(meta) && block.getBlockHardness(worldObj, xCoord+x, y, zCoord+z) >= 0.0F && ((block.getMaterial() != null && block.getMaterial().isToolNotRequired()) || (block.getHarvestTool(meta) == null || (block.getHarvestTool(meta).equals("pickaxe") && block.getHarvestLevel(meta) <= 3)))){ int[] oreIDs = OreDictionary.getOreIDs(new ItemStack(block, 1, meta)); for(int ID : oreIDs){ String oreName = OreDictionary.getOreName(ID); diff --git a/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java b/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java index e6440cd82..ef9e2a940 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java +++ b/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java @@ -5,7 +5,7 @@ import org.apache.logging.log4j.Logger; public class ModUtil{ - public static final String VERSION = "1.7.10-0.0.7.6"; + public static final String VERSION = "1.7.10-0.0.8.0"; public static final String MOD_ID = "ActuallyAdditions"; public static final String NAME = "Actually Additions"; diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index 7a033fc4f..b3c6322fc 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -4,6 +4,8 @@ achievement.page.actuallyadditions=Actually Additions fluid.oil=Oil fluid.canolaoil=Canola Oil +tooltip.actuallyadditions.block.desc=Block + tile.actuallyadditions.blockCompost.name=Compost tile.actuallyadditions.blockMiscOreBlackQuartz.name=Black Quartz Ore tile.actuallyadditions.blockMiscBlackQuartz.name=Block of Black Quartz @@ -90,6 +92,18 @@ tile.actuallyadditions.blockColoredLampPink.name=Pink Lamp tile.actuallyadditions.blockColoredLampCyan.name=Cyan Lamp tile.actuallyadditions.blockColoredLampPurple.name=Purple Lamp +item.actuallyadditions.itemGrowthRing.name=Ring of Growth +tooltip.actuallyadditions.itemGrowthRing.desc=Lets Plants around you grow when held in hand +item.actuallyadditions.itemWaterRemovalRing.name=Ring of Liquid Banning +tooltip.actuallyadditions.itemWaterRemovalRing.desc=Removes Water & Lava Blocks around you when held in hand +item.actuallyadditions.itemSuctionRing.name=Ring of Magnetism +tooltip.actuallyadditions.itemSuctionRing.desc=Sucks in Items in the area when in Inventory + +tile.actuallyadditions.blockOreMagnet.name=Magnetic Miner +tooltip.actuallyadditions.blockOreMagnet.desc.1=Pulls underground Ore Blocks to the Surface +tooltip.actuallyadditions.blockOreMagnet.desc.2=Places where Ores should be mined have to have a +tooltip.actuallyadditions.blockOreMagnet.desc.3=Casing Block one block lower than the Miner. + item.actuallyadditions.itemBucketCanolaOil.name=Canola Oil Bucket tooltip.actuallyadditions.itemBucketCanolaOil.desc=A Bucket filled with Canola Oil item.actuallyadditions.itemBucketOil.name=Oil Bucket diff --git a/src/main/resources/assets/actuallyadditions/textures/gui/guiOreMagnet.png b/src/main/resources/assets/actuallyadditions/textures/gui/guiOreMagnet.png new file mode 100644 index 0000000000000000000000000000000000000000..676b76e81af363a429486daebfcb99cc64d8b8f6 GIT binary patch literal 1919 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K58911MRQ8&P5Fo{p?&#~tz_78O`%fY(0|PTd zfKP}kP~6Px!KsBRaGz5la2t*WX z=YujzNswPKFsYAZz!3bMT@@I~oCO|{#S9F52SJ!|$HeTnKtYKT*NBqf{Irtt#G+J& zg2c?c61}|C5(N`I13lB!R-;q~2BxQ;E{-7;ac}43`acQ~VJo~lz3cz~@0%1JYu=vl zT61CA!YY?ZJx$5;qJoYdD%Cfd;inqH|*qorWbK-+4lF} zKJVXe%56}7@DA(gTVI&>kJ{~xyJPfWocRc46;3^`_P5Yvt^RP-?NBrt#k&%{bJRE8xpJkx^;uqA9ZJQEAF zXOkJ*fn>PgyF(0THcK%ZlqZ63JAcPDfg&|NW7P zFUIyu3*)tkk_o#iruFRXZeduyziwX-&xgXFzjXv89@zX(XI#$+HMW6~=RjIA)cgDN z53oiuo?G7;|6z)LKmUmeyMzYD8M_TYiokX-Fq<&nk!F5i$OaUfXTdN($L5L1gX?t% z&oZvNd&%&?^@2;^Q_6RhOB