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


Java BlockEvent.NeighborNotifyEvent方法代码示例

本文整理汇总了Java中net.minecraftforge.event.world.BlockEvent.NeighborNotifyEvent方法的典型用法代码示例。如果您正苦于以下问题:Java BlockEvent.NeighborNotifyEvent方法的具体用法?Java BlockEvent.NeighborNotifyEvent怎么用?Java BlockEvent.NeighborNotifyEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.event.world.BlockEvent的用法示例。


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

示例1: redstoneUpdate

import net.minecraftforge.event.world.BlockEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void redstoneUpdate(BlockEvent.NeighborNotifyEvent event)
{
    World world = event.getWorld();
    BlockPos pos = event.getPos();
    IBlockState state = event.getState();

    if(state.getBlock() != Blocks.REDSTONE_WIRE)
        return;

    if(!willRedstoneBoil(world,pos))
        return;

    if(state.getValue(BlockRedstoneWire.POWER) > 0)
        return;

    scheduleRedstone(world,pos,9);
}
 
开发者ID:DaedalusGame,项目名称:BetterWithAddons,代码行数:19,代码来源:RedstoneBoilHandler.java

示例2: onBlockUpdate

import net.minecraftforge.event.world.BlockEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onBlockUpdate(BlockEvent.NeighborNotifyEvent e) {
	if (!Seasons.enabled)
		return;
	try {
		if (e.getState() == null)
			return;
		if ((e.getState().getBlock() instanceof ITemperatureUpdater ? !((ITemperatureUpdater)e.getState().getBlock()).requiresTemperatureUpdate(e.getWorld(), e.getState(), e.getPos()): !SeasonsAPI.instance.getBlockTemperatureRegistry().hasTemperature(e.getState())))
			return;
		if (!tempMap.containsKey(e.getWorld().getChunkFromBlockCoords(e.getPos()).getChunkCoordIntPair()))
			return;
		tempMap.get(e.getWorld().getChunkFromBlockCoords(e.getPos()).getChunkCoordIntPair()).calcBlockTemp(e.getWorld(), e.getPos());
	} catch (Exception ex) {
		ex.printStackTrace();
	}
}
 
开发者ID:EdwinMindcraft,项目名称:SeasonsAPI,代码行数:17,代码来源:WorldHandler.java

示例3: makeBlazeGolem

import net.minecraftforge.event.world.BlockEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void makeBlazeGolem(BlockEvent.NeighborNotifyEvent event)
{
    World world = event.getWorld();
    BlockPos pos = event.getPos();
    IBlockState head = event.getState();

    if(!world.isRemote && InteractionBWR.BLAZE_GOLEMS && head.getBlock() == Blocks.SKULL)
    {
        TileEntity te = world.getTileEntity(pos);
        if(!(te instanceof TileEntitySkull) || ((TileEntitySkull) te).getSkullType() != 0)
            return;

        BlockPos body = pos.down();
        BlockPos feet = pos.down(2);

        if(world.getBlockState(body).getBlock() == Blocks.GOLD_BLOCK &&
                world.getBlockState(body.north()).getBlock() == Blocks.IRON_BARS &&
                world.getBlockState(body.south()).getBlock() == Blocks.IRON_BARS &&
                world.getBlockState(body.east()).getBlock() == Blocks.IRON_BARS &&
                world.getBlockState(body.west()).getBlock() == Blocks.IRON_BARS &&
                world.getBlockState(feet).getMaterial() == Material.FIRE)
        {
            world.setBlockToAir(pos);
            world.setBlockToAir(body);
            world.setBlockToAir(body.north());
            world.setBlockToAir(body.south());
            world.setBlockToAir(body.east());
            world.setBlockToAir(body.west());
            world.setBlockToAir(feet);

            spawnArtificalBlaze(world,feet,true);
        }
    }
}
 
开发者ID:DaedalusGame,项目名称:BetterWithAddons,代码行数:36,代码来源:RenewablesHandler.java

示例4: hardcorePacking

import net.minecraftforge.event.world.BlockEvent; //导入方法依赖的package包/类
public void hardcorePacking(BlockEvent.NeighborNotifyEvent notifyEvent) {
    World world = notifyEvent.getWorld();
    BlockPos pos = notifyEvent.getPos();
    IBlockState state = notifyEvent.getState();
    if(state.getBlock() instanceof BlockPistonBase)
    {
        boolean extended = state.getValue(BlockPistonBase.EXTENDED);
        EnumFacing facing = state.getValue(BlockPistonBase.FACING);
        if(world.isBlockPowered(pos) && !extended)
        {
            BlockPos shovePos = pos.offset(facing);
            IBlockState shoveState = world.getBlockState(shovePos);

            if(!isEmpty(world,shovePos,shoveState))
            {
                shovePos = shovePos.offset(facing);
                shoveState = world.getBlockState(shovePos);
            }

            if(isEmpty(world, shovePos, shoveState))
            {
                BlockPos compressPos = shovePos.offset(facing);
                IBlockState compressState = world.getBlockState(compressPos);
                if(isEmpty(world, compressPos, compressState))
                {
                    world.setBlockState(compressPos,Blocks.CLAY.getDefaultState());
                }
            }
        }

    }
}
 
开发者ID:DaedalusGame,项目名称:BetterWithAddons,代码行数:33,代码来源:AssortedHandler.java

示例5: onBlockUpdate

import net.minecraftforge.event.world.BlockEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onBlockUpdate(BlockEvent.NeighborNotifyEvent event)
{
	for (EnumFacing f : EnumFacing.VALUES)
    {
		BlockPos pos = event.getPos().offset(f);
		IBlockState state = event.getWorld().getBlockState(pos);
		if (event.getState().getBlock() == this && (state.getBlock() == this) && (state.getValue(FACING) == event.getState().getValue(FACING)))
		{
			event.getWorld().setBlockState(pos, state.withProperty(OPEN, event.getState().getValue(OPEN)));
		}
    }
}
 
开发者ID:Zundrel,项目名称:How-Bout-That-Furniture,代码行数:14,代码来源:BlockBlinds.java

示例6: onNeighborNotify

import net.minecraftforge.event.world.BlockEvent; //导入方法依赖的package包/类
@SubscribeEvent
    public void onNeighborNotify(BlockEvent.NeighborNotifyEvent event) {
//        if (event.getWorld().getBlockState(event.getPos().up()).getBlock() == FCRBlocks.RICE_PLANT &&
//            event.getState().getBlock() != Blocks.FARMLAND)
//            event.getWorld().destroyBlock(event.getPos().up(), true);
    }
 
开发者ID:LasmGratel,项目名称:FoodCraft-Reloaded,代码行数:7,代码来源:EventLoader.java

示例7: blockNeighborUpdate

import net.minecraftforge.event.world.BlockEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void blockNeighborUpdate(BlockEvent.NeighborNotifyEvent notifyEvent) {
    World world = notifyEvent.getWorld();
    dropPlatform(world, notifyEvent.getPos());
}
 
开发者ID:DaedalusGame,项目名称:BetterWithAddons,代码行数:6,代码来源:FallingPlatformHandler.java

示例8: blockNeighborUpdate

import net.minecraftforge.event.world.BlockEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void blockNeighborUpdate(BlockEvent.NeighborNotifyEvent notifyEvent) {
    World world = notifyEvent.getWorld();
    makeRedstonePCB(world, notifyEvent.getPos());
}
 
开发者ID:DaedalusGame,项目名称:BetterWithAddons,代码行数:6,代码来源:AssortedHandler.java

示例9: blockNeighborUpdate

import net.minecraftforge.event.world.BlockEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void blockNeighborUpdate(BlockEvent.NeighborNotifyEvent notifyEvent) {
    World world = notifyEvent.getWorld();
    makeWetSoap(world, notifyEvent.getPos());
}
 
开发者ID:DaedalusGame,项目名称:BetterWithAddons,代码行数:6,代码来源:SoapHandler.java


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