Everything posted by UntouchedWagons
-
'onItemRightClick' being called right after 'onItemUse' is called
What? I don't want to clear the saved data immediately after it's been set. That defeats the purpose of the item.
-
'onItemRightClick' being called right after 'onItemUse' is called
In my item's onItemUse method, some data about the tile entity that the player has right clicked on while sneaking is saved to the itemstack. If a player right clicks the item while sneaking and not looking at anything, this data is cleared. However when the player sneak-right clicks the tile entity, the onItemUse method is called then onItemRightClick is called. I want to stop the later from happening. Is this controlled by the return value of onItemUse or something else?
-
[1.7.10]Message is being received client side, but not processed
Yup that indeed would be it. I don't find that parameter very intuitive, but that's just me. Cool it works now. Changes for anyone coming across this thread in the future.
-
[1.7.10]Message is being received client side, but not processed
When a player connects to the server, I want to send the PowerGridWorldSavedData object for that world to the client. I know that when the player logs in that the event fires because I see "Sending grid info" in the console output, and I know the client receives the message because I see "bytes received". The problem is that I never see "message received" in the console. I took another look at diesieben07's tutorial on the SimpleNetworkWrapper and nothing stands out as being wrong, yet there must be something I've done wrong.
-
[1.7.10]Block with custom model renders as an invisible block
Through the power of shotgun debugging and looking at what others have done I have finally got my model to render properly. This is what I have now to make it work: public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTick) { GL11.glPushMatrix(); GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); bindTexture(texture); GL11.glRotatef(180, 0F, 0F, 1F); model.render(null, 0, 0, 0, 0, 0, 0.0625F); GL11.glPopMatrix(); } The glTranslatef method allows you to moves the model around. The glRotatef method allows you to rotate the model which you'd want if you need to rotate your machine. The first parameter is the amount to rotate in degrees along the X axis, the second is the Y axis and the third is the Z axis. I don't know what the parameters for the render method do but in my model classes only the last parameter is ever used.
-
[1.7.10]Block with custom model renders as an invisible block
Uh huh.
-
[1.7.10]Block with custom model renders as an invisible block
Yeah I found that. That's how I know about the chest rotation and checking for adjacent chests stuff.
-
[1.7.10]Block with custom model renders as an invisible block
I understand the stuff about chest rotation and checking for adjacent chests but I don't see what you want me to see.
-
[1.7.10]Block with custom model renders as an invisible block
So like this: public void renderTileEntityAt(TileEntityLargePowerLine te, double x, double y, double z, float partialTick) { GL11.glPushMatrix(); //GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); bindTexture(new ResourceLocation("powerlines", "render/largePowerLine.png")); GL11.glRotatef(180, 0F, 0F, 1F); model.render(null, (float)x, (float)y, (float)z, 0, 0, partialTick); GL11.glPopMatrix(); } It doesn't seem right that I have to cast the doubles to floats, but what do I know? I'm basically a monkey at a keyboard when it comes to this rendering stuff.
-
[1.7.10]Block with custom model renders as an invisible block
Here are the changes I made in the latest commit: https://github.com/UntouchedWagons/PowerLines/commit/76fe68c404ac2bd323be240e3ad6401046381aca
-
[1.7.10]Block with custom model renders as an invisible block
Okay now it's rendering, but it's flickering and jumping around. I recorded what was happening with OBS but GFYCat doesn't give me a useful error message when uploading fails. It works with YouTube: https://www.youtube.com/watch?v=C-cXm0IlevM
-
[1.7.10]Block with custom model renders as an invisible block
There's six floats though.
-
[1.7.10]Block with custom model renders as an invisible block
Okay fixed that (not pushed yet), stupid me. That's because I don't know what those arguments mean. According to IntelliJ, only the last float value is used.
-
[1.7.10]Block with custom model renders as an invisible block
Oh okay, you use an ISBRH if you want to give a basic block a custom model right? I may want to do that later. I've pushed the changes I've made as per your recommendations, but the block is still rendering as invisible.
-
[1.7.10]Block with custom model renders as an invisible block
Okay so I've fixed the first two issues and the second half of the third (haven't pushed the changes yet) but I'm not sure how to implement the ISBRH, or where to put it (in the file structure that is).
-
[1.7.10]Block with custom model renders as an invisible block
Source code can be found in my git repo: https://github.com/UntouchedWagons/PowerLines My mod will add, among other things, a large power line like the ones you find outside. I've made a babby's first model using Tabula and have hacked together the rendering stuff using Mekanism as a point of reference. The large power line is supposed to look like this: http://i.imgur.com/na6ceWe.png but instead looks like this: http://i.imgur.com/qPOXbjC.png What did I do wrong? It's bound to be something stupidly simple. I know I screwed up the texture size.
-
How do I send an IMessage object to a player when they login?
When a player logs onto the server, I want my mod to send him/her a message (not a chat message but an IMessage using the network wrapper stuff). In my server proxy class I have this: @SubscribeEvent public void onPlayerJoin(PlayerEvent.PlayerLoggedInEvent event) { } But in order to send a message to a particular player, I need an EntityPlayerMP object but event's player field is of type EntityPlayer. Am I using the wrong event? I don't want to send the message to everyone because I don't need to.
-
Question about the WorldEvent events
In that case I'd want to load the data when a save is loaded, not when a world is loaded. Is there an event for that? Actually nevermind, since my power lines won't be doing cross-dimensional transfer, saving the power grids per world will be fine. Thanks.
-
Question about the WorldEvent events
Okay so by looking at this post by mew and your following post and copying a bit of code from your Questology mod I got this: package untouchedwagons.minecraft.powerlines.grids; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraft.world.WorldSavedData; public class PowerGridWorldData extends WorldSavedData { private static final String IDENTIFIER = "power-lines"; public PowerGridWorldData(String identifier) { super(identifier); } public PowerGridWorldData() { super(IDENTIFIER); } @Override public void readFromNBT(NBTTagCompound p_76184_1_) { } @Override public void writeToNBT(NBTTagCompound p_76187_1_) { } public static PowerGridWorldData get(World world) { PowerGridWorldData data = (PowerGridWorldData)world.mapStorage.loadData(PowerGridWorldData.class, IDENTIFIER); if (data == null) { data = new PowerGridWorldData(); world.mapStorage.setData(IDENTIFIER, data); } return data; } } My remaining question is in the WorldEvent events, does it mean World as in a single dimension or as in a save encompassing multiple dimensions? Also, is the Load event fired before chunks are loaded?
-
Question about the WorldEvent events
In any case, how would I go about saving and loading data from a file when a save is loaded?
-
Question about the WorldEvent events
I suppose if a player wanted to transfer power 1000 blocks and a power line could be 50 blocks apart, that would be 20 chunks loaded which wouldn't be too bad. I'm looking at the ForgeChunkManager class now, the first parameter for the setForcedChunkLoadingCallback is an object named mod. I assume I pass the class that I have annotated with the @Mod annotation?
-
Question about the WorldEvent events
I want to make a mod that adds power lines (like the ones in real life) to let you transmit RF large distances without the use of tesseracts or similar "magic" blocks. What I want to do is create power grids that multiple power lines are a part of, this would have the effect of not requiring the entire run of chunks to be loaded. To do this I need to be able to load data about the various power grids in the dimensions when a save is loaded. Thus my question is this: In the WorldEvent class it says, "WorldEvent is fired when an event involving the world occurs.". When it says "World", does this mean a save or a dimension? Also as a bonus question, how would I go about storing data structures to an external file? I'd need to create an NBT structure which I know how to do, but I don't know how to save it. In the World class I see the getSaveHandler method which returns an implementation of ISaveHandler which has a getWorldDirectory method.
-
What's the proper way of writing an exception to the forge log?
Oh. Thanks.
-
What's the proper way of writing an exception to the forge log?
Due to cross mod interactions, my mod will have to catch Exceptions. I don't want to just ignore the exception but I don't know how to write the error and its stack trace to Forge's log.
-
[PEBKAC]Tile entity client-side doesn't seem to be being updated
I figured it out, it was my fault. In part of the upgrade process I commented out a line of code that tells the client about any changes to the tile entity and never replaced it with the new netty based network stuff. So I overrode the updateEntity method and send a message to the client about current energy levels and it works. I should probably check if the energy level has changed at all though.
IPS spam blocked by CleanTalk.