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


Forge Modder
  • Content Count

  • Joined

  • Last visited

Everything posted by gcewing

  1. You seem to be using a mixture of two different algorithms, a recursive one and a non-recursive one. If you're keeping a queue of backtracking locations, you should *not* also be making recursive calls. It's usually better to do this kind of thing non-recursively, because then there's no danger of running out of stack space for complicated networks. The skeleton of a non-recursive graph traversal algorithm goes something like this: set visited_notes to an an empty set set nodes_to_visit to an empty queue add initial_node to nodes_to_visit while nodes_to_visit is not
  2. That looks like it should work. Have you checked that the pathname is correct? Also, I'm not sure if I've ever tried switching textures inside an item renderer, although I can't think of any reason it shouldn't work. Can you show us your whole renderItem method? There might be something else in there that's messing things up. OpenGL provides lots of ways to do that. :-)
  3. I'm developing an add-on for Project Red, and weird things are happening with the way Java and Scala interact. Everything compiles fine, but some things misbehave at run time. 1) I have a subclass of JItemMultiPart written in Java that overrides some Item methods, such as registerIcons. But my overrides are never called -- it calls the base methods defined in class Item instead. If I replace JItemMultiPart with a re-implementation of it in pure Java, my overrides are called as expected. 2) Calling methods of a TileMultipart that are defined in TileEntity, e.g. getBlockType and markDi
  4. Also, if you want to change the texture, you need to do it while the tesselator is not tesselating, otherwise you'll mess up rendering of other blocks. You also need to restore the previous texture when you're finished, again while the tesselator is not tesselating. The correct procedure is: tes.draw(); /* bind your texture here */ tes.startDrawingQuads(); /* draw your block here */ test.draw(); /* restore the default texture */ tes.startDrawingQuads(); But note that using a custom texture for rendering blocks is no longer the recommended way of doing things. The modern way is t
  5. This may sound silly, but have you made sure that the same thing doesn't happen with vanilla arrows? I had a problem with very similar symptoms some time back while working on SG Craft. It turned out to be a bug in vanilla Minecraft, that was fixed in 1.5.2 according to the changelog. What version of Minecraft are you modding?
  6. You might also want to make sure the blending function is set appropriately, e.g. GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); I just fixed a bug in SG Craft that was due to failing to do this.
  7. I can think of two possible reasons for this: 1) Items are only getting put into your tile entity on the client side, not the server side. 2) Your tile entity's onInventoryChanged() method is not getting called when it should be.
  8. I think the side is always reported as client side in single player. It's probably more reliable to check world.isRemote. Also, I don't think the @SideOnly annotations do anything in mod code. All methods are compiled in, so that the same jar can be used on client and server.
  9. Be careful -- if you're testing in single player mode, all the client side methods are accessible, even from server-only parts of the code, which means it's possible to write code that works fine in single player, but crashes when run on a real server. Concerning the packet handler, if you use packethandler = ... in @NetworkMod, it uses the same packet handler class for both client and server, so it's possible that your packet *is* being received on the server side but you're not noticing. Also, the earlier reply concerning isRemote got it backwards -- isRemote == true on the client
  10. Something like return plant instanceof BlockSapling;
  11. Greg's French Vanilla This mod adds enhanced abilities to some vanilla game elements. It has an unusual feature: It operates entirely on the server side. Despite being a Forge mod, it allows a standard, unmodified client to connect in multiplayer. It is not necessary for Forge to be installed on the client, unless other Forge mods are being used. Features currently implemented Signs Ever get frustrated that the only way to change a sign is to break it and re-type the whole thing? Now you can edit the text of a previously placed sign by right-clicking on it with a piece
  12. The answer to this depends on how much information your renderer needs to render the block as an item. Is the block ID and metadata enough, or do you need values from your TileEntity? Note that "rendering a tile entity as an item" is not the right way to think about this. Taken literally, that's impossible, because tile entities only exist in the world -- when in the form of an item (in hand, in inventory, or as a dropped item), there is no TileEntity instance. If your renderer only needs the block ID and metadata, you can do this using an ISimpleBlockRenderingHandler, registered us
  13. As others have said, the best way to answer this kind of question is by experiment. Try changing each of the rotation angles a little bit, one axis at a time, and observe what happens. Once you've found the right axis, adjust the angle until you get the result you want. Keep in mind that when you perform multiple rotations, the effect of later ones will depend on the earlier ones. You may find it less confusing to start with all angles zero.
  14. The root cause is this exception: Googling for "java ConcurrentModificationException" turns up this explanation: http://docs.oracle.com/javase/6/docs/api/java/util/ConcurrentModificationException.html In this case it's because you have this line inside the loop that's iterating over the drops: event.drops.add(new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, new ItemStack(MetallurgyRealismModBase.FoodEggBoiled))); One way to fix this would be to add the replacement items to a temporary list
  15. I have a class implementing IInventory that relies on a superclass to provide implementations for its methods. There's a message here https://github.com/BuildCraft/BuildCraft/pull/726 mentioning that this won't work unless you use reobfuscate_srg.sh instead of reobfuscate.sh. However, I am using reobfuscate_srg.sh, and it still doesn't work. I get: 2013-07-28 19:24:23 [iNFO] [sTDOUT] java.lang.AbstractMethodError 2013-07-28 19:24:23 [iNFO] [sTDOUT] at net.minecraft.inventory.Slot.func_75211_c(Slot.java:91) where that line is doing return this.inventory.getStackInSlot
  16. News Version 1.2.0 Updated for Minecraft 1.7.2. Version 1.1.0 Updated for Minecraft 1.6.2. Greg's Blogging Keep a diary of your adventures while playing This mod came about because I wanted a way to make notes about interesting things I encountered during my games. I tried keeping a diary using a word processor, but having to switch to another application, find screenshots and paste them in, etc., was a nuisance and interrupted the flow of the game. I wanted a better way. That's what Greg's Blogging provides. Whenever the mood strikes, you can hit the B k
  17. To anyone who isn't hearing any sounds: A Feed the Beast user reported that the sounds weren't working for him, and tracked it down to a conflict with the Integrated Soundpacks mod. Removing "integratedsoundpacks.litemod" from the mods folder reportedly fixed it.
  18. Thank you! That's the piece of information I was missing.
  19. Maybe I've got the wrong idea about what runtime deobfuscation means. I've been assuming it means I don't need to reobfuscate my mod -- I should be able to drop the unobfuscated classes into a standard Minecraft instance and it will run. That doesn't work for me; I get errors like 2013-04-13 12:29:34 [iNFO] [sTDERR] java.lang.RuntimeException: java.lang.reflect.InvocationTargetException 2013-04-13 12:29:34 [iNFO] [sTDERR] at gcewing.sg.BaseMod.newBlock(BaseMod.java:140) ... 2013-04-13 12:29:34 [iNFO] [sTDERR] Caused by: java.lang.NoSuchFieldError: blocksList 2013-04-13 12:29:34 [iNFO]
  20. Is anyone successfully using runtime deobfuscation with Forge The deobfuscation_data file that this version of Forge uses appears to be missing some rather crucial field names. In particular, all the static fields defined in the Block, Material and MapColor classes are missing. Without access to these fields, it's almost impossible to define any custom block classes, so I have trouble seeing how this wouldn't affect just about every mod in existence.
  21. I have a class called BaseTileEntity that defines all the methods required to implement IInventory, but doesn't claim to implement it. Then I have subclasses that do claim to implement it, and rely on inheriting the necessary methods from the base class. When I run the mod unobfuscated under MCP, this works fine. However, when I reobfuscate and run it in a real Minecraft installation, I get an AbstractMethodError from an attempt to call getSizeInventory(). It seems that the reobfuscator is getting confused somehow, and doesn't realise that the getSizeInventory() implementation in BaseTile
  22. There's another thread about this here that you might find helpful: http://www.minecraftforge.net/forum/index.php/topic,5722.0.html
  23. Here's some code I've successfully used to add trades to villagers. // Called during init void registerTradeHandlers() { VillagerRegistry reg = VillagerRegistry.instance(); SGTradeHandler handler = new SGTradeHandler(); reg.registerVillageTradeHandler(tokraVillagerID, handler); } // Trade handler class public class SGTradeHandler implements IVillageTradeHandler { public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipes, Random random) { // Trade 1 emerald and 3 naquadah ingots for 1 stargate ring block recipes.add(new MerchantRecipe( new It
  24. This looks like my BaseContainer class from SGCraft. It's meant to be used by subclassing it and overriding the sendStateTo() and updateProgressBar() methods. For example, here's how the stargate container class communicates the stargate's fuel level from server to client: public class SGBaseContainer extends BaseContainer { ... SGBaseTE te; // the stargate's tile entity ... @Override void sendStateTo(ICrafting crafter) { crafter.sendProgressBarUpdate(this, 0, te.fuelBuffer); } @Override public void updateProgressBar(int i, int value) { switch (1) { case 0: te.fuelBu
  25. The last four parameters to onItemUse are: int side, float px, float py, float pz side = which side of the block was clicked on px, py, pz = the point on the block that was clicked, in local coordinates (0.0 - 1.0) if I remember correctly.
  • Create New...

Important Information

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