Jump to content

MickeyD3557

Members
  • Posts

    6
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

MickeyD3557's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. After doing some more work on this, I have found some solutions to most of these problems. Regarding 1 and 2, what I ultimately did was create a custom renderer which initialized itself based on information from the original player renderer. I store it as a singleton in the mod class, but its probably possible to use reflection to overwrite the original renderer in the render manager. While I havent done 2.5 yet, it probably isnt that bad. The model doesnt need much of anything for initialization, so making a new one and using it should not be very hard. It updates itself during the render function of the renderer, so modifying it shouldnt be tied to any events. Regarding 3, I still need to look at it a bit more, but it appears that that method is the right place to look when making new animations. Lastly for 4, check out this forum to see a bit more on that: https://forums.minecraftforge.net/topic/86774-1152-custom-player-entity/?tab=comments#comment-407517 Hopefully this information helps anyone who has a similar question for modifying the player.
  2. Thanks for the help, both of you! Since Im new to the forum, Im not sure if there is a function to close this thread, or what best practices are for selecting an answer, so feel free to let me know about that as well!
  3. I see. The reason I am concerned about it is because I am writing a custom renderer and model for the player. Things like sword swings and other actions are stored in the entity handed to the PlayerRenderer. It uses swing progress and other things in order to animate the model. I had two concerns when seeing this: Would I need to change the entity coming in in order to add new features for animation? The second issue was where the hit boxes were stored. If they are stored in the model thats fine, but if they are prepared in the entity I see no way around changing it. If I wanted to do a vertical slash, and there were 2 enemies in front of me, stacked on top of each other, like a spider jockey, they should both be hit. If the hit boxes are in the entity, then I would need to change the hit boxes in the entity based on the action. We have plenty of other ideas we may want to implement once we figure out limitations of the modding, so I wish I could provide more concrete examples of what we want to do, but to sum up its a lot(I think). With all that in mind, can that be done only by hooking onto events?
  4. I want to change what happens when you left click with different objects, essentially. Also, I want to change the way that sword damage is calculated. In vanilla, damage is reduced based on the speed of attack, and there is a charge bar for a swing attack, unless I am misunderstanding something. My goal is to change this to a sort of repeatable n hit combo. This is just one of the goals of the mod, there are other things including changing how xp is gathered and player leveling is done, and adding new actions to the player. I had an idea, but I am unsure of if it would work yet: Writing a sub class which overrides functionality of the PlayerEntity, and replacing the reference in the Main Minecraft file through reflection. The problem is: When would I be able to do this without breaking anything. It would need to be after Minecraft.instance is initialized somehow. Is this a possibility?
  5. If I wanted to create a custom player entity, to overwrite the functionality of the player, how could I do that? I have noticed that the player is initialized in net.minecraft.client . If Overwriting this variable is what I would need to do, how would I go about doing that? If I need to, can I/ how do I change some of the code in this main Minecraft.java file?
  6. Hello all, I have had a concept for a large mod that I want to make which has a variety of features from spicing up core animations of the game to changing the way certain actions work including weapon and tool swings. While changing those actions is something I also need to figure out, I want to focus on changing the animations first. For some background, while I don't have much experience modding Minecraft, I have a strong background in Java specifically, and as long as I have an explanation to the function of some non intuitive bits of code, I have no problem understanding Minecrafts code. I was pointed to an older forum post in the Minecraft Mod Development discord: And while it makes sense, there are a couple of questions about it that I have regarding it, as well as if it still works. As a test, I want to create a custom player that does everything the same as the original player. For this, I plan to make a custom Player renderer and model if need be which perform the exact same function. I have found that I can hook into the pre render event for the player, and cancel its rendering. This noticeably makes the player invisible. My goal before changing animations as I mentioned is to make the player appear using my custom renderer, and then start making changes. I made a custom renderer and copied the code from PlayerRenderer, except for some of the render method, which I commented out for now(see below). public void render(AbstractClientPlayerEntity entityIn, float entityYaw, float partialTicks, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int packedLightIn) { this.setModelVisibilities(entityIn); //TODO - replace the rendering code with custom stuff //if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Pre(entityIn, this, partialTicks, matrixStackIn, bufferIn, packedLightIn))) return; //super.render(entityIn, entityYaw, partialTicks, matrixStackIn, bufferIn, packedLightIn); //net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Post(entityIn, this, partialTicks, matrixStackIn, bufferIn, packedLightIn)); } Looking at the code above, I can see the render function I would need to change, but the event posts pose a problem, namely that the this reference is no longer a playerrenderer, and so it will not compile. I have toyed around with passing the original renderer to my custom renderer to use its reference somehow, which leads into my questions(In order of priority). 1. If the above forum is no longer usable, or if my code is not on the right track, what resources can I use to get onto the right track? Basically what should I be doing if not this? 2. How, where, and when do I initialize this? It requires a render manager, and a boolean for using small arms. I dont know how, where, or when the original PlayerRenderer is initialized, so I am not sure how to initialize this one. --EDIT-- 2.5. How would I get started on writing the code to render the custom model in the render function, and how can I use the event bus in this case to post the events? --END EDIT-- 3. Given these steps, do I also need to create a custom model to change the animations of the player? How would I go about changing the animations? I think I have seen the code in the PlayerModel's setRotationAngles method, but I am not sure if that is the code and I still dont quite get how it achieves the animations that way. 4. Assuming that I have been successful in creating custom animations for existing actions, what is the difficulty/possibility of changing existing actions and making new animations for them? As an example, changing the speed of pickaxe swings while increasing the amount of damage to the block each swing, or changing the swing speed of a sword, and depending on the swing increasing delay(combo attacks)? My first priority is questions 1 and 2. As far as I know, I absolutely cannot proceed until I have figured those out, which I have not been able to. 3 Is also important but I may be able to figure out myself just by messing around with things and some creative thinking. 4 comes after everything else and isnt a priority for this forum, but I am tossing it around in case anyone has it on the top of their head. I can answer any questions if I wasn't clear on something, thanks in advance!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.