Compare commits

..
2 Commits
Author SHA1 Message Date
Martin Robertz 6a3b0e1a70 update 2024-05-03 23:15:46 +02:00
Guillaume Mercier 232148ac42 Add new rune to reduce the delay between crafts (#51)
* add layout.json to gitignore

* Add quickness rune

This rune reduces the delay between consecutive crafts. This is done by essentially scheduling a recipe check every time a recipe completes. Using something like a world accelerator will have no effect on the frequency and the runes themselves do not increase the frequency at which the altar naturally checks for updates.

This commit also addresses a couple other issues with the altar.
- since the altar was using the world time and not the world age, some mechanics were impossible to trigger if you set doDaylightCycle to false.
- For example it was impossible to start a craft if the time wasn't set to a multiple of 100.

(cherry picked from commit e14b1f23c9)
2024-05-03 23:14:44 +02:00
6 changed files with 26 additions and 37 deletions

No files matched your search

+5 -5
View File
@@ -24,15 +24,15 @@
dependencies { dependencies {
api("com.github.GTNewHorizons:waila:1.7.3:dev") api("com.github.GTNewHorizons:waila:1.7.3:dev")
api("com.github.GTNewHorizons:NotEnoughItems:2.6.0-GTNH:dev") api("com.github.GTNewHorizons:NotEnoughItems:2.5.27-GTNH:dev")
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.46.18:dev") {transitive = false } compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.45.165:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:Botania:1.11.1-GTNH:api") {transitive = false } compileOnly("com.github.GTNewHorizons:Botania:1.10.12-GTNH:api") {transitive = false }
compileOnly("com.github.GTNewHorizons:ForestryMC:4.9.0:api") {transitive = false } compileOnly("com.github.GTNewHorizons:ForestryMC:4.8.9:api") {transitive = false }
compileOnly("com.github.GTNewHorizons:ForgeMultipart:1.4.8:dev") {transitive = false } compileOnly("com.github.GTNewHorizons:ForgeMultipart:1.4.8:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:Chisel:2.15.0-GTNH:api") {transitive = false } compileOnly("com.github.GTNewHorizons:Chisel:2.14.1-GTNH:api") {transitive = false }
compileOnly("com.github.GTNewHorizons:ZenScript:1.0.0-GTNH") {transitive = false } compileOnly("com.github.GTNewHorizons:ZenScript:1.0.0-GTNH") {transitive = false }
compileOnly("com.github.GTNewHorizons:CraftTweaker:3.3.1:dev") {transitive = false } compileOnly("com.github.GTNewHorizons:CraftTweaker:3.3.1:dev") {transitive = false }
Binary file not shown.
@@ -14,7 +14,6 @@ import WayofTime.alchemicalWizardry.api.event.AddToNetworkEvent;
import WayofTime.alchemicalWizardry.api.event.ItemBindEvent; import WayofTime.alchemicalWizardry.api.event.ItemBindEvent;
import WayofTime.alchemicalWizardry.api.event.ItemDrainInContainerEvent; import WayofTime.alchemicalWizardry.api.event.ItemDrainInContainerEvent;
import WayofTime.alchemicalWizardry.api.event.ItemDrainNetworkEvent; import WayofTime.alchemicalWizardry.api.event.ItemDrainNetworkEvent;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.eventhandler.Event; import cpw.mods.fml.common.eventhandler.Event;
import cpw.mods.fml.common.eventhandler.Event.Result; import cpw.mods.fml.common.eventhandler.Event.Result;
@@ -36,12 +35,11 @@ public class SoulNetworkHandler {
} }
public static int getCurrentMaxOrb(String ownerName) { public static int getCurrentMaxOrb(String ownerName) {
MinecraftServer mcServer = FMLCommonHandler.instance().getMinecraftServerInstance(); if (MinecraftServer.getServer() == null) {
if (mcServer == null) {
return 0; return 0;
} }
World world = mcServer.worldServers[0]; World world = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName); LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName);
if (data == null) { if (data == null) {
@@ -53,12 +51,11 @@ public class SoulNetworkHandler {
} }
public static void setMaxOrbToMax(String ownerName, int maxOrb) { public static void setMaxOrbToMax(String ownerName, int maxOrb) {
MinecraftServer mcServer = FMLCommonHandler.instance().getMinecraftServerInstance(); if (MinecraftServer.getServer() == null) {
if (mcServer == null) {
return; return;
} }
World world = mcServer.worldServers[0]; World world = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName); LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName);
if (data == null) { if (data == null) {
@@ -99,7 +96,7 @@ public class SoulNetworkHandler {
} }
public static int syphonFromNetwork(String ownerName, int damageToBeDone) { public static int syphonFromNetwork(String ownerName, int damageToBeDone) {
MinecraftServer mcServer = FMLCommonHandler.instance().getMinecraftServerInstance(); MinecraftServer mcServer = MinecraftServer.getServer();
if (mcServer == null || mcServer.worldServers.length == 0) { if (mcServer == null || mcServer.worldServers.length == 0) {
return 0; return 0;
} }
@@ -195,12 +192,11 @@ public class SoulNetworkHandler {
} }
public static boolean canSyphonFromOnlyNetwork(String ownerName, int damageToBeDone) { public static boolean canSyphonFromOnlyNetwork(String ownerName, int damageToBeDone) {
MinecraftServer mcServer = FMLCommonHandler.instance().getMinecraftServerInstance(); if (MinecraftServer.getServer() == null) {
if (mcServer == null) {
return false; return false;
} }
World world = mcServer.worldServers[0]; World world = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName); LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName);
if (data == null) { if (data == null) {
@@ -212,12 +208,11 @@ public class SoulNetworkHandler {
} }
public static int getCurrentEssence(String ownerName) { public static int getCurrentEssence(String ownerName) {
MinecraftServer mcServer = FMLCommonHandler.instance().getMinecraftServerInstance(); if (MinecraftServer.getServer() == null) {
if (mcServer == null) {
return 0; return 0;
} }
World world = mcServer.worldServers[0]; World world = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName); LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName);
if (data == null) { if (data == null) {
@@ -229,12 +224,11 @@ public class SoulNetworkHandler {
} }
public static void setCurrentEssence(String ownerName, int essence) { public static void setCurrentEssence(String ownerName, int essence) {
MinecraftServer mcServer = FMLCommonHandler.instance().getMinecraftServerInstance(); if (MinecraftServer.getServer() == null) {
if (mcServer == null) {
return; return;
} }
World world = mcServer.worldServers[0]; World world = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName); LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName);
if (data == null) { if (data == null) {
@@ -261,12 +255,11 @@ public class SoulNetworkHandler {
return 0; return 0;
} }
MinecraftServer mcServer = FMLCommonHandler.instance().getMinecraftServerInstance(); if (MinecraftServer.getServer() == null) {
if (mcServer == null) {
return 0; return 0;
} }
World world = mcServer.worldServers[0]; World world = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, event.ownerNetwork); LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, event.ownerNetwork);
if (data == null) { if (data == null) {
@@ -355,11 +348,10 @@ public class SoulNetworkHandler {
} }
public static EntityPlayer getPlayerForUsername(String str) { public static EntityPlayer getPlayerForUsername(String str) {
MinecraftServer mcServer = FMLCommonHandler.instance().getMinecraftServerInstance(); if (MinecraftServer.getServer() == null) {
if (mcServer == null) {
return null; return null;
} }
return mcServer.getConfigurationManager().func_152612_a(str); return MinecraftServer.getServer().getConfigurationManager().func_152612_a(str);
} }
public static void causeNauseaToPlayer(ItemStack stack) { public static void causeNauseaToPlayer(ItemStack stack) {
@@ -11,7 +11,6 @@ import net.minecraft.server.MinecraftServer;
import WayofTime.alchemicalWizardry.ModItems; import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.common.items.LavaCrystal; import WayofTime.alchemicalWizardry.common.items.LavaCrystal;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.IFuelHandler; import cpw.mods.fml.common.IFuelHandler;
public class AlchemicalWizardryFuelHandler implements IFuelHandler { public class AlchemicalWizardryFuelHandler implements IFuelHandler {
@@ -36,12 +35,11 @@ public class AlchemicalWizardryFuelHandler implements IFuelHandler {
return 0; return 0;
} }
MinecraftServer mcServer = FMLCommonHandler.instance().getMinecraftServerInstance(); if (MinecraftServer.getServer() == null) {
if (mcServer == null) {
return 0; return 0;
} }
if (mcServer.getConfigurationManager() == null) { if (MinecraftServer.getServer().getConfigurationManager() == null) {
return 0; return 0;
} }
@@ -5,6 +5,7 @@ import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.WorldProvider; import net.minecraft.world.WorldProvider;
@@ -12,7 +13,6 @@ import net.minecraftforge.common.DimensionManager;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@@ -72,7 +72,7 @@ public class LavaCrystal extends EnergyItems {
if (itemStack.getTagCompound() != null && !(itemStack.getTagCompound().getString("ownerName").equals(""))) { if (itemStack.getTagCompound() != null && !(itemStack.getTagCompound().getString("ownerName").equals(""))) {
String ownerName = itemStack.getTagCompound().getString("ownerName"); String ownerName = itemStack.getTagCompound().getString("ownerName");
if (FMLCommonHandler.instance().getMinecraftServerInstance() == null) { if (MinecraftServer.getServer() == null) {
return false; return false;
} }
@@ -8,9 +8,9 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@@ -75,8 +75,7 @@ public class TelepositionFocus extends EnergyItems {
} }
public World getWorld(ItemStack itemStack) { public World getWorld(ItemStack itemStack) {
return FMLCommonHandler.instance().getMinecraftServerInstance() return DimensionManager.getWorld(getDimensionID(itemStack));
.worldServerForDimension(getDimensionID(itemStack));
} }
public int xCoord(ItemStack itemStack) { public int xCoord(ItemStack itemStack) {