Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Draco18s

Members
  • Joined

  • Last visited

Everything posted by Draco18s

  1. Clunky, but it should work.
  2. Ok, so how do I fix it?
  3. Ok, this fixed it for SSP, but not SMP. Now what?
  4. Likely a firewall issue.
  5. Yes there is. public HarvestDropsEvent(int x, int y, int z, World world, Block block, int blockMetadata, int fortuneLevel, float dropChance, ArrayList<ItemStack> drops, EntityPlayer harvester, boolean isSilkTouching)
  6. I know. I'm just saying that you started with GitHub today and I've been using it for months and I still don't understand most of it.
  7. Pfft. Until you can figure out how to manage branches and pull requests, I'd say you've gotten up to "what does GitHub do?"
  8. 1) Don't use addGrassSeed , you want your seeds to ONLY drop in the swamp, so there's no point in adding them to the global drop list. 2) You do not need your biomeSwamp variable. If it's a swamp, do-the-thing, if it's not do-the-other-thing. There's no point in setting the result of a boolean check and then if-checking that boolean again. 3) if(is == Items.seeds) { drps.add(new ItemStack(riceSeeds)); } 4) Move the event.drops.clear(); and event.drops.addAll(drps); lines outside of the loop.
  9. int timeOfDay = world.getWorldTime() % 24000 That will tell you what time of day it is, from there you just have to figure out when the bed lets people sleep and compare.
  10. I knew there was something with Java 6 there, but I didn't catch the diamond operator usage. OTOH, a google search turned up someone completely unrelated that simplified my own work. (I use long-hand, rather than the diamond operator, as I do a lot of cross-language work and AS3 doesn't have it).
  11. Subscribe to the LivingDropsEvent event
  12. Good stab at the problem. But you're doing a few things wrong. drops is an array and it will never equal, or contain, your item. You're going to want to loop through looking to see if any of the array items are Items.seeds and then remove that item and add yours. Here's what I did: @SubscribeEvent public void harvestGrass(BlockEvent.HarvestDropsEvent event) { if(event.block instanceof BlockTallGrass) { //cuts down on checking when the block destroyed was stone, logs, leaves, etc. BiomeGenBase bio = event.world.getBiomeGenForCoords(event.x, event.z); if(biomeTemps.get(bio.biomeID).temp <= 0.3) { //the condition you are interested in ArrayList<ItemStack> drps = new ArrayList<ItemStack>(); for(ItemStack is:event.drops) { if(is.getItem() == Items.wheat_seeds) { drps.add(new ItemStack(WildlifeBase.winterWheatSeeds, is.stackSize)); //add the new item } else { drps.add(is); //add any other items that dropped, but which we're not replacing } } event.drops.clear(); //remove the old event.drops.addAll(drps); } } } The second array is for avoiding modifying the array during the loop, but there are other ways to do that as well, such as using an iterator.
  13. Instead wait for the item drop event, and if seeds drop and its the right biome, replace the seed with your seed. addGrassSeed will permanently add it to the list of dropable seeds.
  14. boolean debug = cfg.getBoolean("genera","debug",false);
  15. Yeah, I could probably do that at this point.
  16. Why are you trying to store "1" or "false" into a boolean? Booleans can't store "1".
  17. You go shopping and bring the shopping list. Milk Bread Eggs Peanut butter Your wife calls and asks, "What's the fifth thing on the shopping list?" How do you reply?
  18. I was looking at this and couldn't get it to work, as I want to have a deobfuscated package that is only one of my packages. I've got various sub-mods all using the same build script, and while I did get a deobf version, it was everything, not just my lib. So I'm not sure how to combine that build entry with something like from zipTree(jar.outputs.getFiles().getSingleFile()).matching { exclude 'com/draco18s/ores/**', 'com/draco18s/hazards/**', 'com/draco18s/wildlife/**', 'mcmod.info' }
  19. Or give your sapling a name... You never call setUnlocalizedName for it, so when you call getUnlocalizedName , it returns null.
  20. Show CherrieSapling.java
  21. While you're still limited to 16-from-metadata, you can supply additional states that are stored in TileEntity data. Look at the flower pot.
  22. ...that's odd, I thought I made sure to account for that. But on that specific event, its missing. Lets try this again. Ah yes, that did it. Thanks Diesieben.
  23. Forge v1291 1.7.10
  24. So, I seem to have a strange problem saving data to the chunk its associated with when the chunk is saved and unloaded. Basically: The data is saved (22:23:02). Then the data is unloaded (22:23:23) as the player moved out of range. Then the data (which is now been removed from memory) is saved again (22:23:48), resulting in data loss. WTH. Why is an unloaded chunk receiving a ChunkSave event? Why does if(event.getChunk().isChunkLoaded) still return true for this actually-unloaded chunk? How the hell do I fix this?

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.