当前位置: 首页>>代码示例>>Java>>正文


Java ObjectIntIdentityMap类代码示例

本文整理汇总了Java中net.minecraft.util.ObjectIntIdentityMap的典型用法代码示例。如果您正苦于以下问题:Java ObjectIntIdentityMap类的具体用法?Java ObjectIntIdentityMap怎么用?Java ObjectIntIdentityMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ObjectIntIdentityMap类属于net.minecraft.util包,在下文中一共展示了ObjectIntIdentityMap类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: set

import net.minecraft.util.ObjectIntIdentityMap; //导入依赖的package包/类
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);
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:22,代码来源:FMLControlledNamespacedRegistry.java

示例2: set

import net.minecraft.util.ObjectIntIdentityMap; //导入依赖的package包/类
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);
    }
}
 
开发者ID:alexandrage,项目名称:CauldronGit,代码行数:19,代码来源:FMLControlledNamespacedRegistry.java

示例3: overwrite_do

import net.minecraft.util.ObjectIntIdentityMap; //导入依赖的package包/类
@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);
}
 
开发者ID:Katalliaan,项目名称:Rubedo,代码行数:17,代码来源:RemapHelper.java

示例4: loadChunk

import net.minecraft.util.ObjectIntIdentityMap; //导入依赖的package包/类
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);
}
 
开发者ID:18107,项目名称:MC-Ray-Tracer,代码行数:37,代码来源:WorldLoader.java

示例5: replaceItem

import net.minecraft.util.ObjectIntIdentityMap; //导入依赖的package包/类
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);
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:10,代码来源:GameDataManipulator.java

示例6: BasicPalette

import net.minecraft.util.ObjectIntIdentityMap; //导入依赖的package包/类
private BasicPalette()
{
    this.ids = new ObjectIntIdentityMap<IBlockState>(16);
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:5,代码来源:HarshenTemplate.java

示例7: BasicPalette

import net.minecraft.util.ObjectIntIdentityMap; //导入依赖的package包/类
private BasicPalette()
{
    this.ids = new ObjectIntIdentityMap(16);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:Template.java

示例8: getBlockStateIDMap

import net.minecraft.util.ObjectIntIdentityMap; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static ObjectIntIdentityMap<IBlockState> getBlockStateIDMap()
{
    return (ObjectIntIdentityMap<IBlockState>)getMain().iBlockRegistry.getSlaveMap(BLOCKSTATE_TO_ID, ObjectIntIdentityMap.class);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:6,代码来源:GameData.java


注:本文中的net.minecraft.util.ObjectIntIdentityMap类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。