当前位置: 首页>>代码示例>>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;未经允许,请勿转载。