BloodMagic/src/main/java/WayofTime/bloodmagic/altar/AltarComponent.java

56 lines
1.3 KiB
Java
Raw Normal View History

package WayofTime.bloodmagic.altar;
import net.minecraft.util.math.BlockPos;
/**
* 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;
private boolean upgradeSlot;
/**
* 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
*/
2018-03-10 02:00:04 +00:00
public AltarComponent(BlockPos offset, ComponentType component) {
this.offset = offset;
this.component = component;
}
/**
* 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
*/
2017-08-16 04:30:48 +00:00
public AltarComponent(BlockPos offset) {
2018-03-10 02:00:04 +00:00
this(offset, ComponentType.NOTAIR);
}
/**
* Sets the location to an upgrade slot.
2017-08-16 04:30:48 +00:00
*
* @return the current instance for further use.
*/
2017-08-16 04:30:48 +00:00
public AltarComponent setUpgradeSlot() {
this.upgradeSlot = true;
return this;
}
public BlockPos getOffset() {
return offset;
}
public boolean isUpgradeSlot() {
return upgradeSlot;
}
2018-03-10 02:00:04 +00:00
public ComponentType getComponent() {
return component;
}
}