本文整理汇总了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);
}
示例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();
}
}
示例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);
}
}
}
示例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());
}
}
}
}
}
示例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)));
}
}
}
示例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);
}
示例7: blockNeighborUpdate
import net.minecraftforge.event.world.BlockEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void blockNeighborUpdate(BlockEvent.NeighborNotifyEvent notifyEvent) {
World world = notifyEvent.getWorld();
dropPlatform(world, notifyEvent.getPos());
}
示例8: blockNeighborUpdate
import net.minecraftforge.event.world.BlockEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void blockNeighborUpdate(BlockEvent.NeighborNotifyEvent notifyEvent) {
World world = notifyEvent.getWorld();
makeRedstonePCB(world, notifyEvent.getPos());
}
示例9: blockNeighborUpdate
import net.minecraftforge.event.world.BlockEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void blockNeighborUpdate(BlockEvent.NeighborNotifyEvent notifyEvent) {
World world = notifyEvent.getWorld();
makeWetSoap(world, notifyEvent.getPos());
}