TheGreyGhost
Members-
Posts
3280 -
Joined
-
Last visited
-
Days Won
8
Everything posted by TheGreyGhost
-
Hi > world.setBlockMetadataWithNotify(x, y, z, data+1, 2); try replacing the "2" with "3" * Sets the block ID and metadata at a given location. Args: X, Y, Z, new block ID, new metadata, flags. Flag 1 will * cause a block update. Flag 2 will send the change to clients (you almost always want this). I think you should also only use setBlockMetadataWithNotify on the server side. eg if (!world.isRemote) { .. etc.. world.setBlockMetadataWithNotify(..etc..) } -TGG
-
Hi In your ISimpleBlockRenderingHandler, use the Tessellator to render your first layer, then the second layer, then the third, etc. You can use the same ISimpleBlockRenderingHandler for multiple blocks, just register it for each one and check for the block type in your renderer. You can use two passes for blocks, but they are handled differently to "passes" in items. pass 0 is for fully opaque, pass1 is for translucent (partially opaque). That might not be what you want... -TGG
-
Hi For sure it is possible. This link might get you started (see the Block Rendering sections) http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html An ISimpleBlockRenderingHandler will let you do this easily. -TGG
-
[1.7.10] how to change a item's texture in game.
TheGreyGhost replied to leviathan01's topic in Modder Support
Hi Just change the IIcon returned by Item.getIcon, Item.getIconFromDamageForRenderPass(), or Item.getIconFromDamage() Or if you want more control, you could use an IItemRenderer. See http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html under the Item Rendering topics. -TGG -
[SOLVED]Check if player.posX ends with .99
TheGreyGhost replied to TheCreepySheep's topic in Modder Support
Hi I think your sample code will work fine with a bit of tweaking double playerXfloor = Math.floor(Minecraft.getMinecraft().thePlayer.posX); double playerXremainder = Minecraft.getMinecraft().thePlayer.posX - playerXfloor; if (String.format("%.2f", playerXremainder ).contains(".99")); { LogHelper.info("true"); } For positive numbers, this will trigger for any numbers between x.985 and x.9949999999 For negative numbers, this will trigger at numbers ending in 0.01 instead of 0.99 Is that what you want? I'm with DieSieben though, are you sure that's really the effect you're looking for? -TGG -
Hi For clues look at BlockFurnace.onBlockPlacedBy. It uses metadata to specify the four directions the furnace can face. For more background information, see the Block topics on this link: http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html public void onBlockPlacedBy(World world, int wx, int wy, int wz, EntityLivingBase entityLivingBase, ItemStack itemStack) { int l = MathHelper.floor_double((double) (entityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; // which compass point is the player facing? if (l == 0) { world.setBlockMetadataWithNotify(wx, wy, wz, 2, 2); } if (l == 1) { world.setBlockMetadataWithNotify(wx, wy, wz, 5, 2); } if (l == 2) { world.setBlockMetadataWithNotify(wx, wy, wz, 3, 2); } if (l == 3) { world.setBlockMetadataWithNotify(wx, wy, wz, 4, 2); } if (itemStack.hasDisplayName()) { ((TileEntityFurnace)world.getTileEntity(wx, wy, wz)).func_145951_a(itemStack.getDisplayName()); } } -TGG
-
Hi Have you looked at DynamicTexture? You can supply it with a BufferedImage that you have created pixel by pixel. Vanilla uses it for a couple of things like the lightmap texture or the map item. Once you have the dynamic texture, you can display it by binding the texture before rendering the side of your block, you may need to use a tile entity to do it because it seems that changing textures midway through IBSRH doesn't work in 1.7.10 (haven't tried it myself). I don't know of any how-to or tutorial on DynamicTexture, unfortunately. -TGG
-
[1.6.4] Block playing a sound when powered (not working)
TheGreyGhost replied to alphawolf918's topic in Modder Support
Hi You are using static variables for the siren state. That will for sure lead to problems. Either remove the static, so eg your ironSirenOn and ironSirenOff have their own siren state, or combine ironSirenOn and ironSirenOff into a single ironSiren and use block metadata to store whether it is on or off. You probably don't need the make your siren a BlockContainer either. Just extend Block instead. -TGG -
PS If you don't want to change the build.gradle, you can also use an IntelliJ artifact to copy the resources to the correct folder i.e. from C:\Users\TGG\Documents\JavaSources\HiddenMessages\src\main to C:\Users\TGG\Documents\JavaSources\HiddenMessages\build\classes\main Project Structure ->Artifacts Add new artifact (green +) Type: Other Give it a name eg CopyResources' Output Directory C:\Users\TGG\Documents\JavaSources\HiddenMessages\build\classes\main Add Copy of (green + with small down arrow) Directory: 'resources directory content' C:\Users\TGG\Documents\JavaSources\HiddenMessages\src\main OK to save Then, add the CopyResources artifact to "before launch" on the Run/Debug configurations. eg Run->Edit Configurations->Application->Minecraft Client - add to 'before launch' box at the bottom. -TGG
-
[1.7.10].setColorRGBA_I alpha setting not working.
TheGreyGhost replied to Taji34's topic in Modder Support
Hi Are you perhaps drawing it twice on top of itself, once as opaque, once as transparent? What did you forget in 1st person, as a matter of interest? -TGG -
Hi What do you mean 'connected textures'? Perhaps you could make a simple image of what you are trying to do, to show us? -TGG
-
[1.7.10].setColorRGBA_I alpha setting not working.
TheGreyGhost replied to Taji34's topic in Modder Support
Hi I'm running out of ideas, sorry! What happens if you replace your source image with one that has a partial transparency (i.e. alpha channel of say 0.5)? You could try this utility https://github.com/TheGreyGhost/SpeedyTools/blob/master/src/main/java/speedytools/common/utilities/OpenGLdebugging.java It will dump a copy of all the opengl rendering flags --> place OpenGLdebugging.dumpAllIsEnabled() immediately before your tess.draw(), it make give a clue about which one should be enabled but isn't. -TGG -
Hi It looks to me like you are trying to undo the motion effects of Entity arrow by guessing what onUpdate did and then undoing it. The reason your arrow is still spinning is because you undo motion but not rotation. I'd suggest the best way to do this is to save a copy of the motionX, Y, Z and the rotationPitch and rotationYaw and overwrite them again afterwards if the arrow hasn't stuck in the ground or bounced off an entity or been destroyed or similar so eg {save motion and rotatino variables} super.onUpdate() if (! inGround && ticksInAir != 0) {copy variables back} -TGG
-
[1.7.10]Textures not loading in IDE
TheGreyGhost replied to theOriginalByte's topic in Modder Support
Hi Alternatively, you could modify your build.gradle file to copy the resources to the expected place http://www.minecraftforge.net/forum/index.php/topic,25429.msg129629.html#msg129629 -TGG -
How to load a single chunk from another dimension?
TheGreyGhost replied to McJty's topic in Modder Support
Hi You might try this code from Entity.travelToDimension() MinecraftServer minecraftserver = MinecraftServer.getServer(); WorldServer worldserver1 = minecraftserver.worldServerForDimension(targetDimension); -TGG -
[1.7.10].setColorRGBA_I alpha setting not working.
TheGreyGhost replied to Taji34's topic in Modder Support
Hmm that's odd Are you sure the "else" is every being called? Try replacing your if (i==0) {} else {} with the snippet below and seeing if it renders partially opaque GL11.glEnable(GL11.GL_BLEND); GL11.glDepthMask(false); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); tess.setColorRGBA_I(color[i], 128); -TGG -
Hi >What are the general guidelines for running code on either on the server only, or both the server on the client? Some general guidelines I use: Client side only: rendering and sound - anything that doesn't affect the "game state" - things other players don't need to know about - for example animations, local sound effects other players don't hear, etc Server side only: things that affect the "master" source of information on the state of the world, such as entity positions, block states, etc, interactions between players Both: It can be a big advantage to run the same code in parallel on both the client and the server, to reduce the amount of information they have to exchange and to reduce the apparent lag. So for example as Draco said, your entity should run its movement code in parallel on both client and server . The client makes a guess / extrapolation based on its current information and just corrects the movement occasionally when server packets arrive. It's much less visually disturbing that way. -TGG
-
Hi Show us your code and describe the symptoms of your problem (including error logs)? -TGG
-
Hi You could perhaps create a custom block which looks exactly like air but stops water flowing into it. For example like a ladder that you can't see. -TGG
-
[1.7.10].setColorRGBA_I alpha setting not working.
TheGreyGhost replied to Taji34's topic in Modder Support
Hi The GL11 flags don't take effect until you render something. The tessellator queues up a list of commands, but doesn't issue them to openGL until you do the draw. So probably what is happening: 1) queue some drawing commands to tessellator 2) change your flags to transparent 3) queue some more drawing commands to tessellator 4) change your flags to opaque 5) queue some more drawing commands to tessellator 6) tessellator.draw At the time of the draw (6), your opengl flags are in opaque mode. So everything queued up in the tessellator is draw as opaque. You need to either issue the draw command after (1), (3), and (5) (which may not be possible depending on where your render code is), or alternatively draw using OpenGL directly instead of through the tessellator. Alternatively, items can be rendered in passes, so you could render your transparent sections in pass 1 - look at ItemPotion for inspiration...requiresMultipleRenderPasses, hasEffect, getIconFromDamageForRenderPass Your flags look good to me. -TGG -
[Solved] Help with Intellij and resources
TheGreyGhost replied to SuperKamiCatbug's topic in Modder Support
Very nice find! Did you solve it without downgrading to IntelliJ 13 or is downgrading necessary to fix this problem? This bloke came up with a fix http://www.minecraftforge.net/forum/index.php/topic,25429.msg129629.html#msg129629 You've got a funny definition of "obvious" I must say -TGG -
Aha. http://www.minecraftforge.net/forum/index.php/topic,25120.msg128867.html#msg128867 I just upgraded to IntelliJ 14, that explains a lot. -TGG
-
Hi Keen, thanks. The biggest frustration I have with the whole FML, gradle setup etc is the lack of decent documentation. It does all its magic and it's great when it works, but god help you if something goes wrong because you've then got to dig for hours through the bowels of the code trying to guess at how it's supposed to work and pinpoint what is going wrong. TI-99/4A huh? The graphics look kind of Minecraft-y I guess... -TGG
-
If you are trying to upload your mod to planetminecraft, which won't accept jar files, just rename your jar file to zip and upload that. eg mymod.jar --> mymod.zip -TGG