TheGreyGhost
Members-
Posts
3280 -
Joined
-
Last visited
-
Days Won
8
Everything posted by TheGreyGhost
-
Hi 1. Yes there is- search for tutorials on ITickHandler. 2. Yes there is - lots of options! For more information see http://greyminecraftcoder.blogspot.com/2013/10/user-input.html You can intercept the keybindings as per this sample code http://gist.github.com/TheGreyGhost/7033821 or for a&d using the MovementInput as per this post http://www.minecraftforge.net/forum/index.php/topic,13727.msg70723.html#msg70723 or alternatively you can just force the appropriate keyBinding to true before GameSettings.updatePlayerMoveState (GameSettings.keyBindLeft etc - see MovementInputFromOptions) -TGG
-
Adding a nausea/confusion effect without adding the potion effect
TheGreyGhost replied to Gwafu's topic in Modder Support
Hi I'm reckon that won't work because of this bit in the code: /** * sets up projection, view effects, camera position/rotation */ private void setupCameraTransform(float par1, int par2) { this.farPlaneDistance = (float)(256 >> this.mc.gameSettings.renderDistance); GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glLoadIdentity(); That last line will overwrite any rotates or scales you have done previously (in your render tick handler), and unless you can find a way to insert your "confusion" code after the call to setupCameraTransform but before anything is rendered (I looked but didn't manage to find anything suitable) then you are stuck with modifying base classes I reckon. -TGG -
Hi uh, what's wrong with it? They both look fine to me... -TGG
-
Hi The hit detection for where the user's mouse is pointing is done in EntityRenderer.getMouseOver for (int i = 0; i < list.size(); ++i) { Entity entity = (Entity)list.get(i); if (entity.canBeCollidedWith()) { float f2 = entity.getCollisionBorderSize(); AxisAlignedBB axisalignedbb = entity.boundingBox.expand((double)f2, (double)f2, (double)f2); MovingObjectPosition movingobjectposition = axisalignedbb.calculateIntercept(vec3, vec32); So if the hitbox is the same for the other code (which I guess it probably is), then it looks like changing entity.boundingBox should do what you want, this is done in the vanilla code by setting Entity.width and Entity.height which is done in Entity.setSize(). So in EntityGiantChicken your this.setSize(0.3F, 0.7F); should be bigger. Never tried it myself, but looks promising. -TGG
-
Changing contents of a slot in block container help
TheGreyGhost replied to AomicTim's topic in Modder Support
Hi My guess is that you've got a client<-->server synchronisation problem, i.e. you are making changes on the client but not on the server, so that when you "refresh" by reopening the GUI or clicking the slot, the server overwrites what you did on the client. I haven't modded GUIs yet so I can't give you specific advice. It might help to look very closely at what the vanilla code does (for example for the player inventory or the forging table or similar). -TGG -
Hi I haven't looked at your source code but I suspect you've got an infinite loop in there. Easiest way to detect this: start it up in your debugger, wait for it to "freeze", then pause the execution and check what client thread is doing. -TGG
-
Adding a nausea/confusion effect without adding the potion effect
TheGreyGhost replied to Gwafu's topic in Modder Support
Hi Well I just tried my own suggestion and it won't work because there are too many private variables in EntityRenderer :-( Looks to me like you need to replace the entire class, which is a bit of a bugger. -TGG -
[Solved]Custom Furnace - Always running bug
TheGreyGhost replied to Mecblader's topic in Modder Support
Hi Try a breakpoint in updateEntity? -TGG PS http://www.gamespot.com/articles/gamer-dies-after-diablo-iii-marathon/1100-6387472/ http://news.bbc.co.uk/2/hi/technology/4137782.stm http://www.ranker.com/list/8-people-who-died-playing-video-games/autumn-spragg :-P -
[ unsolved ] - Issue with ASM not finding the correct class
TheGreyGhost replied to WinneonSword's topic in Modder Support
Hi My advice would be "don't use ASM unless you really really have to" :-) Are you certain that you can't do what you want in a less-error-prone way? -TGG -
Hi The answer is "it depends on what you want". If you want all ItemBeams in the game to render exactly the same, so when you change one mode you change them all, then you could use the static variable you currently have. If you want different ItemBeams to have different modes eg the player can have two ItemBeams in different modes in their hotbar at the same time, then you will need to store that information somewhere else - often this can be the item damage (if this isn't needed for tool usage) - for example like ItemCloth, or a non-static member variable (like in ItemSword). You have access to this through the ItemStack that the renderer receives. -TGG
-
Adding a nausea/confusion effect without adding the potion effect
TheGreyGhost replied to Gwafu's topic in Modder Support
Hi This effect is generated in EntityRenderer.setupCameraTransform I don't know of an easy way to do what you want. If you are feeling brave, I would suggest that you could change this by Creating a new MyEntityRenderer extends EntityRenderer, overwrite Minecraft.entityRenderer with your new myEntityRenderer. Override setupCameraTransform with a copy of the vanilla method but customise this bit to what you need f2 = this.mc.thePlayer.prevTimeInPortal + (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * par1; if (f2 > 0.0F) { byte b0 = 20; if (this.mc.thePlayer.isPotionActive(Potion.confusion)) { b0 = 7; } float f3 = 5.0F / (f2 * f2 + 5.0F) - f2 * 0.04F; f3 *= f3; GL11.glRotatef(((float)this.rendererUpdateCount + par1) * (float)b0, 0.0F, 1.0F, 1.0F); GL11.glScalef(1.0F / f3, 1.0F, 1.0F); GL11.glRotatef(-((float)this.rendererUpdateCount + par1) * (float)b0, 0.0F, 1.0F, 1.0F); } With a bit of skill (and luck) I think it should work, although it might not be very robust. Maybe someone else has a better way, if you find one please let me know! -TGG -
Hi I suspect the problem is here blockSewageWater = BlockSewageWater(155, "BlockSewageWater"); //Line 264 this should probably be blockSewageWater = new BlockSewageWater(155, "BlockSewageWater"); //Line 264 -TGG
-
[Solved] Crashing when trying to pick up a thrown javelin
TheGreyGhost replied to Taintedwater's topic in Modder Support
Hi for Items try Item.getIconFromDamage When thrown - it depends - but the renderer often uses the Item.getIconFromDamage. (For example RenderSnowball.doRender). -TGG -
Hi that happens in Item.onEaten but I don't see any easy way to hook into it for existing items. A couple of suggestions - you could hook into onPlayerPreTick (see EntityPlayer.onUpdate) and check the itemInUseCount as per the vanilla code. Or - you could create a new MyItemPotion that extends ItemPotion, overwrite the vanilla ItemPotion in Item.potion with an instance of your myItemPotion, and override ItemPotion.onEaten to check if this is water and if so reduce thirst. A bit clunky but it should work. -TGG
-
Custom Rendered block not dropping when broken
TheGreyGhost replied to dwinget2008's topic in Modder Support
Hi You can have custom renderers for any Block, not just BlockContainer. http://greyminecraftcoder.blogspot.com.au/2013/07/block-rendering.html Breaking a block with your fist will drop an item (by calling Block.harvestBlock) if: (1) you override Block.canHarvestBlock to true, or (2) block.blockMaterial.isToolNotRequired() returns true, or (3) you have registered for the HarvestCheck event and you return true. (see ItemInWorldManager.tryHarvestBlock if (block != null) { flag1 = block.canHarvestBlock(thisPlayerMP, i1); } -TGG You don't need to override any of the other methods you mentioned unless you want a different item or quantity to drop, the default methods will drop one of the blockID as an Item. -
Hi Some random thoughts - I would suggest using an ITickHandler to deplete the thirst at a rate depending on the biome and the activity (eg if the player is sprinting). I'm not sure how to hook into the food eating. The drinking water is relatively easy if you create your own special item for that - say a water canteen that you can fill from water, similar to a bucket. See ItemBucket for inspiration. -TGG
-
[Solved] Custom IItemRenderer not showing model
TheGreyGhost replied to lexwebb's topic in Modder Support
Ha ha awesome, love the solar panels too. Nice one. -TGG -
Hi As promised... @SidedProxy explained... http://greyminecraftcoder.blogspot.com.au/2013/11/how-forge-starts-up-your-code.html -TGG
-
Wood, Leaves..... What happened to the leaves?
TheGreyGhost replied to mathiasrocker's topic in Modder Support
Hi Just a random guess based on a very similar problem I had rendering other blocks Block.isOpaqueCube needs to return false. I don't have access to my coding PC at the moment so I can't check if BlockLeavesBase does that already... see also here... might be some help - http://greyminecraftcoder.blogspot.com.au/2013/07/rendering-transparent-blocks.html -TGG -
[Solved] Crashing when trying to pick up a thrown javelin
TheGreyGhost replied to Taintedwater's topic in Modder Support
Hi You didn't show what the error was but I'm guessing it's a Null Pointer Exception? Your variable Javelin is probably still null -TGG PS - the convention in Java is to use Capital as first letter for Classes only, and use CamelCase for instances of the classes eg public class BlockJavelin { } BlockJavelin blockJavelin = new BlockJavelin(); -
[Solved] Custom IItemRenderer not showing model
TheGreyGhost replied to lexwebb's topic in Modder Support
Hi Keen, glad it works Re 255: do you mean 256? The sooner they get rid of BlockIDs and ItemIDs the happier I'll be... Re Inventory invisible - suggest to check shouldUseRenderHelper(INVENTORY_BLOCK) returns true handleRenderType(INVENTORY) returns true If those are right, either your model is not right, it's rendering in the wrong spot (out of view), or you've done something funny to the renderer. I don't see anything obvious wrong. -TGG -
[Solved] Custom IItemRenderer not showing model
TheGreyGhost replied to lexwebb's topic in Modder Support
Hi If redphen0nix1' code doesn't work then I would suggest you put a breakpoint here ItemRenderer. /** * Renders the item stack for being in an entity's hand Args: itemStack */ public void renderItem(EntityLivingBase par1EntityLivingBase, ItemStack par2ItemStack, int par3, ItemRenderType type) { GL11.glPushMatrix(); TextureManager texturemanager = this.mc.getTextureManager(); Block block = null; if (par2ItemStack.getItem() instanceof ItemBlock && par2ItemStack.itemID < Block.blocksList.length) { block = Block.blocksList[par2ItemStack.itemID]; } // breakpoint here and trace into it to see why your Item is not getting the appropriate renderer IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(par2ItemStack, type); if your renderer is corrected registered, you should see it in MinecraftForgeClient.customItemRenderers[] if not, it should hopefully give you a clue why not. -TGG -
Can someone explain to me what 'events' are? [SOLVED]
TheGreyGhost replied to EliteCreature's topic in Modder Support
Hi Forge events are a way for the vanilla+forge code to call your code when something happens. This lets you customise the game behaviour without having to modify the vanilla code yourself. For example - PlayerSleepInBedEvent If you register a listener for this event (say thePlayerSleptInBed()), then your method thePlayerSleptInBed will be called whenever a player sleeps in a bed. Forge uses a bit of a mishmash of events, handlers, hooks, and other techniques to enable your code to get itself called when particular things happen. Events is just one of those. A useful link: http://www.minecraftforge.net/wiki/Event_Reference -TGG -
[Solved] Custom IItemRenderer not showing model
TheGreyGhost replied to lexwebb's topic in Modder Support
Hi MinecraftForgeClient.registerItemRenderer(Ids.laserRench, (IItemRenderer)new LaserWrenchRenderer()); Are you sure that this statement is called and that the ID (laserRench? :-) ) is correct? -TGG