Jump to content

zacharyjaiden

Members
  • Posts

    59
  • Joined

  • Last visited

Everything posted by zacharyjaiden

  1. are you asking for my main cause you assume thats where i register my recipes? if so i actually have them in a separate file if that what your wanting, though if you need my main for another purpose i can provide that crash report is as follows
  2. i dont know about a solve to this but im interested in finding out, but if the master block is center of the whole structure wouldnt its coordinate actually be 0,0,0 and the block above it 0,0,1 block below be 0,0,-1 etc? if you get what i mean
  3. is it all possible to add conditions to recipes being avaliable an example of what im trying to do (but failed in doing so) is if(StorageMiningLevel.get(player).GetLevel() > 5){ TestRecipes.instance().AddRecipe(new ItemStack(Items.stick), new ItemStack(Items.diamond)); } or if(StorageMiningLevel.get(player).GetLevel() > 5){ GameRegistry.addShapedRecipe(new ItemStack(ModBlocks.BlackQuartz), new Object[]{"QQ", "QQ", 'Q', ModItems.BlackNetherQuartz}); } long story short im trying to make crafting recipes only available on the condition that the player is the required level but every attempt im making is making the game crash..... is it all possible or is there another way around it?
  4. whats the function of the item? whats the outcome of using the item on the block and the relevance of the item to the block cause ive just recently been doing stuff with forge events around specific items breaking specific blocks
  5. ok mate ive done this before changing whether obsidian blows up with tnt or not i checked and you can set harvest level with the same method in the post init type: OverrideHarvestLevel.Init(); then create a class anywhere and type code package com.Package; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.event.FMLPostInitializationEvent; public class OverrideHarvestLevel { public static void Init(EntityPlayer player) { Blocks.obsidian.setHarvestLevel(toolClass, level); } } the impots arent right cause they were from other stuff i was using the class i gave this example from for import the necessary stuff and remove the rest, tell me how you get on
  6. just looking at the source code i found this strange its in an armour method but maybe it can help /** * Makes entity wear random armor based on difficulty */ protected void addRandomArmor() { super.addRandomArmor(); this.setCurrentItemOrArmor(0, new ItemStack(Items.bow)); }
  7. the closest thing youll probably get (unless you can find the actual code is) iron it composes about 1.3% of all blocks level 5-40 or 60 i think it was on average there are about 77 ores per chunk diamond ores are from level 1-16 and generate about 3.097 ores per chunk gold are in the bottom 32 layers it composes o.147% of blocks per chunk and spawns on average 8.2 ores per chunk lapis are between levels 13 and 16 and make up 0.083% of blocks per chunk its 1.1 times as common as diamond and spawna about 3.42 ores per chunk
  8. for some stupid reason idk if its a minor mistake ive overlooked or forge limits but i can only render 2 overlays in game at any one time.... i have 2 overlays that render in a pair when a pickaxe is present in hand... as i have finished mostly all the work around pickaxes in my mod i decided to move on to the axe when i came across this problem.. the overlay for axe just will not render when the other two associated with the pickaxe are present..... although if i comment out (/****/) one of the pick axes guis the axes then works so it makes me think that it is either one a typo that i keep overlooking that somebody may find or maybe limitations EDIT: Before actually posting this i had a stroke of genius and fixed my problem so ill post the solution that i found for the sake of helping anyone else out with the same problem (Ive only been modding a week or two so this is probably just a stupid mistake thats extremely obvious) BUT i still am curious as to why i can only have two classes that render overlays? this question still stands in case i want to add completely different and separate overlays in the future what was i doing wrong (if anything) or is it just a limitation of forge??? THE FIX, instead of having two classes one for pickaxe one for axe i put in two if statements if player is holding axe reference the value associated to respective class.. if player is holding pickaxe reference the value associated to respective class i can probably do Much more cleaning up of the code as there are probably unnecessary code value declarations variables etc that are in the statements that shouldnt be but for now its working which solved my issue class one PICKAXE LEVEL OVERLAY (keep in mind this is the FIXED solution version of the file) class two PICKAXE EXPERIENCE third and final AXE LEVELING (it is now combined in the first class pickaxe leveling) any ideas on the matter would be appreciated
  9. I've Googled trove and found nothing at all could you write one in sudo
  10. true using that instead and let me know if it got you anywhere @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity te = world.getTileEntity(x, y, z); switch(ID){ case 1: if(te !=null && te instanceof PowderingMachineTileEntity){ return new Gui_PowderingMachine(player.inventory, (PowderingMachineTileEntity)te); } } return null; }
  11. do you have an example of a trove or links to documentations and i think im getting confused by what you mean when saying list? are you refering to the array in the recipes class? public void AddRecipe(ItemStack Input, ItemStack AnotherInput, ItemStack Output) { Recipes.put(Arrays.asList(Input.getItem().getIdFromItem(Input.getItem()), Input.getItemDamage(), AnotherInput.getItem().getIdFromItem(AnotherInput.getItem()), AnotherInput.getItemDamage()), Output); } or the actual implementation of the crafting recipe (CoffeeMachineRecipes.instance().AddRecipe(new ItemStack(ModItems.CoffeeBean), new ItemStack(Items.sugar), new ItemStack(ModItems.CupOfCoffee)); )
  12. hey i may be asking a stupid question but why are you adding an enchantment of sharpness (Each level separately adds 1.25 extra damage (0.625 hearts) to each hit) when your making a mod, couldnt you just ass the respective increase in damage to your item? and add the lore "Enchantment: Sharpness" to the weapon the user wouldnt know the difference
  13. how can it be done more efficiently? and how would you add nulls to the list ?
  14. what do you mean, ive written out a custom recipes class, would i need to modify the code here ? public void AddRecipe(ItemStack Input, ItemStack AnotherInput, ItemStack Output) { Recipes.put(Arrays.asList(Input.getItem().getIdFromItem(Input.getItem()), Input.getItemDamage(), AnotherInput.getItem().getIdFromItem(AnotherInput.getItem()), AnotherInput.getItemDamage()), Output); } public ItemStack GetResult(ItemStack item_1, ItemStack item_2, ItemStack item_3) { if(item_1 == null || item_2 == null || item_3 == null) { return null; } if(item_1.getItem() instanceof ModItemEmpty_Mug){ ItemStack result = (ItemStack)Recipes.get(Arrays.asList(item_2.getItem().getIdFromItem(item_2.getItem()), item_2.getItemDamage(), item_3.getItem().getIdFromItem(item_3.getItem()), item_3.getItemDamage())); return result; } return null; }
  15. when writing out my recipe how would i incorporate the null (is kinda my issue as well) as a regular recipe looks like this CoffeeMachineRecipes.instance().addRecipe(new ItemStack(ModItems.Whatever), new ItemStack(ModItems.Stuff), new ItemStack(ModItems.Cats), new ItemStack(ModItems.Whatever)); ive tried writing CoffeeMachineRecipes.instance().addRecipe(new ItemStack(ModItems.Whatever), null , new ItemStack(ModItems.Cats), new ItemStack(ModItems.Whatever)); also on a long shot CoffeeMachineRecipes.instance().addRecipe(new ItemStack(Blocks.air), new ItemStack(ModItems.Stuff), new ItemStack(ModItems.Cats), new ItemStack(ModItems.Whatever)); i just cant figure out how to write a recipe with a hole in it
  16. Hey guys a question here, is it possible at all to allow a custom furnace to run with for example 3 inputs 1 output, and in certain circumstances, accept 2 inputs and 1 output, i tried removing the null check in the tile entity and recipe files but it returned an error when loading up (which is understandable) but i have no idea how to do it, i thought i could find out a way by browsing how the crafting table works but there is no tile entity for it (that i found) in the folder as brewing stand furnace hopper etc anybody able to help out would be muchly appreciated (im happy to post any relevant code if needed) thanks in advance
  17. oh i see, "{} error on my behalf the isCorrectTool was meant to be inside the is block harvestable all good ! that makes this question solved!
  18. hmm i tried that and it didnt work, i also tried adding "LevelStorage.get(player).AddLevel(0);" inside the if statement didnt work, i have however managed to get it to work by checking if the material is wood or not, is there any issues with this way if not awesome if so then how did i use the if statement wrong this is the working way @SubscribeEvent public void BreakEvent(BreakEvent event) { Block block = (Block)event.block; int meta = (int)event.blockMetadata; EntityPlayer player = (EntityPlayer)event.getPlayer(); // Meta meta = (Meta)event.blockMetadata; if(ForgeHooks.canHarvestBlock(block, player, meta ) && block.getMaterial() == Material.iron || block.getMaterial() == Material.rock && player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemPickaxe) { LevelStorage.get(player).AddLevel(1); } } ############################################################# ############################################################# this is the way i tried to use the if statement @SubscribeEvent public void BreakEvent(BreakEvent event) { Block block = (Block)event.block; int meta = (int)event.blockMetadata; EntityPlayer player = (EntityPlayer)event.getPlayer(); // Meta meta = (Meta)event.blockMetadata; if(ForgeHooks.canHarvestBlock(block, player, meta ) && player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemPickaxe) { LevelStorage.get(player).AddLevel(1); } if (block.getMaterial().isToolNotRequired()) { //do nothing } /// or i also tried if (block.getMaterial().isToolNotRequired()) { LevelStorage.get(player).AddLevel(0); } }
  19. ACTUALLY this is one error ForgeHooks.canHarvestBlock(block, player, meta ) is noot doing its job, the pickaxe works increasing its level on the normal minable blocks but also increases with stuff like mining wood thats a no no for my mod, any idea what went wrong?
  20. Thanks ALOT i found that rather than ctrl clicking and going to the event class itself it was easier to type event. and see the parameters in the drop down box this is the final event @SubscribeEvent public void BreakEvent(BreakEvent event) { Block block = (Block)event.block; int meta = (int)event.blockMetadata; EntityPlayer player = (EntityPlayer)event.getPlayer(); if (ForgeHooks.canHarvestBlock(block, player, meta ) && player.inventory.getCurrentItem().getItem() instanceof ItemPickaxe) { LevelStorage.get(player).AddLevel(1); } } AND it works
  21. okay ive tried to add this code and returned an error tell me what im missing @SubscribeEvent public void onBreakBlock(BreakEvent event, Block block, EntityPlayer player, int meta) { if (ForgeHooks.canHarvestBlock(block, player, meta) && player.inventory.getCurrentItem().getItem() instanceof ItemPickaxe) { LevelStorage.get(player).AddLevel(1); } } ive registered the event bus in the forgepreinit with the other 6 or 7 event busses "MinecraftForge.EVENT_BUS.register(new PickaxeEvent());" and i got this error (game didnt even reach start screen) its something to do with the event bus? should i put the registry somewhere else in my main file? or did i write the event wrong
  22. Also tried things like public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) { if(player.inventory.getCurrentItem().getItem() instanceof ModItemCastrealmPickaxe) { ExperienceStorage.get(player).AddExperience(10); } return true; }
  23. best thing to try first is possibly see if they have a source avaliable or ask for one to be provided, if you tell them the circumstances they may be willing to help you in that respect or possibly set up an api for you to work with, but be careful cause modding somebodies mod without their permission and using it on a public server may make some people grumpy even if it is for a good cause that aside all else fails and you still want to decompile and and work with it anyway im not quite sure how to deobfuscate it best thing to do with that is you cant find a program to help or people telling you how is to place print in statements and see how and when the code runns possibly, if you see any methods that look familiar try comparing them to vanilla classes they might be the deobfuscated verion of them in those classes maybe?
  24. im trying to make my custom pickaxe do something upon breaking a block, i know how to do it from the blocks end but it must be done from the pickaxe class for the sake of my mod. ive tried public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) { ExperienceStorage.get(player).AddExperience(10); return true; } which does in fact add experience to the game but crashes it in the process, it gives the impression something is wrong with the add experience method in my other class with the crash report - -- Head -- Stacktrace: at com.MCR.MinecraftReloaded.Lib.ExperienceStorage.AddExperience(ExperienceStorage.java:75) at com.MCR.MinecraftReloaded.Tools.ModItemCastrealmPickaxe.onBlockStartBreak(ModItemCastrealmPickaxe.java:52) at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerDestroyBlock(PlayerControllerMP.java:132) at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerDamageBlock(PlayerControllerMP.java:292) at net.minecraft.client.Minecraft.func_147115_a(Minecraft.java:1408) but ive added experience with "ExperienceStorage.get(player).AddExperience(10);" plenty of times before in things like respawn events }else if(event.entity.worldObj.difficultySetting == EnumDifficulty.NORMAL){ if(event.entity instanceof EntityPlayer){ EntityPlayer player = (EntityPlayer)event.entity; if(LevelStorage.get(player).GetLevel() > 0) LevelStorage.get(player).SetLevel(LevelStorage.get(player).GetLevel() - 25); } block break events (in the block class itself) /** * Called when the block is attempted to be harvested */ public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player) { ExperienceStorage.get(player).AddExperience(10); } and playerupdate event @SubscribeEvent public void onPlayerUpdate(LivingUpdateEvent event) { if(event.entityLiving instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) event.entityLiving; if(ExperienceStorage.get(player).GetExperience() > 50) { LevelStorage.get(player).AddLevel(1); ExperienceStorage.get(player).SetExperience(0); } } } all of which performed fine.... so it makes me believe that it isnt something to do with my add experience method which is public void AddLevel(int Amount) { Experience += (Amount * (ExperienceUtils.Multiplier)); MinecraftReloaded.packetPipeline.sendTo(new SyncPlayerPropsPacket(player), (EntityPlayerMP) player); } ive searched the Items.class for other ways to do it and tried millions of long shots but no luck maybe im not doing something right you can see? to make this clear it had to only add experience when the pickaxe breaks blocks that are minable by pick axes, it cant be an event or method that does it for every block in the game as its part of a leveling system this item in particular increases your mining skill... THANKS IN ADVANCE TO ANYONE WILLING TO SPARE THEIR TIME TO HELP IL BE SURE TO 1+ any helpful posts
×
×
  • Create New...

Important Information

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