Compare commits

...
3 Commits
Author SHA1 Message Date
Florexiz 1544c1bf0d Lossless blood orb capacity (#126) 2026-05-09 00:33:11 -04:00
Martin Robertz 88002582b9 update+deps 2026-05-03 12:14:47 +02:00
SHARKYauandkoolkrafter5 26580c10b3 Allow Ritual of Magnetism to Pull GT Ores (#125)
Co-authored-by: koolkrafter5 <[email protected]>
2026-05-03 05:16:13 -04:00
13 changed files with 102 additions and 39 deletions

No files matched your search

+10 -10
View File
@@ -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")
}
+10 -10
View File
@@ -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
Binary file not shown.
Vendored
+1 -1
View File
@@ -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
View File
@@ -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);
}
}
@@ -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");
}
@@ -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);
}
@@ -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,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
@@ -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=创造模式独有 - 激活任何仪式