Java Code Examples for net.minecraftforge.event.world.BlockEvent#getPos()

The following examples show how to use net.minecraftforge.event.world.BlockEvent#getPos() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ModGenuinePeoplePersonalities.java    From CommunityMod with GNU Lesser General Public License v2.1 5 votes vote down vote up
public EventData(BlockEvent event) {
    this.event = event;
    this.pos = event.getPos();
    this.world = event.getWorld();
    this.state = event.getState();
    this.random = world.rand;
    this.block = this.state.getBlock();
    this.hand = null;
    this.player = null;
}
 
Example 2
Source File: EventsCommon.java    From Valkyrien-Skies with Apache License 2.0 5 votes vote down vote up
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onBlockBreakFirst(BlockEvent event) {
    BlockPos pos = event.getPos();
    Chunk chunk = event.getWorld()
        .getChunk(pos);
    IPhysicsChunk physicsChunk = (IPhysicsChunk) chunk;
    if (physicsChunk.getPhysicsObjectOptional()
        .isPresent()) {
        event.setResult(Result.ALLOW);
    }
}