Jump to content

Draco18s

Members
  • Posts

    16559
  • Joined

  • Last visited

  • Days Won

    155

Everything posted by Draco18s

  1. Gravity is not a globally referenced variable. Every entity handles its own downward movement and acceleration. (Blocks do not obey gravity, in any way, what so ever. "But sand and gravel!" you say. "Entities. EntityFallingSand. Not a block" I reply.)
  2. @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List) { par3List.add("Whatever string you want to display here"); } Which you probably could have figured out by looking at the classes of any item that displays tooltip information. Like ItemRecord.
  3. ByteArrayOutputStream bt = new ByteArrayOutputStream(); DataOutputStream out = new DataOutputStream(bt); out.writeBoolean(true); Packet250CustomPayload packet = new Packet250CustomPayload("MyChannel", bt.toByteArray()); PacketDispatcher.sendPacketToServer(packet);
  4. I would just like to report that mnn's solution works. He got the config syntax wrong, but there is a set method that works for most data types. I wanted to read in an integer array, then sort it, in order to take advantage of reading this array later in a fast method. So I figured I might as well sort the array and save it back to the config. Here's the solution: int[] white = config.get("WorldGen","dimensionWhitelistList", new int[] {0}).getIntList(); //read the values, supplying defaults int[] black = config.get("WorldGen","dimensionBlacklistList", new int[] {-1,1}).getIntList(); Arrays.sort(white); //sort Arrays.sort(black); String a=Arrays.toString(white); String whitestring[]=a.substring(1,a.length()-1).split(", "); //have to convert to a string array in order to write String b=Arrays.toString(black); String blackstring[]=b.substring(1,b.length()-1).split(", "); config.get("WorldGen","dimensionWhitelistList", new int[] {0}).set(whitestring); //default values here are irrelevant, but required in order to retrieve the config Property config.get("WorldGen","dimensionBlacklistList", new int[] {-1,1}).set(blackstring);
  5. IC2 or BuildCraft. I know IC2 has an API; BC should have one.
  6. IChunkProvider is either not all you're using or you're using something else entirely. IChunkProvider does not contain that method.
  7. I am sorry but I do not see how that would work seeing that I need the server to be able to read and write to the same file. You only need to read at one point: When the server starts You only need to write at one point: When the server stops (There's one additional write operation: if the file to read doesn't exist, initialize it). There's no reason to be reading and writing to the same file at the same time (although you can). That said: Take a look at this post. It will allow you to create and read an arbitrary NBT data file.
  8. A source code base you can peek at: https://github.com/Draco18s/Decaying-World Mind I didn't make any armor, but armor should use the same basic functions.
  9. It's still a thought worth checking: disable the tick handler and see what happens.
  10. UUID = Universally Unique Identifier You're not supposed to be able to change it.
  11. Player dies -> Items automagically dropped.
  12. What do you mean by "save an integer"?
  13. ItemStack itemStack = slots[i]; slots[i].stackSize = 0; Mmm...pointers.... (Tip: ItemStack is passed by reference, not by value. When you set the stack size there, you're returning a stack of size zero: itemStack === slot[i] ).
  14. Entirely possible I figure that the dragon is handled similarly to other mobs that duplicating it would follow similar logic, but I guess not.
  15. Do you also have EntityRegistry.registerModEntity(...) somewhere?
  16. RenderingRegistry.registerEntityRenderingHandler(Class<? extends Entity> entityClass, Render renderer)
  17. Might want to take a peek at my project: https://github.com/Draco18s/Artifacts/tree/master/draco18s/artifacts/item https://github.com/Draco18s/Artifacts/tree/master/draco18s/artifacts/components It'll take a little parsing to find the exact parts you're looking for, but ComponentDamage handles increasing the player's attack value the same way vanilla swords do.
  18. JDGUI by itself is usually sufficient. Most mods don't obfuscate themselves, so you're left with only the Minecraft obfuscated parameters, but most you can figure out just by the context, the rest you can lookup using MCP I actually peeked inside Twilight Forest at the Anti-Builder to see if it had done anything special/clever to minimize get, save, check, and reset blocks (as I needed similar functionality). It was just a standard 3 dimensional for loop. I've also poked my nose into Mystcraft on occasion (notably when trying to figure out how to use XCompWiz's API, I'll get confused over the usage of one parameter, so I pull up base and take a look at how he was using it).
  19. !!! Do not create a new renderer, one is passed to you for all special renderers. Creating a new one will likely give you an "already tesselating" error.
  20. You mean like renderer.renderBlockUsingTexture(Block.stone, x, y, z, textureIcon);
  21. "/textures Make that "textures A / is automatically inserted for you between your mod ID and your texture path: Cyborg53373_Elementum:/textures/gui/cellingMachineGUI.png That : is converted to a / when it attempts to load files.
  22. "Preloading" textures hasn't been necessary since 1.5.0 with the new texture system. Vanilla handles that for you.
  23. Here's what I used: List l = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getAABBPool().getAABB(xCoord-3, yCoord-3, zCoord-3, xCoord+3, yCoord+3, zCoord+3)); And it worked.
  24. Except that if I attempt to register a texture using setTextureName("MyMod:someImage.png") and use the same casing when I build my folder structure it will fail. If I recall correctly, it works in Eclipse, but does not work when compiled and zipped. I don't have a convenient setup at the moment to produce a test case, but I've had the problem and when I tell people to always use lower case, it works.
×
×
  • Create New...

Important Information

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