2015-11-02 20:39:44 +00:00
|
|
|
package WayofTime.bloodmagic.tile;
|
|
|
|
|
2016-04-11 19:36:27 +00:00
|
|
|
import java.util.ArrayList;
|
2016-04-11 01:19:18 +00:00
|
|
|
import java.util.List;
|
|
|
|
|
2016-09-08 00:46:06 +00:00
|
|
|
import WayofTime.bloodmagic.tile.base.TileTicking;
|
2016-03-17 20:00:44 +00:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.nbt.NBTTagCompound;
|
|
|
|
import net.minecraft.util.EnumFacing;
|
|
|
|
import net.minecraft.util.math.BlockPos;
|
2016-04-11 01:19:18 +00:00
|
|
|
import net.minecraft.util.text.TextComponentTranslation;
|
2016-03-17 20:00:44 +00:00
|
|
|
import net.minecraft.world.World;
|
|
|
|
import net.minecraftforge.common.MinecraftForge;
|
|
|
|
import net.minecraftforge.fml.common.eventhandler.Event;
|
2016-04-11 01:19:18 +00:00
|
|
|
import WayofTime.bloodmagic.api.Constants;
|
|
|
|
import WayofTime.bloodmagic.api.event.RitualEvent;
|
|
|
|
import WayofTime.bloodmagic.api.registry.RitualRegistry;
|
|
|
|
import WayofTime.bloodmagic.api.ritual.IMasterRitualStone;
|
|
|
|
import WayofTime.bloodmagic.api.ritual.Ritual;
|
2016-06-20 13:31:16 +00:00
|
|
|
import WayofTime.bloodmagic.api.saving.SoulNetwork;
|
2016-04-11 01:19:18 +00:00
|
|
|
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
|
|
|
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
|
|
|
|
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
|
|
|
|
import WayofTime.bloodmagic.api.util.helper.PlayerHelper;
|
|
|
|
import WayofTime.bloodmagic.api.util.helper.RitualHelper;
|
|
|
|
import WayofTime.bloodmagic.item.ItemActivationCrystal;
|
2017-08-15 03:53:42 +00:00
|
|
|
import WayofTime.bloodmagic.registry.RegistrarBloodMagicItems;
|
2016-04-11 01:19:18 +00:00
|
|
|
import WayofTime.bloodmagic.util.ChatUtil;
|
|
|
|
|
|
|
|
import com.google.common.base.Strings;
|
2015-11-01 00:58:47 +00:00
|
|
|
|
2017-03-29 01:45:45 +00:00
|
|
|
import javax.annotation.Nullable;
|
|
|
|
|
2016-09-08 00:46:06 +00:00
|
|
|
public class TileMasterRitualStone extends TileTicking implements IMasterRitualStone
|
2015-12-30 20:34:40 +00:00
|
|
|
{
|
|
|
|
private String owner;
|
2017-02-13 01:00:18 +00:00
|
|
|
private SoulNetwork cachedNetwork;
|
2015-12-30 20:34:40 +00:00
|
|
|
private boolean active;
|
2016-01-28 22:54:32 +00:00
|
|
|
private boolean redstoned;
|
2015-12-30 20:34:40 +00:00
|
|
|
private int activeTime;
|
|
|
|
private int cooldown;
|
|
|
|
private Ritual currentRitual;
|
|
|
|
private EnumFacing direction = EnumFacing.NORTH;
|
2017-02-14 03:35:14 +00:00
|
|
|
private boolean inverted;
|
2016-07-11 01:51:17 +00:00
|
|
|
private List<EnumDemonWillType> currentActiveWillConfig = new ArrayList<EnumDemonWillType>();
|
|
|
|
|
2015-12-30 20:34:40 +00:00
|
|
|
@Override
|
2016-09-08 00:46:06 +00:00
|
|
|
public void onUpdate()
|
2015-12-30 20:34:40 +00:00
|
|
|
{
|
2016-12-13 03:56:36 +00:00
|
|
|
if (getWorld().isRemote)
|
2016-01-28 22:54:32 +00:00
|
|
|
return;
|
|
|
|
|
2017-02-14 03:35:14 +00:00
|
|
|
if (isPowered() && isActive())
|
2016-01-28 22:54:32 +00:00
|
|
|
{
|
|
|
|
active = false;
|
|
|
|
redstoned = true;
|
|
|
|
stopRitual(Ritual.BreakType.REDSTONE);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-02-14 03:35:14 +00:00
|
|
|
if (!isActive() && !isPowered() && isRedstoned() && getCurrentRitual() != null)
|
2016-01-28 22:54:32 +00:00
|
|
|
{
|
|
|
|
active = true;
|
2017-08-15 03:53:42 +00:00
|
|
|
ItemStack crystalStack = NBTHelper.checkNBT(new ItemStack(RegistrarBloodMagicItems.ACTIVATION_CRYSTAL, 1, getCurrentRitual().getCrystalLevel()));
|
2016-01-28 22:54:32 +00:00
|
|
|
crystalStack.getTagCompound().setString(Constants.NBT.OWNER_UUID, getOwner());
|
2016-02-18 17:11:29 +00:00
|
|
|
activateRitual(crystalStack, null, getCurrentRitual());
|
2016-02-04 21:32:59 +00:00
|
|
|
redstoned = false;
|
2016-01-28 22:54:32 +00:00
|
|
|
}
|
|
|
|
|
2015-12-30 20:34:40 +00:00
|
|
|
if (getCurrentRitual() != null && isActive())
|
|
|
|
{
|
|
|
|
if (activeTime % getCurrentRitual().getRefreshTime() == 0)
|
|
|
|
performRitual(getWorld(), getPos());
|
|
|
|
|
|
|
|
activeTime++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-09-08 00:46:06 +00:00
|
|
|
public void deserialize(NBTTagCompound tag)
|
2015-12-30 20:34:40 +00:00
|
|
|
{
|
|
|
|
owner = tag.getString(Constants.NBT.OWNER_UUID);
|
2017-02-13 01:00:18 +00:00
|
|
|
if (!Strings.isNullOrEmpty(owner))
|
|
|
|
cachedNetwork = NetworkHelper.getSoulNetwork(owner);
|
2015-12-30 20:34:40 +00:00
|
|
|
currentRitual = RitualRegistry.getRitualForId(tag.getString(Constants.NBT.CURRENT_RITUAL));
|
2016-01-09 20:31:30 +00:00
|
|
|
if (currentRitual != null)
|
|
|
|
{
|
|
|
|
NBTTagCompound ritualTag = tag.getCompoundTag(Constants.NBT.CURRENT_RITUAL_TAG);
|
2017-03-09 02:00:36 +00:00
|
|
|
if (!ritualTag.hasNoTags())
|
2016-01-09 20:31:30 +00:00
|
|
|
{
|
|
|
|
currentRitual.readFromNBT(ritualTag);
|
|
|
|
}
|
|
|
|
}
|
2015-12-30 20:34:40 +00:00
|
|
|
active = tag.getBoolean(Constants.NBT.IS_RUNNING);
|
|
|
|
activeTime = tag.getInteger(Constants.NBT.RUNTIME);
|
|
|
|
direction = EnumFacing.VALUES[tag.getInteger(Constants.NBT.DIRECTION)];
|
2016-02-18 17:26:42 +00:00
|
|
|
redstoned = tag.getBoolean(Constants.NBT.IS_REDSTONED);
|
2016-07-11 01:51:17 +00:00
|
|
|
|
|
|
|
for (EnumDemonWillType type : EnumDemonWillType.values())
|
|
|
|
{
|
|
|
|
if (tag.getBoolean("EnumWill" + type))
|
|
|
|
{
|
|
|
|
currentActiveWillConfig.add(type);
|
|
|
|
}
|
|
|
|
}
|
2015-12-30 20:34:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-09-08 00:46:06 +00:00
|
|
|
public NBTTagCompound serialize(NBTTagCompound tag)
|
2015-12-30 20:34:40 +00:00
|
|
|
{
|
|
|
|
String ritualId = RitualRegistry.getIdForRitual(getCurrentRitual());
|
|
|
|
tag.setString(Constants.NBT.OWNER_UUID, Strings.isNullOrEmpty(getOwner()) ? "" : getOwner());
|
|
|
|
tag.setString(Constants.NBT.CURRENT_RITUAL, Strings.isNullOrEmpty(ritualId) ? "" : ritualId);
|
2016-01-09 20:31:30 +00:00
|
|
|
if (currentRitual != null)
|
|
|
|
{
|
|
|
|
NBTTagCompound ritualTag = new NBTTagCompound();
|
|
|
|
currentRitual.writeToNBT(ritualTag);
|
|
|
|
tag.setTag(Constants.NBT.CURRENT_RITUAL_TAG, ritualTag);
|
|
|
|
}
|
2015-12-30 20:34:40 +00:00
|
|
|
tag.setBoolean(Constants.NBT.IS_RUNNING, isActive());
|
|
|
|
tag.setInteger(Constants.NBT.RUNTIME, getActiveTime());
|
|
|
|
tag.setInteger(Constants.NBT.DIRECTION, direction.getIndex());
|
2016-02-18 17:26:42 +00:00
|
|
|
tag.setBoolean(Constants.NBT.IS_REDSTONED, redstoned);
|
2016-07-11 01:51:17 +00:00
|
|
|
|
|
|
|
for (EnumDemonWillType type : currentActiveWillConfig)
|
|
|
|
{
|
|
|
|
tag.setBoolean("EnumWill" + type, true);
|
|
|
|
}
|
|
|
|
|
2016-05-20 00:43:33 +00:00
|
|
|
return tag;
|
2015-12-30 20:34:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-03-29 01:45:45 +00:00
|
|
|
public boolean activateRitual(ItemStack activationCrystal, @Nullable EntityPlayer activator, Ritual ritual)
|
2015-12-30 20:34:40 +00:00
|
|
|
{
|
|
|
|
if (PlayerHelper.isFakePlayer(activator))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
activationCrystal = NBTHelper.checkNBT(activationCrystal);
|
|
|
|
String crystalOwner = activationCrystal.getTagCompound().getString(Constants.NBT.OWNER_UUID);
|
|
|
|
|
|
|
|
if (!Strings.isNullOrEmpty(crystalOwner) && ritual != null)
|
|
|
|
{
|
|
|
|
if (activationCrystal.getItem() instanceof ItemActivationCrystal)
|
|
|
|
{
|
|
|
|
int crystalLevel = ((ItemActivationCrystal) activationCrystal.getItem()).getCrystalLevel(activationCrystal);
|
|
|
|
if (RitualHelper.canCrystalActivate(ritual, crystalLevel))
|
|
|
|
{
|
2016-01-25 01:47:11 +00:00
|
|
|
if (!getWorld().isRemote)
|
2015-12-30 20:34:40 +00:00
|
|
|
{
|
2016-01-25 01:47:11 +00:00
|
|
|
SoulNetwork network = NetworkHelper.getSoulNetwork(crystalOwner);
|
2015-12-30 20:34:40 +00:00
|
|
|
|
2017-03-29 01:45:45 +00:00
|
|
|
if (!isRedstoned() && network.getCurrentEssence() < ritual.getActivationCost() && (activator != null && !activator.capabilities.isCreativeMode))
|
2016-01-25 01:47:11 +00:00
|
|
|
{
|
2017-03-09 02:00:36 +00:00
|
|
|
activator.sendStatusMessage(new TextComponentTranslation("chat.bloodmagic.ritual.weak"), true);
|
2016-01-25 01:47:11 +00:00
|
|
|
return false;
|
|
|
|
}
|
2015-12-30 20:34:40 +00:00
|
|
|
|
2016-01-25 01:47:11 +00:00
|
|
|
if (currentRitual != null)
|
|
|
|
currentRitual.stopRitual(this, Ritual.BreakType.ACTIVATE);
|
2015-12-30 20:34:40 +00:00
|
|
|
|
2016-01-25 01:47:11 +00:00
|
|
|
RitualEvent.RitualActivatedEvent event = new RitualEvent.RitualActivatedEvent(this, crystalOwner, ritual, activator, activationCrystal, crystalLevel);
|
2015-12-30 20:34:40 +00:00
|
|
|
|
2016-01-25 01:47:11 +00:00
|
|
|
if (MinecraftForge.EVENT_BUS.post(event) || event.getResult() == Event.Result.DENY)
|
2016-01-01 18:59:56 +00:00
|
|
|
{
|
2017-03-29 01:48:27 +00:00
|
|
|
if (activator != null)
|
|
|
|
activator.sendStatusMessage(new TextComponentTranslation("chat.bloodmagic.ritual.prevent"), true);
|
2016-01-25 01:47:11 +00:00
|
|
|
return false;
|
2016-01-01 18:59:56 +00:00
|
|
|
}
|
|
|
|
|
2016-02-18 17:11:29 +00:00
|
|
|
if (ritual.activateRitual(this, activator, crystalOwner))
|
2016-01-25 01:47:11 +00:00
|
|
|
{
|
2017-03-29 01:45:45 +00:00
|
|
|
if (!isRedstoned() && (activator != null && !activator.capabilities.isCreativeMode))
|
2016-01-25 01:47:11 +00:00
|
|
|
network.syphon(ritual.getActivationCost());
|
|
|
|
|
2017-03-29 01:45:45 +00:00
|
|
|
if (activator != null)
|
|
|
|
activator.sendStatusMessage(new TextComponentTranslation("chat.bloodmagic.ritual.activate"), true);
|
2016-02-04 21:32:59 +00:00
|
|
|
|
2016-01-25 01:47:11 +00:00
|
|
|
this.active = true;
|
|
|
|
this.owner = crystalOwner;
|
2017-02-13 01:00:18 +00:00
|
|
|
this.cachedNetwork = network;
|
2016-01-25 01:47:11 +00:00
|
|
|
this.currentRitual = ritual;
|
2015-12-30 20:34:40 +00:00
|
|
|
|
2016-09-08 00:46:06 +00:00
|
|
|
notifyUpdate();
|
2016-01-25 01:47:11 +00:00
|
|
|
return true;
|
|
|
|
}
|
2015-12-30 20:34:40 +00:00
|
|
|
}
|
2016-01-25 01:47:11 +00:00
|
|
|
|
2016-09-08 00:46:06 +00:00
|
|
|
notifyUpdate();
|
2016-01-25 01:47:11 +00:00
|
|
|
return true;
|
2015-12-30 20:34:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else
|
|
|
|
{
|
2017-03-29 01:45:45 +00:00
|
|
|
if (activator != null)
|
|
|
|
activator.sendStatusMessage(new TextComponentTranslation("chat.bloodmagic.ritual.notValid"), true);
|
2015-12-30 20:34:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void performRitual(World world, BlockPos pos)
|
|
|
|
{
|
2016-06-20 13:31:16 +00:00
|
|
|
if (!world.isRemote && getCurrentRitual() != null && RitualRegistry.ritualEnabled(getCurrentRitual()))
|
2015-12-30 20:34:40 +00:00
|
|
|
{
|
2016-06-20 13:31:16 +00:00
|
|
|
if (RitualHelper.checkValidRitual(getWorld(), getPos(), RitualRegistry.getIdForRitual(currentRitual), getDirection()))
|
|
|
|
{
|
|
|
|
RitualEvent.RitualRunEvent event = new RitualEvent.RitualRunEvent(this, getOwner(), getCurrentRitual());
|
2015-12-30 20:34:40 +00:00
|
|
|
|
2016-06-20 13:31:16 +00:00
|
|
|
if (MinecraftForge.EVENT_BUS.post(event) || event.getResult() == Event.Result.DENY)
|
|
|
|
return;
|
2015-12-30 20:34:40 +00:00
|
|
|
|
2016-06-20 13:31:16 +00:00
|
|
|
getCurrentRitual().performRitual(this);
|
|
|
|
} else
|
|
|
|
{
|
|
|
|
stopRitual(Ritual.BreakType.BREAK_STONE);
|
|
|
|
}
|
2015-12-30 20:34:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void stopRitual(Ritual.BreakType breakType)
|
|
|
|
{
|
2016-01-25 01:47:11 +00:00
|
|
|
if (!getWorld().isRemote && getCurrentRitual() != null)
|
2015-12-30 20:34:40 +00:00
|
|
|
{
|
|
|
|
RitualEvent.RitualStopEvent event = new RitualEvent.RitualStopEvent(this, getOwner(), getCurrentRitual(), breakType);
|
|
|
|
|
|
|
|
if (MinecraftForge.EVENT_BUS.post(event) || event.getResult() == Event.Result.DENY)
|
|
|
|
return;
|
|
|
|
|
|
|
|
getCurrentRitual().stopRitual(this, breakType);
|
2016-01-28 22:54:32 +00:00
|
|
|
if (breakType != Ritual.BreakType.REDSTONE)
|
|
|
|
{
|
|
|
|
this.currentRitual = null;
|
|
|
|
this.active = false;
|
|
|
|
this.activeTime = 0;
|
|
|
|
}
|
2016-09-08 00:46:06 +00:00
|
|
|
notifyUpdate();
|
2015-12-30 20:34:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getCooldown()
|
|
|
|
{
|
|
|
|
return cooldown;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setCooldown(int cooldown)
|
|
|
|
{
|
|
|
|
this.cooldown = cooldown;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setActive(boolean active)
|
|
|
|
{
|
|
|
|
this.active = active;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public EnumFacing getDirection()
|
|
|
|
{
|
|
|
|
return direction;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean areTanksEmpty()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getRunningTime()
|
|
|
|
{
|
|
|
|
return activeTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getOwner()
|
|
|
|
{
|
|
|
|
return owner;
|
|
|
|
}
|
|
|
|
|
2017-02-13 01:00:18 +00:00
|
|
|
@Override
|
|
|
|
public SoulNetwork getOwnerNetwork()
|
|
|
|
{
|
|
|
|
return cachedNetwork;
|
|
|
|
}
|
|
|
|
|
2015-12-30 20:34:40 +00:00
|
|
|
@Override
|
|
|
|
public World getWorld()
|
|
|
|
{
|
|
|
|
return super.getWorld();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public BlockPos getPos()
|
|
|
|
{
|
|
|
|
return super.getPos();
|
|
|
|
}
|
2016-01-02 03:04:40 +00:00
|
|
|
|
2016-01-03 13:30:59 +00:00
|
|
|
@Override
|
|
|
|
public World getWorldObj()
|
|
|
|
{
|
|
|
|
return getWorld();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public BlockPos getBlockPos()
|
|
|
|
{
|
|
|
|
return getPos();
|
|
|
|
}
|
2016-04-11 01:19:18 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getNextBlockRange(String range)
|
|
|
|
{
|
|
|
|
if (this.currentRitual != null)
|
|
|
|
{
|
|
|
|
return this.currentRitual.getNextBlockRange(range);
|
|
|
|
}
|
|
|
|
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void provideInformationOfRitualToPlayer(EntityPlayer player)
|
|
|
|
{
|
|
|
|
if (this.currentRitual != null)
|
|
|
|
{
|
|
|
|
ChatUtil.sendNoSpam(player, this.currentRitual.provideInformationOfRitualToPlayer(player));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void provideInformationOfRangeToPlayer(EntityPlayer player, String range)
|
|
|
|
{
|
2016-04-11 12:26:41 +00:00
|
|
|
if (this.currentRitual != null && this.currentRitual.getListOfRanges().contains(range))
|
2016-04-11 01:19:18 +00:00
|
|
|
{
|
|
|
|
ChatUtil.sendNoSpam(player, this.currentRitual.provideInformationOfRangeToPlayer(player, range));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-04-11 19:36:27 +00:00
|
|
|
public void setActiveWillConfig(EntityPlayer player, List<EnumDemonWillType> typeList)
|
2016-04-11 01:19:18 +00:00
|
|
|
{
|
2016-07-11 01:51:17 +00:00
|
|
|
this.currentActiveWillConfig = typeList;
|
2016-04-11 01:19:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean setBlockRangeByBounds(EntityPlayer player, String range, BlockPos offset1, BlockPos offset2)
|
|
|
|
{
|
|
|
|
if (this.currentRitual != null)
|
|
|
|
{
|
|
|
|
boolean allowed = this.currentRitual.setBlockRangeByBounds(range, this, offset1, offset2);
|
|
|
|
if (player != null && !allowed)
|
|
|
|
{
|
|
|
|
ChatUtil.sendNoSpam(player, this.currentRitual.getErrorForBlockRangeOnFail(player, range, this, offset1, offset2));
|
2016-04-11 02:09:32 +00:00
|
|
|
} else
|
|
|
|
{
|
2017-01-02 09:18:29 +00:00
|
|
|
ChatUtil.sendNoSpam(player, new TextComponentTranslation("ritual.bloodmagic.blockRange.success"));
|
2016-04-11 01:19:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return allowed;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (player != null)
|
|
|
|
{
|
2017-01-02 09:18:29 +00:00
|
|
|
ChatUtil.sendNoSpam(player, new TextComponentTranslation("ritual.bloodmagic.blockRange.inactive"));
|
2016-04-11 01:19:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
2016-04-11 19:36:27 +00:00
|
|
|
|
|
|
|
@Override
|
2016-07-11 01:51:17 +00:00
|
|
|
public List<EnumDemonWillType> getActiveWillConfig()
|
|
|
|
{
|
|
|
|
return new ArrayList<EnumDemonWillType>(currentActiveWillConfig);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void provideInformationOfWillConfigToPlayer(EntityPlayer player, List<EnumDemonWillType> typeList)
|
2016-04-11 19:36:27 +00:00
|
|
|
{
|
2016-07-11 01:51:17 +00:00
|
|
|
//There is probably an easier way to make expanded chat messages
|
|
|
|
if (typeList.size() >= 1)
|
|
|
|
{
|
|
|
|
Object[] translations = new TextComponentTranslation[typeList.size()];
|
|
|
|
String constructedString = "%s";
|
|
|
|
|
|
|
|
for (int i = 1; i < typeList.size(); i++)
|
|
|
|
{
|
|
|
|
constructedString = constructedString + ", %s";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (int i = 0; i < typeList.size(); i++)
|
|
|
|
{
|
2017-01-02 09:18:29 +00:00
|
|
|
translations[i] = new TextComponentTranslation("tooltip.bloodmagic.currentBaseType." + typeList.get(i).name.toLowerCase());
|
2016-07-11 01:51:17 +00:00
|
|
|
}
|
|
|
|
|
2017-01-02 09:18:29 +00:00
|
|
|
ChatUtil.sendNoSpam(player, new TextComponentTranslation("ritual.bloodmagic.willConfig.set", new TextComponentTranslation(constructedString, translations)));
|
2016-07-11 01:51:17 +00:00
|
|
|
} else
|
|
|
|
{
|
2017-01-02 09:18:29 +00:00
|
|
|
ChatUtil.sendNoSpam(player, new TextComponentTranslation("ritual.bloodmagic.willConfig.void"));
|
2016-07-11 01:51:17 +00:00
|
|
|
}
|
2016-04-11 19:36:27 +00:00
|
|
|
}
|
2017-02-14 03:35:14 +00:00
|
|
|
|
|
|
|
public boolean isPowered()
|
|
|
|
{
|
|
|
|
if (inverted)
|
|
|
|
return !getWorld().isBlockPowered(getPos());
|
|
|
|
|
|
|
|
return getWorld().isBlockPowered(getPos());
|
|
|
|
}
|
2017-08-15 03:53:42 +00:00
|
|
|
|
|
|
|
public void setOwner(String owner) {
|
|
|
|
this.owner = owner;
|
|
|
|
}
|
|
|
|
|
|
|
|
public SoulNetwork getCachedNetwork() {
|
|
|
|
return cachedNetwork;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setCachedNetwork(SoulNetwork cachedNetwork) {
|
|
|
|
this.cachedNetwork = cachedNetwork;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isActive() {
|
|
|
|
return active;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isRedstoned() {
|
|
|
|
return redstoned;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setRedstoned(boolean redstoned) {
|
|
|
|
this.redstoned = redstoned;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getActiveTime() {
|
|
|
|
return activeTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setActiveTime(int activeTime) {
|
|
|
|
this.activeTime = activeTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Ritual getCurrentRitual() {
|
|
|
|
return currentRitual;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setCurrentRitual(Ritual currentRitual) {
|
|
|
|
this.currentRitual = currentRitual;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setDirection(EnumFacing direction) {
|
|
|
|
this.direction = direction;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isInverted() {
|
|
|
|
return inverted;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setInverted(boolean inverted) {
|
|
|
|
this.inverted = inverted;
|
|
|
|
}
|
|
|
|
|
|
|
|
public List<EnumDemonWillType> getCurrentActiveWillConfig() {
|
|
|
|
return currentActiveWillConfig;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setCurrentActiveWillConfig(List<EnumDemonWillType> currentActiveWillConfig) {
|
|
|
|
this.currentActiveWillConfig = currentActiveWillConfig;
|
|
|
|
}
|
2015-11-01 00:58:47 +00:00
|
|
|
}
|