Jump to content

Korlimann

Members
  • Posts

    53
  • Joined

  • Last visited

Recent Profile Visitors

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

Korlimann's Achievements

Stone Miner

Stone Miner (3/8)

0

Reputation

  1. Hello everyone. I'm currently trying to figure out how to use Java Classes for Models in my Mod. A friend of mine created a .java Model with Blockbench, but it appears the class generated is not for 1.14.4, but probably for 1.12, since most of the Classes used in this Class are relocated somewhere else, or renamed entirely. Specifically, I'm searching for these classes: import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBox; import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.renderer.GlStateManager; I was able to find ModelBox, but that was the only class, all the others seem to be renamed or relocated, and I'm not sure which one is which. Furthermore, I'm guessing that these classes have changed in how they work between 1.12 and 1.14. (It appears pastebin is down so I'm posting the class here) import org.lwjgl.opengl.GL11; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBox; import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.Entity; public class windmillrotor extends ModelBase { private final ModelRenderer bone; public windmillrotor() { textureWidth = 16; textureHeight = 16; bone = new ModelRenderer(this); bone.setRotationPoint(0.0F, 24.0F, 0.0F); bone.cubeList.add(new ModelBox(bone, 0, 0, -3.0F, -5.0F, 0.0F, 6, 5, 2, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 0, 0, -1.6F, -4.0F, -6.0F, 3, 3, 6, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 0, 0, -25.6F, -3.0F, -5.0F, 24, 1, 1, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 0, 0, -0.6F, -28.0F, -5.0F, 1, 24, 1, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 0, 0, 1.4F, -2.8F, -5.0F, 24, 1, 1, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 0, 0, -0.7F, -1.0F, -5.0F, 1, 24, 1, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 0, 0, -25.6F, -10.0F, -4.0F, 20, 7, 0, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 0, 0, 0.4F, -28.0F, -4.0F, 7, 20, 0, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 0, 0, 5.4F, -1.8F, -4.0F, 20, 7, 0, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 0, 0, -7.7F, 3.0F, -4.0F, 7, 20, 0, 0.0F, false)); } @Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { bone.render(f5); } public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; } } If any of you guys could tell me what needs to be changed, or have a link so I can read up on Models in 1.14 (I've looked through the forge docs, maybe I overlooked it but I couldn't see anything regarding .java models) or a link to a working example or tutorial, I'd greatly appreciate that. Thanks!
  2. Hey! Just wanted to ask, did you find a solution? If so, could you tell me what the problem was, and did you use a tutorial or research yourself on how custom structures work? I want to try to make my own structure, but wasn't able to find a good tutorial on how to do it yet
  3. Thanks a lot! I think I confused what you meant with Texturemaps, sorry. I just pushed all my changes. I still get a block with no textures though. Do you maybe have an idea why it won't render correctly?
  4. Ah, thanks! So stuff like a chest or similar use Texturemaps? And, do you know how the rotation method works?
  5. Hey there again I'm now in the process of trying to get my Entity to render correctly and had a few question regarding the classes you sent. So, I saw that the GlStateManager has a rotate() mehod, and I need my Model to be turned so that the blade will be horizontal to the player. Furthermore, you get an ItemStack from your Dagger which appears really complicated to me. I tried to get it to work by simply creating the class and registering it in my ModItems and ItemRegistry Class. I was able to replace the green square by a block with no textures that rotates weirdly when shot. So in order to maybe get the block to work, I replaced the TextureMap.LOCATION_BLOCKS_TEXTURE with the path to my textures, but the only thing that changed is that the block now has complete black textures instead of just the "missing textures" texture. What does the TextureMap actually do, and how can I get the Renderer to render my custom model?
  6. Sorry for the wait, I wasn't at home. I tried to replicate the issue https://imgur.com/JTOstpO I hope you can see it here in the gif. When shooting through the wall, most of the times it (seems to) split up into two entities, I don't know though if this description is accurate. But when simply shooting in any direction, it looks like there's only one. EDIT: Just to clarify, I haven't changed any of the code since the last push.
  7. Ah, okay. Either way, quite interesting, I think Okay, so I followed your advice and it works a lot better now, although on every click, it spawns two entities at once now which seem to lay perfectly on each other. I experimented a little bit and when shooting through a wall, those two entities seem to change their direction a little, so you can actually see that it spawns twice everytime. I pushed my changes. Any idea why it get's spawned twice?
  8. Thanks a bunch! I'm gonna check that out right now. By the way, do you have an idea why exactly the Projectile kept following the Players cursor? I'm curious ?
  9. Alrighty. So I finally arrived home and started working on it and I see the following problem. I tried setting some fixed values for the motion variables. This stopped the Entity from following my mouse, but now it always shoots in the same direction, no matter which way I'm facing. I suppose that, for what ever reason, the onUpdate method keeps getting the way the player is facing and updating the motion factors accordingly. I have absolutely no idea how and why this works. But I did manage to let the Entity despawn by making an int that counts 1 up for every time the onUpdate method get's called. If the counter reaches 100, it despawns (and this should be approx. 100 blocks) I also fixed the problem that it slowed down and just stood still by deleting the part where the motion get's multiplied by the motionFactor. Do you maybe have any idea how I can stop the entity from "chasing the cursor"? I also noticed that, when the motion variables are not fixed, the Entity won't spawn until I hit a second time, and when I do it spawns two of them right after each other. When having the motion variables fixed, clicking twice with almost no delay makes the second Entity bounce off the first and change direction. Any ideas? EDIT: I just noticed that the Entity stops following the cursor when you turn really fast EDIT 2: I managed to stop the Entity from following the cursor by setting the RayTracerResult only in the constructor and making a private variable to it, so no new RayTracerResult gets created every onUpdate, however, I noticed why you need to click 2 times before it starts flying. The first one apparently get's spawned right were you stand and every Entity that spawns after that collides with the first one and get's shot of in the direction you're looking. If you move fast while clicking, you will have many entities just floating around.
  10. No no no, I don't want to make a magic missile. I want to do something like this. I don't know how or why it works like that, but it does and I have no idea on how to fix it. So, basically I want this sword to spawn one of those green swords in the gif as entity that shoots out until it has either traveled 100 blocks OR hit 3 enemies. It should move approx. like a fireball, but with more accuracy. So, you shoot it and it shoots exactly in the direction you're looking at. It doesn't drop down, go up or anyone else, just travels into the direction you looked at when firing it with the same speed and everything, until it should be declared dead.
  11. Thanks a lot! I'll check it out as soon as possible. Right now, I changed the Entity to be extending EntityThrowable, which gave me some funny results. https://imgur.com/a/USerdh4 As you can see in the gif, the block now gets... ...somewhat rendered? And seems to behave like a fireball (which might be because I took the code from the RenderEntityFireball class, but I'm not sure anymore) I always need to doubleclick for it to shoot, altough shooting only once does the job too, but only sometimes, which is quite confusing. Also, after shooting, while moving it behaves somewhat like a "magic missile" and follows the cursor, but stops after maybe 3-4 seconds of flying. I think this is probably due to EntityThrowable not having acceleration, so I had to cut a lot of code pieces out. Also, the entitys have no collisions and just disappear in the underground BUT they can push each other, when you shoot them at each other after they stopped and float in the sky. I don't even know where to begin first to fix all of this.
×
×
  • Create New...

Important Information

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