當前位置: 首頁>>代碼示例>>Java>>正文


Java ObfuscationReflectionHelper.getPrivateValue方法代碼示例

本文整理匯總了Java中cpw.mods.fml.common.ObfuscationReflectionHelper.getPrivateValue方法的典型用法代碼示例。如果您正苦於以下問題:Java ObfuscationReflectionHelper.getPrivateValue方法的具體用法?Java ObfuscationReflectionHelper.getPrivateValue怎麽用?Java ObfuscationReflectionHelper.getPrivateValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在cpw.mods.fml.common.ObfuscationReflectionHelper的用法示例。


在下文中一共展示了ObfuscationReflectionHelper.getPrivateValue方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getBedrockImage

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
public static BufferedImage getBedrockImage() {
    if (TConTextureResourcePackBedrockium.bedrockImage == null) {
        final ResourceLocation bedrockLocation = new ResourceLocation("minecraft", "textures/blocks/bedrock.png");
        try {
            final DefaultResourcePack mcDefaultResourcePack = (DefaultResourcePack)ObfuscationReflectionHelper.getPrivateValue((Class)Minecraft.class, (Object)Minecraft.getMinecraft(), new String[] { "field_110450_ap", "mcDefaultResourcePack" });
            InputStream inputStream = mcDefaultResourcePack.getInputStream(bedrockLocation);
            final List<ResourcePackRepository.Entry> t = (List<ResourcePackRepository.Entry>)Minecraft.getMinecraft().getResourcePackRepository().getRepositoryEntries();
            for (final ResourcePackRepository.Entry entry : t) {
                final IResourcePack resourcePack = entry.getResourcePack();
                if (resourcePack.resourceExists(bedrockLocation)) {
                    inputStream = resourcePack.getInputStream(bedrockLocation);
                }
            }
            TConTextureResourcePackBedrockium.bedrockImage = ImageIO.read(inputStream);
        }
        catch (IOException e) {
            throw Throwables.propagate((Throwable)e);
        }
    }
    return TConTextureResourcePackBedrockium.bedrockImage;
}
 
開發者ID:sameer,項目名稱:ExtraUtilities,代碼行數:22,代碼來源:TConTextureResourcePackBedrockium.java

示例2: drawScreen

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
public void drawScreen(int mouseX, int mouseY, float partalTicks)
{
	super.drawScreen(mouseX, mouseY, partalTicks);
       List buttonList = ObfuscationReflectionHelper.getPrivateValue(GuiScreen.class, overriddenScreen, "buttonList", "field_146292_n");
       List labelList = ObfuscationReflectionHelper.getPrivateValue(GuiScreen.class, overriddenScreen, "labelList", "field_146293_o");
       int k1;

       for (k1 = 0; k1 < buttonList.size(); ++k1)
       {
       	((GuiButton)buttonList.get(k1)).drawButton(mc, mouseX, mouseY);
       }

       for (k1 = 0; k1 < labelList.size(); ++k1)
       {
       	((GuiLabel)labelList.get(k1)).func_146159_a(mc, mouseX, mouseY);
       }
}
 
開發者ID:Link1234Gamer,項目名稱:FiveNightsAtFreddysUniverseMod,代碼行數:18,代碼來源:GuiOverride.java

示例3: overwriteTutorialWorld

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
protected void overwriteTutorialWorld()
{
    Minecraft mc = Minecraft.getMinecraft();

    File mcDataDir = mc.mcDataDir;

    String folderName = ObfuscationReflectionHelper.getPrivateValue(BfsrRegenTutorialDimension.class, this, folderNameObfuscated);

    try
    {
        FileUtils.copyDirectory(new File(mcDataDir.getAbsoluteFile() + File.separator + templateName + File.separator + tutorialDimensionFolder),
                new File(mcDataDir.getAbsoluteFile() + File.separator + "saves" + File.separator + folderName + File.separator + tutorialDimensionFolder));
    }
    catch (IOException e)
    {
        FMLLog.info("The template world does not exist at " + templateName, e);
        return;
    }
}
 
開發者ID:rockobonaparte,項目名稱:bfsr,代碼行數:20,代碼來源:BfsrRegenTutorialDimension.java

