Java 类net.minecraft.util.ObjectIntIdentityMap 实例源码
项目:TRHS_Club_Mod_2016
文件:FMLControlledNamespacedRegistry.java
void set(FMLControlledNamespacedRegistry<I> registry)
{
if (this.superType != registry.superType) throw new IllegalArgumentException("incompatible registry");
this.discriminator = registry.discriminator;
this.optionalDefaultName = registry.optionalDefaultName;
this.maxId = registry.maxId;
this.minId = registry.minId;
this.aliases.clear();
this.aliases.putAll(registry.aliases);
this.activeSubstitutions.clear();
field_148759_a = new ObjectIntIdentityMap();
field_82596_a.clear();
for (I thing : registry.typeSafeIterable())
{
addObjectRaw(registry.getId(thing), registry.func_148750_c(thing), thing);
}
this.activeSubstitutions.putAll(registry.activeSubstitutions);
}
项目:CauldronGit
文件:FMLControlledNamespacedRegistry.java
void set(FMLControlledNamespacedRegistry<I> registry)
{
if (this.superType != registry.superType) throw new IllegalArgumentException("incompatible registry");
this.discriminator = registry.discriminator;
this.optionalDefaultName = registry.optionalDefaultName;
this.maxId = registry.maxId;
this.minId = registry.minId;
this.aliases.clear();
this.aliases.putAll(registry.aliases);
underlyingIntegerMap = new ObjectIntIdentityMap();
registryObjects.clear();
for (I thing : registry.typeSafeIterable())
{
addObjectRaw(registry.getId(thing), registry.getNameForObject(thing), thing);
}
}
项目:Cauldron
文件:FMLControlledNamespacedRegistry.java
void set(FMLControlledNamespacedRegistry<I> registry)
{
if (this.superType != registry.superType) throw new IllegalArgumentException("incompatible registry");
this.discriminator = registry.discriminator;
this.optionalDefaultName = registry.optionalDefaultName;
this.maxId = registry.maxId;
this.minId = registry.minId;
this.aliases.clear();
this.aliases.putAll(registry.aliases);
underlyingIntegerMap = new ObjectIntIdentityMap();
registryObjects.clear();
for (I thing : registry.typeSafeIterable())
{
addObjectRaw(registry.getId(thing), registry.getNameForObject(thing), thing);
}
}
项目:Cauldron
文件:FMLControlledNamespacedRegistry.java
void set(FMLControlledNamespacedRegistry<I> registry)
{
if (this.superType != registry.superType) throw new IllegalArgumentException("incompatible registry");
this.discriminator = registry.discriminator;
this.optionalDefaultName = registry.optionalDefaultName;
this.maxId = registry.maxId;
this.minId = registry.minId;
this.aliases.clear();
this.aliases.putAll(registry.aliases);
underlyingIntegerMap = new ObjectIntIdentityMap();
registryObjects.clear();
for (I thing : registry.typeSafeIterable())
{
addObjectRaw(registry.getId(thing), registry.getNameForObject(thing), thing);
}
}
项目:Cauldron
文件:FMLControlledNamespacedRegistry.java
void set(FMLControlledNamespacedRegistry<I> registry)
{
if (this.superType != registry.superType) throw new IllegalArgumentException("incompatible registry");
this.discriminator = registry.discriminator;
this.optionalDefaultName = registry.optionalDefaultName;
this.maxId = registry.maxId;
this.minId = registry.minId;
this.aliases.clear();
this.aliases.putAll(registry.aliases);
underlyingIntegerMap = new ObjectIntIdentityMap();
registryObjects.clear();
for (I thing : registry.typeSafeIterable())
{
addObjectRaw(registry.getId(thing), registry.getNameForObject(thing), thing);
}
}
项目:Rubedo
文件:RemapHelper.java
@SuppressWarnings({ "rawtypes", "unchecked" })
private static void overwrite_do(RegistryNamespaced registry,
String name, Object object, Object oldThing) {
int id = registry.getIDForObject(oldThing);
BiMap map = (BiMap) ReflectionHelper.getField(registry,
"registryObjects");
ObjectIntIdentityMap underlyingIntegerMap = (ObjectIntIdentityMap) ReflectionHelper
.getField(registry, "underlyingIntegerMap");
underlyingIntegerMap.func_148746_a(object, id);
map.remove(name);
map.forcePut(name, object);
}
项目:MC-Ray-Tracer
文件:WorldLoader.java
private void loadChunk(int id, Shader shader, ExtendedBlockStorage storage) {
ObjectIntIdentityMap<IBlockState> map = GameData.getBlockStateIDMap();
int[] data = new int[chunkSize*2];
for (int y = 0; y < 16; y++) {
for (int z = 0; z < 16; z++) {
for (int x = 0; x < 16; x++) {
IBlockState state = storage.get(x, y, z);
boolean fullBlock = state.isFullBlock();
boolean cube = state.isFullCube();
if (fullBlock != cube) {
Log.info(state.getBlock().getUnlocalizedName() + ": " + fullBlock);
}
if (fullBlock) {
stateSet.add(state);
}
int stateId = map.get(state); //TODO
data[(y<<9) + (z<<5) + (x<<1)] = Block.getIdFromBlock(storage.get(x, y, z).getBlock());
}
}
}
for (int y = 0; y < 16; y++) {
for (int z = 0; z < 16; z++) {
for (int x = 0; x < 16; x++) {
data[(y<<9) + (z<<5) + (x<<1) + 1] = storage.getBlocklightArray().get(x, y, z);
}
}
}
IntBuffer buffer = BufferUtils.createIntBuffer(chunkSize*2);
buffer.put(data);
buffer.flip();
GL15.glBindBuffer(GL43.GL_SHADER_STORAGE_BUFFER, shader.getChunkSsbo());
GL15.glBufferSubData(GL43.GL_SHADER_STORAGE_BUFFER, (id-1)*chunkSize*2*4, buffer);
GL15.glBindBuffer(GL43.GL_SHADER_STORAGE_BUFFER, 0);
}
项目:4Space-5
文件:GameDataManipulator.java
public static void replaceItem(int id, Item item) {
try {
String name = Item.itemRegistry.getNameForObject(Item.getItemById(id));
((Map)f_registryObjects.get(Item.itemRegistry)).put(name, item);
((ObjectIntIdentityMap)f_underlyingIntegerMap.get(Item.itemRegistry)).func_148746_a(item, id);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
项目:harshencastle
文件:HarshenTemplate.java
private BasicPalette()
{
this.ids = new ObjectIntIdentityMap<IBlockState>(16);
}
项目:Backmemed
文件:Template.java
private BasicPalette()
{
this.ids = new ObjectIntIdentityMap(16);
}
项目:CustomWorldGen
文件:GameData.java
@SuppressWarnings("unchecked")
public static ObjectIntIdentityMap<IBlockState> getBlockStateIDMap()
{
return (ObjectIntIdentityMap<IBlockState>)getMain().iBlockRegistry.getSlaveMap(BLOCKSTATE_TO_ID, ObjectIntIdentityMap.class);
}
项目:CustomWorldGen
文件:Template.java
private BasicPalette()
{
this.ids = new ObjectIntIdentityMap(16);
}