MixinIntIdentityHashBiMap.java
1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* This file is part of LiteLoader.
* Copyright (C) 2012-16 Adam Mummery-Smith
* All Rights Reserved.
*/
package com.mumfrey.liteloader.client.mixin;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import com.mumfrey.liteloader.client.ducks.IIntIdentityHashBiMap;
import net.minecraft.util.IntIdentityHashBiMap;
@Mixin(IntIdentityHashBiMap.class)
public abstract class MixinIntIdentityHashBiMap<V> implements IIntIdentityHashBiMap<V>
{
@Shadow private V[] objectArray;
@Shadow private int[] intKeys;
@Shadow private V[] intToObjects;
@Shadow private int field_186821_e;
@Shadow private int mapSize;
@Shadow private int func_186816_b(V object, int hash)
{
return -1;
}
@Shadow private int hashObject(V object)
{
return -1;
}
@Override
public void removeObject(V object)
{
int index = this.func_186816_b(object, this.hashObject(object));
int intKey = this.intKeys[index];
this.objectArray[index] = null;
this.intKeys[index] = 0;
this.intToObjects[intKey] = null;
}
}