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


Java ReflectionManager类代码示例

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


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

示例1: forgeShapedRecipe

import codechicken.core.ReflectionManager; //导入依赖的package包/类
public CachedShapedRecipe forgeShapedRecipe(ShapedOreRecipe recipe) {
    int width;
    int height;
    try {
        width = ReflectionManager.getField(ShapedOreRecipe.class, Integer.class, recipe, 4);
        height = ReflectionManager.getField(ShapedOreRecipe.class, Integer.class, recipe, 5);
    } catch (Exception e) {
        NEIClientConfig.logger.error("Error loading recipe", e);
        return null;
    }

    Object[] items = recipe.getInput();
    for (Object item : items)
        if (item instanceof List && ((List<?>) item).isEmpty())//ore handler, no ores
            return null;

    return new CachedShapedRecipe(width, height, items, recipe.getRecipeOutput());
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:19,代码来源:ShapedRecipeHandler.java

示例2: init

import codechicken.core.ReflectionManager; //导入依赖的package包/类
public static void init()
{
    replaceWater = TweakTransformer.tweaks.getTag("replaceWaterFX").setComment("Set this to true to use the pre1.5 water textures").getBooleanValue(false);
    replaceLava = TweakTransformer.tweaks.getTag("replaceLavaFX").setComment("Set this to true to use the pre1.5 lava textures").getBooleanValue(false);
    if(replaceWater)
    {
        newTextures[0] = new TextureWaterFX().texture;
        newTextures[1] = new TextureWaterFlowFX().texture;
    }
    if(replaceLava)
    {
        newTextures[2] = new TextureLavaFX().texture;
        newTextures[3] = new TextureLavaFlowFX().texture;
    }
    
    if(replaceWater || replaceLava)
    {
        MinecraftForge.EVENT_BUS.register(new LiquidTextures());
        field_tex = ReflectionManager.getField(new ObfMapping("net/minecraft/block/BlockLiquid", "field_149806_a", "[Lnet/minecraft/util/IIcon;"));
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:22,代码来源:LiquidTextures.java

示例3: postStitch

import codechicken.core.ReflectionManager; //导入依赖的package包/类
@SubscribeEvent
public void postStitch(TextureStitchEvent.Post event)
{
    IIcon[] icons;
    if(replaceLava)
    {
        icons = ReflectionManager.get(field_tex, IIcon[].class, Blocks.flowing_lava);
        icons[0] = newTextures[2];
        icons[1] = newTextures[3];
        icons = ReflectionManager.get(field_tex, IIcon[].class, Blocks.lava);
        icons[0] = newTextures[2];
        icons[1] = newTextures[3];
    }
    if(replaceWater)
    {
        icons = ReflectionManager.get(field_tex, IIcon[].class, Blocks.flowing_water);
        icons[0] = newTextures[0];
        icons[1] = newTextures[1];
        icons = ReflectionManager.get(field_tex, IIcon[].class, Blocks.water);
        icons[0] = newTextures[0];
        icons[1] = newTextures[1];
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:24,代码来源:LiquidTextures.java

示例4: getCachedOreRecipe

import codechicken.core.ReflectionManager; //导入依赖的package包/类
private CachedRollingMachineShapedRecipe getCachedOreRecipe(ShapedOreRecipe recipe, boolean genPerms) {
    int width;
    int height;
    try {
        width = ReflectionManager.getField(ShapedOreRecipe.class, Integer.class, recipe, 4);
        height = ReflectionManager.getField(ShapedOreRecipe.class, Integer.class, recipe, 5);
    } catch (Exception e) {
        return null;
    }
    
    Object[] items = recipe.getInput();
    for (Object item : items) {
        if (item instanceof List && ((List<?>) item).isEmpty()) {
            return null;
        }
    }
    
    return new CachedRollingMachineShapedRecipe(width, height, items, recipe.getRecipeOutput(), genPerms);
}
 
开发者ID:Tonius,项目名称:NEI-Integration,代码行数:20,代码来源:RecipeHandlerRollingMachineShaped.java

示例5: getRandomUnsmelteryResult

import codechicken.core.ReflectionManager; //导入依赖的package包/类
public static ItemStack getRandomUnsmelteryResult(ItemStack stack) {
	ItemStack ret = null;
	try {
		ret = ReflectionManager.callMethod(LOTRTileEntityUnsmeltery.class, ItemStack.class, unsmelteryTileEntity,
				"getRandomUnsmeltingResult");
	} catch (Exception e) {
		NeiLotr.mod.getLogger().error("Could not invoke getRandomUnsmeltingResult via reflection", e);
	}
	return ret;
}
 
开发者ID:CraftedMods,项目名称:nei-lotr,代码行数:11,代码来源:NeiLotrReflection.java

示例6: getEquipmentMaterial

import codechicken.core.ReflectionManager; //导入依赖的package包/类
public static ItemStack getEquipmentMaterial(ItemStack stack) {
	ItemStack ret = null;
	try {
		ret = ReflectionManager.callMethod(LOTRTileEntityUnsmeltery.class, ItemStack.class, "getEquipmentMaterial",
				stack);
	} catch (Exception e) {
		NeiLotr.mod.getLogger().error("Could not invoke static method getEquipmentMaterial via reflection", e);
	}
	return ret;
}
 
开发者ID:CraftedMods,项目名称:nei-lotr,代码行数:11,代码来源:NeiLotrReflection.java


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