TheGreyGhost
Members-
Posts
3280 -
Joined
-
Last visited
-
Days Won
8
Everything posted by TheGreyGhost
-
Entities do not render from some rotations.
TheGreyGhost replied to david476's topic in Modder Support
Hi. I've never noticed this myself. Do you have code and screenshots you could show us? -TGG -
[unSOLVED] Trigonometry with connected entities
TheGreyGhost replied to david476's topic in Modder Support
Hi Yes those equations will do the job. They are essentially the same as the ones in the previous posts. These equations don't care if you use radians or degrees. It depends on the sin and cos library methods you're using. If the sin method expects you to provide the angle in radians, you need to give it in radians. If it expects the angle in degrees, give it in degrees. You can convert between the two easily as Naiten said. -TGG -
Hi You've got a good point about playing sounds through World if you want other players to hear them. In my case I didn't, but I agree that's not clear from my post. The point of my post was to show the SoundLoadEvent which is very different to how forge registers just about everything else. Took me quite some time to find it myself because based on the name I assumed it was an event triggered by the loading of each sound, not an event you need to hook into to register your sounds at the right time. Once you're aware of that key difference it's easy to fill in the blanks. I never managed to get sounds to work properly until I did it this way and it took nearly a day of stuffing around to get there. -TGG
-
Changing player arm rendering (in first person) [1.7.2]
TheGreyGhost replied to Alesimula's topic in Modder Support
ha ha this could go on for hours :-) It's a recent addition (2 months ago according to the history).... https://github.com/MinecraftForge/MinecraftForge/search?q=renderhandevent&ref=cmdform -TGG -
Hi Sorry no You-Tube, but some code: public class CustomSoundsHandler { @ForgeSubscribe public void onSound(SoundLoadEvent event) { event.manager.addSound("speedytools:wandplace.ogg"); event.manager.addSound("speedytools:wandunplace.ogg"); event.manager.addSound("speedytools:orbplace.ogg"); event.manager.addSound("speedytools:orbunplace.ogg"); event.manager.addSound("speedytools:sceptreunplace.ogg"); event.manager.addSound("speedytools:sceptreplace.ogg"); } } In commonproxy.postInit: MinecraftForge.EVENT_BUS.register(new CustomSoundsHandler()); When you want to play the sound: Minecraft.getMinecraft().sndManager.playSound("speedytools:sceptreplace.ogg", (float) (thePlayer.posX), (float) (thePlayer.posY), (float) (thePlayer.posZ), 1.0F, 1.0F); That's it.... -TGG
-
[unSOLVED] Trigonometry with connected entities
TheGreyGhost replied to david476's topic in Modder Support
Hi I find the easiest way to visualise yaw, pitch, and roll is to imagine a spaceship with its tail at [0,0,0] and its nose pointing to [x,y,z]. Yaw is where the nose is pointing in terms of compass direction, eg North, East, etc, which in Minecraft corresponds to changes in the x and z coordinates of the nose. Pitch is how far "up" the nose is pointing, eg straight up, 45 degrees up, 30 degrees down, etc. In Minecraft this affects primarily the y coordinate, but also the x and z coordinate in a fixed ratio (i.e. as you tilt the nose upwards, its x and z move back towards the [0,0,0]) Roll is how much the ship has rotated around its own axis - for example is it upright, upside down, or on its side. I think you've got the idea of Yaw and Pitch already, the spherical coordinate system with phi and theta. If all you care about is the [x,y,z] of the nose, then you don't need roll at all. You only need roll if you are rendering your spaceship and it needs to be upside down. In that case, you need to perform a rotation around the roll axis of the ship (the line between the tail and the nose) , which is a bit more complicated. You've seen these in the code already (glRotatef). On the other hand, if you want the nose position but also the position of the two wing tips, you will need to perform a matrix multiplication for each wing tip, using a matrix that corresponds to a rotation about the roll axis. See here for more details (warning, it's pretty fierce) http://inside.mines.edu/~gmurray/ArbitraryAxisRotation/ArbitraryAxisRotation.html -TGG -
Changing player arm rendering (in first person) [1.7.2]
TheGreyGhost replied to Alesimula's topic in Modder Support
Hi There is no event called just before it, as far as I can tell, it's not done the same way as 3rd person. To be honest I don't know what the best way to do that is. Perhaps overwrite the hand model; or alternatively perhaps there is some way to extend RenderPlayer with your own class and overwrite the player's entry in entityRenderMap. With any luck someone else on the forum may have tried it before... -TGG -
Hi You can still override that method from Item. It doesn't have to be in ItemBlock, since ItemBlock derives from Item. Just use @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) exactly like you did for your MyItem extends Item -TGG
-
[1.7.2] GameRegistry.onItemCrafted HELP !!!
TheGreyGhost replied to Heltrato's topic in Modder Support
Hi ItemCraftedEvent Have you used events before? If not, try googling atomicstryker forge events -TGG -
Changing player arm rendering (in first person) [1.7.2]
TheGreyGhost replied to Alesimula's topic in Modder Support
Hi EntityRenderer.renderHand See http://greyminecraftcoder.blogspot.com.au/2013/08/rendering-first-person-view-items.html -TGG -
Hi I'd suggest you put a breakpoint here at net.minecraft.stats.StatBase.registerStat() and keep pressing continue until you find the call which registers 5244883 "unknown stat". Trace back out and see what it registering it. My guess is that you've somehow registered twice on the same ID, once with a blank name. -TGG
-
Rotating Block Textures in an SBRH (Using Metadata)
TheGreyGhost replied to MrArcane111's topic in Modder Support
Hi This might be of interest to you as well. http://greyminecraftcoder.blogspot.com.au/2013/07/rendering-non-standard-blocks.html I spent a few very frustrating hours last year figuring it out too... what were Notch & co thinking-?! -TGG -
Hi THis link might help you to understand the proxy It's for 1.6.4 but the concepts are exactly the same http://greyminecraftcoder.blogspot.com/2013/11/how-forge-starts-up-your-code.html -TGG
-
Hi What does the crash log say after it crashes? -TGG
-
How to make a weapon [gun] fire faster than default speed?
TheGreyGhost replied to HappleAcks's topic in Modder Support
Hi Do you mean - the bullets fire more frequently, or the bullets travel faster? -TGG -
Hi Ah- I just realised- in order for your client to process the description packet you will need to override TileEntity:: /** * Called when you receive a TileEntityData packet for the location this * TileEntity is currently in. On the client, the NetworkManager will always * be the remote server. On the server, it will be whomever is responsible for * sending the packet. * * @param net The NetworkManager the packet originated from * @param pkt The data packet */ public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { } The S35PacketUpdateTileEntity will contain some NBT data, you should call your TileEntity.readFromNBT() on that NBT data. -TGG
-
[1.7.2][Not needed now]Making an uncollideable block
TheGreyGhost replied to Naiten's topic in Modder Support
Hi Just because the onEntityCollidedWithBlock method is called, doesn't mean that anything will happen. For each entity, vanilla calls onEntityCollidedWithBlock for all blocks that partially overlap the entity's bounding box. But if you don't override it, it won't do anything. I don't think this is causing the issue. As far as I can tell, your block shouldn't collide with anything. Show us your loco code? perhaps the problem is there. -TGG -
[1.7.2][Unsolved]Getting direct texture locations
TheGreyGhost replied to SoBiohazardous's topic in Modder Support
Hi Sorry, I should have been a bit clearer; what I meant was that you can use that as a starting point to figure out where the directory is coming from. To be honest I don't know exactly the answer to your question. The following is based on 1.6.4 but I imagine it's similar for 1.7.2 The base path is stored in the FolderResourcePack or the FileResourcePack depending on whether your assets are in a directory or in a zip. So you need to find the file that is passed to their constructor. If you put a breakpoint in the constructor, you should be able to trace back to the caller and hopefully figure out where the base path is coming from, or alternatively a way for you to access it. (It looks to me like they are contained in ResourcePackRepository, which gives you access to getDirResourcepacks and getResourcePackFiles() from Minecraft.getMinecraft().getResourcePackRepository, but I'm not sure exactly how forge inserts your mod packs into that.) -TGG -
drat Yeah it looks very much like a client-server synchronisation problem. I had high hopes that getDescriptionPacket would fix it, since that appears to be what the vanilla uses to transmit most NBT information for TileEntities. Perhaps try putting the System.out.println code in a couple of extra places in TileEntityBookshelf, eg at the end of readFromNBT in your getDescriptionPacket in the constructor in setInventorySlotContents I suggest changing the println to (eg) System.out.println( (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) ? "[Client]" : "[server]" + "readFromNBT() inv[0] = " + (inv == null || inv[0] == null) ? "null" : "filled"); Let me know if that doesn't give you any more insight, and I can see if I can download your GitHub to test it directly (is the rest of it compilable?) -TGG
-
[1.7.2][Unsolved]Getting direct texture locations
TheGreyGhost replied to SoBiohazardous's topic in Modder Support
Hi This link should help http://www.minecraftforge.net/forum/index.php/topic,11963.0.html -TGG -
Hi try overriding TileEntity:: public Packet getDescriptionPacket() eg for 1.6.4 @Override public Packet getDescriptionPacket() { NBTTagCompound nbttagcompound = new NBTTagCompound(); this.writeToNBT(nbttagcompound); return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 3, nbttagcompound); } for 1.7.2: @Override public Packet getDescriptionPacket() { NBTTagCompound nbttagcompound = new NBTTagCompound(); this.writeToNBT(nbttagcompound); return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 3, nbttagcompound); } -TGG
-
Hi I sent you a private message yesterday, let me know if it doesn't help? -TGG
-
Hi Rendering lighting is made up of several components and I suspect you haven't disabled them all. Perhaps try GL11.glPushAttrib(GL11.GL_ENABLE_BIT); disableStandardItemLighting(); GL11.glColor4f(1.0, 1.0, 1.0, 1.0); { do your render here} GL11.glPopAttrib(); That worked for me... -TGG
-
Hi This link might also be useful http://greyminecraftcoder.blogspot.com.au/2013/09/custom-item-rendering-using.html -TGG
-
Hi This link might be of interest http://greyminecraftcoder.blogspot.com.au/2013/10/user-input.html It's a bit outdated (1.6.4) but the concepts are the same and the code is still very similar. -TGG