API interface to add variant blocks to altar structure
This commit is contained in:
parent
40cb3a501a
commit
2099826500
2 changed files with 38 additions and 2 deletions
|
@ -0,0 +1,14 @@
|
||||||
|
package WayofTime.alchemicalWizardry.api.tile;
|
||||||
|
|
||||||
|
public interface IAltarComponent {
|
||||||
|
|
||||||
|
ComponentType getType();
|
||||||
|
|
||||||
|
enum ComponentType {
|
||||||
|
GLOWSTONE,
|
||||||
|
BLOODSTONE,
|
||||||
|
BEACON,
|
||||||
|
BLOODRUNE,
|
||||||
|
CRYSTAL
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,8 +5,13 @@ import java.util.List;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import WayofTime.alchemicalWizardry.api.BlockStack;
|
import WayofTime.alchemicalWizardry.api.BlockStack;
|
||||||
|
import WayofTime.alchemicalWizardry.api.tile.IAltarComponent;
|
||||||
|
import WayofTime.alchemicalWizardry.common.block.BlockCrystal;
|
||||||
|
import WayofTime.alchemicalWizardry.common.block.BloodStoneBrick;
|
||||||
|
import WayofTime.alchemicalWizardry.common.block.LargeBloodStoneBrick;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockBeacon;
|
import net.minecraft.block.BlockBeacon;
|
||||||
|
import net.minecraft.block.BlockGlowstone;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||||
|
@ -361,6 +366,10 @@ public class UpgradedAltars
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (altarComponent.getBlock() == ModBlocks.bloodRune)
|
||||||
|
if ((blockStack.getBlock() instanceof BloodRune) || (blockStack.getBlock() instanceof IAltarComponent && (((IAltarComponent) blockStack.getBlock()).getType() == IAltarComponent.ComponentType.BLOODRUNE)))
|
||||||
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -374,7 +383,20 @@ public class UpgradedAltars
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (altarComponent.getBlock() == Blocks.beacon && blockStack.getBlock() instanceof BlockBeacon)
|
if (altarComponent.getBlock() == ModBlocks.largeBloodStoneBrick)
|
||||||
|
if ((blockStack.getBlock() instanceof BloodStoneBrick || blockStack.getBlock() instanceof LargeBloodStoneBrick) || (blockStack.getBlock() instanceof IAltarComponent && (((IAltarComponent) blockStack.getBlock()).getType() == IAltarComponent.ComponentType.BLOODSTONE)))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (altarComponent.getBlock() == ModBlocks.blockCrystal)
|
||||||
|
if ((blockStack.getBlock() instanceof BlockCrystal) || (blockStack.getBlock() instanceof IAltarComponent && (((IAltarComponent) blockStack.getBlock()).getType() == IAltarComponent.ComponentType.CRYSTAL)))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (altarComponent.getBlock() == Blocks.glowstone)
|
||||||
|
if ((blockStack.getBlock() instanceof BlockGlowstone) || (blockStack.getBlock() instanceof IAltarComponent && (((IAltarComponent) blockStack.getBlock()).getType() == IAltarComponent.ComponentType.GLOWSTONE)))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (altarComponent.getBlock() == Blocks.beacon)
|
||||||
|
if ((blockStack.getBlock() instanceof BlockBeacon) || (blockStack.getBlock() instanceof IAltarComponent && (((IAltarComponent) blockStack.getBlock()).getType() == IAltarComponent.ComponentType.BEACON)))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue