java类cpw.mods.fml.common.eventhandler.Event.Result的实例源码

EventHandlerGC.java 文件源码 项目:4Space-5 阅读 23 收藏 0 点赞 0 评论 0
@SubscribeEvent
public void onZombieSummonAid(SummonAidEvent event)
{
    if (event.entity instanceof EntityEvolvedZombie)
    {
        event.customSummonedAid = new EntityEvolvedZombie(event.world);

        if (((EntityLivingBase) event.entity).getRNG().nextFloat() < ((EntityEvolvedZombie) event.entity).getEntityAttribute(((EntityEvolvedZombie) event.entity).getReinforcementsAttribute()).getAttributeValue())
        {
            event.setResult(Result.ALLOW);
        }
        else
        {
            event.setResult(Result.DENY);
        }
    }
}
ChunkProviderOcean.java 文件源码 项目:EvilOcean 阅读 22 收藏 0 点赞 0 评论 0
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)]);
        }
    }

}
StructureVillagePieces.java 文件源码 项目:PopularMMOS-EpicProportions-Mod 阅读 25 收藏 0 点赞 0 评论 0
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_;
}
ChunkProviderEpic.java 文件源码 项目:PopularMMOS-EpicProportions-Mod 阅读 22 收藏 0 点赞 0 评论 0
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]);
        }
    }*/
}
WorldGenStones.java 文件源码 项目:PrimitiveCraft 阅读 20 收藏 0 点赞 0 评论 0
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onWorldDecoration(DecorateBiomeEvent.Decorate event) 
{
    if ((event.getResult() == Result.ALLOW || event.getResult() == Result.DEFAULT) && event.type == EventType.FLOWERS) 
    {
        for(int i = 0; i < 2; i++) 
        {
            int x = event.chunkX + event.rand.nextInt(16) + 8;
            int z = event.chunkZ + event.rand.nextInt(16) + 8;
            int y = event.world.getTopSolidOrLiquidBlock(x, z);

            if(event.world.isAirBlock(x, y, z) && Blocks.flower_pot.canBlockStay(event.world, x, y, z) && ConfigPrimitiveCraft.genrocks)
            {
                event.world.setBlock(x, y, z, ModBlocks.rock);
            }
            else if(event.world.getBlock(x, y, z) == Blocks.water && ConfigPrimitiveCraft.genshale)
            {
                event.world.setBlock(x, y-1, z, ModBlocks.shale);
            }
        }
    }
}
EntityGuardEventHandler.java 文件源码 项目:Coding 阅读 18 收藏 0 点赞 0 评论 0
@SubscribeEvent
    public void onEntityJoinWorldEvent(EntityJoinWorldEvent event) {
        if (event.entity instanceof EntityGuard){
            EntityGuard guard = (EntityGuard) event.entity;
            // If spawned by WorldGen, it will not be looking for home
            if (guard.isLookingForHome()) {
                if (okToSpawnNearVillage(event, 50)) {
//                  LogHelper.info("EntityJoinWorldEvent: Do spawn " + guard.getGuardType() + " at: " + guard.posX + ", " + guard.posY + ", " + guard.posZ);
                    // If I set to ALLOW, need to do all own checks here, so use DEFAULT
                    event.setResult(Result.DEFAULT);
                }
                else {
                    // Prevents spawns not in a village 
//                  LogHelper.info("onLivingCheckSpawnEvent: Don't spawn Guard at: " + guard.posX + ", " + guard.posY + ", " + guard.posZ);
                    event.setResult(Result.DENY);               
                }
            }
        }
    }
Fidelis.java 文件源码 项目:Fidelis 阅读 22 收藏 0 点赞 0 评论 0
@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;
            }
        }
}
ChunkProviderNowhere.java 文件源码 项目:It-s-About-Time-Minecraft-Mod 阅读 25 收藏 0 点赞 0 评论 0
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]);
        }
    }
}
ChunkProviderCretaceous.java 文件源码 项目:It-s-About-Time-Minecraft-Mod 阅读 25 收藏 0 点赞 0 评论 0
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]);
        }
    }
}
ChunkProviderPlanet.java 文件源码 项目:AdvancedRocketry 阅读 22 收藏 0 点赞 0 评论 0
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]);
        }
    }
}
PlanetEventHandler.java 文件源码 项目:AdvancedRocketry 阅读 37 收藏 0 点赞 0 评论 0
@SubscribeEvent
public void onWorldGen(OreGenEvent.GenerateMinable event) {

    if(event.world.provider instanceof WorldProviderPlanet && 
            DimensionManager.getInstance().getDimensionProperties(event.world.provider.dimensionId).getOreGenProperties(event.world) != null) {

        switch(event.type) {
        case COAL:
        case DIAMOND:
        case GOLD:
        case IRON:
        case LAPIS:
        case QUARTZ:
        case REDSTONE:
        case CUSTOM:
            event.setResult(Result.DENY);
            break;
        default:
            event.setResult(Result.DEFAULT);
        }
    }
}
TDEChunkProvider.java 文件源码 项目:TheDarkEra 阅读 23 收藏 0 点赞 0 评论 0
@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]);
        }
    }
}
ChunkProviderTheDeep.java 文件源码 项目:atlantis-mod 阅读 27 收藏 0 点赞 0 评论 0
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]);
        }
    }
}
ChunkProviderAtlantis.java 文件源码 项目:atlantis-mod 阅读 22 收藏 0 点赞 0 评论 0
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]);
        }
    }
}
RPGEventHooks.java 文件源码 项目:rpginventory 阅读 23 收藏 0 点赞 0 评论 0
@SubscribeEvent
public void interact(PlayerInteractEvent evt){

    EntityPlayer p = evt.entityPlayer;
    PlayerRpgInventory inv = PlayerRpgInventory.get(p);
    ItemStack shield = inv.getShield();

    if(shield == null)
        return;

    ItemRpgInvArmor theShield = (ItemRpgInvArmor) shield.getItem();

    if(inv.isBlocking() && p.isSneaking()){
        evt.setResult(Result.DENY);
        evt.setCanceled(true);
    }
}
ChunkProviderNillax.java 文件源码 项目:ZeroQuest 阅读 32 收藏 0 点赞 0 评论 0
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]);
        }
    }
}
ChunkProviderDarkax.java 文件源码 项目:ZeroQuest 阅读 25 收藏 0 点赞 0 评论 0
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]);
        }
    }
}
StructureVillagePieces.java 文件源码 项目:Cauldron 阅读 23 收藏 0 点赞 0 评论 0
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_;
}
StructureVillagePieces.java 文件源码 项目:Cauldron 阅读 26 收藏 0 点赞 0 评论 0
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_;
}
ChunkProviderFloodgate.java 文件源码 项目:Floodgate 阅读 21 收藏 0 点赞 0 评论 0
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]);
        }
    }
}
OreEventHandler.java 文件源码 项目:OresPlus 阅读 21 收藏 0 点赞 0 评论 0
@SubscribeEvent
public void genOre(GenerateMinable event) {
    switch (event.type) {
    //case EMERALD:
    case QUARTZ:
    case IRON:
    case GOLD:
    case LAPIS:
    case REDSTONE:
    case DIAMOND:
    case COAL:
        event.setResult(Result.DENY);
        break;
    default:
        event.setResult(Result.ALLOW);
    }
}
SoulNetworkHandler.java 文件源码 项目:Rubedo 阅读 25 收藏 0 点赞 0 评论 0
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;
}
ChunkProviderMysticalDimension.java 文件源码 项目:MysticalTrinkets 阅读 30 收藏 0 点赞 0 评论 0
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]);
        }
    }
}
ChunkProviderUsther.java 文件源码 项目:TheStuffMod 阅读 24 收藏 0 点赞 0 评论 0
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]);
        }
    }
}
ChunkProviderWater.java 文件源码 项目:Realms-of-Chaos 阅读 19 收藏 0 点赞 0 评论 0
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]);
        }
    }
}
ChunkProviderIceRuins.java 文件源码 项目:Realms-of-Chaos 阅读 22 收藏 0 点赞 0 评论 0
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]);
        }
    }
}
SoulNetworkHandler.java 文件源码 项目:ModularArmour 阅读 21 收藏 0 点赞 0 评论 0
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;
}
RediscoveredEventHandler.java 文件源码 项目:Rediscovered-Mod-1.7.10 阅读 32 收藏 0 点赞 0 评论 0
@SubscribeEvent
public void onBonemealClick(BonemealEvent event) 
{
    World world = event.world;
    if (event.block.equals(mod_Rediscovered.CherrySapling)) 
    {
        event.setResult(Result.ALLOW);
        if (!world.isRemote)
        {
            double chance = 0.45D;
            if (world.rand.nextFloat() < chance)
            {
                //grow tree
                ((BlockCherrySapling)mod_Rediscovered.CherrySapling).func_149878_d(event.world, event.x, event.y, event.z, event.world.rand);

            }
        }
    }
}
ChunkProviderSavannah.java 文件源码 项目:WuppyMods 阅读 24 收藏 0 点赞 0 评论 0
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]);
        }
    }
}
EventHooks.java 文件源码 项目:Still-Hungry 阅读 21 收藏 0 点赞 0 评论 0
@SubscribeEvent
public void bonemealUsed(BonemealEvent event) {
    int plantMetadata = event.world.getBlockMetadata(event.x, event.y, event.z);

    if (event.world.getBlock(event.x, event.y, event.z) == ModBlocks.riceBlock) {
        if (plantMetadata != 7) {
            event.world.setBlockMetadataWithNotify(event.x, event.y, event.z, plantMetadata + 1, 2);
            event.setResult(Result.ALLOW);
        }
    }
    if (event.world.getBlock(event.x, event.y, event.z) == ModBlocks.strawberryBlock) {
        if (plantMetadata != 7) {
            event.world.setBlockMetadataWithNotify(event.x, event.y, event.z, plantMetadata + 1, 2);
            event.setResult(Result.ALLOW);
        }
    }

    if (event.world.getBlock(event.x, event.y, event.z) == ModBlocks.grapeBlock) {
        if (plantMetadata != 7) {
            event.world.setBlockMetadataWithNotify(event.x, event.y, event.z, plantMetadata + 1, 2);
            event.setResult(Result.ALLOW);
        }
    }
}


问题


面经


文章

微信
公众号

扫码关注公众号