Jump to content

UberAffe

Forge Modder
  • Posts

    316
  • Joined

  • Last visited

Everything posted by UberAffe

  1. As for when to fire it also happens to work out that if you have a counter like this count = 0; if(count == 0 || count == 2) //fire bullet count = (count + 1)%3; it will fire 13 bullets every second as long as they are shooting.
  2. I still recommend setting up something like I mentioned where the bullets are tracked in code and only do raytraces on the distance they would have traveled in 1 tick as an entity. If you find that you there are too many checks happening per tick and the game slows down you can split up the bullets into multiple queues and only update/check 1 queue per tick. You could probably get away with updating a bullet once every 4 ticks without it looking laggy
  3. I guess I didn't specifically mention particles but I assumed they would be used to handle any rendering since there wouldn't be entities in my method.
  4. there are 20 ticks per second ... 1 bullet per tick is 1200 bullets per minute
  5. do your really need guns that shoot faster than 1200 bpm, there are very few hand held guns that fire faster 1000. If you do plan on making your guns shoot that fast or faster I recommend you not use actual entities. 10 people firing at the same time for 1 second would spawn 200+ entities. I would recommend that you make a handler class that implements ITickable and then have each bullet get added to a list for updates. something like this: class Manager implements ITickable{ private static List<Bullet> bullets = new ArrayList<Bullet>(); public void shoot(Bullet b){bullets.add(b);} @Override (I don't recall the exact method name and params) public void onUpdate(){ List<Bullet> toRemove = new ArrayList<Bullet>(); for(Bullet b : bullets) { MovingObjectPosition result = customRayTrace((vec3d)b.travel(), b.currentLocation()); if(result hit entity) //do damage //add b to toRemove list else if(result hit block) //add b to toRemove list else b.updateLocation() } for(Bullet b : toRemove) bullets.remove(b); } } Edit: Entities are effectively using raytrace to detect collision anyways and they have a lot of overhead so if you are going to be making that many you should NOT use entities.
  6. actual NBTTagCompounds are Maps internally anyways. I don't know how much overhead it adds and I don't imagine it adds much but it does have more overhead.
  7. I was wrong about registering it, but I still don't understand why you wouldn't use a provider here. The process for attaching capabilities to all three types is identical. check if the instance has your capability already if not then e#addCapability(stringIdentifier, new Provider(new Capability()))
  8. You still need a provider to actually register your capability with forge.
  9. In my case I can't use #addInformation, I am adding information to any item that extends ItemSword.
  10. It makes sense after seeing it but before I knew where it was getting fired from it made more sense to look for it in an item package seeing as I want to change something specific to an item not a player.
  11. why is that under the player package and not item ... and yes this is what I was looking for, thank you.
  12. I haven't been able to find an example of changing a tooltip throughout the game. I know TiCon does this but I haven't been able to find where they handle it.
  13. If you models are already in json my process might be too granular for your needs, I am generating the quads from code.
  14. I have something similar to this mostly working but the process is somewhat convoluted. You can look at my code here. You can see most of it in common/draftcore/..., helpers/..., api/ I can try to come up with a path for you to follow to help you understand what is going on. Edit: this is more or less the path you can follow for looking through the code: *helpers/CommonProxy #preInit, #registerLuxin, #registerCores, #registerParts, #registerItems They lead to my registries in the API for other mods to use, a good practice is to use your own api's to accomplish create things. If something can't be done with your api then expand it so it can be done. *helpers/ClientProxy #init, you can see me registering my models here *client/itemrenderers/DraftableModelLoader you will want to use something like this *client/itemrenderers/DraftableModel yours should be similar to this *client/itemrenderers/DraftableBakedModel #Quads yours you should be able to almost copy from the default one *client/itemrenderers/DraftableOverrideList #handleItemState is where you can parse nbt info
  15. What it sounds like you want to do is something like this. BaseMod(includes ore gen and other basic things ChildMod(includes machines and requires BaseMod)
  16. If you already have the code in two places and it is working there is no reason to change it. It's really up to personal preference where you put the code.
  17. You do realize that you are specifying unicode as the style on line 19.
  18. When you hold an item in your hand right clicking on a block effectively overrides the items onActivated with the blocks onActivated when you are sneaking the items onActivated effectively overrides the blocks onActivated. So you want a sneak right click interaction you have to put that code in your items onActivated. BTW the method probably isn't actually call onActivated but I don't recall the actual name right now.
  19. Something to make note of if you run in to render issues. I had to remove my getType check for my bar to render properly. I tried with every ElementType and every single one of them made my bar render with the wrong colors. So start out using it but if you have issues keep in mind that you may have a similar problem.
  20. Unless you are physically simulating the pressing of the wasd keys you will probably want to handle this serverside.
  21. If the problem is that it isn't making the correct shape I believe it has to do with the order you specify the vertices. IIRC you have to specify them in counterclockwise order (could be clockwise)
  22. that is a lot of information for a single entity, like an absurd amount for a single entity. Are you sure everything that is being added to the packet is done correctly?
  23. don't forget that you have two options for "bullets" you can actually make an entity that travels through the world like the arrow does or you can just look at what is currently at the target location and damage it.
  24. you need to use a raytrace, I have only seen it client side but I'm sure it can be done server side also.
  25. damage from after the armor and enchantments or before?
×
×
  • Create New...

Important Information

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