All Downloads are FREE. Search and download functionalities are using the official Maven repository.

mmb.engine.block.SensitiveBlock Maven / Gradle / Ivy

Go to download

Dependency for the MultiMachineBuilder, a voxel game about building an industrial empire in a finite world. THIS RELEASE IS NOT PLAYABLE. To play the game, donwload from >ITCH.IO LINK HERE< or >GH releases link here<

The newest version!
/**
 * 
 */
package mmb.engine.block;

import mmb.NN;
import mmb.Nil;
import mmb.beans.Positioned;
import mmb.engine.worlds.world.World;

/**
 * A block which is instantiated prior to placement, in contrast to placement directly as a simple block
 * @author oskar
 */
public interface SensitiveBlock extends BlockEntry, Positioned {
	/**
	 * Gets the current holder of the block
	 * @throws IllegalArgumentException when there is no onwer
	 * @return the current owner
	 */
	@NN public default World owner() {
		World owner = nowner();
		if(owner == null) throw new IllegalStateException("Not placed in map");
		return owner;
	}
	/**
	 * Gets the current holder of the block
	 * @return the current owner or null
	 */
	@Nil public World nowner();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy