AyyyyLmao
-
Posts
27 -
Joined
-
Last visited
Posts posted by AyyyyLmao
-
-
I'm trying to make a 1.7 block hit mod for forge, I already have a mcp version of it. All I have to do is this:
[spoiler=Normal renderItemInFirstPerson method]
public void renderItemInFirstPerson(float p_78440_1_) { float var2 = 1.0F - (this.prevEquippedProgress + (this.equippedProgress - this.prevEquippedProgress) * p_78440_1_); EntityPlayerSP var3 = this.mc.thePlayer; float var4 = var3.getSwingProgress(p_78440_1_); float var5 = var3.prevRotationPitch + (var3.rotationPitch - var3.prevRotationPitch) * p_78440_1_; float var6 = var3.prevRotationYaw + (var3.rotationYaw - var3.prevRotationYaw) * p_78440_1_; this.func_178101_a(var5, var6); this.func_178109_a(var3); this.func_178110_a((EntityPlayerSP)var3, p_78440_1_); GlStateManager.enableRescaleNormal(); GlStateManager.pushMatrix(); if (this.itemToRender != null) { if (this.itemToRender.getItem() == Items.filled_map) { this.func_178097_a(var3, var5, var2, var4); } else if (var3.getItemInUseCount() > 0) { EnumAction var7 = this.itemToRender.getItemUseAction(); switch (ItemRenderer.SwitchEnumAction.field_178094_a[var7.ordinal()]) { case 1: this.func_178096_b(var2, 0.0F); break; case 2: case 3: this.func_178104_a(var3, p_78440_1_); this.func_178096_b(var2, 0.0F); break; case 4: this.func_178096_b(var2, 0.0F); this.func_178103_d(); break; case 5: this.func_178096_b(var2, 0.0F); this.func_178098_a(p_78440_1_, var3); } } else { this.func_178105_d(var4); this.func_178096_b(var2, var4); } this.renderItem(var3, this.itemToRender, ItemCameraTransforms.TransformType.FIRST_PERSON); } else if (!var3.isInvisible()) { this.func_178095_a(var3, var2, var4); } GlStateManager.popMatrix(); GlStateManager.disableRescaleNormal(); RenderHelper.disableStandardItemLighting(); }
and change it to this
[spoiler=Modded renderItemInFirstPerson method]
public void renderItemInFirstPerson(float p_78440_1_) { float var2 = 1.0F - (this.prevEquippedProgress + (this.equippedProgress - this.prevEquippedProgress) * p_78440_1_); EntityPlayerSP var3 = this.mc.thePlayer; float var4 = var3.getSwingProgress(p_78440_1_); float var5 = var3.prevRotationPitch + (var3.rotationPitch - var3.prevRotationPitch) * p_78440_1_; float var6 = var3.prevRotationYaw + (var3.rotationYaw - var3.prevRotationYaw) * p_78440_1_; this.func_178101_a(var5, var6); this.func_178109_a(var3); this.func_178110_a((EntityPlayerSP)var3, p_78440_1_); GlStateManager.enableRescaleNormal(); GlStateManager.pushMatrix(); if (this.itemToRender != null) { if (this.itemToRender.getItem() == Items.filled_map) { this.func_178097_a(var3, var5, var2, var4); } else if (var3.getItemInUseCount() > 0) { EnumAction var7 = this.itemToRender.getItemUseAction(); switch (ItemRenderer.SwitchEnumAction.field_178094_a[var7.ordinal()]) { case 1: this.func_178096_b(var2, 0.0F); break; case 2: case 3: this.func_178104_a(var3, p_78440_1_); this.func_178096_b(var2, 0.0F); break; case 4: this.func_178096_b(0.2F, var4); this.func_178103_d(); GlStateManager.translate(-0.5F, 0.2F, 0.0F); break; case 5: this.func_178096_b(var2, 0.0F); this.func_178098_a(p_78440_1_, var3); } } else { this.func_178105_d(var4); this.func_178096_b(var2, var4); } this.renderItem(var3, this.itemToRender, ItemCameraTransforms.TransformType.FIRST_PERSON); } else if (!var3.isInvisible()) { this.func_178095_a(var3, var2, var4); } GlStateManager.popMatrix(); GlStateManager.disableRescaleNormal(); RenderHelper.disableStandardItemLighting(); }
And then it does the old 1.7 block hit animation
-
I forgot to say that using a sub class of ItemRenderer didn't work as some of the methods that are in the method I'm changing are private
-
Ok so I want to override the method 'renderItemInFirstPerson' in the 'ItemRenderer' class but I dont know how to.
What the simplest way to do this? Thanks.
-
I havent tried with reflection but events wont work
-
I havent made any animations, Ive just edited some of the values in several classes of the Minecraft code
-
So there isnt any other simple way to make the mod I've made work with forge?
-
I have already made this mod, and all you have to do is drag it into the mc version jar and it works, I just want to know how I can get it to work with forge because I want to play with the other forge mods Ive made as well as this mod
-
Hey, so I've been reading through this http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571568-tutorial-1-6-2-changing-vanilla-without-editing
And I want to create my own coremod to change some of the 1.8 player animations back to 1.7's style, example: blockhit, sneaking, damage etc.
But I don't know how to do this for 1.8 let alone 1.6.2 if I was using it, so I was wondering if anyone can give me some help or explain it in an easier way to understand.
Thanks.
-
Use FontRenderer#drawSplitString and it will split the string so that it fits on screen.
And what about the height of the window?
-
I want to display a few paragraphs of text which will have all the changes in an upcoming version. But if the user has their window size different to what I'm testing with then it will go over the edges and the user will not view it correctly.
How would I implement a scroll bar and format it to fit in every window of any size?
Heres what I have now:
package mc.ayyyylmao.testgui; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiControls; import net.minecraft.client.gui.GuiMultiplayer; import net.minecraft.client.gui.GuiScreen; public class TestGui extends GuiScreen { private GuiScreen parentScreen; private GuiButton dlnow; private GuiButton rmlater; private int headerPos; private int footerPos; private byte byte0 = -16; public TestGui(GuiScreen parent) { this.parentScreen = parent; } public void initGui() { this.buttonList.clear(); headerPos = 35; footerPos = this.height - 29; this.dlnow = new GuiButton(1, this.width / 2 - 70, footerPos-17, 150, 20, "Download Now"); this.rmlater = new GuiButton(2, this.width / 2 - 70, footerPos+3, 150, 20, "Remind Me Later"); this.buttonList.add(dlnow); this.buttonList.add(rmlater); } protected void mouseClicked(int mouseX, int mouseY, int mouseButton) { if (mouseButton == 0) { for (int l = 0; l < this.buttonList.size(); ++l) { GuiButton guibutton = (GuiButton)this.buttonList.get(l); if (guibutton.mousePressed(this.mc, mouseX, mouseY)) { actionPerformed(guibutton); } } } } protected void actionPerformed(GuiButton button) { switch(button.id) { case 1: // Do stuff break; case 2: // Do stuff break; } } public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawBackground(0); this.drawGradientRect(0, 50, this.width, this.height - 50, -1072689136, -804253680); this.drawCenteredString(this.fontRendererObj, "New Version Released", this.width/2, headerPos, 0xFFFFFF); super.drawScreen(mouseX, mouseY, partialTicks); } }
Thanks.
-
Hello,
How would I be able to render my techne model (I already exported and imported in to my mod)
I was just wondering how I would be able to render it on to the player, sitting on top of the head
thanks
-
I don't think there is hook for before sending anything.
Depending how autocorrecting your autocorrect will be you might do some tricks.
Minecraft client knows current Gui opened. (mc.currentScreen).
There is ClientTickEvent that is fired by FML client-side every phase: START and END of tick (choose one always).
You can check if gui instanceof GuiChat and get currently written text box and apply autocorrect, problem is you would need to do it in some tricky way to not interfere with player's input. (Obviously not every tick).
If you can't think of a way to do it (I can, but don't know what are you planning) then you are left with implementing custom GuiChat (there is also GuiChatNew, look it up) and using GuiOpenEvent - replace GuiChat with yours. (better way I think, if you are planning that big feature, yet - more coding).
EDIT
Obviously, you can also use other events - Input events, e.g "click 'Insert' to check spelling".
I was thinking of having a guibutton popup above the word as you're typing it and that way if you spelled the word incorrectly and want to correct it you can click the button that you want.
I'm interested in hearing what you had in mind though. If you would like to tell me that is, I don't mind :>
-
How would I be able to get what the player is typing in the chat bar, before they send it.
I'm working on an autocorrect mod for my friend.
Is there a way to do this or not?
Thanks
-
What you have against Iterators?
someLivingEntity.getActivePotionEffect(<thePotion>) gives you the potion effect which tells you everything about the potion, such as amount left, modifier, etc.
Nothing I just wanted to know if there was an easier way
But thanks
-
Hey,
Im trying to create a Damage Reduction Calculator so I can see how much damage my armor, potion effects and enchants are stopping, and I have everything so far I just dont know how to get just the resistance level I have.
I want to be able to just get the resistance effect's amplifier without having to create and iterator. Is there a way to do this?
Thanks.
-
Hey, I was using GuiPlayerInfo in a 1.7.10 mod, and Im trying to get it for 1.8 but I cant find the GuiPlayerInfo class. What was it changed to?
-
Is it possible with a mod to change the resource pack the player is using?
If so what would I have to do to do so
-
On the client it will be a EntityClientPlayerMP. On the server it will be EntityPlayerMP. How hard is this to understand?
How can I get the EntityPlayerMP though, thats what im asking
-
You must be doing something wrong.
EntityPlayerMP exists only on server side.
Commands registered using FMLServerStartingEvent call execute() on server side, therefore you can cast ICS to EntityPlayerMP.
Why do you need EntityClientPlayerMP? If you are looking for Client commands, they should be registered with ClientCommandHandler.instance.registerCommand(cmd);
Everytime i use the command i get this
[22:08:22] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: java.lang.ClassCastException: net.minecraft.client.entity.EntityClientPlayerMP cannot be cast to net.minecraft.entity.player.EntityPlayerMP [22:08:22] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.ayyyylmao.ping.cmds.PingCommand.func_71515_b(PingCommand.java:49) [22:08:22] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraftforge.client.ClientCommandHandler.func_71556_a(ClientCommandHandler.java:72) [22:08:22] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.gui.GuiChat.func_146403_a(GuiChat.java:141) [22:08:22] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.gui.GuiChat.func_73869_a(GuiChat.java:131) [22:08:22] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.gui.GuiScreen.func_146282_l(GuiScreen.java:319) [22:08:22] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.gui.GuiScreen.func_146269_k(GuiScreen.java:276) [22:08:22] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1628) [22:08:22] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:961) [22:08:22] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:887) [22:08:22] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.main.Main.main(SourceFile:148) [22:08:22] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [22:08:22] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [22:08:22] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [22:08:22] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.lang.reflect.Method.invoke(Method.java:483) [22:08:22] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [22:08:22] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
-
There are 2 types of icommand sender. player and console. so check if the sender is an instance of player and if it is an player cast it to entityplayermp
I need to get to get the EntityClientPlayerMP, but i cant cast it to EntityPlayerMP .-.
java.lang.ClassCastException: net.minecraft.client.entity.EntityClientPlayerMP cannot be cast to net.minecraft.entity.player.EntityPlayerMP
-
1) Don't give copy-paste ready code, it doesn't help anyonenot sure what your problem is, here's the code
EntityPlayerMP player = (EntityPlayerMP) sender;
2) What is
sender
isn't a
EntityPlayerMP
?
Its ICommandSender
Sorry but I couldn't help but notice your username.
Reddit?
Its my IGN I dont have reddit ;-;
-
Hey, im working on adding a /ping command to my mod but at the moment I just cant get the player without it erroring.
How do I get the EntityPlayerMP from the command sender.
thanks!
-
Lucky for you I already have a ping command and it's really simple.
@Override public void processCommandPlayer(EntityPlayer player, String[] args) { outputMessage(player, String.valueOf(((EntityPlayerMP) player).ping), false, false); }
Don't use outputMessage, it's a method I made. use player.addChatMessage
Thanks!!
-
What are you trying to do?
Create a /ping command
Or maybe add a drawString in the top so I can see my ping without having to use cmd or logout of the server
[1.8] Overriding a method in ItemRenderer
in Modder Support
Posted
Im creating a '1.7 blockhit' mod for forge, I created a mcp version a while ago and the people I gave it to want me to make a forge version so its compatible with other mods like bspkrs's mods and such.
The way to do this is in the 'renderItemInFirstPerson' method in 'ItemRenderer', there is a switch statement for the action that the item is doing, case 4 of the statement is the blocking animation.
Normally case 4 just contains this
To change the animation that is played in 1.8 and make it show the animation that was shown in 1.7 all you have to do is change the values and then use the GlStateManager to translate it in to a better position like so
Is there an easy way to override this method using reflection or something? because I've tried using a subclass of the ItemRenderer method but that didn't work because some of the methods that are run inside of the 'renderItemInFirstPerson' method are private