Jump to content

MrJPGames

Members
  • Posts

    31
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • URL
    http://www.sheepgames.us
  • Location
    The Nether
  • Personal Text
    I am not new!

MrJPGames's Achievements

Tree Puncher

Tree Puncher (2/8)

-1

Reputation

  1. I don't quite understand what you mean. I could add them to my own block class but I think that wouldn't work correctly, if that is the way could you try to be a little more specific on how to do so! Here is the code I use for the adding the block: public static final Block SapphireBlock = new MT_Block (235, 7).setHardness(2F).setResistance(4F).setStepSound(Block.soundTypeStone).setUnlocalizedName("SapphireBlock").setBlockTextureName("moretools:SapphireBlock"); Here is the MT_Block file: package MoreTools; import java.util.Random; import net.minecraftforge.*; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; public class MT_Block extends Block { public MT_Block(int par1, int par2) { super(Material.iron); this.setCreativeTab(CreativeTabs.tabBlock); } }
  2. So I was trying to update my mod to 1.8 (and yes I know it's in it's early stages right now). But it seems like these three functions (setHardness, setResistance, setStepSound) are protected in the Block class of Minecraft. Is there a workaround or do I just wait for the next update of FML for 1.8?
  3. I was trying to install the SRC for FML 1.8 (FML 7.10.93.1001). But I keep getting this error. Note: This time I was trying build 1000 just to see if that made a difference but it didn't! Edit: I used the command "gradlew setupDecompWorkspace" and also tried "gradlew setupDecompWorkspace --refresh-dependencies" Here is the error (in image form)
  4. That is true but if you want "true" full control over the block you wouldn't extend BlockCrops now would you? OK maybe that was the No True Scotsman fallacy... (http://en.wikipedia.org/wiki/No_true_Scotsman)
  5. K thanks for the reply that does seem more useful! I don't have any code for that so I can't send it but I would advice using this method if you need more than 1 type of items to drop though in the case of paprika's you might want only the paprika to drop as the seeds should be simmular to a melon where you can use the crafting table to get them! If you want you can use this code I wrote to test (otherwhise ask the others for further help if needed!): public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { return customGetDropFunction(p_149650_1_); } private Item itemdropped; public Item customGetDropFunction(int p_149650_1_){ //switch statment for the metadata switch (p_149650_1_) { case 5: //sets itemdropped so quantity can be changed latter itemdropped = MT_mod.greenpaprika; //Has to be an Item! //sets the item to drop return itemdropped; case 6: itemdropped = MT_mod.greenpaprika; return itemdropped; case 7: itemdropped = MT_mod.greenpaprika; return itemdropped; default: itemdropped = MT_mod.PaprikaSeeds; return itemdropped; } } /** * Returns the quantity of items to drop on block destruction. */ public int quantityDropped(Random p_149745_1_) { int quant; if (itemdropped == MT_mod.PaprikaSeeds){ //Gives only 1 seed (no dupe glitches that way!) quant = 1; }else{ //Gives min of 1 Paprika and max of 4. Min can be changed by the number before the + the max can be controlled by the number inbetween te () (Which it adds to the number before the + but thats basic math) quant = 1 + p_149745_1_.nextInt(3); } return quant; }
  6. BTW, I know Java. I atleast know that getDrops(params) isn't called this.func_149865_P() in the BlockCrops class... Good you know such a complicated function name! But the amount of items is controlled by: public int quantityDropped(Random p_149745_1_) { return 1; } and can easliy be manipulated (depending on metadata!) So that shouldn't be a problem! Also i could not find a way to specify a drop amount in the getDrops() function I will asume you're right and it is possible with it but just for my informaition could you tell me how to specify such a thing?
  7. Just tested the code I sent and it works! YOU DO NOT HAVE TO OVERRIDE getDrops! If you're stupid enought to still belive so please get of the internet. If you want prove I can post the code I used so you could test it. Here's reason you don't need getDrops: getDrops is a function called within the getItemDropped. the function getItemDropped can not be repleaced as it´s a function Minecraft uses to see which item/block has to be dropped getDrops is a "easy" way of chaning the drop! If you look at the getItemDropped of the minecraft block BlockCrops: public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { return p_149650_1_ == 7 ? this.func_149865_P() : this.func_149866_i(); } As you can see if you know ANYTHING about java this only call the functions getDrop (this.func_149865_P() in the case of BlockCrops) and this.func_149866_i() is the drop of the seed this function only returns this item, thus it could be used if you want but in this specific case it would only call getDrop() if the metadata was 7 which would be useless this statment could either be changed in the "if statment" in getItemDropped or be replaced with a custom getDrops (which is easier in this case!). Sorry if you got offended but please check your facts before telling that something will not work is necessary if it's not!
  8. public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { return customGetDropFunction(p_149650_1_); } public Item customGetDropFunction(int p_149650_1_){ if (p_149650_1_ == 5){ return modfile.greenpaprika; }else if (p_149650_1_ == 6){ return modfile.yellowpaprika; }else if (p_149650_1_ == 7){ return modfile.redpaprika }else{ return modfile.paprikaseeds; } } This should work if you replace the Items. What the others are saying is correct as long as the getItemDropped is refering to those functions, this changes that so these functions are in theory not requered anymore. You should also know how it works from the code but basicly what it does is if the user breaks the crop block it will run the getItemDropped function this function has the metadata as the variable "p_149650_1_" which you pass to your custom getDrop function which than has if else statements to check the metadata and drop the correct item. NOTE untested!
  9. Use the onItemRightClick in the Item to spawn the entity, then use the interact on the entity to open the GUI and then you add the functions you wanted to this GUI and it should work!
  10. I think that ISpecialArmor should be able to fix it. The armor seems to function as it should it's just the armor bar. After implementing ISpecialArmor I get 3 functions I haven't used before. The bar doesn't show at all (first it only showed with the helmet and incorectly) I think it has to do with everything returning null, or 0 but as I don't know what they should return I can't fix it. The three functions are: ArmorProperties, getArmorDisplay and damageArmor I think getArmorDisplay should be it so now I would like to know how to implemt this (along side the other one as they make the original function of the armor not work as I have yet to test this after the changes!)
  11. Does anyone know what I am doing wrong, it's the only thing I can't get working. At this point it seems to me like I have tried evrything but I'm sure that I'm missing something! As said before if you need more code I will obvs give that code as soons as I can!
  12. First to Mecblader this is about modding. You CAN NOT do this any more but if you make changes in the code where on startup or world launching you check for an update people can manuly install that update which you made it gives notifications. You can not magicly do this without updating the mod. And I don't know how to do this as I (like most) add things along side the update to support the newer versions of minecraft! But it can be done and some have done it (though if you can go for auto update not the notifications!)
  13. Not sure but I think you'll actualy have to use something like this: public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { return p_149650_1_ == 7 ? this.func_149865_P() : item; } where 7 is the metadata of the block and item is the item it should give. Just expland that for the 4 states (not grown, green, yellow, red)
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.