mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-27 07:13:14 +00:00
Compare commits
9
Commits
1.8.14
...
1.8.18-pre
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd770d71e9 | ||
|
|
6eb879cbf9 | ||
|
|
8fc1276725 | ||
|
|
1544c1bf0d | ||
|
|
801c1c9eb5 | ||
|
|
88002582b9 | ||
|
|
142fa182ae | ||
|
|
26580c10b3 | ||
|
|
03e5cb2a64 |
No files matched your search
+10
-10
@@ -23,22 +23,22 @@
|
||||
*/
|
||||
|
||||
dependencies {
|
||||
api("com.github.GTNewHorizons:waila:1.19.22:dev")
|
||||
api("com.github.GTNewHorizons:NotEnoughItems:2.8.72-GTNH:dev")
|
||||
api("com.github.GTNewHorizons:waila:1.19.25:dev")
|
||||
api("com.github.GTNewHorizons:NotEnoughItems:2.8.93-GTNH:dev")
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:GTNHLib:0.9.36:dev") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.52.341:dev") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:GTNHLib:0.9.57:dev") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.52.480:dev") {transitive = false }
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:Botania:1.13.15-GTNH:api") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:ForestryMC:4.11.7:api") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:ForgeMultipart:1.7.2:dev") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:Botania:1.13.16-GTNH:api") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:ForestryMC:4.11.19:api") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:ForgeMultipart:1.7.10:dev") {transitive = false }
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:Chisel:2.17.20-GTNH:api") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:Chisel:2.17.26-GTNH:api") {transitive = false }
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:CraftTweaker:3.4.2:dev") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:CraftTweaker:3.4.7:dev") {transitive = false }
|
||||
|
||||
compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") {transitive = false }
|
||||
compileOnly("curse.maven:guide-api-228832:2287185") {transitive = false }
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:StructureLib:1.4.30:dev")
|
||||
compileOnly("com.github.GTNewHorizons:StructureLib:1.4.34:dev")
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
#This file is generated by updateDaemonJvm
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/46949723aaa20c7b64d7ecfed7207034/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/d6690dfd71c4c91e08577437b5b2beb0/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/3cd7045fca9a72cd9bc7d14a385e594c/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/552c7bffe0370c66410a51c55985b511/redirect
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c2dd35c9d0aaf0ba6ad0791320f99dfc/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/e5810bd7fd1f8a586644409d395a7e55/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/7b3c4877c0749019e6805bb61e421497/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/d76df094a9cbbabd3b08251f9e61444a/redirect
|
||||
toolchainVersion=25
|
||||
Vendored
BIN
Binary file not shown.
@@ -57,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.23'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.24'
|
||||
}
|
||||
|
||||
|
||||
@@ -5,23 +5,28 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
public class LifeEssenceNetwork extends net.minecraft.world.WorldSavedData {
|
||||
|
||||
public int currentEssence;
|
||||
public int maxEssence;
|
||||
public int maxOrb;
|
||||
|
||||
public LifeEssenceNetwork(String par1Str) {
|
||||
super(par1Str);
|
||||
currentEssence = 0;
|
||||
// can be lower than currentEssence (overfilled) with runes of the orb
|
||||
maxEssence = 1;
|
||||
maxOrb = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
currentEssence = nbttagcompound.getInteger("currentEssence");
|
||||
maxEssence = nbttagcompound.getInteger("maxEssence");
|
||||
maxOrb = nbttagcompound.getInteger("maxOrb");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
nbttagcompound.setInteger("currentEssence", currentEssence);
|
||||
nbttagcompound.setInteger("maxEssence", maxEssence);
|
||||
nbttagcompound.setInteger("maxOrb", maxOrb);
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import WayofTime.alchemicalWizardry.api.event.ItemBindEvent;
|
||||
import WayofTime.alchemicalWizardry.api.event.ItemDrainInContainerEvent;
|
||||
import WayofTime.alchemicalWizardry.api.event.ItemDrainNetworkEvent;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
@@ -36,6 +37,10 @@ public class SoulNetworkHandler {
|
||||
return syphonFromNetwork(event.ownerNetwork, event.drainAmount) >= damageToBeDone;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #getMaxEssence(String ownerName)} to get maximum soul network capacity
|
||||
*/
|
||||
@Deprecated
|
||||
public static int getCurrentMaxOrb(String ownerName) {
|
||||
MinecraftServer mcServer = FMLCommonHandler.instance().getMinecraftServerInstance();
|
||||
if (mcServer == null) {
|
||||
@@ -53,6 +58,28 @@ public class SoulNetworkHandler {
|
||||
return data.maxOrb;
|
||||
}
|
||||
|
||||
public static int getMaxEssence(String ownerName) {
|
||||
MinecraftServer mcServer = FMLCommonHandler.instance().getMinecraftServerInstance();
|
||||
if (mcServer == null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
World world = mcServer.worldServers[0];
|
||||
LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName);
|
||||
|
||||
if (data == null) {
|
||||
data = new LifeEssenceNetwork(ownerName);
|
||||
world.setItemData(ownerName, data);
|
||||
}
|
||||
|
||||
return data.maxEssence;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #setMaxEssenceToMax(String ownerName, int maxEssence)} to set maximum soul network
|
||||
* capacity
|
||||
*/
|
||||
@Deprecated
|
||||
public static void setMaxOrbToMax(String ownerName, int maxOrb) {
|
||||
MinecraftServer mcServer = FMLCommonHandler.instance().getMinecraftServerInstance();
|
||||
if (mcServer == null) {
|
||||
@@ -71,6 +98,28 @@ public class SoulNetworkHandler {
|
||||
data.markDirty();
|
||||
}
|
||||
|
||||
public static void setMaxEssenceToMax(String ownerName, int maxEssence) {
|
||||
MinecraftServer mcServer = FMLCommonHandler.instance().getMinecraftServerInstance();
|
||||
if (mcServer == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
World world = mcServer.worldServers[0];
|
||||
LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName);
|
||||
|
||||
if (data == null) {
|
||||
data = new LifeEssenceNetwork(ownerName);
|
||||
world.setItemData(ownerName, data);
|
||||
}
|
||||
|
||||
data.maxEssence = Math.max(maxEssence, data.maxEssence);
|
||||
data.markDirty();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #getMaxEssence(String ownerName)} to get maximum soul network capacity
|
||||
*/
|
||||
@Deprecated
|
||||
public static int getMaximumForOrbTier(int maxOrb) {
|
||||
switch (maxOrb) {
|
||||
case 1:
|
||||
@@ -327,6 +376,14 @@ public class SoulNetworkHandler {
|
||||
}
|
||||
|
||||
public static boolean checkAndSetItemPlayer(ItemStack item, EntityPlayer player) {
|
||||
if (item.getItem() instanceof IBloodOrb orb) {
|
||||
String currentOwner = item.hasTagCompound() ? item.getTagCompound().getString("ownerName") : "";
|
||||
String thisPlayer = getUsername(player);
|
||||
if (currentOwner.isEmpty() || currentOwner.equals(thisPlayer)) {
|
||||
setMaxEssenceToMax(thisPlayer, orb.getMaxEssence());
|
||||
}
|
||||
}
|
||||
|
||||
if (item.hasTagCompound() && !item.getTagCompound().getString("ownerName").equals("")) return true;
|
||||
|
||||
ItemBindEvent event = new ItemBindEvent(player, SoulNetworkHandler.getUsername(player), item);
|
||||
|
||||
@@ -482,8 +482,7 @@ public class AlchemicalWizardryEventHooks {
|
||||
NewPacketHandler.INSTANCE.sendTo(
|
||||
NewPacketHandler.getLPPacket(
|
||||
SoulNetworkHandler.getCurrentEssence(ownerName),
|
||||
SoulNetworkHandler
|
||||
.getMaximumForOrbTier(SoulNetworkHandler.getCurrentMaxOrb(ownerName))),
|
||||
SoulNetworkHandler.getMaxEssence(ownerName)),
|
||||
(EntityPlayerMP) entityLiving);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,21 @@
|
||||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.Int3;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -41,6 +49,37 @@ public class BlockReagentConduit extends BlockContainer {
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float what,
|
||||
float these, float are) {
|
||||
if (!world.isRemote) {
|
||||
ItemStack held = player.getHeldItem();
|
||||
if (held == null || !(held.getItem() instanceof IReagentManipulator)) {
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if (tile instanceof TEReagentConduit) {
|
||||
TEReagentConduit relay = (TEReagentConduit) tile;
|
||||
if (relay.reagentTargetList.isEmpty()) {
|
||||
player.addChatComponentMessage(
|
||||
new ChatComponentTranslation("message.reagentconduit.noconnections"));
|
||||
} else {
|
||||
player.addChatComponentMessage(
|
||||
new ChatComponentTranslation("message.reagentconduit.connections"));
|
||||
for (Map.Entry<Reagent, List<Int3>> entry : relay.reagentTargetList.entrySet()) {
|
||||
Reagent reagent = entry.getKey();
|
||||
List<Int3> offsets = entry.getValue();
|
||||
if (offsets == null) continue;
|
||||
for (Int3 offset : offsets) {
|
||||
player.addChatComponentMessage(
|
||||
new ChatComponentTranslation(
|
||||
"message.reagentconduit.connection.entry",
|
||||
reagent.name,
|
||||
x + offset.xCoord,
|
||||
y + offset.yCoord,
|
||||
z + offset.zCoord));
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onBlockActivated(world, x, y, z, player, side, what, these, are);
|
||||
}
|
||||
|
||||
|
||||
@@ -69,15 +69,15 @@ public class CommandSN extends CommandBase {
|
||||
func_152373_a(icommandsender, this, "commands.soulnetwork.get.success", currentEssence, owner);
|
||||
} else if ("fillMax".equalsIgnoreCase(astring[1])) {
|
||||
int currentEssence = SoulNetworkHandler.getCurrentEssence(owner);
|
||||
int orbTier = SoulNetworkHandler.getCurrentMaxOrb(owner);
|
||||
int maxForOrb = SoulNetworkHandler.getMaximumForOrbTier(orbTier);
|
||||
int fillAmount = maxForOrb - currentEssence;
|
||||
int maxForUser = SoulNetworkHandler.getMaxEssence(owner);
|
||||
int fillAmount = maxForUser - currentEssence;
|
||||
SoulNetworkHandler.addCurrentEssenceToMaximum(owner, fillAmount, fillAmount);
|
||||
func_152373_a(icommandsender, this, "commands.soulnetwork.fillMax.success", owner);
|
||||
} else if ("create".equalsIgnoreCase(astring[1])) {
|
||||
int orbTier = parseIntBounded(icommandsender, astring[2], 1, 6);
|
||||
SoulNetworkHandler.setMaxOrbToMax(proxyPlayerName.getDisplayName(), orbTier);
|
||||
func_152373_a(icommandsender, this, "commands.soulnetwork.create.success", owner, orbTier);
|
||||
int desiredCapacity = parseInt(icommandsender, astring[2]);
|
||||
SoulNetworkHandler.setMaxEssenceToMax(proxyPlayerName.getDisplayName(), desiredCapacity);
|
||||
int actualCapacity = SoulNetworkHandler.getMaxEssence(proxyPlayerName.getDisplayName());
|
||||
func_152373_a(icommandsender, this, "commands.soulnetwork.create.success", owner, actualCapacity);
|
||||
} else {
|
||||
throw new CommandException("commands.soulnetwork.notACommand");
|
||||
}
|
||||
|
||||
+4
-6
@@ -85,9 +85,8 @@ public class SubCommandNetwork extends SubCommandBase {
|
||||
if (args.length == 3) {
|
||||
if (isInteger(args[2])) {
|
||||
int amount = Integer.parseInt(args[2]);
|
||||
int maxOrb = SoulNetworkHandler
|
||||
.getMaximumForOrbTier(SoulNetworkHandler.getCurrentMaxOrb(givenName));
|
||||
SoulNetworkHandler.addCurrentEssenceToMaximum(givenName, amount, maxOrb);
|
||||
int maxEssence = SoulNetworkHandler.getMaxEssence(givenName);
|
||||
SoulNetworkHandler.addCurrentEssenceToMaximum(givenName, amount, maxEssence);
|
||||
displaySuccessString(commandSender, "commands.network.add.success", amount, givenName);
|
||||
} else {
|
||||
displayErrorString(commandSender, "commands.error.arg.invalid");
|
||||
@@ -152,9 +151,8 @@ public class SubCommandNetwork extends SubCommandBase {
|
||||
}
|
||||
|
||||
if (args.length > 1) {
|
||||
int maxOrb = SoulNetworkHandler
|
||||
.getMaximumForOrbTier(SoulNetworkHandler.getCurrentMaxOrb(givenName));
|
||||
SoulNetworkHandler.setCurrentEssence(givenName, maxOrb);
|
||||
int maxEssence = SoulNetworkHandler.getMaxEssence(givenName);
|
||||
SoulNetworkHandler.setCurrentEssence(givenName, maxEssence);
|
||||
displaySuccessString(commandSender, "commands.network.cap.success", givenName);
|
||||
}
|
||||
|
||||
|
||||
+114
-37
@@ -60,6 +60,9 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator {
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.attunedcrystal.desc1"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.attunedcrystal.desc2"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.attunedcrystal.desc3"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.attunedcrystal.desc4"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.attunedcrystal.desc5"));
|
||||
|
||||
if (!(par1ItemStack.getTagCompound() == null)) {
|
||||
Reagent reagent = this.getReagent(par1ItemStack);
|
||||
@@ -142,6 +145,10 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator {
|
||||
if (movingobjectposition == null) {
|
||||
if (player.isSneaking()) {
|
||||
this.setHasSavedCoordinates(itemStack, false);
|
||||
if (!itemStack.hasTagCompound()) {
|
||||
itemStack.setTagCompound(new net.minecraft.nbt.NBTTagCompound());
|
||||
}
|
||||
itemStack.getTagCompound().setString("reagent", "");
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.clearing"));
|
||||
}
|
||||
|
||||
@@ -161,35 +168,101 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator {
|
||||
IReagentHandler relay = (IReagentHandler) tile;
|
||||
|
||||
if (player.isSneaking()) {
|
||||
ReagentContainerInfo[] infos = relay.getContainerInfo(ForgeDirection.UNKNOWN);
|
||||
if (infos != null) {
|
||||
List<Reagent> reagentList = new LinkedList();
|
||||
for (ReagentContainerInfo info : infos) {
|
||||
if (info != null) {
|
||||
ReagentStack reagentStack = info.reagent;
|
||||
if (reagentStack != null) {
|
||||
Reagent reagent = reagentStack.reagent;
|
||||
if (reagent != null) {
|
||||
reagentList.add(reagent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.getHasSavedCoordinates(itemStack)) {
|
||||
Int3 coords = this.getCoordinates(itemStack);
|
||||
int dimension = this.getDimension(itemStack);
|
||||
|
||||
Reagent pastReagent = this.getReagent(itemStack);
|
||||
|
||||
if (reagentList.size() <= 0) {
|
||||
if (coords == null) {
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
int reagentLocation;
|
||||
// Sneak+right-click saved source block again → clear all of reagent's connections
|
||||
if (coords.xCoord == x && coords.yCoord == y && coords.zCoord == z) {
|
||||
TileEntity pastTile = world.getTileEntity(coords.xCoord, coords.yCoord, coords.zCoord);
|
||||
if (!(pastTile instanceof TEReagentConduit)) {
|
||||
player.addChatComponentMessage(
|
||||
new ChatComponentTranslation("message.attunedcrystal.error.cannotfind"));
|
||||
return itemStack;
|
||||
}
|
||||
Reagent reagent = this.getReagent(itemStack);
|
||||
if (reagent == null) {
|
||||
player.addChatComponentMessage(
|
||||
new ChatComponentTranslation("message.attunedcrystal.error.noreagent"));
|
||||
return itemStack;
|
||||
}
|
||||
TEReagentConduit pastRelay = (TEReagentConduit) pastTile;
|
||||
pastRelay.reagentTargetList.remove(reagent);
|
||||
this.setHasSavedCoordinates(itemStack, false);
|
||||
player.addChatComponentMessage(
|
||||
new ChatComponentTranslation(
|
||||
"message.attunedcrystal.clearedreagent",
|
||||
reagent.name));
|
||||
world.markBlockForUpdate(coords.xCoord, coords.yCoord, coords.zCoord);
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
reagentLocation = reagentList.indexOf(pastReagent);
|
||||
if (dimension != world.provider.dimensionId || Math.abs(coords.xCoord - x) > maxDistance
|
||||
|| Math.abs(coords.yCoord - y) > maxDistance
|
||||
|| Math.abs(coords.zCoord - z) > maxDistance) {
|
||||
player.addChatComponentMessage(
|
||||
new ChatComponentTranslation("message.attunedcrystal.error.toofar"));
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
if (reagentLocation == -1 || reagentLocation + 1 >= reagentList.size()) {
|
||||
this.setReagentWithNotification(itemStack, reagentList.get(0), player);
|
||||
} else {
|
||||
this.setReagentWithNotification(itemStack, reagentList.get(reagentLocation + 1), player);
|
||||
TileEntity pastTile = world.getTileEntity(coords.xCoord, coords.yCoord, coords.zCoord);
|
||||
if (!(pastTile instanceof TEReagentConduit)) {
|
||||
player.addChatComponentMessage(
|
||||
new ChatComponentTranslation("message.attunedcrystal.error.cannotfind"));
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
Reagent reagent = this.getReagent(itemStack);
|
||||
if (reagent == null) {
|
||||
player.addChatComponentMessage(
|
||||
new ChatComponentTranslation("message.attunedcrystal.error.noreagent"));
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
TEReagentConduit pastRelay = (TEReagentConduit) pastTile;
|
||||
boolean removed = pastRelay.removeReagentDestinationViaActual(reagent, x, y, z);
|
||||
player.addChatComponentMessage(
|
||||
new ChatComponentTranslation(
|
||||
removed ? "message.attunedcrystal.removed"
|
||||
: "message.attunedcrystal.error.notremoved"));
|
||||
world.markBlockForUpdate(coords.xCoord, coords.yCoord, coords.zCoord);
|
||||
} else {
|
||||
// No saved coords → cycle reagent selection
|
||||
ReagentContainerInfo[] infos = relay.getContainerInfo(ForgeDirection.UNKNOWN);
|
||||
if (infos != null) {
|
||||
List<Reagent> reagentList = new LinkedList();
|
||||
for (ReagentContainerInfo info : infos) {
|
||||
if (info != null) {
|
||||
ReagentStack reagentStack = info.reagent;
|
||||
if (reagentStack != null) {
|
||||
Reagent reagent = reagentStack.reagent;
|
||||
if (reagent != null) {
|
||||
reagentList.add(reagent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reagent pastReagent = this.getReagent(itemStack);
|
||||
|
||||
if (reagentList.size() <= 0) {
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
int reagentLocation = reagentList.indexOf(pastReagent);
|
||||
|
||||
if (reagentLocation == -1 || reagentLocation + 1 >= reagentList.size()) {
|
||||
this.setReagentWithNotification(itemStack, reagentList.get(0), player);
|
||||
} else {
|
||||
this.setReagentWithNotification(
|
||||
itemStack,
|
||||
reagentList.get(reagentLocation + 1),
|
||||
player);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -217,25 +290,28 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator {
|
||||
}
|
||||
|
||||
Reagent reagent = this.getReagent(itemStack);
|
||||
|
||||
if (reagent == null) {
|
||||
player.addChatComponentMessage(
|
||||
new ChatComponentTranslation("message.attunedcrystal.error.noreagent"));
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
TEReagentConduit pastRelay = (TEReagentConduit) pastTile;
|
||||
|
||||
if (player.isSneaking()) {
|
||||
pastRelay.removeReagentDestinationViaActual(reagent, x, y, z);
|
||||
if (pastRelay.hasReagentDestination(reagent, x, y, z)) {
|
||||
player.addChatComponentMessage(
|
||||
new ChatComponentTranslation("message.attunedcrystal.error.duplicate"));
|
||||
} else if (pastRelay.addReagentDestinationViaActual(reagent, x, y, z)) {
|
||||
int used = pastRelay.getTotalConnections();
|
||||
int max = pastRelay.maxConnextions;
|
||||
player.addChatComponentMessage(
|
||||
new ChatComponentTranslation(
|
||||
"message.attunedcrystal.linked",
|
||||
reagent.name,
|
||||
used,
|
||||
max));
|
||||
} else {
|
||||
if (pastRelay.addReagentDestinationViaActual(reagent, x, y, z)) {
|
||||
player.addChatComponentMessage(
|
||||
new ChatComponentText(
|
||||
StatCollector.translateToLocal("message.attunedcrystal.linked") + " "
|
||||
+ reagent.name));
|
||||
} else {
|
||||
player.addChatComponentMessage(
|
||||
new ChatComponentTranslation("message.attunedcrystal.error.noconnections"));
|
||||
}
|
||||
player.addChatComponentMessage(
|
||||
new ChatComponentTranslation("message.attunedcrystal.error.noconnections"));
|
||||
}
|
||||
world.markBlockForUpdate(coords.xCoord, coords.yCoord, coords.zCoord);
|
||||
} else {
|
||||
@@ -244,7 +320,8 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator {
|
||||
this.setDimension(itemStack, dimension);
|
||||
this.setCoordinates(itemStack, new Int3(x, y, z));
|
||||
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.linking"));
|
||||
player.addChatComponentMessage(
|
||||
new ChatComponentTranslation("message.attunedcrystal.linking", x, y, z));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import WayofTime.alchemicalWizardry.common.ItemType;
|
||||
import WayofTime.alchemicalWizardry.common.block.BlockTeleposer;
|
||||
import gregtech.common.blocks.GTBlockOre;
|
||||
|
||||
public class RitualEffectMagnetic extends RitualEffect {
|
||||
|
||||
@@ -34,7 +35,10 @@ public class RitualEffectMagnetic extends RitualEffect {
|
||||
|
||||
public static boolean isBlockOre(Block block, int meta) {
|
||||
// Special case for lit redstone ore
|
||||
if (block instanceof BlockOre || block instanceof BlockRedstoneOre) return true;
|
||||
if (block instanceof BlockOre || block instanceof BlockRedstoneOre
|
||||
|| (AlchemicalWizardry.isGregTechLoaded && block instanceof GTBlockOre)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (block == null || Item.getItemFromBlock(block) == null) return false;
|
||||
|
||||
|
||||
@@ -417,17 +417,31 @@ public class TEReagentConduit extends TileSegmentedReagentHandler {
|
||||
readClientNBT(packet.func_148857_g());
|
||||
}
|
||||
|
||||
public boolean addReagentDestinationViaOffset(Reagent reagent, int xOffset, int yOffset, int zOffset) {
|
||||
int totalConnections = 0;
|
||||
|
||||
for (Entry<Reagent, List<Int3>> entry : this.reagentTargetList.entrySet()) {
|
||||
if (entry.getValue() != null) {
|
||||
totalConnections += entry.getValue().size();
|
||||
public int getTotalConnections() {
|
||||
int total = 0;
|
||||
for (List<Int3> list : this.reagentTargetList.values()) {
|
||||
if (list != null) {
|
||||
total += list.size();
|
||||
}
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
if (totalConnections >= this.maxConnextions) {
|
||||
// Send message that it cannot be done? Maybe add a Player instance
|
||||
public boolean hasReagentDestination(Reagent reagent, int x, int y, int z) {
|
||||
int xOffset = x - this.xCoord;
|
||||
int yOffset = y - this.yCoord;
|
||||
int zOffset = z - this.zCoord;
|
||||
if (this.reagentTargetList.containsKey(reagent)) {
|
||||
List<Int3> coords = this.reagentTargetList.get(reagent);
|
||||
if (coords != null) {
|
||||
return coords.contains(new Int3(xOffset, yOffset, zOffset));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean addReagentDestinationViaOffset(Reagent reagent, int xOffset, int yOffset, int zOffset) {
|
||||
if (getTotalConnections() >= this.maxConnextions) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -444,6 +458,9 @@ public class TEReagentConduit extends TileSegmentedReagentHandler {
|
||||
newCoordList.add(newCoord);
|
||||
this.reagentTargetList.put(reagent, newCoordList);
|
||||
} else {
|
||||
if (coordList.contains(newCoord)) {
|
||||
return false;
|
||||
}
|
||||
coordList.add(newCoord);
|
||||
}
|
||||
|
||||
|
||||
@@ -417,7 +417,7 @@ commands.soulnetwork.noPlayer=There is no player specified
|
||||
commands.soulnetwork.noCommand=There is no command specified
|
||||
commands.soulnetwork.notACommand=That is not a valid command
|
||||
commands.soulnetwork.fillMax.success=Successfully filled %s's Soul Network to their orb max!
|
||||
commands.soulnetwork.create.success=Successfully created %s's Soul Network (Orb tier: %d)
|
||||
commands.soulnetwork.create.success=Successfully created %s's Soul Network (Capacity: %d)
|
||||
|
||||
#Tooltips
|
||||
tooltip.activationcrystal.creativeonly=Creative Only - activates any ritual
|
||||
@@ -434,8 +434,11 @@ tooltip.alchemyflask.caution=CAUTION: Contents are throwable
|
||||
tooltip.alchemyflask.swigsleft=Swigs Left:
|
||||
tooltip.armorinhibitor.desc1=Used to suppress a soul's
|
||||
tooltip.armorinhibitor.desc2=unnatural abilities.
|
||||
tooltip.attunedcrystal.desc1=A tool to tune alchemy
|
||||
tooltip.attunedcrystal.desc2=reagent transmission
|
||||
tooltip.attunedcrystal.desc1=1) Sneak+right-click relay to select reagent
|
||||
tooltip.attunedcrystal.desc2=2) Right-click source relay
|
||||
tooltip.attunedcrystal.desc3=3) Right-click destination relay to link
|
||||
tooltip.attunedcrystal.desc4=Sneak+right-click air to clear selection.
|
||||
tooltip.attunedcrystal.desc5=Sneak+right-click relay to remove/clear links.
|
||||
tooltip.blankspell.desc=Crystal of infinite possibilities.
|
||||
tooltip.bloodframe.desc=Stirs bees into a frenzy.
|
||||
tooltip.bloodletterpack.desc=This pack really chafes...
|
||||
@@ -548,13 +551,21 @@ message.altar.progress=Altar's Progress: %,d LP / %,d LP
|
||||
message.altar.inputtank= Input Tank: %,d LP
|
||||
message.altar.outputtank= Output Tank: %,d LP
|
||||
message.altar.hunger=[BM] Your high regeneration rate has caused you to become hungry...
|
||||
message.attunedcrystal.clearing=Clearing saved container...
|
||||
message.attunedcrystal.clearing=Cleared saved source and reagent selection.
|
||||
message.attunedcrystal.error.cannotfind=Can no longer find linked container.
|
||||
message.attunedcrystal.error.noconnections=Linked container has no connections remaining!
|
||||
message.attunedcrystal.error.toofar=Linked container is either too far or is in a different dimension.
|
||||
message.attunedcrystal.linked=Container is now linked. Transmitting:
|
||||
message.attunedcrystal.linking=Linking to selected container.
|
||||
message.attunedcrystal.error.noreagent=No reagent selected! Sneak+right-click a relay to select one.
|
||||
message.attunedcrystal.error.duplicate=Already connected to that destination!
|
||||
message.attunedcrystal.error.notremoved=No matching connection found to remove.
|
||||
message.attunedcrystal.removed=Connection removed successfully.
|
||||
message.attunedcrystal.clearedreagent=Cleared all %s connections from this relay.
|
||||
message.attunedcrystal.linked=Linked! Transmitting %s. (%s/%s connections used)
|
||||
message.attunedcrystal.linking=Source relay saved at %s, %s, %s. Right-click a destination to link.
|
||||
message.attunedcrystal.setto=Attuned Crystal now set to:
|
||||
message.reagentconduit.noconnections=This relay has no routing connections.
|
||||
message.reagentconduit.connections=Routing connections:
|
||||
message.reagentconduit.connection.entry= %s -> (%s, %s, %s)
|
||||
message.demon.shallfollow=I shall follow and protect you!
|
||||
message.demon.willstay=I will stay here for now, Master.
|
||||
message.destinationclearer.cleared=Destination list now cleared.
|
||||
|
||||
@@ -389,7 +389,7 @@ commands.soulnetwork.noPlayer=没有指定玩家
|
||||
commands.soulnetwork.noCommand=命令不够详细
|
||||
commands.soulnetwork.notACommand=这不是有效的命令
|
||||
commands.soulnetwork.fillMax.success=成功填满 %s 的气血宝珠!
|
||||
commands.soulnetwork.create.success=成功创建 %s 的灵魂网络(气血宝珠等级: %d)
|
||||
commands.soulnetwork.create.success=成功创建 %s 的灵魂网络(容量: %d)
|
||||
|
||||
#Tooltips
|
||||
tooltip.activationcrystal.creativeonly=创造模式独有 - 激活任何仪式
|
||||
|
||||
Reference in new issue
Block a user