Jump to content

TheGreyGhost

Members
  • Posts

    3280
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by TheGreyGhost

  1. Hi There's something wrong with a recipe you are registering Show your Stones.java? -TGG
  2. hi try World.scheduleBlockUpdate() (must be done on the server) -TGG
  3. If you create your own furnace: yes, fairly easy If you use the vanilla furnace: yes, but it is tricky. 1) you could use a technique called ASM with Reflection to modify the vanilla code for Furnace. 2) you could use a tick event handler to change the output of the smelting recipe every tick to a random value; using GameRegistry.addSmelting(). 3) you could make the smelting result a custom Item, and then when the ItemStack.updateAnimation is called, replace itself in the player's inventory by either the nugget or the ingot. They are all fairly advanced and will take some fiddling to get right. I would start with #2 personally. -TGG
  4. Hi At a guess it is because your upper/lower case don't match. package names and their directories should match each other exactly. By convention they should be in all lower case. -TGG
  5. That depends. If you have (say) 1000 items, and you only query your items storage system a couple of times second (for example- when the player wants to retrieve an item), then I guarantee you that no-one will ever notice the difference between O(n) or O(log2(n)). If you are certain you really want a faster lookup, you could place your Item into a HashMap, which is O(1) for retrieval. It will check whether the Item object is the same instance. If you want ItemStacks (includes damage) then your idea of using ItemID and damage as the key would also work. ID retrieval for 1.7.2 is not slow, don't worry about that. -TGG
  6. Hi It depends a lot on how big the packets are. To give you some context, Vanilla queues up Chunk updates (which are quite large, up to 10k depending on compression) to send at no more than 5 per tick. Over a LAN, you can easily send several MB per second with almost no delay and the system can easily keep up with it. Over the internet it is much much slower, as little as 10k per second or less, and with variable arrival times of the packets by up to hundreds of milliseconds or more. A much better solution is to code the client and server to run independently as much as possible. The client predicts what is happening on the server and just adjusts it every now and again based on a synchronisation packet. This works very well for moving objects, for example. Depending on what your properties are, the client might be able to predict the updates very easily. Another important thing to think about is whether you can tweak the game mechanics to make the rapid updates unnecessary. Is the player really able to follow 20 property changes per second? Could you add a delay or smoothing to the property change and make it a feature of your gameplay rather than a limitation? -TGG
  7. Hi I don't think it is rendering twice. I am not sure exactly what I'm seeing, but I sure it's because one of the rendering settings from the beacon is carrying over into your render. Common settings which cause problems are back face culling, depth culling, and alpha blending. I wrote a tool a while ago that is useful for determining openGL settings: https://github.com/TheGreyGhost/SpeedyTools/blob/Working/src/speedytools/common/Utilities/OpenGLdebugging.java I've used it in the past to check what the OpenGL settings are; it's not complete, but dumpAllIsEnabled() works and has showed up problems for me before- dump for a good render, dump for a bad render, and spot the difference. -TGG
  8. Hi If you post your code on GitHub or similar, I'll download and try to track it down. -TGG
  9. Hi. Is the problem that your inventory shows the same icon for both different types of tree? Or that the two trees are different when planted? This line doesn't look right and I'm not sure how it compiles even for (int i = 0; i < saplingicon.length; ++i) { saplingicon = iconRegister.registerIcon("Abrynos:Sapling" + saplings); // ? } The icon shown in your inventory depends on the Item for this block, not the Block. So for example BlockWood has an ItemMultiTexture; BlockWool has an ItemCloth. Look at those vanilla to see how they do it (getIconFromDamage - since the damage value for the item corresponds to the Block metadata); -TGG
  10. hi try the advice in this link... http://www.minecraftforge.net/forum/index.php/topic,18371.msg92948.html#msg92948 -TGG
  11. Hi Just a guess- "dependants": [ "devonmod", "nothing", "unlogic", "mobrebirth", "clayspawn", "mechpistons", "darkmetal", "firefoods" ] Do you need to include a section in your mcmod.info for each of these dependants? You have a section for (eg) devonmod, nothing, unlogic, but not for some of the others. I've never used dependants before so I don't know for sure. -TGG
  12. Hi When it stops at the breakpoint, inspect the snapshot variable and look at the value of the String field (in my forge version this is field_151412_b). That is the attribute it was looking for but didn't find. Then, look in baseattributemap.attributesByName to see the attributes that the client knows about for this entity. My off-the-cuff guess is it's an upper-case / lower-case problem. Try using only lower case for the attribute name. public class Snapshot { private final String field_151412_b; private final double field_151413_c; private final Collection field_151411_d; private static final String __OBFID = "CL_00001342"; -TGG
  13. Hi TLHPoE I would suggest the fastest way to narrow this down is to put a breakpoint on this line iattributeinstance = baseattributemap.registerAttribute(new RangedAttribute(snapshot.func_151409_a(), 0.0D, 2.2250738585072014E-308D, Double.MAX_VALUE)); and then look at snapshot.func_151409_a() to see what the attribute name is and (hopefully) why it's not being found in the baseattributemap. -TGG
  14. Hi Lex I think his code is only indirectly causing the problem, I think it is a bug in Minecraft code. This code is straight out of NetHandlerPlayClient::handleEntityProperties(..) - IAttributeInstance iattributeinstance = baseattributemap.getAttributeInstanceByName(snapshot.func_151409_a()); if (iattributeinstance == null) { iattributeinstance = baseattributemap.registerAttribute(new RangedAttribute(snapshot.func_151409_a(), 0.0D, 2.2250738585072014E-308D, Double.MAX_VALUE)); } and public RangedAttribute(String par1Str, double defaultValue, double minimumValue, double maximumValue) { super(par1Str, defaultValue); this.minimumValue = minimumValue; this.maximumValue = maximumValue; if (minimumValue > maximumValue) { throw new IllegalArgumentException("Minimum value cannot be bigger than maximum value!"); } else if (defaultValue < minimumValue) { throw new IllegalArgumentException("Default value cannot be lower than minimum value!"); } else if (defaultValue > maximumValue) { throw new IllegalArgumentException("Default value cannot be bigger than maximum value!"); } } Yes, the error is triggered by something his code does - attribute name is wrong maybe? - but the min value is for sure wrong, the code uses Double.MIN_NORMAL but it should probably be new RangedAttribute(snapshot.func_151409_a(), 0.0D, -Double.MAX_VALUE, Double.MAX_VALUE)); -TGG
  15. Hi In general, if you're getting purple and black it's because your texture name is wrong or the texture filename is wrong. This link might help. http://www.minecraftforge.net/forum/index.php/topic,18371.msg92948.html#msg92948 It may not be anything to do with double-block plants. -TGG
  16. Yes. Use an IItemRenderer - google for tutorials or see here (Item Rendering sections) http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html In the INVENTORY render, call the model rendering code as normal. Fiddle with the rotation until it looks how you want. -TGG
  17. Hi I don't think there is any way to change the rendering of vanilla blocks without base class edits. But you might be able to get the same game mechanic a different way. For example, you could change the appearance of the block you're looking at if it's next to lava or water- by hooking into RenderWorldLastEvent, checking the block the player is looking at using Minecraft.getMinecraft().entityRenderer.getMouseOver(), and rendering over the top of the block (eg outline, or an alpha-blended box) if appropriate. -TGG
  18. Hi My guess is that your writeEntityToNBT has a problem - I'm guessing it is a recursive loop -it calls super.writeToNBT , which calls writeEntityToNBT etc. If that doesn't work, try putting a breakpoint into the catch in Entity.writeToNBT, then inspecting throwable to see what is causing the exception. catch (Throwable throwable) { CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Saving entity NBT"); CrashReportCategory crashreportcategory = crashreport.makeCategory("Entity being saved"); this.addEntityCrashInfo(crashreportcategory); throw new ReportedException(crashreport); } -TGG
  19. Hi What WorldServer did you give Teleporter in your CustomTeleporter constructor? serverPlayer.mcServer.getConfigurationManager().transferPlayerToDimension(serverPlayer, CUSTOM_DIM_ID, new CustomTeleporter()); Each dimension has its own WorldServer. So I'm guessing you've probably given your Teleporter the wrong one. MinecraftServer.getServer().worldServerForDimension or DimensionManager.getWorld() might be of use. -TGG
  20. Hi Looks like you haven't implemented the IItemRenderer correctly. There are a couple of tutorials around on how to do IItemRenderer; this link will also help (See the sections on ItemRendering) http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html -TGG
  21. Hi Looks like an FML bug to me. Even if there is something wrong in your mod header (eg dependencies), the loader should handle it gracefully. suggest you post it in the bug report forum. If you feel like troubleshooting yourself, I'd suggest putting a breakpoint into the Loader method at line 230 and seeing why it tries to create a list from something that's null. -TGG
  22. Hi What are the symptoms of the problem? -TGG
  23. Hi To just use the 2D inventory icon for the sword, change your ItemRender3Dtool to have @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { return (type == ENTITY || type == EQUIPPED || type == EQUIPPED_FIRST_PERSON); } And make sure you have included the image you register in registerIcons. public class testSword extends ItemSword { public testSword(ToolMaterial arg0) { super(arg0); this.setCreativeTab(grwarcraft.g1rwarcraft); } @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { this.itemIcon = iconRegister.registerIcon(grwarcraft.modid + ":" + this.getUnlocalizedName().substring(5)); } } -TGG
  24. Hi There is no icon in inventory because you need to either give your Item an icon using .setTextureName() or you need to implement the INVENTORY render type in your IItemRenderer. See the Item Rendering sections on this page, and especially the IItemRenderer topic. http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html -TGG
  25. Hi I'm not sure I understand your code. What are you expecting to call spreadOverArea? Forge has something similar to this already. Look at BlockFluidFinite (and in the minecraftforge\fluids package in general). I don't know how to use it properly myself, never tried, but it's intended for exactly this sort of thing. A google will probably show up a tutorial or at least a few GitHubs where people have used it before. -TGG
×
×
  • Create New...

Important Information

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