Jump to content

V0idWa1k3r

Members
  • Posts

    1773
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by V0idWa1k3r

  1. We would need at the very least the whole error report, not just one line that tells "something is wrong" but doesn't tell what exactly is. And since there are multiple errors you should just post your debug.log. Please make sure it is not cluttered with unrelevant issues though. I hope it is not directly in your preinit method but is called through your proxy during preinit.
  2. As you can see yourself these are static fields, meaning they are the same for all your buttons. Why are you setting a static field to a thing passed in a constructor? And that doesn't even matter because by the time your resourcelocation resolver code gets executed state is guaranteed to be 0. How well do you know java? drawTexturedModalRect expects a 256x256 texture, not a 16x16. You can use the overload which takes uv coordinates instead. Of course you would need to override GuiButton#drawButton for that to work. I don't think so. What's the problem though? How are these two things connected? There is a GuiScreen#drawDefaultBackground method which makes the background darker. You are not calling it.
  3. Wait for forge to come out first. Worst case scenario is you looking at the way the world data fixer works and writing a similar script that would convert your structure files. Yes they will, after being converted to a new format. There have been numerous format changes in the past, like the blockid -> registry name transition, or block+meta pair -> blockstate id transition and yet if you had an alpha world you would still be able to open it in the latest version of the game. This is likely due to flattening.
  4. Why? What's wrong with mojang's Vec3d? Or lwjgl's Vector3? You should not be reinventing the wheel. Unless you mean some other code instantinating an object that consists out of 3 primitives is nearly instant.
  5. Looks like your face normals are reversed for some faces. You will need to find those faces in your modeling software and reverse their normals.
  6. This to me implies that you want to get a texture of a block's breaking particles, not that you want to spawn the particle.
  7. The OP wants to spawn a particle that is a breaking particle of a block, I think(based on the provided code). Their title is confusing though. Edit: The last parameter is the blockstate ID if I recall correctly. I am unable to check this at the moment though.
  8. This thread is almost 6 years old. Don't necropost.
  9. Don't offset the boxes by the blockpos provided to you, the game will do that for you later. Apart from that your code should work, but here is an example of mine.
  10. How well do you know java? You are trying to invoke instance methods as if they were static and are passing wring parameters to them. If you don't know the basics of java you should learn it before trying to create a mod.
  11. 1.7.10 is no longer supported on this forum. Update to a modern version of minecraft to receive support.
  12. While that is true from what I can tell the server itself currently only keeps the english translation(or at least it exists within the server's jar, whether it actually collects the translation or not is something to debug). In general I assume that the best course of action is to not do translations on the server at all, since the deprecated I18n even at best would only perform the english translation. Return the unlocalized name for the client to translate on the server and perform the translation on the client. There is no need to use the deprecated class here, a proxy would suffice. It just seems like a logical way of approaching things to me.
  13. Be aware that the BufferBuilder is designed to uploads quads and assumes quads as the drawing primitive at some of it's methods. The methods for providing vertex data are safe to use ofcourse, but most of putX aren't.
  14. There is no "server version" because the server isn't aware of translations being a thing. Translation only happens on the client.
  15. I know this has been solved and this is irrelevant but https://en.wikipedia.org/wiki/Home_directory#Default_home_directory_per_operating_system The fact that you are using unix doesn't mean that you don't have a user home directory.
  16. That method applies the attribute modifiers of a given potion to the entity. No it doesn't. Reflection is a thing. As far as I know forge has no relevant hooks so your best bet is to store a collection of all currently active potion effects in a capability attached to the entity, then each tick compare your collection to the entity's. If some entries in the entity's collection are missing but are present in yours then the potion effect expired. If there are entries in the entity's collection but not in yours then the potion was added. After you are done update your collection to be even with the entity's.
  17. Why are you using trig? If you just want to pull items to a spot then motion is [blockPos - itemPos] / someNumber. Doesn't look like there is a way to do this.
  18. Hmm, that's true. I am not very familiar with it though and don't know how to animate items with it, especially if said items are multipart.
  19. Well I suppose in theory it is possible with a custom IBakedModel. In practice though you will be recalculating quads quite frequently and that may eat a lot of frames. I would use a TEISR here, even though it is technically possible without one. I mean, this would mean that the OP would need to recompute the quad list pretty much every frame of their animation. Or at least parts of it anyway. Potentially all of it if their gun also needs to move during the animation. It should be faster to fill in the rendering buffer with elements each frame than it is to have to recompute quads like this. In theory that is, if anyone has any metrics feel free to correct me here.
  20. Well, those kind of animations are simple changes of the model matrix over time. So yes, you should be able to do it using either IBakedModel#handlePerspective or by transforming quad position data on the fly. I would assume the former should work just fine. Edit: I am not sure whether the OP can do it with a custom IBakedModel or not because they have not specified whether they need to also render the player's arm, and I am assuming that they do want that. That is not possible with a IBakedModel
  21. %user_home%\.gradle\caches\minecraft\net\minecraftforge\forge\%version%\snapshot\%snapshot_date%
  22. Isn't that mod stuck in 1.7.10? I might be looking at a wrong mod though. Yes, and that's quite easy. I am not sure this is possible with IBakedModel without some hacky solutions. Why would you scale it up dynamically? There is no reason to do so. No, but you can use a custom IBakedModel and have a custom model matrix with IBakedModel#handlePerspective(or just transform the quads on the fly when you need to do so). However ultimately I am actually leaning for this being a TEISR use case. Please can you provide some more points of functionality for your gun? Are there part-independent animations? Dynamic textures? Custom shaders? Do you need to render the player's hand? How should your gun be transformed? Are there transformation animations? Are they independent for parts? Do you have parts like gun ammunition clips that may not be rendered at points in time? etc. In any case a basic JSON is out of the question here unfortunately. The question is - would a custom IBakedModel be sufficient or not.
  23. This happens because if the damage is 0 then EntityLivingBase#attackEntityFrom will return false which will cause the arrow to "bounce". You can have the exact same effect if you shoot the player in creative mode. You might be able to circumvent the issue by using a LivingHurtEvent(or LivingDamageEvent) in combination with ProjectileImpactEvent. Basically in the impact event do your arrow check and if it is supposed to have no damage set some kind of flag to true(somewhere in your code that is) and also store the entity reference of the entity being damaged(that's important)(you may store something to identify the entity by, like it's UUID instead of a direct reference). Next in the Hurt/Damage event check for the flag - if it's true check whether the entity being damaged is the one you've stored the reference to(it should be but there are edge cases where it may not be). If it isn't set the flag to false, clear the reference and return. If it is you have a jackpot - set the damage to 0, flag to false, clear reference and be done. Alternatively don't clear the reference, but store it as a UUID to not leak like half of the game. I've just tested this idea and it works flawlessly. Here is the code I've used. private static boolean checkImpact = false; private static UUID hurtID = null; @SubscribeEvent public static void onArrowDamage(ProjectileImpactEvent event) { checkImpact = false; if (event.getEntity() instanceof EntityArrow && event.getRayTraceResult() != null && event.getRayTraceResult().typeOfHit == RayTraceResult.Type.ENTITY) { checkImpact = true; hurtID = event.getRayTraceResult().entityHit.getUniqueID(); } } @SubscribeEvent public static void onHurt(LivingHurtEvent event) { if (checkImpact) { checkImpact = false; UUID id = event.getEntityLiving().getUniqueID(); if (id.equals(hurtID)) { event.setAmount(0); } hurtID = null; } } Now admitedly you shouldn't have to store the entity reference, since the code flow should take you directly to the LivingHurtEvent from the ProjectileImpactEvent(in this case) but you never know with all the forge re-implementations around like them spigots and stuff. Since I can't guarantee the code flow within those implementations it's better to be sure.
  24. Forge's PermissionAPI is pretty basic, it only allows a framework for others to build upon. The PermissionAPI has a IPermissionHandler object it reroutes things to. The handler is the object that decides what to do. By default forge uses a DefaultPermissionHandler as it's handler. It's implementation allows all players for permission level of ALL, denies all players for a level of NONE and if the level isn't either of those it simply checks whether the player can send commands or not. As you can see the default implementation doesn't allow you to have permission levels per player per se - it just checks whether the player is allowed to use commands or not. You need to find an API that actually expands upon forge's permission API.
×
×
  • Create New...

Important Information

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