Jump to content

UberAffe

Forge Modder
  • Posts

    316
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed

Recent Profile Visitors

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

UberAffe's Achievements

Diamond Finder

Diamond Finder (5/8)

27

Reputation

  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)
×
×
  • Create New...

Important Information

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