TheGreyGhost
Members-
Posts
3280 -
Joined
-
Last visited
-
Days Won
8
Everything posted by TheGreyGhost
-
Hi Some ideas to try (1) when a client sends a chat message, it could remember it, and if it receives the identical message within (say) 1 - 2 seconds, it knows that it was almost certainly the sender or (2) you could search the incoming message for each of the player names, discard any which don't match, and pick the best of any that do match (the one with the earliest match position in the string) or (3) write your own "play sound" packet, i.e. the client searches the chat message it is about to send for the specific word, and if it is present, sends a packet to the server which then does "play the sound on all clients except the original client". -TGG
-
[SOLVED] [1.7.2] How to make a transparent block?
TheGreyGhost replied to Texenox's topic in Modder Support
Hi This might be useful info for you http://greyminecraftcoder.blogspot.com.au/2013/07/rendering-transparent-blocks.html -TGG -
Hi The ISBRHandler is described in more detail here http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html The sections on Block Rendering will be of greatest interest, some specifics on the ISBRH here: http://greyminecraftcoder.blogspot.com.au/2013/07/block-rendering.html -TGG
-
Hi If you want your item to be rendered in the inventory as a 3D block using the ISBRH, you should define it as an ItemBlock. so for example /* This is the item that corresponds to BlockPyramid. */ public class ItemBlockPyramid extends ItemBlock { public ItemBlockPyramid(int id) { super(id); this.setMaxStackSize(64); this.setCreativeTab(CreativeTabs.tabBlock); this.setUnlocalizedName("ItemBlockPyramid"); } } and register it properly... GameRegistry.registerBlock(blockPyramid, ItemBlockPyramid.class, "blockPyramid"); It should render fine in the inventory if you do that. -TGG for reference: public class BlockPyramid extends Block { public BlockPyramid(int id) { super(id, Material.ground); this.setCreativeTab(CreativeTabs.tabBlock).setUnlocalizedName("BlockPyramid"); } @Override public boolean isOpaqueCube() { return false; } // This icon is never actually displayed because we always render it using ISBRendererBlockPyramid, however when you // destroy a block the // fragments that fly everywhere are derived from the block Icon, so we use something sensible.. @Override public void registerIcons(IconRegister iconRegister) { blockIcon = Block.blockLapis.getIcon(0, 0); } @Override public boolean renderAsNormalBlock() { return false; } @Override public int getRenderType() { return ISBRendererBlockPyramid.myRenderID; } }
-
[1.7] [solved] Common Proxy not working
TheGreyGhost replied to TwIxToR_TiTaN's topic in Modder Support
Hi This link might help explain it to you. It took me a while to figure it out, myself. http://greyminecraftcoder.blogspot.com/2013/11/how-forge-starts-up-your-code.html -TGG -
Minecraft freezes on world loading screen
TheGreyGhost replied to chasingfire_hpps's topic in Modder Support
Hi Yeah your mod shouldn't need a large amount of memory if that's all it's doing. I suspect that you've implemented something not quite right (probably the world generation?). Hard to tell what. That's why I suggested the heap analyser - if you look at the heap after the crash, and discover that it's nearly completely full of a particular object (say - 1,0000,000 copies of your Item), then you have a strong clue where the problem is. If you're not keen on the heap analyser idea, I would suggest you try and narrow down the part of the code which is causing the problem by commenting some of it out, running to see if it crashes, uncomment (or comment more), etc, until you can put your finger on the exact part of the code which leads to the crash. Memory problems can be tricky to fix, it might take a fair bit of trial & error (and patience). If you really get stumped, you could consider posting your code (say, on GitHub), and some eager person on this forum might try to reproduce+troubleshoot the error for you :-) -TGG -
1.6.4 Forge Obj Block Issue. Please Help!!!
TheGreyGhost replied to SuperHB's topic in Modder Support
Hi You've got a suitable function here to register the TESR, but you never call it? public class ClientProxy extends ServerProxy { public void registerTESR(){ //ClientRegistry.bindTileEntitySpecialRenderer(Class <? extends TileEntity> tileEntityClass, TileEntitySpecialRenderer specialRenderer) <- this is the method you call to register your TESR ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTardis.class, new TESR()); } } I'd suggest you just move it to your main class, something like this one @Mod(modid="speedytoolsmod", name="Build Faster Mod", version="1.0.0") @NetworkMod(clientSideRequired=true, serverSideRequired=true, channels={"speedytools"}, packetHandler = PacketHandler.class) public class SpeedyToolsMod { // .. etc .. @EventHandler public void postInit(FMLPostInitializationEvent event) { ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTardis.class, new TESR()); // you are missing this bit } } also, do you have GameRegistry.registerTileEntity(tileEntityClass, id); somewhere? -TGG -
[1.6.4]I have a GL11 scaling issue, or math problem you decide...
TheGreyGhost replied to skullywag's topic in Modder Support
rofl a Grey Ghost mob, that would be awesome :-P. Can I have special powers, like when I kill the player, they become (spawn) a Grey Ghost too? :-) -
[1.6.4]I have a GL11 scaling issue, or math problem you decide...
TheGreyGhost replied to skullywag's topic in Modder Support
Hi Are you applying the GL11.glScalef(f,f,f) twice by any chance? -TGG -
1.6.4 Forge Obj Block Issue. Please Help!!!
TheGreyGhost replied to SuperHB's topic in Modder Support
Hi That error message is because you're missing the code from your TileEntity that saves and loads it from disk, i.e. readFromNBT and writeToNBT. See here http://www.minecraftforge.net/wiki/Basic_Tile_Entity Did you check if your registerTESR function is called (add a breakpoint or a println to it...)? -TGG -
Minecraft freezes on world loading screen
TheGreyGhost replied to chasingfire_hpps's topic in Modder Support
Hi Does it happen when just your mod is installed and not any others? It looks like your mod might be using up a lot of heap space and there is none left for vanilla stuff. You might be able to get a clue using a heap analyser eg http://stackoverflow.com/questions/145922/how-can-i-see-what-is-in-my-heap-in-java http://blog.jeroenreijn.com/2010/10/large-heap-dump-analysis-with-eclipse.html -TGG -
[1.6.4]I have a GL11 scaling issue, or math problem you decide...
TheGreyGhost replied to skullywag's topic in Modder Support
Hi casting between float and double is ok for this. That 1 and 1.0 should be 1.0f, my bad. And actually the line I told you is wrong... got the test around the wrong way... brainfade, sorry! float entityScaleFactor = Math.abs(entityHeight) >= 0.1f ? 1.0f / entityHeight : 1.0f; // avoid problems if height == 0.0 -TGG -
1.6.4 Forge Obj Block Issue. Please Help!!!
TheGreyGhost replied to SuperHB's topic in Modder Support
Hi where is your registerTESR called from? Are you sure it's being called? I'd suggest that the first thing to check is whether your TESR.renderTileEntityAt is ever being called. If you know how to use breakpoints, put one on this line and see if it ever gets there Minecraft.getMinecraft().renderEngine.getTexture(tardisTexture);// dont create them here, create them in Otherwise, add System.out.println("TardisTESR::renderTileEntityAt"); just before the getTexture, and see if the message gets printed to the console or not. That will help you narrow down whether the problem is with the rendering of your model, or with the setup of the TESR or TileEntity. -TGG -
[1.6.4]I have a GL11 scaling issue, or math problem you decide...
TheGreyGhost replied to skullywag's topic in Modder Support
Hi If you ask the entity for its size, you can scale it down (or up) just enough to make it fit in the block. for example float entityHeight = entityToRender.height; float entityScaleFactor = Math.abs(entityHeight) < 0.1f ? 1 / entityHeight : 1.0; // avoid problems if height == 0.0 GL11.glScalef(entityScaleFactor, entityScaleFactor, entityScaleFactor); renderMyEntity If you are worried about wide entities sticking out the side, then ask for the width too, calculate the scaling factor for that, and use the smallest scale factor of the two. -TGG -
Hi The key concept is to realise that you need to get access to a tick counter somewhere. For example - every entity has its onUpdate method called once per tick (every 1/20 of a second). so when you render your item, you need to read the value of a tickcounter from somewhere and use that to figure out how much the item has changed since the last time you rendered it. I'm not sure if Minecraft has a global tickcounter somewhere, if so I've never found it, but you can create your own easily enough. eg in 1.6.4 register a ClientTickHandler that increments your global tickCounter class every tick, and from your item rendering code read the tickCounter's value. For increased animation smoothness, you should add the partialTick parameter to your globalTickCounter, this will increase the resolution of your timer above 1/20 of a second. (This bit is optional, if you're not sure what I mean) -TGG
-
awesome! Do you know of any way I might be able to help? -TGG
-
Hi all Over the past month I've noticed that the biggest thing holding up progress on the change to 1.7.2 seems to be the deobfuscation of the names. The folks at MCP are obviously very busy, but it seems to me that they've done the hard work already weeks ago, i.e. decompiling the source and making it compile. The deobfuscation is the easy part, it's something that the hundreds of us out here could do in a couple of days. So the idea is basically - can we somehow use the gradle setup to apply deobfuscation that we have supplied ourselves (instead of needing an official MCP release)? in a text file, or from a minecraft forum web database, or whatever? Perhaps this looks something like - (1) the cached forge and minecraft source all use searge names; (2) at the start of a session, the deobfuscation "patch" is updated (from wherever) and creates a deobfuscated copy of the cached forge and minecraft sources (3) ideally, there is some sort of mechanism so that user source code can use either searge or deobfuscated names without conflict - so that when the names are updated, the user source code doesn't break. Even the ability to create a deobfuscation patch for my own use would be nice, rather than having to use the searge names even though I know what the deobfuscated name is. I know next to nothing about how the deobfuscation currently works, and not much more about gradle. But it sounds "so simple", is there a good reason why this wouldn't work? (Apart from needing a deobfuscation database separate from MCPbot, and some sort of quality control checking) -TGG
-
Use @Override for all your methods, it will help you pick up this sort of problem much faster. -TGG
-
Hi This problem is normally associated with an incorrect isOpaqueCube. Try adding @Override before your public boolean func_149686_d() Also - what is this line supposed to do (in shouldSideBeRendered)? It looks broken to me, is 1 - side deliberate? (treat top & bottom different from sides?) return super.func_149646_a(par1IBlockAccess, par2, par3, par4, 1 - par5); if you always return true from this function, does your missing side problem go away? -TGG
-
Hi I know not-much about TCP/IP, but some random places you might look: INetworkManager (TcpConnection) in Minecraft.getMinecraft().thePlayer.sendQueue.getNetManager() perhaps .getSocketAddress? It's created by ThreadConnectToServer.run It looks like you might be able to intercept FMLNetworkHandler. onClientConnectionToRemoteServer to record it (use registerConnectionHandler) -TGG
-
[1.6.4]How to spawn a mob using data available ingame
TheGreyGhost replied to skullywag's topic in Modder Support
Don't sweat it, I once wasted days trying to debug a very similar problem, glad I could help shorten it a bit :-) 3am coding is awesome, I've done some of my most incredible coding between 12am - 6 am, nothing quite like getting "into the zone" :-) -TGG -
[1.6.4]How to spawn a mob using data available ingame
TheGreyGhost replied to skullywag's topic in Modder Support
Hi OK, so if I understand correctly, the problem is that the unique identifier you're reading (in the living death event) doesn't match the unique identifier you need for your mob spawner. Just to be 100% clear - in living death you have used string myUniqueName = EntityList.getEntityString(livingDeathEvent.source); and in your spawner you have tried Entity entity = EntityList.createEntityByName(myUniqueName, this.getSpawnerWorld()); But the names don't match-? I don't understand that at all, EntityList should map those symmetrically as far as I can tell. -TGG -
Releasing mod- where do I put my textures? [1.6.4]
TheGreyGhost replied to Athire's topic in Modder Support
yeah that's a real trap. Been there several times myself That's because the windows file system isn't case sensitive, so essence and Essence still match. But zip files are case-sensitive, so when you package up your mod it suddenly doesn't work any more. you're welcome, thanks :-) -
[1.7.2] Changing a block at an (x, y, z)
TheGreyGhost replied to libarclite's topic in Modder Support
have you used the icq MCPbot before? It's a bit clunky to do it manually but if you are any good at scripting that might be the easiest. DieSieben has expressed some interest in writing a decent web interface for querying and making suggestions about mappings. I'd recommend talking to him about it; you could try contacting the MCP guys but I haven't had much luck with that myself, they are very busy folks. Ultimately I dream of a day when Mojang just release their source directly (with comments removed and variable names anonymised, of course). Would save everyone a whole heap of trouble and speed up the release cycle a huge amount. I'm sure the idea has been thought of, don't know why it hasn't happened since I can't see any disadvantage for Mojang. Anything which helps the modding community will help extend the life of Minecraft, which is getting rather mature now. Anyway that's for more influential folks than me to progress... -TGG