2018-02-16 02:49:01 +00:00
|
|
|
package WayofTime.bloodmagic.altar;
|
2015-10-30 03:22:14 +00:00
|
|
|
|
2016-03-17 20:00:44 +00:00
|
|
|
import net.minecraft.util.math.BlockPos;
|
2015-10-30 03:22:14 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Used for building the altar structure.
|
|
|
|
*/
|
2017-08-16 04:30:48 +00:00
|
|
|
public class AltarComponent {
|
2018-03-10 02:00:04 +00:00
|
|
|
private final BlockPos offset;
|
|
|
|
private final ComponentType component;
|
2015-10-30 03:22:14 +00:00
|
|
|
private boolean upgradeSlot;
|
|
|
|
|
|
|
|
/**
|
2015-12-03 00:02:18 +00:00
|
|
|
* Sets a component location for the altar.
|
2017-08-16 04:30:48 +00:00
|
|
|
*
|
|
|
|
* @param offset - Where the block should be in relation to the Altar
|
|
|
|
* @param component - The type of Component the location should contain
|
2015-10-30 03:22:14 +00:00
|
|
|
*/
|
2018-03-10 02:00:04 +00:00
|
|
|
public AltarComponent(BlockPos offset, ComponentType component) {
|
2015-12-03 00:02:18 +00:00
|
|
|
this.offset = offset;
|
|
|
|
this.component = component;
|
2015-10-30 03:22:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Use for setting a location at which there must be a block, but the type
|
|
|
|
* of block does not matter.
|
2017-08-16 04:30:48 +00:00
|
|
|
*
|
|
|
|
* @param offset - Where the block should be in relation to the Altar
|
2015-10-30 03:22:14 +00:00
|
|
|
*/
|
2017-08-16 04:30:48 +00:00
|
|
|
public AltarComponent(BlockPos offset) {
|
2018-03-10 02:00:04 +00:00
|
|
|
this(offset, ComponentType.NOTAIR);
|
2015-10-30 03:22:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the location to an upgrade slot.
|
2017-08-16 04:30:48 +00:00
|
|
|
*
|
2015-10-30 03:22:14 +00:00
|
|
|
* @return the current instance for further use.
|
|
|
|
*/
|
2017-08-16 04:30:48 +00:00
|
|
|
public AltarComponent setUpgradeSlot() {
|
2015-10-30 03:22:14 +00:00
|
|
|
this.upgradeSlot = true;
|
|
|
|
return this;
|
|
|
|
}
|
2017-08-15 03:53:42 +00:00
|
|
|
|
|
|
|
public BlockPos getOffset() {
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isUpgradeSlot() {
|
|
|
|
return upgradeSlot;
|
|
|
|
}
|
|
|
|
|
2018-03-10 02:00:04 +00:00
|
|
|
public ComponentType getComponent() {
|
2017-08-15 03:53:42 +00:00
|
|
|
return component;
|
|
|
|
}
|
2015-10-30 03:22:14 +00:00
|
|
|
}
|