Refactor everything to WayofTime.bloodmagic.*
This commit is contained in:
parent
46742a73d1
commit
096ba02450
771 changed files with 566 additions and 573 deletions
|
@ -0,0 +1,64 @@
|
|||
package WayofTime.bloodmagic.api.altar;
|
||||
|
||||
import WayofTime.bloodmagic.api.BlockStack;
|
||||
import lombok.Getter;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.BlockPos;
|
||||
|
||||
/**
|
||||
* Used for building the altar structure.
|
||||
*/
|
||||
@Getter
|
||||
public class AltarComponent {
|
||||
|
||||
private BlockPos offset;
|
||||
private BlockStack blockStack;
|
||||
private boolean bloodRune;
|
||||
private boolean upgradeSlot;
|
||||
|
||||
/**
|
||||
* @param offset - The position in the world relative to the MasterRitualStone
|
||||
* @param blockStack - The block and meta combination expected
|
||||
*/
|
||||
public AltarComponent(BlockPos offset, BlockStack blockStack) {
|
||||
this.offset = offset;
|
||||
this.blockStack = blockStack;
|
||||
}
|
||||
|
||||
/**
|
||||
* Non-meta based variant for ease of use.
|
||||
*/
|
||||
public AltarComponent(BlockPos offset, Block block) {
|
||||
this(offset, new BlockStack(block));
|
||||
}
|
||||
|
||||
/**
|
||||
* Use for setting a location at which there must be a block, but the type
|
||||
* of block does not matter.
|
||||
*/
|
||||
public AltarComponent(BlockPos offset) {
|
||||
this(offset, new BlockStack(Blocks.air));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the location to a Blood Rune. This does not mean that the location
|
||||
* can be used as an upgrade.
|
||||
*
|
||||
* @return the current instance for further use.
|
||||
*/
|
||||
public AltarComponent setBloodRune() {
|
||||
this.bloodRune = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the location to an upgrade slot.
|
||||
*
|
||||
* @return the current instance for further use.
|
||||
*/
|
||||
public AltarComponent setUpgradeSlot() {
|
||||
this.upgradeSlot = true;
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package WayofTime.bloodmagic.api.altar;
|
||||
|
||||
import lombok.Getter;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@Getter
|
||||
public class AltarRecipe {
|
||||
|
||||
public final int minTier, syphon, consumeRate, drainRate;
|
||||
public final boolean useTag;
|
||||
public final ItemStack input, output;
|
||||
|
||||
/**
|
||||
* Allows creation of a recipe for the {@link WayofTime.bloodmagic.block.BlockAltar} / {@link WayofTime.bloodmagic.tile.TileAltar}.
|
||||
* The output ItemStack is allowed to be null as some recipes do not contain an output. (Blood Orbs)
|
||||
*
|
||||
* @param input - The input ItemStack
|
||||
* @param output - The ItemStack obtained from the recipe
|
||||
* @param minTier - The minimum tier of Altar required
|
||||
* @param syphon - The amount of LP to syphon from the Altar
|
||||
* @param consumeRate - The rate at which LP is consumed during crafting
|
||||
* @param drainRate - The rate at which LP is drained during crafting
|
||||
* @param useTag -
|
||||
*/
|
||||
public AltarRecipe(ItemStack input, @Nullable ItemStack output, int minTier, int syphon, int consumeRate, int drainRate, boolean useTag) {
|
||||
this.input = input;
|
||||
this.output = output;
|
||||
this.minTier = minTier;
|
||||
this.syphon = syphon;
|
||||
this.consumeRate = consumeRate;
|
||||
this.drainRate = drainRate;
|
||||
this.useTag = useTag;
|
||||
}
|
||||
|
||||
public AltarRecipe(ItemStack input, ItemStack output, int minTier, int syphon, int consumeRate, int drainRate) {
|
||||
this(input, output, minTier, syphon, consumeRate, drainRate, false);
|
||||
}
|
||||
|
||||
public AltarRecipe (ItemStack input, int minTier, int consumeRate, int drainRate) {
|
||||
this(input, null, minTier, 0, consumeRate, drainRate);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package WayofTime.bloodmagic.api.altar;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public class AltarUpgrade {
|
||||
|
||||
private int speedCount;
|
||||
|
||||
public AltarUpgrade() {
|
||||
|
||||
}
|
||||
|
||||
// Adders
|
||||
|
||||
public AltarUpgrade addSpeed() {
|
||||
speedCount++;
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package WayofTime.bloodmagic.api.altar;
|
||||
|
||||
public enum EnumAltarComponent {
|
||||
|
||||
GLOWSTONE,
|
||||
BLOODSTONE,
|
||||
BEACON,
|
||||
BLOODRUNE,
|
||||
CRYSTAL
|
||||
}
|
135
src/main/java/WayofTime/bloodmagic/api/altar/EnumAltarTier.java
Normal file
135
src/main/java/WayofTime/bloodmagic/api/altar/EnumAltarTier.java
Normal file
|
@ -0,0 +1,135 @@
|
|||
package WayofTime.bloodmagic.api.altar;
|
||||
|
||||
import WayofTime.bloodmagic.api.BlockStack;
|
||||
import WayofTime.bloodmagic.registry.ModBlocks;
|
||||
import lombok.Getter;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.BlockPos;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@Getter
|
||||
public enum EnumAltarTier {
|
||||
ONE(),
|
||||
TWO() {
|
||||
@Override
|
||||
public void buildComponents() {
|
||||
altarComponents.add(new AltarComponent(new BlockPos(-1, -1, -1), ModBlocks.rune).setBloodRune());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(0, -1, -1), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(1, -1, -1), ModBlocks.rune).setBloodRune());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(-1, -1, 0), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(1, -1, 0), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(-1, -1, 1), ModBlocks.rune).setBloodRune());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(0, -1, 1), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(1, -1, 1), ModBlocks.rune).setBloodRune());
|
||||
}
|
||||
},
|
||||
THREE() {
|
||||
@Override
|
||||
public void buildComponents() {
|
||||
altarComponents.addAll(TWO.getAltarComponents());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(-1, -1, -1), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(0, -1, -1), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(1, -1, -1), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(-1, -1, 0), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(1, -1, 0), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(-1, -1, 1), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(0, -1, 1), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(1, -1, 1), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(-3, -1, -3)));
|
||||
altarComponents.add(new AltarComponent(new BlockPos(-3, 0, -3)));
|
||||
altarComponents.add(new AltarComponent(new BlockPos(3, -1, -3)));
|
||||
altarComponents.add(new AltarComponent(new BlockPos(3, 0, -3)));
|
||||
altarComponents.add(new AltarComponent(new BlockPos(-3, -1, 3)));
|
||||
altarComponents.add(new AltarComponent(new BlockPos(-3, 0, 3)));
|
||||
altarComponents.add(new AltarComponent(new BlockPos(3, -1, 3)));
|
||||
altarComponents.add(new AltarComponent(new BlockPos(3, 0, 3)));
|
||||
altarComponents.add(new AltarComponent(new BlockPos(-3, 1, -3), Blocks.glowstone));
|
||||
altarComponents.add(new AltarComponent(new BlockPos(3, 1, -3), Blocks.glowstone));
|
||||
altarComponents.add(new AltarComponent(new BlockPos(-3, 1, 3), Blocks.glowstone));
|
||||
altarComponents.add(new AltarComponent(new BlockPos(3, 1, 3), Blocks.glowstone));
|
||||
|
||||
for (int i = -2; i <= 2; i++) {
|
||||
altarComponents.add(new AltarComponent(new BlockPos(3, -2, i), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(-3, -2, i), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(i, -2, 3), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(i, -2, -3), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
}
|
||||
}
|
||||
},
|
||||
FOUR() {
|
||||
@Override
|
||||
public void buildComponents() {
|
||||
altarComponents.addAll(THREE.getAltarComponents());
|
||||
|
||||
for (int i = -3; i <= 3; i++) {
|
||||
altarComponents.add(new AltarComponent(new BlockPos(5, -3, i), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(-5, -3, i), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(i, -3, 5), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(i, -3, -5), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
}
|
||||
|
||||
for (int i = -2; i <= 1; i++) {
|
||||
altarComponents.add(new AltarComponent(new BlockPos(5, i, 5)));
|
||||
altarComponents.add(new AltarComponent(new BlockPos(5, i, -5)));
|
||||
altarComponents.add(new AltarComponent(new BlockPos(-5, i, -5)));
|
||||
altarComponents.add(new AltarComponent(new BlockPos(-5, i, 5)));
|
||||
}
|
||||
|
||||
altarComponents.add(new AltarComponent(new BlockPos(5, 2, 5), new BlockStack(ModBlocks.bloodStone, 1)));
|
||||
altarComponents.add(new AltarComponent(new BlockPos(5, 2, -5), new BlockStack(ModBlocks.bloodStone, 1)));
|
||||
altarComponents.add(new AltarComponent(new BlockPos(-5, 2, -5), new BlockStack(ModBlocks.bloodStone, 1)));
|
||||
altarComponents.add(new AltarComponent(new BlockPos(-5, 2, 5), new BlockStack(ModBlocks.bloodStone, 1)));
|
||||
}
|
||||
},
|
||||
FIVE() {
|
||||
@Override
|
||||
public void buildComponents() {
|
||||
altarComponents.addAll(FOUR.getAltarComponents());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(-8, -3, 8), Blocks.beacon));
|
||||
altarComponents.add(new AltarComponent(new BlockPos(-8, -3, -8), Blocks.beacon));
|
||||
altarComponents.add(new AltarComponent(new BlockPos(8, -3, -8), Blocks.beacon));
|
||||
altarComponents.add(new AltarComponent(new BlockPos(8, -3, 8), Blocks.beacon));
|
||||
|
||||
for (int i = -6; i <= 6; i++) {
|
||||
altarComponents.add(new AltarComponent(new BlockPos(8, -4, i), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(-8, -4, i), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(i, -4, 8), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(i, -4, -8), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
}
|
||||
}
|
||||
},
|
||||
SIX() {
|
||||
@Override
|
||||
public void buildComponents() {
|
||||
altarComponents.addAll(FIVE.getAltarComponents());
|
||||
|
||||
for(int i = -4; i <= 2; i++) {
|
||||
altarComponents.add(new AltarComponent(new BlockPos(11, i, 11)));
|
||||
altarComponents.add(new AltarComponent(new BlockPos(-11, i, -11)));
|
||||
altarComponents.add(new AltarComponent(new BlockPos(11, i, -11)));
|
||||
altarComponents.add(new AltarComponent(new BlockPos(-11, i, 11)));
|
||||
}
|
||||
|
||||
altarComponents.add(new AltarComponent(new BlockPos(11, 3, 11), ModBlocks.crystal));
|
||||
altarComponents.add(new AltarComponent(new BlockPos(-11, 3, -11), ModBlocks.crystal));
|
||||
altarComponents.add(new AltarComponent(new BlockPos(11, 3, -11), ModBlocks.crystal));
|
||||
altarComponents.add(new AltarComponent(new BlockPos(-11, 3, 11), ModBlocks.crystal));
|
||||
|
||||
for (int i = -9; i <= 9; i++) {
|
||||
altarComponents.add(new AltarComponent(new BlockPos(11, -5, i), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(-11, -5, i), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(i, -5, 11), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
altarComponents.add(new AltarComponent(new BlockPos(i, -5, -11), ModBlocks.rune).setUpgradeSlot().setBloodRune());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public static final int MAXTIERS = values().length;
|
||||
|
||||
ArrayList<AltarComponent> altarComponents = new ArrayList<AltarComponent>();
|
||||
|
||||
public void buildComponents() {
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
package WayofTime.bloodmagic.api.altar;
|
||||
|
||||
public interface IAltarComponent {
|
||||
|
||||
EnumAltarComponent getType(int meta);
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package WayofTime.bloodmagic.api.altar;
|
||||
|
||||
public interface IBloodAltar {
|
||||
|
||||
int getCapacity();
|
||||
|
||||
int getCurrentBlood();
|
||||
|
||||
int getTier();
|
||||
|
||||
int getProgress();
|
||||
|
||||
float getSacrificeMultiplier();
|
||||
|
||||
float getSelfSacrificeMultiplier();
|
||||
|
||||
float getOrbMultiplier();
|
||||
|
||||
float getDislocationMultiplier();
|
||||
|
||||
int getBufferCapacity();
|
||||
|
||||
void sacrificialDaggerCall(int amount, boolean b);
|
||||
|
||||
void startCycle();
|
||||
|
||||
/**
|
||||
* Will set the altar to initiate a cooldown cycle after it crafts before starting to craft again, giving the user time to interact with the altar.
|
||||
* This can only be set while the altar is not active.
|
||||
*
|
||||
* @param cooldown - How long the cooldown should last
|
||||
*/
|
||||
void requestPauseAfterCrafting(int cooldown);
|
||||
|
||||
void addToDemonBloodDuration(int dur);
|
||||
|
||||
boolean hasDemonBlood();
|
||||
|
||||
void decrementDemonBlood();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue