TheGreyGhost
Members-
Posts
3280 -
Joined
-
Last visited
-
Days Won
8
Everything posted by TheGreyGhost
-
Hi It only renders the yneg face at half the brightness, the ypos face is at full brightness. One of the tricks minecraft uses is to render the different faces of standard blocks at different relative brightness - 1.0 for top, 0.5 for bottom, 0.6 for east west, or 0.8 for north south. FOV stands for Field of View which means how wide your vision is. It is quite subtle, but if you pay close attention when you lower your head below the water, you will notice that you can only see a narrower view of the blocks (they get a bit wider so less fit into your display). The semi-transparent "large-pixel" pattern that appears all over your screen when you're underwater is drawn in ItemRenderer.renderOverlays if (this.mc.thePlayer.isInsideOfMaterial(Material.water)) { this.renderWarpedTextureOverlay(par1); } -TGG
-
Redstone Powered Furnace Textures Not Updating [SOLVED]
TheGreyGhost replied to mardiff's topic in Modder Support
Hi So what did you do to make the furnace turn off when the redstone goes off? It seems likely that getItemBurnTime is only called when an item first starts burning. Once it's started, getItemBurnTime isn't needed any more. I'd suggest you look in TileEntityFurnace.updateEntity and make sure you understand the logic. The answer will probably be pretty obvious then. -TGG -
Hi Is HeatMolder a Block? override setBlockBoundsBasedOnState, setBlockBoundsForItemRender, getCollisionBoundingBoxFromPool, and getSelectedBoundingBoxFromPool? Not really sure exactly what you want to do / what the problem is? -TGG
-
[Solved]Problem with unsaving ItemBlock's NBT
TheGreyGhost replied to 3059673's topic in Modder Support
Hi What do you mean exactly, "ItemBlock NBT"? Items don't have NBT because they are just a definition of what each Item type is. Do you mean NBT of the ItemStack that holds your RussyPeripheralAsItem? If so you'll need to copy the NBT data manually when the block is broken, like GotoLink says. -TGG -
http://www.youtube.com/watch?v=5Yl6YdJImPY ? Haven't watched it myself but looks promising.
-
Hi Maybe you could do it more robustly by being a bit sneaky... NBTTagCompound dummyTag = new NBTTagCompound(); player.getFoodStats().writeNBT(dummyTag); float foodExhaustionLevel = dummyTag.getFloat("foodExhaustionLevel"); -TGG
-
Metadata Blocks - Different Textures for subBlocks
TheGreyGhost replied to feandrad's topic in Modder Support
Hi For a good vanilla example, see BlockWood. -TGG -
That's quite weird Each time you click, a single furnace appears in a "random" position? Are you sure the blocks are really there (can you walk through them, interact with them) or is it just your TileEntityRenderer rendering at a different spot? I would suggest you add a breakpoint to PlayerControllerMP.onPlayerRightClick - when you right-click to place the block, trace through to see which set of [x,y,z] are passed to Packet15Place. If still no joy - on the server side, add a breakpoint to NetServerHandler.handlePlace, and see what the resulting Packet53BlockChange is. If still not clear - on the client side again, add a breakpoint to NetClientHandler.handleBlockChange and see what happens in setBlockAndMetadataAndInvalidate --> WorldClient.setBlock. Somewhere along the way it should (!) be obvious where the error is coming in. -TGG
-
Hi There is a whole bunch of information in here on item rendering including some sample code to do exactly what you want... http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html See the sections under "Items". -TGG
-
Hi Do you know if your renderer is being called at all? (your .doRender) If not, I'd suggest you go to RenderGlobal.renderEntities, modify this small section of code and put a breakpoint in it. Then trace into renderEntity and see why your renderer isn't being called. If the breakpoint never triggers even when you're looking at your entity, then maybe your entity isn't being spawned at all. if (flag && (entity != this.mc.renderViewEntity || this.mc.gameSettings.thirdPersonView != 0 || this.mc.renderViewEntity.isPlayerSleeping()) && this.theWorld.blockExists(MathHelper.floor_double(entity.posX), 0, MathHelper.floor_double(entity.posZ))) { ++this.countEntitiesRendered; if (entity instanceof EntityChickenFired) { int dummy = 1; // put breakpoint here } RenderManager.instance.renderEntity(entity, par3); } -TGG
-
Hmmmm beats me what's going on. If it were me, I'd place a breakpoint in your constructor public MobNecromancer(World par1World) { super(par1World); this.experienceValue = 0; } and then trace into super, EntityLivingBase.setHealth etc until I could figure out which vble is null (and hopefully - why) If there's an obvious error, I'm not seeing it. -TGG
-
Hi I would suggest you override Block.getBlockTexture /** * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side */ public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int x, int y, int z, int side) { In the method, check if side is 2,3,4,5 (sides) and if so check if the block above is grass. Return the appropriate texture. See also here http://greyminecraftcoder.blogspot.com.au/2013/07/rendering-standard-blocks-cubes.html -TGG
-
Hi Important to remember that you'll need to add NBT to the ItemStack not the Item (you know what the difference is, yeah?) For vanilla examples, see ItemStack.setRepairCost(), ItemStack.setItemName, ItemStack.getDisplayName, etc. -TGG
-
Hi Show us your MobNecromancer? Something in your MobNecromancer.applyEntityAttributes is probably attempting to use an object that hasn't been initialised yet. -TGG
-
Hi Good call on the quantaPerBlock, didn't think of that myself. Luminosity is supposed to control how much your fluid glows, and by looking at the code in BlockFluidClassic.getLightValue, it looks like the block light value (i.e. how much it glows) is multiplied by the amount of fluid. So a full block gives full light, a half block gives only half light. For lava (using the LightValue), it always glows at full strength regardless of whether it's a full block or just a thin sliver. From what I saw looking at the code, I would have expected luminosity = 15 to be the same as LightValue 1.0 like you did. Not sure why it didn't work for you. Don't rightly know about the other render effects. There is bubble and splash rendering in BlockFluid.randomDisplayTick for water blocks. The murkiness might be related to the opacity, I'm not certain - see here for a bit more info on lighting http://greyminecraftcoder.blogspot.com.au/2013/08/lighting.html Some random other observations: BlockFluid.colorMultiplier seems to control the colour of the top and side faces somehow depending on the Biome. The underside of the surface of the water looks darker than the top because it is rendered at half the brightness - in RenderBlocks.renderBlockFluids f3 = 0.5F; // ... etc ... f11 = 1.0F; tessellator.setColorOpaque_F(f3 * f11, f3 * f11, f3 * f11); this.renderFaceYNeg(par1Block, (double)par2, (double)par3 + d6, (double)par4, this.getBlockIconFromSide(par1Block, 0)); -TGG
-
Hi Keen, sounds like you're nearly there. Overriding getIcon() to take the icons from the fluid sounds like a perfectly good way to solve the problem. My only other thought was that perhaps you declared your DCBlockFluid.iconStill and iconFlowing as static? That tutorial you promised might be very helpful to modders who come after:-P Glad I could be of some help, it was pretty interesting to hunt through the vanilla code and figure out how this works. IMHO I don't think it was coded very well (or at least - not very extensibly) by the Mojang folks. Fragments of responsibility scattered all over the place. -TGG
-
Hi At a guess, this.getFluid() in your registerIcons retrieves the same Fluid for both sludge blocks and waste blocks. A breakpoint or logging code might show why. -TGG
-
Hi Why do you think the lootEnchantLevel is always set to 0? For example in EntityLivingBase.onDeath: public void onDeath(DamageSource par1DamageSource) { if (ForgeHooks.onLivingDeath(this, par1DamageSource)) return; Entity entity = par1DamageSource.getEntity(); // .. etc ... int i = 0; if (entity instanceof EntityPlayer) { i = EnchantmentHelper.getLootingModifier((EntityLivingBase)entity); } // .. etc ... this.dropFewItems(this.recentlyHit > 0, i); -TGG
-
Hi What do you mean "in a random position"? Do you mean the block doesn't get placed where you want? Or the block gets placed in the right spot but doesn't face the way you want? Perhaps you could describe in more detail what you are expecting to see and what you actually see. -TGG
-
Hi FLuid flowing outwards takes place in updateTick. in BlockFlowing, the difference between lava and water is set here public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { int flowDecayThisBlock = this.getFlowDecay(par1World, par2, par3, par4); // variable renamed for clarity byte flowDecayChangePerBlock = 1; // b0 before renaming if (this.blockMaterial == Material.lava && !par1World.provider.isHellWorld) { flowDecayChangePerBlock = 2; } BlockFluidClassic has analagous code where the flowDecayChangePerBlock is effectively set equal to 1, but of course you can override updateTick to change this to whatever you want. -TGG
-
Hi The animation is performed automatically by the vanilla engine since the flowing water is an animated texture. http://www.minecraftforum.net/topic/1881638-animation-in-resource-packs-a-minecraft-16-tutorial/ This bit in RenderBlockFluid.renderWorldBlock is a rotation which orients the animated texture in the direction of the flow float flowDir = (float) BlockFluidBase.getFlowDirection(world, x, y, z); // ..... snip .... float xFlow = MathHelper.sin(flowDir) * 0.25F; float zFlow = MathHelper.cos(flowDir) * 0.25F; u2 = iconStill.getInterpolatedU(8.0F + (-zFlow - xFlow) * 16.0F); v2 = iconStill.getInterpolatedV(8.0F + (-zFlow + xFlow) * 16.0F); u1 = iconStill.getInterpolatedU(8.0F + (-zFlow + xFlow) * 16.0F); v1 = iconStill.getInterpolatedV(8.0F + (zFlow + xFlow) * 16.0F); u4 = iconStill.getInterpolatedU(8.0F + (zFlow + xFlow) * 16.0F); v4 = iconStill.getInterpolatedV(8.0F + (zFlow - xFlow) * 16.0F); u3 = iconStill.getInterpolatedU(8.0F + (zFlow - xFlow) * 16.0F); v3 = iconStill.getInterpolatedV(8.0F + (-zFlow - xFlow) * 16.0F); What do you mean "flow length"? -TGG
-
Hi That means you've gotten the "signature" wrong on your method so it will never be called - i.e. the name is wrong or the parameters are different. In this case, only BlockFluid has a Material parameter, but BlockFluidClassic derives from BlockFluidBase not BlockFluid. eg BlockFLuid: public static double getFlowDirection(IBlockAccess par0IBlockAccess, int par1, int par2, int par3, Material par4Material) BlockFluidBase: public static double getFlowDirection(IBlockAccess world, int x, int y, int z) If you derive your DCBlockFluid from BlockFluidClassic, you don't need the code to pass the material in because your DCBlockFluid already knows it. BlockFluid is vanilla, BlockFluidClassic is Forge. Use BlockFluidClassic. The renderer will call from RenderBlockFluid.renderWorldBlock (confusing choice of name for that class!), not RenderBlocks.renderBlockFluids. -TGG
-
Hi The other day I wanted to store some information about the World and I thought WorldInfo would be a good place since it already has additionalProperties with setAdditionalProperties and getAdditionalProperty. But from the way it is used it doesn't look like I can access those to add custom properties. Any chance of adding a similar place to store data in WorldInfo that mods can use? -TGG
-
Hi This is the bit you're interested in from EntityRenderer, I think: int i = ActiveRenderInfo.getBlockIdAtEntityViewpoint(this.mc.theWorld, entitylivingbase, par1); float f8; if (this.cloudFog) { Vec3 vec33 = worldclient.getCloudColour(par1); this.fogColorRed = (float)vec33.xCoord; this.fogColorGreen = (float)vec33.yCoord; this.fogColorBlue = (float)vec33.zCoord; } else if (i != 0 && Block.blocksList[i].blockMaterial == Material.water) { f8 = (float)EnchantmentHelper.getRespiration(entitylivingbase) * 0.2F; this.fogColorRed = 0.02F + f8; this.fogColorGreen = 0.02F + f8; this.fogColorBlue = 0.2F + f8; } else if (i != 0 && Block.blocksList[i].blockMaterial == Material.lava) { this.fogColorRed = 0.6F; this.fogColorGreen = 0.1F; this.fogColorBlue = 0.0F; } I think the changing the viewport colour might be a challenge, not sure how best to do that myself The effects of liquids seem to all be handled in the various Entity update methods Air supply is in EntityLivingBase.onEntityUpdate Entity.handleWaterMovement appears to take care of water current effects Swimming upwards in liquid is handled by this bit in EntityLivingBase.onLivingUpdate if (this.isJumping) { if (!this.isInWater() && !this.handleLavaMovement()) { if (this.onGround && this.jumpTicks == 0) { this.jump(); this.jumpTicks = 10; } } else { this.motionY += 0.03999999910593033D; } -TGG
-
Hi Did you look in EntityRenderer.updateFogColor for the viewport colour change? -TGG