示例4: getTesOffsets

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
private double[] getTesOffsets() {
  double[] off = new double[3];

  int count = 0;
  int xoff = 0;
  Field[] fields = Tessellator.class.getDeclaredFields();
  for (int i = 0; i < fields.length; i++) {
    if (fields[i].getType() == double.class) {
      count++;
      if (count == 3) {
        xoff = i - 2;
      }
    } else {
      count = 0;
    }
  }

  off[0] = ObfuscationReflectionHelper.getPrivateValue(Tessellator.class, Tessellator.instance, xoff);
  off[1] = ObfuscationReflectionHelper.getPrivateValue(Tessellator.class, Tessellator.instance, xoff + 1);
  off[2] = ObfuscationReflectionHelper.getPrivateValue(Tessellator.class, Tessellator.instance, xoff + 2);

  return off;
}
 
開發者ID:twothe,項目名稱:DaVincing,代碼行數:24,代碼來源:SculptureRenderCompiler.java

示例5: generateDescription

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
@Override
public String generateDescription() {
	if(this.description!=null) return this.description;
	
	description = getPrefix()+"!";
	int width = (Integer) ObfuscationReflectionHelper.getPrivateValue(ShapedRecipes.class, sr, 0);
	int height = (Integer) ObfuscationReflectionHelper.getPrivateValue(ShapedRecipes.class, sr, 1);
	ItemStack[] items = (ItemStack[]) ObfuscationReflectionHelper.getPrivateValue(ShapedRecipes.class, sr, 2);
	
	description += Formatter.getWHString(width, height);
	
	for (ItemStack is: items) {
		description += Formatter.getISDescription(is);
	}
	
	ItemStack result = sr.getRecipeOutput();
	description += "->" + Formatter.getISDescription(result);
	
	return this.description;
}
 
開發者ID:vitzli,項目名稱:recipedumper,代碼行數:21,代碼來源:ShapedRecipesModule.java

示例6: generateDescription

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
@Override
public String generateDescription() {
    if(description!=null) return description;
    description = getPrefix()+"!";
    int width =  (Integer) ObfuscationReflectionHelper.getPrivateValue(ShapedOreRecipe.class, sr, 4);
    int height = (Integer) ObfuscationReflectionHelper.getPrivateValue(ShapedOreRecipe.class, sr, 5);
    Object[] items = ObfuscationReflectionHelper.getPrivateValue(ShapedOreRecipe.class, sr, 3);
    
    description += Formatter.getWHString(width, height);
    
    for(Object o : items)
    {
        if(o == null) {
        	description += "(None)";
        } else if (o instanceof ItemStack) {
        	description+=Formatter.getISDescription((ItemStack) o);
        } else {
            description+=Formatter.getItemOreDescription(o);
        }
    }
    ItemStack result = sr.getRecipeOutput();
    description+="->"+Formatter.getISDescription(result);
    
    return description;
}
 
開發者ID:vitzli,項目名稱:recipedumper,代碼行數:26,代碼來源:ShapedOreModule.java

示例7: generateDescription

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
@Override
    public String generateDescription() {
        if(description!=null) return description;
        
        description = getPrefix()+"!";
        ArrayList items = ObfuscationReflectionHelper.getPrivateValue(ShapelessOreRecipe.class, sr, 1);
        for(Object o : items)
        {
            if(o instanceof ItemStack)
            {
	description += Formatter.getISDescription((ItemStack) o);
} else {
	description += Formatter.getItemOreDescription(o);
}                
        }
        ItemStack result = sr.getRecipeOutput();
        description+="->"+Formatter.getISDescription(result);
        
        return description;
    }
 
開發者ID:vitzli,項目名稱:recipedumper,代碼行數:21,代碼來源:ShapelessOreModule.java

示例8: getiResourcePacks

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
public List<IResourcePack> getiResourcePacks() {
    List<IResourcePack> packs1 = TConTextureResourcePackBase.packs;
    if (packs1 == null) {
        packs1 = (List<IResourcePack>)ObfuscationReflectionHelper.getPrivateValue((Class)FMLClientHandler.class, (Object)FMLClientHandler.instance(), new String[] { "resourcePackList" });
    }
    return packs1;
}
 
開發者ID:sameer,項目名稱:ExtraUtilities,代碼行數:8,代碼來源:TConTextureResourcePackBase.java

示例9: registerTileEntityWithAlternatives

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
/**
 * Register a tile entity, with alternative TileEntity identifiers. Use with caution!
 * This method allows for you to "rename" the 'id' of the tile entity.
 *
 * @param tileEntityClass The tileEntity class to register
 * @param id The primary ID, this will be the ID that the tileentity saves as
 * @param alternatives A list of alternative IDs that will also map to this class. These will never save, but they will load
 */
public static void registerTileEntityWithAlternatives(Class<? extends TileEntity> tileEntityClass, String id, String... alternatives)
{
    TileEntity.func_145826_a(tileEntityClass, id);
    Map<String,Class<?>> teMappings = ObfuscationReflectionHelper.getPrivateValue(TileEntity.class, null, "field_" + "145855_i", "nameToClassMap");
    for (String s: alternatives)
    {
        if (!teMappings.containsKey(s))
        {
            teMappings.put(s, tileEntityClass);
        }
    }
}
 
開發者ID:SchrodingersSpy,項目名稱:TRHS_Club_Mod_2016,代碼行數:21,代碼來源:GameRegistry.java

示例10: manipulateTradesForVillager

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
@Override
public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random rand) 
{
       Calendar calendar = Calendar.getInstance();

       if((calendar.get(2) + 1 == 10 && calendar.get(5) >= 28 && calendar.get(5) <= 31) || (calendar.get(2) + 1 == 11 && calendar.get(5) >= 1 && calendar.get(5) <= 2))
       {  
       	isHalloween = true;
   	}
       else
       {
       	isHalloween = false;
       }
	
       baseChance = ObfuscationReflectionHelper.<Float, EntityVillager>getPrivateValue(EntityVillager.class, villager, "field_82191_bN");
       if(!isHalloween)
       {
       	addTrade(recipeList, rand, 0.7F, new Offer(Items.bread, 2), new Offer(Items.emerald, 1));
       	addTrade(recipeList, rand, 0.7F, new Offer(Items.emerald, 3), new Offer(Items.bread, 2));
       
       	addTrade(recipeList, rand, 0.7F, new Offer(Items.bread, 6), new Offer(Items.wheat, 16));
       }
       else
       {
       	addTrade(recipeList, rand, 0.7F, new Offer(Items.string, 6), new Offer(Items.emerald, 1));
       	addTrade(recipeList, rand, 0.7F, new Offer(Items.apple, 3), new Offer(Items.emerald, 1));
       	
       	addTrade(recipeList, rand, 0.7F, new Offer(Item.getItemFromBlock(Blocks.netherrack), 64), new Offer(Item.getItemFromBlock(Blocks.cobblestone), 64));
       	addTrade(recipeList, rand, 0.7F, new Offer(Item.getItemFromBlock(Blocks.cobblestone), 64), new Offer(Item.getItemFromBlock(Blocks.netherrack), 64));
       	
       	addTrade(recipeList, rand, 0.7F, new Offer(Item.getItemFromBlock(Blocks.pumpkin), 2), new Offer(Items.emerald, 1));
       	addTrade(recipeList, rand, 0.7F, new Offer(Item.getItemFromBlock(Blocks.lit_pumpkin), 2), new Offer(Items.emerald, 2));
       }
    /*   addTrade(recipeList, rand, 0.7F, new Offer(Items.fish, 3), new Offer(Items.emerald, 1));
       addTrade(recipeList, rand, 0.7F, new Offer(Items.emerald, 5), new Offer(Items.fish, 8));*/
}
 
開發者ID:DracoAnimus,項目名稱:Coding,代碼行數:37,代碼來源:VillagerBakeryTradeHandler.java

示例11: registerTileEntityWithAlternatives

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
/**
 * Register a tile entity, with alternative TileEntity identifiers. Use with caution!
 * This method allows for you to "rename" the 'id' of the tile entity.
 *
 * @param tileEntityClass The tileEntity class to register
 * @param id The primary ID, this will be the ID that the tileentity saves as
 * @param alternatives A list of alternative IDs that will also map to this class. These will never save, but they will load
 */
public static void registerTileEntityWithAlternatives(Class<? extends TileEntity> tileEntityClass, String id, String... alternatives)
{
    TileEntity.addMapping(tileEntityClass, id);
    Map<String,Class<?>> teMappings = ObfuscationReflectionHelper.getPrivateValue(TileEntity.class, null, "field_" + "145855_i", "nameToClassMap");
    for (String s: alternatives)
    {
        if (!teMappings.containsKey(s))
        {
            teMappings.put(s, tileEntityClass);
        }
    }
}
 
開發者ID:alexandrage,項目名稱:CauldronGit,代碼行數:21,代碼來源:GameRegistry.java

示例12: bakeModel

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
/**
 * Use this to convert TechneModel to it's static representation
 */
@SuppressWarnings("unchecked")
public static Map<String, GroupObject> bakeModel(TechneModel model, float scale, Matrix4f m, boolean rotateYFirst) {
  Map<String, ModelRenderer> parts = (Map<String, ModelRenderer>) ObfuscationReflectionHelper.getPrivateValue(TechneModel.class, model, "parts");
  Map<String, GroupObject> res = Maps.newHashMap();

  for (Map.Entry<String, ModelRenderer> e : parts.entrySet()) {
    GroupObject obj = bakeModel(e.getValue(), model, scale, m, rotateYFirst).get(0);
    res.put(e.getKey(), obj);
  }

  return res;
}
 
開發者ID:SleepyTrousers,項目名稱:EnderCore,代碼行數:16,代碼來源:TechneUtil.java

示例13: loadResearch

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
private void loadResearch(EntityPlayer fakePlayer) {
    boolean online = false;
    for(String username : MinecraftServer.getServer().getAllUsernames()) {
        if(username.equals(player)) {
            online = true;
            break;
        }
    }

    if(online) {
        this.research = ResearchManager.getResearchForPlayer(player);
    } else {
        if(research == null) {
            Thaumcraft.proxy.getCompletedResearch().put(fakePlayer.getCommandSenderName(), new ArrayList<String>());

            IPlayerFileData playerNBTManagerObj = MinecraftServer.getServer().worldServerForDimension(0).getSaveHandler().getSaveHandler();
            SaveHandler sh = (SaveHandler)playerNBTManagerObj;
            File dir = ObfuscationReflectionHelper.getPrivateValue(SaveHandler.class, sh, "playersDirectory", "field_75771_c");
            File file1 = new File(dir, player + ".thaum");
            File file2 = new File(dir, player + ".thaumbak");
            ResearchManager.loadPlayerData(fakePlayer, file1, file2, false);

            this.research = ResearchManager.getResearchForPlayerSafe(fakePlayer.getCommandSenderName());
        }
    }

    Thaumcraft.proxy.getCompletedResearch().put(fakePlayer.getCommandSenderName(), research == null ? new ArrayList<String>() : research);
}
 
開發者ID:makeoo,項目名稱:Gadomancy,代碼行數:29,代碼來源:TileInfusionClaw.java

示例14: inject

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
public static void inject(HashMap<String, String> map) {
    try {
        Map<String, String> languageMap = ObfuscationReflectionHelper.getPrivateValue(StringTranslate.class, getInstance(), LANGUAGE_MAP);
        languageMap.putAll(map);
        ObfuscationReflectionHelper.setPrivateValue(StringTranslate.class, getInstance(), System.currentTimeMillis(), LAST_UPDATE);
    } catch (Exception ex) {
        ex.printStackTrace();
    }
}
 
開發者ID:tm1990,項目名稱:MiscUtils,代碼行數:10,代碼來源:LocalizationUpdater.java

示例15: tickStart

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData)
{
	if (FMLCommonHandler.instance().getEffectiveSide().isClient() && Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative)
	{
		GuiContainerCreative gui = (GuiContainerCreative) Minecraft.getMinecraft().currentScreen;
		List<GuiButton> buttons = ObfuscationReflectionHelper.<List<GuiButton>, GuiScreen> getPrivateValue(GuiScreen.class, Minecraft.getMinecraft().currentScreen, "buttonList", "field_73887_h");
		if (buttons.size() > 2)
			buttons.remove(2);
		buttons.add(new SmallButton(10, 0, (Integer) ObfuscationReflectionHelper.getPrivateValue(GuiContainer.class, gui, "guiLeft", "field_74198_m"), (Integer) ObfuscationReflectionHelper
				.getPrivateValue(GuiContainer.class, gui, "guiTop", "field_74197_n")));
	}
}
 
開發者ID:tterrag1098,項目名稱:RecipeIGE,代碼行數:14,代碼來源:RIGETickHandler.java


注:本文中的cpw.mods.fml.common.ObfuscationReflectionHelper.getPrivateValue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。