Implement an inverted MRS that requires an RS signal to function (#1022)
This commit is contained in:
parent
9cbec7dd37
commit
ddb7542827
|
@ -59,7 +59,7 @@ public class BlockRitualController extends BlockEnumContainer<EnumRitualControll
|
|||
{
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
if (getMetaFromState(state) == 0 && tile instanceof TileMasterRitualStone)
|
||||
if (state.getValue(getProperty()) != EnumRitualController.IMPERFECT && tile instanceof TileMasterRitualStone)
|
||||
{
|
||||
if (heldItem != null && heldItem.getItem() == ModItems.ACTIVATION_CRYSTAL)
|
||||
{
|
||||
|
@ -72,13 +72,15 @@ public class BlockRitualController extends BlockEnumContainer<EnumRitualControll
|
|||
if (((TileMasterRitualStone) tile).activateRitual(heldItem, player, RitualRegistry.getRitualForId(key)))
|
||||
{
|
||||
((TileMasterRitualStone) tile).setDirection(direction);
|
||||
if (state.getValue(getProperty()) == EnumRitualController.INVERTED)
|
||||
((TileMasterRitualStone) tile).setInverted(true);
|
||||
}
|
||||
} else
|
||||
{
|
||||
ChatUtil.sendNoSpamUnloc(player, "chat.BloodMagic.ritual.notValid");
|
||||
}
|
||||
}
|
||||
} else if (getMetaFromState(state) == 1 && tile instanceof TileImperfectRitualStone)
|
||||
} else if (state.getValue(getProperty()) == EnumRitualController.IMPERFECT && tile instanceof TileImperfectRitualStone)
|
||||
{
|
||||
|
||||
IBlockState determinerState = world.getBlockState(pos.up());
|
||||
|
@ -109,13 +111,15 @@ public class BlockRitualController extends BlockEnumContainer<EnumRitualControll
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(IBlockState state) {
|
||||
public boolean hasTileEntity(IBlockState state)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, IBlockState state) {
|
||||
return state.getValue(getProperty()) == EnumRitualController.MASTER ? new TileMasterRitualStone() : new TileImperfectRitualStone();
|
||||
public TileEntity createTileEntity(World world, IBlockState state)
|
||||
{
|
||||
return state.getValue(getProperty()) != EnumRitualController.IMPERFECT ? new TileMasterRitualStone() : new TileImperfectRitualStone();
|
||||
}
|
||||
|
||||
// IVariantProvider
|
||||
|
|
|
@ -7,7 +7,9 @@ import net.minecraft.util.IStringSerializable;
|
|||
public enum EnumRitualController implements IStringSerializable
|
||||
{
|
||||
MASTER,
|
||||
IMPERFECT;
|
||||
IMPERFECT,
|
||||
INVERTED,
|
||||
;
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
|
|
|
@ -47,7 +47,9 @@ public class DataProviderRitualController implements IWailaDataProvider
|
|||
{
|
||||
if (accessor.getBlock() instanceof BlockRitualController)
|
||||
{
|
||||
if (accessor.getBlock().getMetaFromState(accessor.getBlockState()) == 0 && accessor.getTileEntity() instanceof TileMasterRitualStone)
|
||||
int controllerMeta = accessor.getBlock().getMetaFromState(accessor.getBlockState());
|
||||
|
||||
if ((controllerMeta == 0 || controllerMeta == 2) && accessor.getTileEntity() instanceof TileMasterRitualStone)
|
||||
{
|
||||
TileMasterRitualStone mrs = (TileMasterRitualStone) accessor.getTileEntity();
|
||||
|
||||
|
@ -63,7 +65,7 @@ public class DataProviderRitualController implements IWailaDataProvider
|
|||
}
|
||||
}
|
||||
|
||||
if (accessor.getBlock().getMetaFromState(accessor.getBlockState()) == 1 && accessor.getTileEntity() instanceof TileImperfectRitualStone)
|
||||
if (controllerMeta == 1 && accessor.getTileEntity() instanceof TileImperfectRitualStone)
|
||||
{
|
||||
if (accessor.getWorld().getBlockState(accessor.getPosition().up()).getBlock() != null)
|
||||
{
|
||||
|
|
|
@ -150,6 +150,8 @@ public class ModRecipes
|
|||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModBlocks.RITUAL_STONE, 4), "aba", "bcb", "aba", 'a', Blocks.OBSIDIAN, 'b', new ItemStack(ModItems.SLATE, 1, 1), 'c', OrbRegistry.getOrbStack(ModItems.ORB_APPRENTICE)));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModBlocks.RITUAL_CONTROLLER), "aba", "bcb", "aba", 'a', Blocks.OBSIDIAN, 'b', ModBlocks.RITUAL_STONE, 'c', OrbRegistry.getOrbStack(ModItems.ORB_MAGICIAN)));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModBlocks.RITUAL_CONTROLLER, 1, 1), "aba", "bcb", "aba", 'a', Blocks.OBSIDIAN, 'b', "stone", 'c', OrbRegistry.getOrbStack(ModItems.ORB_WEAK)));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.RITUAL_CONTROLLER, 1, 2), new ItemStack(ModBlocks.RITUAL_CONTROLLER), new ItemStack(Blocks.REDSTONE_TORCH), new ItemStack(ModItems.SLATE)));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.RITUAL_CONTROLLER), new ItemStack(ModBlocks.RITUAL_CONTROLLER, 1, 2)));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.BASE_ITEM_FILTER, 1, 0), "sgs", "gfg", "sgs", 'f', ItemComponent.getStack(ItemComponent.COMPONENT_FRAME_PART), 'g', "blockGlass", 's', "stickWood"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.BASE_ITEM_FILTER, 1, 1), "sgs", "gfg", "sgs", 'f', ItemComponent.getStack(ItemComponent.COMPONENT_FRAME_PART), 'g', "dyeYellow", 's', "stickWood"));
|
||||
|
|
|
@ -46,6 +46,8 @@ public class TileMasterRitualStone extends TileTicking implements IMasterRitualS
|
|||
private Ritual currentRitual;
|
||||
@Setter
|
||||
private EnumFacing direction = EnumFacing.NORTH;
|
||||
@Setter
|
||||
private boolean inverted;
|
||||
|
||||
private List<EnumDemonWillType> currentActiveWillConfig = new ArrayList<EnumDemonWillType>();
|
||||
|
||||
|
@ -55,7 +57,7 @@ public class TileMasterRitualStone extends TileTicking implements IMasterRitualS
|
|||
if (getWorld().isRemote)
|
||||
return;
|
||||
|
||||
if (getWorld().isBlockPowered(getPos()) && isActive())
|
||||
if (isPowered() && isActive())
|
||||
{
|
||||
active = false;
|
||||
redstoned = true;
|
||||
|
@ -63,7 +65,7 @@ public class TileMasterRitualStone extends TileTicking implements IMasterRitualS
|
|||
return;
|
||||
}
|
||||
|
||||
if (!isActive() && !getWorld().isBlockPowered(getPos()) && isRedstoned() && getCurrentRitual() != null)
|
||||
if (!isActive() && !isPowered() && isRedstoned() && getCurrentRitual() != null)
|
||||
{
|
||||
active = true;
|
||||
ItemStack crystalStack = NBTHelper.checkNBT(new ItemStack(ModItems.ACTIVATION_CRYSTAL, 1, getCurrentRitual().getCrystalLevel()));
|
||||
|
@ -405,4 +407,12 @@ public class TileMasterRitualStone extends TileTicking implements IMasterRitualS
|
|||
ChatUtil.sendNoSpam(player, new TextComponentTranslation("ritual.BloodMagic.willConfig.void"));
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isPowered()
|
||||
{
|
||||
if (inverted)
|
||||
return !getWorld().isBlockPowered(getPos());
|
||||
|
||||
return getWorld().isBlockPowered(getPos());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,11 @@
|
|||
"textures": {
|
||||
"all": "bloodmagic:blocks/ImperfectRitualStone"
|
||||
}
|
||||
},
|
||||
"inverted": {
|
||||
"textures": {
|
||||
"all": "bloodmagic:blocks/MasterRitualStone_Inverted"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -198,6 +198,7 @@ tile.BloodMagic.fluid.lifeEssence.name=Life Essence
|
|||
|
||||
tile.BloodMagic.stone.ritual.master.name=Master Ritual Stone
|
||||
tile.BloodMagic.stone.ritual.imperfect.name=Imperfect Ritual Stone
|
||||
tile.BloodMagic.stone.ritual.inverted.name=Inverted Master Ritual Stone
|
||||
|
||||
tile.BloodMagic.altar.name=Blood Altar
|
||||
tile.BloodMagic.alchemyArray.name=&r&fAlchemy Array
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 724 B |
Loading…
Reference in a new issue