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


Java Result.DENY属性代码示例

本文整理汇总了Java中cpw.mods.fml.common.eventhandler.Event.Result.DENY属性的典型用法代码示例。如果您正苦于以下问题:Java Result.DENY属性的具体用法?Java Result.DENY怎么用?Java Result.DENY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在cpw.mods.fml.common.eventhandler.Event.Result的用法示例。


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

示例1: replaceBlocksForBiome

public void replaceBlocksForBiome(int p_147422_1_, int p_147422_2_, Block[] p_147422_3_, byte[] p_147422_4_, BiomeGenBase[] p_147422_5_) {
	ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_147422_1_, p_147422_2_, p_147422_3_, p_147422_5_);
	MinecraftForge.EVENT_BUS.post(event);
	if (event.getResult() == Result.DENY) {
		return;
	}

	double d0 = 0.03125D;
	this.stoneNoise = this.field_147430_m.func_151599_a(this.stoneNoise, p_147422_1_ * 16, p_147422_2_ * 16, 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D);

	for (int k = 0; k < 16; ++k) {
		for (int l = 0; l < 16; ++l) {
			BiomeGenBase biomegenbase = p_147422_5_[(l + k * 16)];
			
			biomegenbase.genTerrainBlocks(this.worldObj, this.rand, p_147422_3_, p_147422_4_, p_147422_1_ * 16 + k, p_147422_2_ * 16 + l, this.stoneNoise[(l + k * 16)]);
		}
	}

}
 
开发者ID:kormic911,项目名称:EvilOcean,代码行数:19,代码来源:ChunkProviderOcean.java

示例2: func_151557_c

protected int func_151557_c(Block p_151557_1_, int p_151557_2_)
{
    BiomeEvent.GetVillageBlockMeta event = new BiomeEvent.GetVillageBlockMeta(startPiece == null ? null : startPiece.biome, p_151557_1_, p_151557_2_);
    MinecraftForge.TERRAIN_GEN_BUS.post(event);
    if (event.getResult() == Result.DENY) return event.replacement;
    if (this.field_143014_b)
    {
        if (p_151557_1_ == Blocks.log || p_151557_1_ == Blocks.log2)
        {
            return 0;
        }

        if (p_151557_1_ == Blocks.cobblestone)
        {
            return 0;
        }

        if (p_151557_1_ == Blocks.planks)
        {
            return 2;
        }
    }

    return p_151557_2_;
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:25,代码来源:StructureVillagePieces.java

示例3: replaceBlocksForBiome

public void replaceBlocksForBiome(int par1, int par2, Block[] blocks, byte[] par3ArrayOfByte, BiomeGenBase[] par4ArrayOfBiomeGenBase) {
	GameLogHelper.writeToLog(Level.INFO, "Replacing block for biome.");
	@SuppressWarnings("deprecation")
	ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, par1, par2, blocks, par3ArrayOfByte, par4ArrayOfBiomeGenBase);
	MinecraftForge.EVENT_BUS.post(event);
	if (event.getResult() == Result.DENY) return;
	double d0 = 0.03125D;
	this.stoneNoise = this.noisePerl.func_151599_a(this.stoneNoise, (double)(par1 * 16), (double)(par2 * 16), 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D);
	/*for (int k = 0; k < 16; ++k) {
		for (int l = 0; l < 16; ++l) {
			BiomeGenPat biomegenbase = (BiomeGenPat) par4ArrayOfBiomeGenBase[l + k * 16];
			biomegenbase.genTerrainBlocks(this.worldObj, this.rand, blocks, par3ArrayOfByte, par1 * 16 + k, par2 * 16 + l, this.stoneNoise[l + k * 16]);
		}
		for (int l = 0; l < 8; ++l) {
			BiomeGenJen biomegenbase = (BiomeGenJen) par4ArrayOfBiomeGenBase[l + k * 16];
			biomegenbase.genTerrainBlocks(this.worldObj, this.rand, blocks, par3ArrayOfByte, par1 * 16 + k, par2 * 16 + l, this.stoneNoise[l + k * 16]);
		}
	}*/
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:19,代码来源:ChunkProviderEpic.java

示例4: use

@SubscribeEvent
public void use(PlayerInteractEvent event){
	ItemStack item = event.entityPlayer.getEquipmentInSlot(0);
	if(item == null)
		return;
	if(item.hasTagCompound())
		if(item.getTagCompound().hasKey("Fidelis"))
		{
			String fidelisID = item.getTagCompound().getString("Fidelis");
			if(event.entityPlayer.getGameProfile().getId().toString().equals(fidelisID))
				return;
			else if(fidelisID.equals(""))
			{
				item.getTagCompound().setString("Fidelis", event.entityPlayer.getGameProfile().getId().toString());
				item.getTagCompound().setString("FidelisDisplay", event.entityPlayer.getDisplayName());
			}
			else{
				event.setCanceled(true);
				event.useItem = Result.DENY;
			}
		}
}
 
开发者ID:UnderMybrella,项目名称:Fidelis,代码行数:22,代码来源:Fidelis.java

示例5: replaceBlocksForBiome

public void replaceBlocksForBiome(int p_147422_1_, int p_147422_2_, Block[] p_147422_3_, byte[] p_147422_4_, BiomeGenBase[] p_147422_5_)
{
	ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_147422_1_, p_147422_2_, p_147422_3_, p_147422_4_, p_147422_5_);
	MinecraftForge.EVENT_BUS.post(event);
	if (event.getResult() == Result.DENY) return;

	double d0 = 0.03125D;
	this.stoneNoise = this.field_147430_m.func_151599_a(this.stoneNoise, (double)(p_147422_1_ * 16), (double)(p_147422_2_ * 16), 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D);

	for (int k = 0; k < 16; ++k)
	{
		for (int l = 0; l < 16; ++l)
		{
			BiomeGenBase biomegenbase = p_147422_5_[l + k * 16];
			biomegenbase.genTerrainBlocks(this.worldObj, this.rand, p_147422_3_, p_147422_4_, p_147422_1_ * 16 + k, p_147422_2_ * 16 + l, this.stoneNoise[l + k * 16]);
		}
	}
}
 
开发者ID:Alex-the-666,项目名称:It-s-About-Time-Minecraft-Mod,代码行数:18,代码来源:ChunkProviderNowhere.java

示例6: replaceBlocksForBiome

public void replaceBlocksForBiome(int p_147422_1_, int p_147422_2_, Block[] p_147422_3_, byte[] p_147422_4_, BiomeGenBase[] p_147422_5_)
{
	ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_147422_1_, p_147422_2_, p_147422_3_, p_147422_4_, p_147422_5_, this.worldObj);
	MinecraftForge.EVENT_BUS.post(event);
	if (event.getResult() == Result.DENY) return;

	double d0 = 0.03125D;
	this.stoneNoise = this.field_147430_m.func_151599_a(this.stoneNoise, (double)(p_147422_1_ * 16), (double)(p_147422_2_ * 16), 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D);

	for (int k = 0; k < 16; ++k)
	{
		for (int l = 0; l < 16; ++l)
		{
			BiomeGenBase biomegenbase = p_147422_5_[l + k * 16];
			biomegenbase.genTerrainBlocks(this.worldObj, this.rand, p_147422_3_, p_147422_4_, p_147422_1_ * 16 + k, p_147422_2_ * 16 + l, this.stoneNoise[l + k * 16]);
		}
	}
}
 
开发者ID:zmaster587,项目名称:AdvancedRocketry,代码行数:18,代码来源:ChunkProviderPlanet.java

示例7: replaceBlocksForBiome

@SuppressWarnings("deprecation")
public void replaceBlocksForBiome(int p_147422_1_, int p_147422_2_, Block[] p_147422_3_, byte[] p_147422_4_, BiomeGenBase[] p_147422_5_) {
	ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_147422_1_, p_147422_2_, p_147422_3_, p_147422_4_, p_147422_5_);
	MinecraftForge.EVENT_BUS.post(event);
	if (event.getResult() == Result.DENY)
		return;

	double d0 = 0.03125D;
	this.stoneNoise = this.noiseGen4.func_151599_a(this.stoneNoise, (double) (p_147422_1_ * 16), (double) (p_147422_2_ * 16), 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D);

	for (int k = 0; k < 16; ++k) {
		for (int l = 0; l < 16; ++l) {
			BiomeGenBase biomegenbase = p_147422_5_[l + k * 16];
			biomegenbase.genTerrainBlocks(this.worldObj, this.rand, p_147422_3_, p_147422_4_, p_147422_1_ * 16 + k, p_147422_2_ * 16 + l, this.stoneNoise[l + k * 16]);
		}
	}
}
 
开发者ID:TheDarkEra,项目名称:TheDarkEra,代码行数:17,代码来源:TDEChunkProvider.java

示例8: replaceBlocksForBiome

public void replaceBlocksForBiome(int p_147422_1_, int p_147422_2_, Block[] p_147422_3_, byte[] p_147422_4_, BiomeGenBase[] p_147422_5_)
{
    ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_147422_1_, p_147422_2_, p_147422_3_, p_147422_5_);
    MinecraftForge.EVENT_BUS.post(event);
    if (event.getResult() == Result.DENY) return;

    double d0 = 0.03125D;
    this.stoneNoise = this.field_147430_m.func_151599_a(this.stoneNoise, (double)(p_147422_1_ * 16), (double)(p_147422_2_ * 16), 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D);

    for (int k = 0; k < 16; ++k)
    {
        for (int l = 0; l < 16; ++l)
        {
            BiomeGenBase biomegenbase = p_147422_5_[l + k * 16];
            biomegenbase.genTerrainBlocks(this.worldObj, this.rand, p_147422_3_, p_147422_4_, p_147422_1_ * 16 + k, p_147422_2_ * 16 + l, this.stoneNoise[l + k * 16]);
        }
    }
}
 
开发者ID:CodecademyMinecraftMods,项目名称:atlantis-mod,代码行数:18,代码来源:ChunkProviderTheDeep.java

示例9: replaceBlocksForBiome

public void replaceBlocksForBiome(int p_147422_1_, int p_147422_2_, Block[] p_147422_3_, byte[] p_147422_4_, BiomeGenBase[] p_147422_5_)
{
    ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_147422_1_, p_147422_2_, p_147422_3_, p_147422_4_, p_147422_5_, this.worldObj);
    MinecraftForge.EVENT_BUS.post(event);
    if (event.getResult() == Result.DENY) return;

    double d0 = 0.03125D;
    this.stoneNoise = this.field_147430_m.func_151599_a(this.stoneNoise, (double)(p_147422_1_ * 16), (double)(p_147422_2_ * 16), 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D);

    for (int k = 0; k < 16; ++k)
    {
        for (int l = 0; l < 16; ++l)
        {
            BiomeGenBase biomegenbase = p_147422_5_[l + k * 16];
            biomegenbase.genTerrainBlocks(this.worldObj, this.rand, p_147422_3_, p_147422_4_, p_147422_1_ * 16 + k, p_147422_2_ * 16 + l, this.stoneNoise[l + k * 16]);
        }
    }
}
 
开发者ID:NovaViper,项目名称:ZeroQuest,代码行数:18,代码来源:ChunkProviderNillax.java

示例10: syphonFromNetworkWhileInContainer

public static boolean syphonFromNetworkWhileInContainer(ItemStack ist, int damageToBeDone)
{
	String ownerName = "";
	if (ist.getTagCompound() != null && !(ist.getTagCompound().getString("ownerName").equals("")))
    {
        ownerName = ist.getTagCompound().getString("ownerName");
    }
	
	ItemDrainInContainerEvent event = new ItemDrainInContainerEvent(ist, ownerName, damageToBeDone);
	
	if(MinecraftForge.EVENT_BUS.post(event) || event.getResult() == Result.DENY)
	{
		return false;
	}
	
	return syphonFromNetwork(event.ownerNetwork, event.drainAmount) >= damageToBeDone;
}
 
开发者ID:Katalliaan,项目名称:Rubedo,代码行数:17,代码来源:SoulNetworkHandler.java

示例11: replaceBlocksForBiome

public void replaceBlocksForBiome(int p_147422_1_, int p_147422_2_, Block[] p_147422_3_, byte[] p_147422_4_, BiomeGenBase[] p_147422_5_) {
	ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_147422_1_, p_147422_2_, p_147422_3_, p_147422_5_);
	MinecraftForge.EVENT_BUS.post(event);
	if (event.getResult() == Result.DENY)
		return;

	double d0 = 0.03125D;
	this.stoneNoise = this.field_147430_m.func_151599_a(this.stoneNoise, p_147422_1_ * 16, p_147422_2_ * 16, 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D);

	for (int k = 0; k < 16; ++k) {
		for (int l = 0; l < 16; ++l) {
			BiomeGenBase biomegenbase = p_147422_5_[l + k * 16];
			biomegenbase.genTerrainBlocks(this.worldObj, this.rand, p_147422_3_, p_147422_4_, p_147422_1_ * 16 + k, p_147422_2_ * 16 + l, this.stoneNoise[l + k * 16]);
		}
	}
}
 
开发者ID:jaredlll08,项目名称:MysticalTrinkets,代码行数:16,代码来源:ChunkProviderMysticalDimension.java

示例12: func_151558_b

protected Block func_151558_b(Block p_151558_1_, int p_151558_2_)
{
    BiomeEvent.GetVillageBlockID event = new BiomeEvent.GetVillageBlockID(startPiece == null ? null : startPiece.biome, p_151558_1_, p_151558_2_);
    MinecraftForge.TERRAIN_GEN_BUS.post(event);
    if (event.getResult() == Result.DENY) return event.replacement;
    if (this.field_143014_b)
    {
        if (p_151558_1_ == Blocks.log || p_151558_1_ == Blocks.log2)
        {
            return Blocks.sandstone;
        }

        if (p_151558_1_ == Blocks.cobblestone)
        {
            return Blocks.sandstone;
        }

        if (p_151558_1_ == Blocks.planks)
        {
            return Blocks.sandstone;
        }

        if (p_151558_1_ == Blocks.oak_stairs)
        {
            return Blocks.sandstone_stairs;
        }

        if (p_151558_1_ == Blocks.stone_stairs)
        {
            return Blocks.sandstone_stairs;
        }

        if (p_151558_1_ == Blocks.gravel)
        {
            return Blocks.sandstone;
        }
    }

    return p_151558_1_;
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:40,代码来源:StructureVillagePieces.java

示例13: onFillBucket

@SubscribeEvent
public void onFillBucket(FillBucketEvent event)
{
	ItemStack itemInHand = event.entityPlayer.getCurrentEquippedItem();

	if(event.getResult() != Result.DENY && itemInHand.getItem() == TFCItems.woodenBucketEmpty)
	{
		if(event.result != null && event.result.getItem() == BuildCraftEnergy.bucketOil)
		{
			event.result = new ItemStack(TFPItems.CustomBucketOil);
		}
	}
}
 
开发者ID:StrayWolfe,项目名称:TerrafirmaPunk-Tweaks,代码行数:13,代码来源:PlayerInteractionHandler.java

示例14: onBlockInteract

@SubscribeEvent(receiveCanceled = false)
public void onBlockInteract(final PlayerInteractEvent event) {

	final World world = event.entityPlayer.worldObj;
	if (world.isRemote)
		return;

	final TileEntity te = world.getTileEntity(event.x, event.y, event.z);
	if (te instanceof TileEntitySign) {
		
		String playerMessage = null;
		final EntityPlayerMP player = (EntityPlayerMP) event.entityPlayer;
		final TileEntitySign sign = (TileEntitySign) te;
		
		switch (InteractionType.getInteractionType(event)) {
		case Configure:
			if(TeleportSignTracking.canBeConfigured(sign)) {
				TeleportSignTracking.configureSign(sign);
				event.useItem = Result.DENY;
			} else
				playerMessage = StatCollector.translateToLocal("msg.Pathways.IncorrectSignFormat");
			break;
		case Use:
			if(TeleportSignTracking.canBeUsed(sign)) {
				final String target = TeleportSignTracking.getTargetName(sign);
				TargetManager.execute(player, target, false);
			}
			break;
		case Nothing:
		default:
			;
		}
		
		if (playerMessage != null && !playerMessage.isEmpty())
			player.addChatComponentMessage(new ChatComponentText(playerMessage));
	}
}
 
开发者ID:OreCruncher,项目名称:Pathways,代码行数:37,代码来源:PlayerInteractEventHandler.java

示例15: limitSpawn

private Result limitSpawn(Entity entity)
{
    final Settings settings = Settings.INSTANCE;
    final int successChance =
            entity instanceof EntityBat ? settings.batSpawnPercent() : settings.squidSpawnPercent();
    if (successChance == 0) return Result.DENY;
    if (successChance == 100) return Result.DEFAULT;

    return entity.worldObj.rand.nextInt(100) < successChance ? Result.DEFAULT : Result.DENY;
}
 
开发者ID:MinecraftModArchive,项目名称:ScottsTweaks,代码行数:10,代码来源:SpawnGovernor.java


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