Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by jabelar

  1. The event is probably technically working, but I suspect that most rendering code overwrites whatever you do there. The rendering events are good for ADDING something else to be rendered, or fully replacing what is rendered, but not really good for changing what is rendered. It is actually usually good practice for any rendering code to sort of "reset" some of the GL stuff to a known state, exactly so other code running before it can't mess it up. Now Minecraft code is quite inconsistent so you might get lucky and find some places where a judiciously placed alpha chang
  2. Your IDE should allow you to see all fields and methods for a class. In Eclipse it is called the Type Hierarchy. Just right-click on the class in the project hierarchy pane and select Type Hierarchy. There are a couple of "buttons" that affect the filtering of the view, I like to show everything including the inherited methods. That is a better way to scan for available methods than simply scrolling through class files themselves. In modding it is especially useful to look at the Type Hierarchy because you can actually get a lot of ideas for modding after you see some o
  3. Yes it is a common problem in client-server games. Ideally all "game truth" is enforced by the server but in order to get smooth movement and minimize network traffic the client usually processes the immediate movement with the server just sampling it to check the validity. But the problem then is how much "tolerance" the server has in this verification. The server can and does rule out impossible movement but what about the fringes of what is possible? As an ethical mod maker you can add a barrier to using it for cheating yourself by making your mod require that it also be loaded
  4. Well, the ScorePlayerTeam class has the getAllowFriendlyFire() method.
  5. The entity bounding boxes need to have the same length and width (i.e. square base). I believe this is to simplify path-finding. Similarly note that the bounding box never rotates even when the model does, so it wouldn't be that helpful even if you could specify different values. EDIT: Also the setEntityBoundingBox() method set's the actual box in the world meaning the values of the box would be related to the entity position. If the size was 2.0 wide and the entity is at x position of 300 then the bounding box would go from 299 to 301. You shouldn't ever use the setEnt
  6. I don't think your code will move them in a circle. It might spawn them in a circle, although the code for that looks a little weird for that too. Let's go through you update() method in the hastebin link. The first important thing is -- where is this update code? If you want to move the particles it would need to be in the particle class, but I kind of suspect you have it somewhere else like in an entity. So your first mistake is that your code isn't moving the particles, it is just spawning them constantly. It might also be possible to used particles in f
  7. The issue is that the term "entity" usually implies a number of things (such as registration) and functionality (like AI) that is expected to also be run on the server. ESPECIALLY note that if you want to do the following then the server MUST be involved: Syncing across multiple clients so that all players can see the entity. Saving so that the entity persists across saves. There are cases though where it can make sense for an entity that exists only for each play on the client side. In that case I think your best bet for client-side "entity" behavior is to create y
  8. Well you set the default state to have the check decay and decayable as false.
  9. I have some tutorial information on custom villagers, which also discusses trades a bit. http://jabelarminecraft.blogspot.com/p/minecraft-forge-modding-villagers.html
  10. For your original question, yes the approach of having a simple "queue" for scheduling things should work. The actual mechanics of the queue can be coded in different ways depending on how many things and how far in time you want to queue things. Unless there is a performance concern due to having a huge number of scheduled events, almost any sort of collection can be used that you cycle through. One detail is that if you're doing this for worlds that might be saved, you'll probably want the time to continue when the world is loaded again. In that case, you should also save the que
  11. I think so. I think maybe you can maybe you can handle the RenderHandEvent or the RenderSpecificHandEvent. You might also want to rotate the original model. Note that it (in order to be more gun-like) may be more important to control the rotation of the whole hand.
  12. Okay, that makes more sense. I'm wondering if there is a more efficient way to do the "rebuilding" then. Let me see what that is doing -- if it could be targeted to just the light map updating part that shouldn't really bog things down.
  13. I'm fairly aware of how all that works. However, I always thought the lighting recalculation was a fairly localized thing. In fact I optimized a massive structure generator by making my own set block method which didn't update the lighting until the end and only did so in a few specific locations rather than recursively throughout the whole structure. The weird thing that is new to me (and hence my question) is why it shows literally 50 chunk updates in conjunction with this placement. I could see why the current chunk might update (actual block placement plus lighting updates) and
  14. So I've got a mod that is fairly popular which allows moving lights. But some people have complained about frame rate drop when moving with a light source. However, the general idea is quite simple -- I'm just placing an invisible block with tile entity that has a light level. The tile entity takes care of things like removing the block if the light source moves away. At any given time there is only a couple blocks at most per light source. But if you're moving then a block gets added and old one gets deleted as you move from one position to the next. Anyway, it really shouldn't ca
  15. Basically, the "payload" you put into an IMessage is up to you. It is just a series of bytes that represents something. As long as you take the bytes out in the same order as you put them in then you have successfully transmitted the data. So then it depends on how complicated the object is. If it contains collections of other objects it could get pretty complicated, but still doable if you just take your time to think about the order things get written to the buffer. If your object has simple fields then it is super easy -- just add them to the buffer and read them back in the sam
  16. Okay, I stand corrected about single player mode. There are things like inventory and capabilities that persist, but modded things like tameable entity ownership can have trouble. I always test in dedicated server mode -- I highly recommend most modders should do this to avoid all those "side-only" problems people invariably run into. As you mentioned, in the dedicated server (i.e. multiplayer) mode, each new run of a client that connects will cause inventory and capabilities to disappear affecting continuity of your testing unless you force the login. In both cases, it
  17. I don't think you understand the problem. If you don't set the run configuration, every time you run in single player you will be a new player (Player123, etc.). If you have anything in your mod that depends on this, (usually things that "remember the player" like tamed animals and such) -- for example I have tile entities which keep track of which player placed them, then anything you do in one game session will not persist in the next. Technically, the game DOES save in the dat for the previous player, but you can't really access that because you can't log in as that player again
  18. You mean when you run it from Eclipse, right? All you need to do is make sure your Run Configuration includes the program arguments for your username and password. It is a good tip to specify this because many times when modding you want continuity between test runs (like having same things in inventory, or having certain Capability values retained.)
  19. Well there are some methods related to attacking in the entity, but those are for dealing the damage and only happen on the exact tick of the attack (which also might be too late for the animation to start). Animations normally progress over several ticks. I think it might make sense to trigger it using the AI classes for your custom entity. However, the AI runs on the server (I'm pretty sure) and not the client where you want the animations. I guess I would probably have the AI trigger it. If you look at the EntityAIAttackMelee class you can see what I mean. In that class, in the
  20. There are actually a lot of different methods for playing sounds and they also have different behavior depending on whether they called on the server or client. Here is some official documentation to help sort it out: https://mcforge.readthedocs.io/en/latest/effects/sounds/#playing-sounds
  21. Yes, it is definitely possible but as my long "essay" above notes it is rarely worth it. 1.10 to 1.11 was a rare transition with very little big things changing between them. Most versions are much more drastic. But imagine going from a version before blockstates was introduced to afterwards -- you'd need to like replicate the whole system of one of the two approaches in order to make them compatible. Or imagine going from a version before capabilities to one afterwards, and so forth. So like I said before -- you can do it but only if you "pick your battles". If your mo
  22. Well, more accurately you can subscribe to anything that descends from Event class and is also posted on the main EVENT_BUS. There are actually events related to ore generation for example that are posted on a different bus and you have to register your listener differently because the annotation method of subscribing only works (as far as I know) for the main event bus.
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.