-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hack minecraft to be happy with more tile entities
- Loading branch information
Showing
3 changed files
with
152 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
package cam72cam.mod.util; | ||
|
||
import java.util.*; | ||
|
||
public class FastContainsList<T> implements List<T> { | ||
|
||
private List<T> list; | ||
private Set<T> set; | ||
|
||
public FastContainsList(List<T> list, Set<T> set) { | ||
this.list = list; | ||
this.set = set; | ||
} | ||
|
||
@Override | ||
public int size() { | ||
return list.size(); | ||
} | ||
|
||
@Override | ||
public boolean isEmpty() { | ||
return list.isEmpty(); | ||
} | ||
|
||
@Override | ||
public boolean contains(Object o) { | ||
return set.contains(o); | ||
} | ||
|
||
@Override | ||
public Iterator<T> iterator() { | ||
return list.iterator(); | ||
} | ||
|
||
@Override | ||
public Object[] toArray() { | ||
return list.toArray(); | ||
} | ||
|
||
@Override | ||
public <T1> T1[] toArray(T1[] a) { | ||
return list.toArray(a); | ||
} | ||
|
||
@Override | ||
public boolean add(T t) { | ||
set.add(t); | ||
return list.add(t); | ||
} | ||
|
||
@Override | ||
public boolean remove(Object o) { | ||
set.remove(o); | ||
return list.remove(o); | ||
} | ||
|
||
@Override | ||
public boolean containsAll(Collection<?> c) { | ||
return set.containsAll(c); | ||
} | ||
|
||
@Override | ||
public boolean addAll(Collection<? extends T> c) { | ||
set.addAll(c); | ||
return list.addAll(c); | ||
} | ||
|
||
@Override | ||
public boolean addAll(int index, Collection<? extends T> c) { | ||
set.addAll(c); | ||
return list.addAll(index, c); | ||
} | ||
|
||
@Override | ||
public boolean removeAll(Collection<?> c) { | ||
set.removeAll(c); | ||
return list.removeAll(c); | ||
} | ||
|
||
@Override | ||
public boolean retainAll(Collection<?> c) { | ||
set.retainAll(c); | ||
return list.retainAll(c); | ||
} | ||
|
||
@Override | ||
public void clear() { | ||
set.clear(); | ||
list.clear(); | ||
} | ||
|
||
@Override | ||
public T get(int index) { | ||
return list.get(index); | ||
} | ||
|
||
@Override | ||
public T set(int index, T element) { | ||
T found = list.set(index, element); | ||
if (found != null) { | ||
set.remove(found); | ||
set.add(element); | ||
} | ||
return found; | ||
} | ||
|
||
@Override | ||
public void add(int index, T element) { | ||
set.add(element); | ||
list.add(index, element); | ||
} | ||
|
||
@Override | ||
public T remove(int index) { | ||
T found = list.remove(index); | ||
set.remove(found); | ||
return found; | ||
} | ||
|
||
@Override | ||
public int indexOf(Object o) { | ||
return list.indexOf(o); | ||
} | ||
|
||
@Override | ||
public int lastIndexOf(Object o) { | ||
return list.lastIndexOf(o); | ||
} | ||
|
||
@Override | ||
public ListIterator<T> listIterator() { | ||
return list.listIterator(); | ||
} | ||
|
||
@Override | ||
public ListIterator<T> listIterator(int index) { | ||
return list.listIterator(index); | ||
} | ||
|
||
@Override | ||
public List<T> subList(int fromIndex, int toIndex) { | ||
return list.subList(fromIndex, toIndex); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
public net.minecraft.client.audio.SoundHandler field_147694_f # sndManager | ||
public net.minecraft.client.audio.SoundManager field_148629_h # playingSounds | ||
public net.minecraft.client.resources.FolderResourcePack func_191385_d(Ljava/lang/String;)Ljava/io/File; # getFile | ||
public net.minecraft.client.Minecraft field_110449_ao # defaultResourcePacks | ||
public net.minecraft.client.Minecraft field_110449_ao # defaultResourcePacks | ||
public-f net.minecraft.world.World field_147482_g # loadedTileEntityList |