Jump to content

Draco18s

Members
  • Posts

    16559
  • Joined

  • Last visited

  • Days Won

    156

Everything posted by Draco18s

  1. Every. Single. Gorram. One. Do you not read the news?
  2. Probably the same way. Except that that function likely isn't deobfuscated yet. You need to look for a function that returns void and takes 6 integers as an input.
  3. Of course 9003 is out of bounds. Block IDs cap out at 4095.
  4. Deobfuscation happens slowly, as it requires uses determining what a function does, or what a variable is for, then reporting it back to the deobfuscation team (through MCPbot, usually).
  5. They ran reobfuscate when they compiled their mod. Those are the names of vanilla classes when you run it through the launcher.
  6. Player.sendChatMessage(...) ? Assuming that method has been deobfuscated yet.
  7. @PreInit MinecraftForge.EVENT_BUS.register(new HalflifeMod_EventSounds()); }} This is wrong. First, @PreInit is a function declared with the @PreInit annotation in your main class. Second (and the only inaccuracy in the tutoral) is that @PreInit was depreciated in favor of @EventHandler, but it should alert you to this and what to use instead. Third, I don't know how you thought you needed two unpaired close-braces. @EventHandler public void preInit(FMLPreInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new HalflifeMod_EventSounds()); }
  8. I have been reengineering my getItemDisplayName function to be language-good. public String getItemDisplayName(ItemStack par1ItemStack) { String n = ""; if(par1ItemStack.stackTagCompound != null) { if(doEnchName) { if(par1ItemStack.stackTagCompound.getString("enchName").length() > 0) n += StatCollector.translateToLocal(par1ItemStack.stackTagCompound.getString("enchName")) + " "; } if(doAdjName) { if(par1ItemStack.stackTagCompound.getString("preadj").length() > 0) n += StatCollector.translateToLocal("pre."+par1ItemStack.stackTagCompound.getString("preadj")) + " "; } if(doMatName) { n += StatCollector.translateToLocal("mat."+par1ItemStack.stackTagCompound.getString("matName")) + " "; } if(!(doEnchName || doMatName || doAdjName)) { n += StatCollector.translateToLocal("type.Artifact") + " "; } n += StatCollector.translateToLocal("type."+par1ItemStack.stackTagCompound.getString("iconName")); if(doAdjName) { if(par1ItemStack.stackTagCompound.getString("postadj").length() > 0) n += " " + StatCollector.translateToLocal("post."+par1ItemStack.stackTagCompound.getString("postadj")); } } if(n.length() < 1) { n = StatCollector.translateToLocal("type.Artifact"); } return n; } And entering all the unlocalized pieces to a localization file. Downside is that I switched over to using vanilla's names for enchantments, so instead of "Efficient Gold Whatever" it's now "Efficiency Gold Whatever" but oh well. Enchantments in item names makes them super long (as noted, there are config values for each piece).
  9. And.... Solved my own problem. I figured that "Artifact" was a string that was coming from somewhere, so I did a workspace-wide search. ItemArtifact#getItemDisplayName()
  10. Huh, that looks pretty neat. Sadly, I can't find a list of features (or what is premium only).
  11. I didn't push what I'm working with to Github. The code is not currently working, so why would I push a broken version? What I mean is that setUnlocalizedName("Artifact"); line I've changed to setUnlocalizedName("Banana"); and it still displays in-game as "Artifact":
  12. So this has been bugging me for a little while, but as the name that showed up was accurate enough I just left it as it was. Now though I'd like to actually fix it. Here's the thing: all of items I've made for this one mod all display in-game with the same name: "Artifact" I'd like to fix that so that the armor items are "Artifact Armor" ideally with material designations. The only place this shows up is the creative inventory (as the item's name is later controlled by NBT data, which works great). I have no language file entries for these items yet, and have removed the LanguageRegistry entries for them as well. I've even gone so far as to remove the setUnlocalizedName from them, NOTHING causes it to change. The items don't even inherit from each other. All my code can be found here: https://github.com/Draco18s/Artifacts/tree/master/draco18s/artifacts DragonArtifacts.java is the main mod class and the two item classes are ItemArtifact.java and ItemArtifactArmor.java inside /item Codebase hasn't change significantly from last night.
  13. You can also check for item equivalence. itemstack.getItem() == Items.disksleeve For instance. Which is how things will work come 1.7
  14. Look on the wiki (link above) in the tutorials list. Seriously? Wiki? There is no answers on such questions. They only giv e answers on development if so. Oh, so this page doesn't exist. Gotcha. (Despite being old, its still accurate, based on a cursory glance and my recollections of when I did it)
  15. Just FYI: Minecraft does not like bounding boxes and collision hulls that are larger than 1 full cube. You'll find very strange quirks when you do set things up that way
  16. ent.getEntityName().equals("Pig") String comparison in Java does not work like integer comparison. Strings are compared as other complex objects, just like new ItemStack() doesn't equal new ItemStack(), so too will "Pig" not equal "Pig"
  17. Here's an example from my mod, dealing with integer arrays: int[] white = config.get("WorldGen","dimensionWhitelistList", new int[] {0}).getIntList(); int[] black = config.get("WorldGen","dimensionBlacklistList", new int[] {-1,1}).getIntList(); Arrays.sort(white); Arrays.sort(black); String a=Arrays.toString(white); String whitestring[]=a.substring(1,a.length()-1).split(", "); String b=Arrays.toString(black); String blackstring[]=b.substring(1,b.length()-1).split(", "); config.get("WorldGen","dimensionWhitelistList", new int[] {0}).set(whitestring); config.get("WorldGen","dimensionBlacklistList", new int[] {-1,1}).set(blackstring);
  18. Items are singletons and inherit from the class Item. Classes have instances called instance objects. itemID is a non-static public property of the Item class.
  19. The problem with enchants being averaged with the regular damage is this: If the regular damage is 5 and the enchantment of +1 damage is added to it, now your bow does 3 damage. That's less than if it was unenchanted!
  20. You have to add a cooldown and not teleport the player during that cooldown period. Look at Nether Portals.
  21. I don't know why you're averaging the bow damage with the enchantment damage, those should just add together. entityarrow.setDamage(entityarrow.getDamage() + (double)(k+h)); Also, 4.0F + material.getDamageVsEntity() is waaay too high for a bow. That's sword damage. Dividing by 2 or even 4 would be prudent.
  22. Hence "static properties" not "static methods" and quoting the two in question.
  23. The reason I get a little sarcastic is because people using static for inherently not-static purposes has happened four times in the last two days and several more times in the past. 90% of the time people don't understand what I mean when I say "why are you using static here?" because they don't know what they're doing. And rather than try and supply copy-paste solutions, I'm forcing people to think. Doing so means they learn things, even if it makes me look like an asshole. It also means I don't have to do as much work to get a better result. And I'm all about efficiency. And I don't care what people think about me.
×
×
  • Create New...

Important Information

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