Jump to content

Draco18s

Members
  • Posts

    16559
  • Joined

  • Last visited

  • Days Won

    156

Everything posted by Draco18s

  1. This is what System.out.println() is made for.
  2. It's called automatically. All you need to do is add your string to the list passed as a parameter.
  3. MinecraftForgeClient.registerItemRenderer(...) ?
  4. You have to save the information somewhere. Then the right-click changes that datavalue, then the addInformation function interprets that datavalue as whatever you want it to say.
  5. Dynamic, how? In any case, this might help: https://github.com/Draco18s/Artifacts/blob/master/draco18s/artifacts/item/ItemArtifact.java Look for addInformation(...)
  6. I have this feeling you didn't read what they're trying to do.
  7. In post init loop through the list of biomes: public static void generateBiomeData() { for (int i = 0; i < BiomeGenBase.biomeList.length; i++) { BiomeGenBase biome = BiomeGenBase.biomeList[i]; if (biome != null) if (biome.biomeName == null) { System.out.println("[Wispy] Biome (id " + i + ") has null name, could not build spawn information."); } else { String name = biome.biomeName.toLowerCase(); float E = biome.temperature; float F = biome.rainfall; float H = biome.minHeight; int I = biome.theBiomeDecorator.flowersPerChunk; int J = biome.theBiomeDecorator.grassPerChunk; int K = biome.theBiomeDecorator.treesPerChunk; } } } } There are other factors too, those just happened to be ones I was using for a mod (my variable names ended up coming from an excel spreadsheet. F was column F, etc).
  8. I figured. I tend to do really bizarre things when I mod. Works out to be great examples in so many ways for much simpler purposes. I didn't know about multiple render passes when I did that block, though. It dates about six months older than the Item...I should redo how several of the blocks are rendered. The spikes block uses three textures (I could probably just use setTextureOffset instead!)
  9. Oh good catch.
  10. ...Forge 737? What version of Minecraft are you trying to mod with here? If it's not "1.7.x" then Lex is just going to jump in here and say "Use the current version."
  11. It saves all changes made to it. There are ways to set values, even if those values already exist. And one of the changes you'd have to save is its initial setup. Leave that out and the file will be blank!
  12. It's because vanilla assumes that travelToDimension() needs to create a nether portal. The reason you're "ending up back in the nether" is that you transitioned to the overworld, vanilla placed a nether portal, and because you didn't have any teleport-cooldown set, you were instantly sent back to the nether (because you were touching the created portal). I had this problem and the only solution I found was to send the player to the overworld, then move them to a new location. Even then there's a small possibility of creating a nether portal (but the player doesn't end up touching it).
  13. Huh. I've got no idea. And you're welcome for making it neater.
  14. Yes. Use multiple passes. First pass renders the background, second pass uses the overlay. Here's an example for an Item, but I'm pretty sure Blocks can do it too. https://github.com/Draco18s/Artifacts/blob/master/draco18s/artifacts/item/ItemArtifact.java (Keeping in mind that I'm using NBT data to store which icon to use and the icons themselves are stored in an API referenced hashtable) If it doesn't work in a similar manner, an ISimpleBlockRenderingHandler will work https://github.com/Draco18s/Artifacts/blob/master/draco18s/artifacts/client/RenderArrowTrap.java Line 109 renders the base texture and the switch statement on 110 renders an overlay across one face. Not the best code in the world, but it works, so I haven't cleaned it up.
  15. Know what's cool about Object... ? GameRegistry.addShapelessRecipe(new ItemStack(MyMod.MyNewBlock), new ItemStack(MyMod.MyOtherNewBlock), new ItemStack(Block.dirt)); Voila!
  16. You don't need a TESR, I was asking if you were using one. For a full cube you can either go the standard block renderer route or you can go ISimpleBlockRenderingHandler, if the default renderer won't work for you. Likely the default renderer will work and you just need to write a getIcon() function to handle your needs. There's one in the Block class that has an IBlockAccess or World parameter passed to it. Use that parameter to get your TE and determine the state and which Icon should be returned as a result.
  17. Super easy As long as you've set up your read/write NBT functions (inventory persists across a save/load boundary) then all you need is this: public Packet getDescriptionPacket() { NBTTagCompound nbtTag = new NBTTagCompound(); this.writeToNBT(nbtTag); return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, nbtTag); } public void onDataPacket(INetworkManager net, Packet132TileEntityData packet) { readFromNBT(packet.data); }
  18. In your pre-init function (the @EventHandler that takes a FMLPreInitializationEvent, though the others work as well, but best practice is pre-init) do this: Configuration config = event.getSuggestedConfigurationFile(); BAM. Now you have access to the file. config.load(); //read the file config.getBlock("name", defaultID); config.getItem("name",defaultID); config.save(); //writes any changes to the file Example: https://github.com/Draco18s/Artifacts/blob/master/draco18s/artifacts/DragonArtifacts.java
  19. How is your block being rendered? ISimpleBlockRenderingHandler, TileEntitySpecialRenderer, or neither?
  20. Those are tooltips, not subscript. The OP wanted subscript.
  21. Noooooo.....Don't use the language registry. That's what language files are for! So much easier and it makes translation work easier because you don't have to write code to do it.
×
×
  • Create New...

Important Information

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