Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

noahc3

Forge Modder
  • Content Count

    26
  • Joined

  • Last visited

Everything posted by noahc3

  1. Thanks, that worked. I had to dig through the features recursively since they weren't always one level deep: @SubscribeEvent(priority = EventPriority.LOWEST) public static void BiomeLoadingIntercept(final BiomeLoadingEvent event) { BiomeGenerationSettingsBuilder gen = event.getGeneration(); for(Supplier<ConfiguredFeature<?, ?>> f : gen.getFeatures(GenerationStage.Decoration.UNDERGROUND_ORES)) { ConfiguredFeature<?, ?> resolved = resolve(f.get()); if (resolved.feature instanceof OreFeature) { OreFeatur
  2. The end goal is to disable certain aspects of vanilla ore/feature generation so I can replace them with my own features with custom values. To disable vanilla ore generation, I've created an event handler for BiomeLoadingEvent. This allows me to get the BiomeGenerationSettingsBuilder which allows me to get the list of ConfiguredFeature's for the biome associated with the event call: @SubscribeEvent(priority = EventPriority.LOWEST) public static void BiomeLoadingIntercept(final BiomeLoadingEvent event) { BiomeGenerationSettingsBuilder gen = event.getGeneration();
  3. I used to track the items life by using a tick counter, however I was forced to change this due to the fact that anytime NBT is updated, the item (if held) performs the re-equip animation, which looks very strange even with longer tick delays. In 1.8 this could be dealt with by enabling some flag that disables the re-equip animation, but this has a different effect in 1.10+ in which when you swap items, it actually doesn't change what item is rendered in hand (this might be a Forge bug). Ticks existed also won't work since the item can be toggled on and off, therefore it could real
  4. Hello! I have some items which have a timer that compares current system time and a stored system time while activated to determine when the item is "depleted" and should be removed from the players inventory. The problem is, if a player logs out with the item in an active state (determined by a NBT boolean value) and logs back in long enough after that the item would be considered old enough, the item depletes itself. To combat this, I figure I should detect if the player the item is held by is logging off, and when that happens, change necessary NBT values so that the item is in
  5. Minecraft does not like me using getItem on the itemstack returned from the slot check ( this.getStackInSlot(0).getItem() ), crashes and throws a NullPointerException, even though I'm making sure to check that it isn't null before executing any code using it. Crash report: http://paste.ee/p/CnMhU Tile Entity Class where the error is thrown: http://paste.ee/p/tyuNv (getItem checks around line 204) Help would be appreciated, and sorry for any hassle. EDIT: Whoops! Needed to make sure the ItemStack itself wasn't null before setting a variable to Itemstack.getItem()
  6. Simple (hopefully) question. How can I compare the itemstack in a slot with an itemstack that I am checking for. Eg. I am trying to check if slot index 0 has a diamond. I've tried just comparing the itemstack in the slot with new ItemStack(items.whatever) however that does not work presumably because certain data such as how long the item has existed for is different from a newly generated itemstack. Any help would be appreciated!
  7. Hey, I have an item which has 2 timers stored in NBT, a cooldown and a time remaining counter. For some reason, if the NBT is being modified, the item does some crazy jumping thing if you hold it in your hand (Like when you right click an item on the ground, except constant). I don't remember this being an issue in 1.7. Here is my code: http://pastebin.com/C9ZrfKVY Any help would be much appreciated!
  8. package noahc3.AbilityStones; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = "abilstones", name = "Ability Stones", version = "1.0") public class AbilityStones
  9. en_US.lang: item.ItemRegenerationStone.name=Regeneration Stone itemGroup.tabAbilitystones=Ability Stones Again, when I put the item in my inventory, it correctly displays as Regeneration Stone.
  10. Hey, for some reason I have an item that while in the creative menu or in NEI, it's name is Unnamed. When I put it into my inventory it fixes itself. I suspect this may be due to me using NBT but I'm not sure. Here is my Item Class: package noahc3.AbilityStones; import java.util.List; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraf
  11. Hey, I'm currently having an issue where if you hold right click for longer than maybe half a second, the if statement I use to detect right clicks is constantly activating. Here is my if statement: public ItemStack onItemRightClick(ItemStack itemstack, World par2World, EntityPlayer par3EntityPlayer) { if(itemstack.stackTagCompound.getInteger("enabled") == 1) { itemstack.stackTagCompound.setInteger("enabled", 0); System.out.println("Was Enabled, now Disabled"); return itemstack; } else { itemstack.stackTagCompou
  12. @AwesomeSpider Thanks, switching it to return itemstack fixed it. Yea, it was a nullpointer exception. @coolAlias I have created the NBT tag further in the code with this: if(itemstack.stackTagCompound == null){ itemstack.stackTagCompound = new NBTTagCompound(); itemstack.stackTagCompound.setInteger("timer", 24000); itemstack.stackTagCompound.setInteger("enabled", 0); } Thanks for the help. That's inside onUpdate.
  13. Hey, I'm having some issues with detecting right clicks with an item. Here is the code I'm using: public ItemStack onItemRightClick(ItemStack itemstack, World par2World, EntityPlayer par3EntityPlayer) { if(itemstack.stackTagCompound.getInteger("enabled") == 1) { itemstack.stackTagCompound.setInteger("enabled", 0); System.out.println("Was Enabled, now Disabled"); return null; } else { itemstack.stackTagCompound.setInteger("enabled", 1); System.out.println("Was Disabled, now Enabled"); return null;
  14. I figured out how to do it, but yea, I decided to move the timer to NBT to stop the weird jumpy stuff it does when you hold it in your hand. Thanks anyways.
  15. Hey, I'm attempting to make an item take damage over time. I plan to have the item last 20 active minutes, so 20 x 60 x 20 ticks = 24000. Anyways, the issue is I can't get the item to take damage. package noahc3.AbilityStones; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; public class ItemRegenerationStone extends Item { //use timer in ticks (24000) public static
  16. Okay, I'm starting to feel like a pest but I can't get this to work. At this point I am able to at least launch Minecraft and load/make worlds, but when I put the item in my inventory, the game crashes. Here is my code: import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; public class ItemRegenerationStone extends Item { EntityP
  17. Where/how would i use Item#onUpdate? I would imagine somehow like the following: @SubscribeEvent public void onUpdate(LivingUpdateEvent event) { //seteffects } but how do I put in the Item# part and how would I specify the item in question?
  18. Hey, i'm simply trying to figure out how to detect a specific item in a players inventory, then run specific actions such as potion effects if its there, which would run under a server tick event. I just can't seem to figure out how to actually detect the item itself. From what I've read, I should use if(player.inventory.hasItem(ItemRegenerationStone)) but that doesnt seem to work. Any help would be much appreciated.
  19. Odd, other games can successfully utilize multi-threaded rendering. And the loading screen works with all of my other forge configurations. Anyways, thanks for the help.
  20. This worked, thanks. Any idea why it isn't working? Kind of saddens me that I can't look at the glorious loading screen.
  21. I understand that the EAQ says to not make support threads about any mc versions other than the latest. However, since 1.7.10 is still actively supported/updated, and many other people are making 1.7.10 threads successfully, I will post this anyways. Feel free to ban me/lock this thread or whatever you feel is right. It just doesn't make sense to me that you wouldn't allow bug reports for a version you are still actively working on. Hello, I have recently come across a bug when attempting to make a new modpack. The title screen graphics are all white and the text is replaced with blocks.
  22. Thanks! With some trickery with NBTExplorer I managed to move over the item ID data. Thanks again!
  23. But the problem is we were planning to reset the world, and copy over alchemy bag data from ProjectE, which contains all of the items... Is there a specific part of the world file that holds the data in it?
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.