Advertisement
bobmarley12345

Disable minecraft 1.6.4 VecPool for world, when using Vec3-intensive functions (unnessesary pooling)

May 25th, 2022
833
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1. // completel untested lolol
  2. // should work
  3.  
  4. // storing world as a key is alright, as long as the vec pools are disable and enabled correctly
  5. private static final TObjectIntHashMap<World> disabledVecPools = new TObjectIntHashMap<World>(64, 0.75f, -1);
  6.  
  7. public static void disableVecPool(World world) {
  8.     if (disabledVecPools.containsKey(world)) {
  9.         return;
  10.     }
  11.     disabledVecPools.put(world, world.func_82732_R().field_72346_f);
  12.     world.func_82732_R().field_72346_f = 0;
  13. }
  14. public static void enableVecPool(World world) {
  15.     if (disabledVecPools.containsKey(world)) {
  16.         world.func_82732_R().field_72346_f = disabledVecPools.remove(world);
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement