TheGreyGhost
Members-
Posts
3280 -
Joined
-
Last visited
-
Days Won
8
Everything posted by TheGreyGhost
-
Hi Try following this howTo for events http://www.minecraftforum.net/forums/archive/tutorials/931112-forge-4-x-events-howto (Use @SubscribeEvent instead of @ForgeSubscribe) This one is also helpful- https://github.com/coolAlias/Forge_Tutorials/blob/master/EventHandlerTutorial.java and http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571567-1-7-2-1-6-4-eventhandler-and You need to register your event handler on the correct bus, which you don't seem to be doing at all. -TGG
-
Hi These links might help http://www.minecraftforge.net/forum/index.php/topic,18371.msg92948.html#msg92948 http://www.minecraftforge.net/forum/index.php/topic,11963.0.html -TGG
-
Hi You might find this link useful for some background (it is for 1.6.4 but the concepts are still the same) http://greyminecraftcoder.blogspot.com.au/2013/11/how-forge-starts-up-your-code.html Your error is caused by this public void init(FMLInitializationEvent events){ init(events); } the init function calls itself recursively. i.e. it keeps calling itself in an infinite loop until it runs out of stack space. -TGG
-
Calculating pitch and yaw of a projectile.
TheGreyGhost replied to imadnsn's topic in Modder Support
Hi You might find these posts useful http://www.minecraftforge.net/forum/index.php/topic,18543.msg93804.html#msg93804 http://www.minecraftforge.net/forum/index.php/topic,18682.msg94603.html#msg94603 and https://www.chrobotics.com/library/understanding-euler-angles -TGG -
Hi I haven't encountered the Tessellator stop-start problem yet, haven't tried it on 1.7.10 yet. I would be surprised if there weren't a way around it (even though I don't know what it is ) The utility jabelar mentioned is 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. Not sure it is likely to help you in this case, but it might be worth a go. A general comment about alpha blending is that the order of rendering the faces is very important. If you render the rear pane alpha first, then the front pane alpha next, it will look different to rendering the front pane alpha first and the back pane alpha second. This is because of the effects of depth testing, and additionally the way alpha blending calculates the final colour. You could try rendering just one pane and see if the problem persists. Apart from that nothing is springing to mind unless you're doing something accidental like rendering the same pane twice directly on top of itself. -TGG
-
Hi Is your renderTileEntityAt being called? (Use a breakpoint, or System.out.println to find out) If so - you have a rendering problem. If not - your tile entity renderer is probably not registered properly. Re missing texture - show your error log? -TGG
-
[1.7.10][SOLVED] Problems with custom item renderer
TheGreyGhost replied to Jacky2611's topic in Modder Support
Hi One of your OpenGL settings is not being set properly before your render, so it is carrying over from the render of a previous item. 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 -
[1.7.10] Rendering triangles into a gui
TheGreyGhost replied to Disconsented's topic in Modder Support
Some random ideas... Perhaps your z coordinate is behind the background. Try using z = -75, or turning off depth testing. Perhaps you have back face culling on, and the triangle vertices are in wrong order. Try turning off back face culling, or reversing the vertex order in each triangle. -TGG -
[1.7.10]Custom seed is crashing game
TheGreyGhost replied to LogicTechCorp's topic in Modder Support
No worries, you're welcome, glad we fixed it -TGG -
How do I make the block icon look like the block?
TheGreyGhost replied to FlyingSwine's topic in Modder Support
Hi you might find this link useful http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html Look under the item rendering sections. The easiest is if your Item extends ItemBlock. -TGG -
Hi I don't really understand your question, could you perhaps explain with a few screenshots what you want, compared with what you're currently getting? -TGG
-
Game crash when trying to use loadWorld()
TheGreyGhost replied to kamokuma's topic in Modder Support
Hi Your (WorldClient)null is for sure not right. I imagine you need to construct a valid new WorldClient first before you call loadWorld(). To be honest I've never tried this so I've never looked into the details, but I suggest you look at the vanilla to see how it uses the loadWorld() method. You will also need to trigger it on both the server and the client, which needs some careful thought. Are you wanting to quit the current world and load a new one? Or just to add another parallel dimension similar to the nether? -TGG -
[1.7.10]Custom seed is crashing game
TheGreyGhost replied to LogicTechCorp's topic in Modder Support
Hi Your .init() methods don't control when your static Item initialisers are running. They execute when the class is loaded, not when you call .init(). If Forge loads your ModItems class before ModBlocks class, your static Item initialisers will run before the static Block initialisers. I would suggest you move the initialisers to the init() method. eg public static Item ginsengSeeds; public void init() { ginsengSeeds = new ItemSeeds(ModBlocks.ginHerb, Blocks.farmland).setCreativeTab(CreativeTab.tabHerbology).setTextureName(Reference.RESOURCE_PREFIX + "ginSeeds").setUnlocalizedName("ginSeeds").setPotionEffect("+4"); } -TGG -
Game crash when trying to use loadWorld()
TheGreyGhost replied to kamokuma's topic in Modder Support
Hi What are you trying to do actually? Trying to load a null world is definitely going to end in tears. -TGG -
[1.7.10] How to Make Block Infinitely Burn?????
TheGreyGhost replied to Mattkx10's topic in Modder Support
Hi Check out Block.isFireSource(), .getFlammability(), .isFlammable(). You can see how vanilla uses them in BlockFire.updateTick() -TGG public void updateTick(World par1World, int wx, int wy, int wz, Random par5Random) { if (par1World.getGameRules().getGameRuleBooleanValue("doFireTick")) { Block base = Block.blocksList[par1World.getBlockId(wx, wy - 1, wz)]; boolean blockBelowIsFireSource = (base != null && base.isFireSource(par1World, wx, wy - 1, wz, par1World.getBlockMetadata(wx, wy - 1, wz), UP)); if (!this.canPlaceBlockAt(par1World, wx, wy, wz)) { par1World.setBlockToAir(wx, wy, wz); } if (!blockBelowIsFireSource && par1World.isRaining() && (par1World.canLightningStrikeAt(wx, wy, wz) || par1World.canLightningStrikeAt(wx - 1, wy, wz) || par1World.canLightningStrikeAt(wx + 1, wy, wz) || par1World.canLightningStrikeAt(wx, wy, wz - 1) || par1World.canLightningStrikeAt(wx, wy, wz + 1))) { par1World.setBlockToAir(wx, wy, wz); } else { int l = par1World.getBlockMetadata(wx, wy, wz); if (l < 15) { par1World.setBlockMetadataWithNotify(wx, wy, wz, l + par5Random.nextInt(3) / 2, 4); } par1World.scheduleBlockUpdate(wx, wy, wz, this.blockID, this.tickRate(par1World) + par5Random.nextInt(10)); if (!blockBelowIsFireSource && !this.canNeighborBurn(par1World, wx, wy, wz)) { if (!par1World.doesBlockHaveSolidTopSurface(wx, wy - 1, wz) || l > 3) { par1World.setBlockToAir(wx, wy, wz); } } else if (!blockBelowIsFireSource && !this.canBlockCatchFire(par1World, wx, wy - 1, wz, UP) && l == 15 && par5Random.nextInt(4) == 0) { par1World.setBlockToAir(wx, wy, wz); } else { boolean flag1 = par1World.isBlockHighHumidity(wx, wy, wz); byte b0 = 0; if (flag1) { b0 = -50; } this.tryToCatchBlockOnFire(par1World, wx + 1, wy, wz, 300 + b0, par5Random, l, WEST ); this.tryToCatchBlockOnFire(par1World, wx - 1, wy, wz, 300 + b0, par5Random, l, EAST ); this.tryToCatchBlockOnFire(par1World, wx, wy - 1, wz, 250 + b0, par5Random, l, UP ); this.tryToCatchBlockOnFire(par1World, wx, wy + 1, wz, 250 + b0, par5Random, l, DOWN ); this.tryToCatchBlockOnFire(par1World, wx, wy, wz - 1, 300 + b0, par5Random, l, SOUTH); this.tryToCatchBlockOnFire(par1World, wx, wy, wz + 1, 300 + b0, par5Random, l, NORTH); for (int i1 = wx - 1; i1 <= wx + 1; ++i1) { for (int j1 = wz - 1; j1 <= wz + 1; ++j1) { for (int k1 = wy - 1; k1 <= wy + 4; ++k1) { if (i1 != wx || k1 != wy || j1 != wz) { int l1 = 100; if (k1 > wy + 1) { l1 += (k1 - (wy + 1)) * 100; } int i2 = this.getChanceOfNeighborsEncouragingFire(par1World, i1, k1, j1); if (i2 > 0) { int j2 = (i2 + 40 + par1World.difficultySetting * 7) / (l + 30); if (flag1) { j2 /= 2; } if (j2 > 0 && par5Random.nextInt(l1) <= j2 && (!par1World.isRaining() || !par1World.canLightningStrikeAt(i1, k1, j1)) && !par1World.canLightningStrikeAt(i1 - 1, k1, wz) && !par1World.canLightningStrikeAt(i1 + 1, k1, j1) && !par1World.canLightningStrikeAt(i1, k1, j1 - 1) && !par1World.canLightningStrikeAt(i1, k1, j1 + 1)) { int k2 = l + par5Random.nextInt(5) / 4; if (k2 > 15) { k2 = 15; } par1World.setBlock(i1, k1, j1, this.blockID, k2, 3); } } } } } } } } } } -
Generating Less than one Ore vein per chunk.
TheGreyGhost replied to turangur's topic in Modder Support
No worries, you're welcome -TGG -
[1.7.10]Custom seed is crashing game
TheGreyGhost replied to LogicTechCorp's topic in Modder Support
Hi I think that your static Item intialisers are probably running before your static Blocks are initialised, so that the blocks are still null. How I got there: NPE at ExtendedBlockStorage:96 if (p_150818_4_.getTickRandomly()) p_150818_4 is the Block passed to the method, and it is null. Looking back up the call stack, it comes from ItemSeeds.onItemUse par3World.setBlock(par4, par5 + 1, par6, this.field_150925_a); field_150925_a is initialised in the constructor public ItemSeeds(Block p_i45352_1_, Block p_i45352_2_) { this.field_150925_a = p_i45352_1_; Which tells me that your ItemSeeds being initialised with a null block, eg public static final Item ginsengSeeds = new ItemSeeds(ModBlocks.ginHerb, Blocks.farmland).setCreativeTab(CreativeTab.tabHerbology).setTextureName(Reference.RESOURCE_PREFIX + "ginSeeds").setUnlocalizedName("ginSeeds").setPotionEffect("+4"); Which suggests to me that ModBlocks.ginHerb is null. -TGG -
client/ server / singleplayer server messages
TheGreyGhost replied to Ewe Loon's topic in Modder Support
This is useful http://www.minecraftforge.net/forum/index.php/topic,20138.0.html -TGG -
Block Faces me when I Place It, But Icon in Inventory Does Not
TheGreyGhost replied to kenoba10's topic in Modder Support
What do you mean "similar to how the furnace does" ? Do you mean you want the inventory block to face a particular direction? If so, I would suggest one of two things- either change your metadata meanings so that medata=0 gives you the inventory rendering appearance that you want, or use an ISimpleBlockRenderingHandler or an IItemRenderer for your item to give you more control. For some background info, see here under the Item Rendering topics http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html -TGG -
you're welcome, I hope it works -TGG
-
Hi I would suggest that you add code to the WorldTickEvent- i.e. code that looks through the list of all entities, finds the EntityItems, and performs the checks for each one it finds. Look in World.updateEntities() for the vanilla code - you can get the entities by looking at World.loadedEntityList -TGG
-
Hi By definition, a client side mod doesn't need to be run on the server. So installing it on the server doesn't make any sense. Do you mean that your mod runs in single player mode, but you want to run it multiplayer? That might be very easy or very hard depending on how you've coded it. Maybe you could describe your mod a bit more. -TGG
-
Hi The milk bucket is a "container item". Container items are returned to your inventory like that. So you could get a list of recipes from the CraftingManager, and inspect each ItemStack in .recipeItems for ones which have hasContainerItem(). Seems like a lot of hassle to me. What are you trying to do exactly? -TGG Item itemBucket = (new ItemBucket(Blocks.air)).setUnlocalizedName("bucket").setMaxStackSize(16).setTextureName("bucket_empty"); itemRegistry.addObject(325, "bucket", itemBucket ); itemRegistry.addObject(326, "water_bucket", (new ItemBucket(Blocks.flowing_water)).setUnlocalizedName("bucketWater").setContainerItem(itemBucket ).setTextureName("bucket_water")); itemRegistry.addObject(327, "lava_bucket", (new ItemBucket(Blocks.flowing_lava)).setUnlocalizedName("bucketLava").setContainerItem(itemBucket ).setTextureName("bucket_lava")); itemRegistry.addObject(335, "milk_bucket", (new ItemBucketMilk()).setUnlocalizedName("milk").setContainerItem(itemBucket).setTextureName("bucket_milk")); Look in SlotCrafting.onPickupFromSlot to see how it is used, i.e. if (itemstack1.getItem().hasContainerItem(itemstack1)) { ItemStack itemstack2 = itemstack1.getItem().getContainerItem(itemstack1); if (itemstack2 != null && itemstack2.isItemStackDamageable() && itemstack2.getItemDamage() > itemstack2.getMaxDamage()) { MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(thePlayer, itemstack2)); continue; } if (!itemstack1.getItem().doesContainerItemLeaveCraftingGrid(itemstack1) || !this.thePlayer.inventory.addItemStackToInventory(itemstack2)) { if (this.craftMatrix.getStackInSlot(i) == null) { this.craftMatrix.setInventorySlotContents(i, itemstack2); } else { this.thePlayer.dropPlayerItemWithRandomChoice(itemstack2, false); } } }