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


Java ObfuscationReflectionHelper.setPrivateValue方法代碼示例

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


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

示例1: controlClient

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
@Override
public void controlClient(EntityPlayerCustom playerCustom, EntityPlayer player) {
	if (keyPressedSlow && !playerCustom.slow) {
		ObfuscationReflectionHelper.setPrivateValue(Timer.class,
				((Timer) ObfuscationReflectionHelper.getPrivateValue(
						Minecraft.class, Minecraft.getMinecraft(), 16)),
				5F, 0);
		playerCustom.slow = true;
	}
	if (playerCustom.slow) {
		playerCustom.slowTime++;
	}
	if (playerCustom.slowTime == 25 && playerCustom.slow) {
		ObfuscationReflectionHelper.setPrivateValue(Timer.class,
				((Timer) ObfuscationReflectionHelper.getPrivateValue(
						Minecraft.class, Minecraft.getMinecraft(), 16)),
				20F, 0);
		playerCustom.slowTime = 0;
		Minecraft.getMinecraft().gameSettings.mouseSensitivity = defaultSensitivity;
		keyPressedSlow = false;
		playerCustom.slow = false;
	}
}
 
開發者ID:ZakCreeper,項目名稱:CubesEdge,代碼行數:24,代碼來源:MovementSlowClient.java

示例2: onGui

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onGui(GuiOpenEvent event)
{
    if (event.gui instanceof GuiMainMenu)
    {
    	if (shouldLoadGUI && ConfigurationHandler.showIRCGui)
        {
            event.gui = new IRCGui();
            shouldLoadGUI = false;
        }
        else
        {
            ObfuscationReflectionHelper.setPrivateValue(GuiMainMenu.class, (GuiMainMenu) event.gui, getRandTPPISplash(), "splashText", "field_73975_c");
        }
    }
}
 
開發者ID:TPPIDev,項目名稱:TPPI-Tweaks,代碼行數:18,代碼來源:TPPIEventHandler.java

示例3: serverStopped

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
@Override
public void serverStopped()
{
    // If the server crashes during startup, it might hang the client- reset the client so it can abend properly.
    MinecraftServer server = getServer();

    if (server != null && !server.func_71200_ad())
    {
        ObfuscationReflectionHelper.setPrivateValue(MinecraftServer.class, server, true, "field_71296"+"_Q","serverIs"+"Running");
    }
}
 
開發者ID:SchrodingersSpy,項目名稱:TRHS_Club_Mod_2016,代碼行數:12,代碼來源:FMLClientHandler.java

示例4: serverStopped

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
@Override
public void serverStopped()
{
    // If the server crashes during startup, it might hang the client- reset the client so it can abend properly.
    MinecraftServer server = getServer();

    if (server != null && !server.serverIsInRunLoop())
    {
        ObfuscationReflectionHelper.setPrivateValue(MinecraftServer.class, server, true, "field_71296"+"_Q","serverIs"+"Running");
    }
}
 
開發者ID:alexandrage,項目名稱:CauldronGit,代碼行數:12,代碼來源:FMLClientHandler.java

示例5: resetPlayerInAirTime

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
public void resetPlayerInAirTime(EntityPlayer player) {
    if (!(player instanceof EntityPlayerMP)) {
        return;
    }

    ObfuscationReflectionHelper.setPrivateValue(NetHandlerPlayServer.class, ((EntityPlayerMP) player).playerNetServerHandler,
            Integer.valueOf(0), new String[]{"field_147365_f", "floatingTickCount"});
}
 
開發者ID:estebes,項目名稱:Gravitation-Suite-Reloaded,代碼行數:9,代碼來源:ItemElectricArmorJetpack.java

示例6: drawButton

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
public void drawButton(Minecraft mc, int mx, int my)
    {
        if (this.visible)
        {
//            if(drawList)
//            {
//                list.render(mc, mx, my);
//            }
            ObfuscationReflectionHelper.setPrivateValue(GuiTextField.class, field, xPosition, 1);
            ObfuscationReflectionHelper.setPrivateValue(GuiTextField.class, field, yPosition, 2);
            list.xPos = this.xPosition;
            list.yPos = this.yPosition+height;
            field.drawTextBox();
            mc.getTextureManager().bindTexture(GuiSpinnerButton.spinnerTextures);
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            this.field_146123_n = mx >= this.xPosition && my >= this.yPosition && mx < this.xPosition + this.width && my < this.yPosition + this.height;
            GL11.glEnable(GL11.GL_BLEND);
            OpenGlHelper.glBlendFunc(770, 771, 1, 0);
            GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
            
            boolean arrowHovered = mx >= this.xPosition +width-12 && mx <= this.xPosition+width && my >= yPosition && my <= yPosition + height;
            func_146110_a(xPosition+width-12, yPosition+height/2-7/2, 0, arrowHovered ? 7 : 0, 11, 7, 22, 14);
            this.mouseDragged(mc, mx, my);
            
            int k = this.getHoverState(this.field_146123_n);
            int l = 14737632;
            
        }
    }
 
開發者ID:jglrxavpok,項目名稱:CustomAI,代碼行數:30,代碼來源:GuiComboBox.java

示例7: render

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
@SubscribeEvent
public void render(RenderPlayerEvent.Pre e) {
    ModelPlayer model;
    if (!models.containsKey(e.entityPlayer.func_146103_bH().getName())) {
        model = new ModelPlayer();
        model.setUpCustom(e.entityPlayer.func_146103_bH().getName());
        models.put(e.entityPlayer.func_146103_bH().getName(), model);
    } else {
        model = models.get(e.entityPlayer.func_146103_bH().getName());
    }

    ObfuscationReflectionHelper.setPrivateValue(RendererLivingEntity.class, e.renderer, model, "mainModel", "field_77045_g");
    ObfuscationReflectionHelper.setPrivateValue(RenderPlayer.class, e.renderer, model, "modelBipedMain", "field_77109_a");
}
 
開發者ID:Cazzar,項目名稱:VoxelPlayerModels,代碼行數:15,代碼來源:EventHandler.java

示例8: setThirdPersonDistance

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
public void setThirdPersonDistance(float dist) {
    try {
        ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, renderer, dist, FIELDS_THIRDPERSONDISTANCE);
    } catch (Exception ex) {
        L.log(Level.WARNING, "Can't set third person distance!", ex);
    }
}
 
開發者ID:NovaViper,項目名稱:ZeroQuest,代碼行數:8,代碼來源:ThirdPersonCameraAccessor.java

示例9: WorldChunkManagerIG

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
public WorldChunkManagerIG(World world)
{
	super();
	
       GenLayer[] agenlayer = GenLayerBiomeIG.initializeAllBiomeGenerators(world.getSeed(), world.getWorldInfo().getTerrainType());
       agenlayer = getModdedBiomeGenerators(world.getWorldInfo().getTerrainType(), world.getSeed(), agenlayer);
       ObfuscationReflectionHelper.setPrivateValue(WorldChunkManager.class, this, agenlayer[0], "genBiomes", "field_76944_d");
       ObfuscationReflectionHelper.setPrivateValue(WorldChunkManager.class, this, agenlayer[1], "biomeIndexLayer", "field_76945_e");
}
 
開發者ID:ZippyIO,項目名稱:IgnitionUtilities,代碼行數:10,代碼來源:WorldChunkManagerIG.java

示例10: 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:dmillerw,項目名稱:CosmeticArmor,代碼行數:10,代碼來源:LocalizationUpdater.java

示例11: onRender

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
private void onRender(float partialTickTime) {
	if (Minecraft.getMinecraft().thePlayer != null) {
		float dSwing = swingProgress - prevSwingProgress;
		if (dSwing < 0) {
			dSwing++; // Why?
		}
		float currentSwingProgress = (float)swingCurve(prevSwingProgress + dSwing * partialTickTime);
		EntityLivingBase player = Minecraft.getMinecraft().thePlayer;
		ObfuscationReflectionHelper.setPrivateValue(EntityLivingBase.class, player, currentSwingProgress, swingProgressObfFields);
	}
}
 
開發者ID:Hunternif,項目名稱:Dota2Items,代碼行數:12,代碼來源:SwingTickHandler.java

示例12: recreateOreRecipe

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
public static IRecipe recreateOreRecipe(ShapedOreRecipe template, ItemStack output, Object[] input) {
	int width = ObfuscationReflectionHelper.getPrivateValue(ShapedOreRecipe.class, template, "width");
	int height = ObfuscationReflectionHelper.getPrivateValue(ShapedOreRecipe.class, template, "height");
       for (int i = 0; i < input.length; i++) {
       	if (input[i] instanceof String) {
       		input[i] = OreDictionary.getOres((String) input[i]);
       	}
       }
	ShapedOreRecipe recipe = new ShapedOreRecipe(output, 'x', Blocks.anvil);
	ObfuscationReflectionHelper.setPrivateValue(ShapedOreRecipe.class, recipe, input, "input");
	/* field names repeated to dispatch to correct overload */
	ObfuscationReflectionHelper.setPrivateValue(ShapedOreRecipe.class, recipe, width, "width", "width");
	ObfuscationReflectionHelper.setPrivateValue(ShapedOreRecipe.class, recipe, height, "height", "height");
	return recipe;
}
 
開發者ID:lawremi,項目名稱:PerFabricaAdAstra,代碼行數:16,代碼來源:RecipeUtils.java

示例13: setDisableRain

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
/**
 * Disable the rain for the biome.
 */
@Override
public BiomeDreamLand setDisableRain()
{
	ObfuscationReflectionHelper.setPrivateValue(BiomeGenBase.class, this, false, 39);
	return this;
}
 
開發者ID:JennyLeeP,項目名稱:JLPModJam,代碼行數:10,代碼來源:BiomeDreamLand.java

示例14: mouseClicked

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
/**
 * Called when the mouse is clicked.
 */
protected void mouseClicked(int par1, int par2, int par3)
{
	// super
	if (par3 == 0)
	{
		for (Object aButtonList : this.buttonList)
		{
			GuiButton guibutton = (GuiButton) aButtonList;

			if (guibutton.mousePressed(this.mc, par1, par2))
			{
				ObfuscationReflectionHelper.setPrivateValue(GuiScreen.class, this, guibutton, "selectedButton", "field_73883_a");
				this.mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
				this.actionPerformed(guibutton);
			}
		}
	}
	// ....

	if (this.moreOptions)
	{
		this.textboxSeed.mouseClicked(par1, par2, par3);
	}
	else
	{
		this.textboxWorldName.mouseClicked(par1, par2, par3);
	}
}
 
開發者ID:Ubiquitous-Spice,項目名稱:Modjam-3,代碼行數:32,代碼來源:HackedCreateWorld.java

示例15: onBowUse

import cpw.mods.fml.common.ObfuscationReflectionHelper; //導入方法依賴的package包/類
@Override
public void onBowUse(ItemStack stack, EntityPlayer player, int pulseRifleFireTime)
{
    float f = 1.0F;

    if (player.capabilities.isFlying)
    {
        f *= 1.1F;
    }

    float speedOnGround = 0.1F;
    // int i = player.getItemInUseDuration();
    int i = pulseRifleFireTime;
    float f1 = i / 420.0F;

    if (f1 > 1.0F)
    {
        f1 = 1.0F;
    }
    else
    {
        f1 *= f1;
    }

    f *= 1.0F - f1 * 0.25F;

    fovModifierHand = fovModifierHand > 0.001F
                      ? fovModifierHand
                      : (Float) ObfuscationReflectionHelper.getPrivateValue( EntityRenderer.class,
                                                                             Minecraft.getMinecraft().entityRenderer,
                                                                             "fovModifierHand",
                                                                             "field_78507_R" );
    fovModifierHand += (f - fovModifierHand) * 0.5F;

    if (fovModifierHand > 1.5F)
    {
        fovModifierHand = 1.5F;
    }

    if (fovModifierHand < 0.1F)
    {
        fovModifierHand = 0.1F;
    }

    ObfuscationReflectionHelper.setPrivateValue( EntityRenderer.class,
                                                 Minecraft.getMinecraft().entityRenderer,
                                                 fovModifierHand,
                                                 "fovModifierHand",
                                                 "field_78507_R" );
}
 
開發者ID:Maxwolf,項目名稱:MC-MineAPI.Java,代碼行數:51,代碼來源:ClientProxy.java


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