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
8 changed files with 32 additions and 44 deletions

No files matched your search

+6 -6
View File
@@ -24,16 +24,16 @@
dependencies {
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.49.55: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:ForestryMC:4.9.0:api") {transitive = false }
compileOnly("com.github.GTNewHorizons:Botania:1.10.12-GTNH: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: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:CraftTweaker:3.3.1:dev") {transitive = false }
Binary file not shown.
@@ -718,9 +718,8 @@ public class AlchemicalWizardry {
proxy.registerEntities();
proxy.registerEntityTrackers();
proxy.registerEvents();
if (Loader.isModLoaded("Waila")) {
BloodMagicWailaPlugin.init();
}
BloodMagicWailaPlugin.init();
// ItemStacks used for crafting go here
ItemStack lapisStack = new ItemStack(Items.dye, 1, 4);
ItemStack lavaBucketStack = new ItemStack(Items.lava_bucket);
@@ -14,7 +14,6 @@ import WayofTime.alchemicalWizardry.api.event.AddToNetworkEvent;
import WayofTime.alchemicalWizardry.api.event.ItemBindEvent;
import WayofTime.alchemicalWizardry.api.event.ItemDrainInContainerEvent;
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.Result;
@@ -36,12 +35,11 @@ public class SoulNetworkHandler {
}
public static int getCurrentMaxOrb(String ownerName) {
MinecraftServer mcServer = FMLCommonHandler.instance().getMinecraftServerInstance();
if (mcServer == null) {
if (MinecraftServer.getServer() == null) {
return 0;
}
World world = mcServer.worldServers[0];
World world = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName);
if (data == null) {
@@ -53,12 +51,11 @@ public class SoulNetworkHandler {
}
public static void setMaxOrbToMax(String ownerName, int maxOrb) {
MinecraftServer mcServer = FMLCommonHandler.instance().getMinecraftServerInstance();
if (mcServer == null) {
if (MinecraftServer.getServer() == null) {
return;
}
World world = mcServer.worldServers[0];
World world = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName);
if (data == null) {
@@ -99,7 +96,7 @@ public class SoulNetworkHandler {
}
public static int syphonFromNetwork(String ownerName, int damageToBeDone) {
MinecraftServer mcServer = FMLCommonHandler.instance().getMinecraftServerInstance();
MinecraftServer mcServer = MinecraftServer.getServer();
if (mcServer == null || mcServer.worldServers.length == 0) {
return 0;
}
@@ -195,12 +192,11 @@ public class SoulNetworkHandler {
}
public static boolean canSyphonFromOnlyNetwork(String ownerName, int damageToBeDone) {
MinecraftServer mcServer = FMLCommonHandler.instance().getMinecraftServerInstance();
if (mcServer == null) {
if (MinecraftServer.getServer() == null) {
return false;
}
World world = mcServer.worldServers[0];
World world = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName);
if (data == null) {
@@ -212,12 +208,11 @@ public class SoulNetworkHandler {
}
public static int getCurrentEssence(String ownerName) {
MinecraftServer mcServer = FMLCommonHandler.instance().getMinecraftServerInstance();
if (mcServer == null) {
if (MinecraftServer.getServer() == null) {
return 0;
}
World world = mcServer.worldServers[0];
World world = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName);
if (data == null) {
@@ -229,12 +224,11 @@ public class SoulNetworkHandler {
}
public static void setCurrentEssence(String ownerName, int essence) {
MinecraftServer mcServer = FMLCommonHandler.instance().getMinecraftServerInstance();
if (mcServer == null) {
if (MinecraftServer.getServer() == null) {
return;
}
World world = mcServer.worldServers[0];
World world = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName);
if (data == null) {
@@ -261,12 +255,11 @@ public class SoulNetworkHandler {
return 0;
}
MinecraftServer mcServer = FMLCommonHandler.instance().getMinecraftServerInstance();
if (mcServer == null) {
if (MinecraftServer.getServer() == null) {
return 0;
}
World world = mcServer.worldServers[0];
World world = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, event.ownerNetwork);
if (data == null) {
@@ -355,11 +348,10 @@ public class SoulNetworkHandler {
}
public static EntityPlayer getPlayerForUsername(String str) {
MinecraftServer mcServer = FMLCommonHandler.instance().getMinecraftServerInstance();
if (mcServer == null) {
if (MinecraftServer.getServer() == null) {
return null;
}
return mcServer.getConfigurationManager().func_152612_a(str);
return MinecraftServer.getServer().getConfigurationManager().func_152612_a(str);
}
public static void causeNauseaToPlayer(ItemStack stack) {
@@ -11,7 +11,6 @@ import net.minecraft.server.MinecraftServer;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.common.items.LavaCrystal;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.IFuelHandler;
public class AlchemicalWizardryFuelHandler implements IFuelHandler {
@@ -36,12 +35,11 @@ public class AlchemicalWizardryFuelHandler implements IFuelHandler {
return 0;
}
MinecraftServer mcServer = FMLCommonHandler.instance().getMinecraftServerInstance();
if (mcServer == null) {
if (MinecraftServer.getServer() == null) {
return 0;
}
if (mcServer.getConfigurationManager() == null) {
if (MinecraftServer.getServer().getConfigurationManager() == null) {
return 0;
}
@@ -5,6 +5,7 @@ import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraft.world.WorldProvider;
@@ -12,7 +13,6 @@ import net.minecraftforge.common.DimensionManager;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -72,7 +72,7 @@ public class LavaCrystal extends EnergyItems {
if (itemStack.getTagCompound() != null && !(itemStack.getTagCompound().getString("ownerName").equals(""))) {
String ownerName = itemStack.getTagCompound().getString("ownerName");
if (FMLCommonHandler.instance().getMinecraftServerInstance() == null) {
if (MinecraftServer.getServer() == null) {
return false;
}
@@ -8,9 +8,9 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -75,8 +75,7 @@ public class TelepositionFocus extends EnergyItems {
}
public World getWorld(ItemStack itemStack) {
return FMLCommonHandler.instance().getMinecraftServerInstance()
.worldServerForDimension(getDimensionID(itemStack));
return DimensionManager.getWorld(getDimensionID(itemStack));
}
public int xCoord(ItemStack itemStack) {
@@ -16,7 +16,7 @@ import net.minecraftforge.oredict.OreDictionary;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.common.blocks.TileEntityOres;
import gregtech.common.blocks.GT_TileEntity_Ores;
public class MeteorParadigm {
@@ -220,8 +220,8 @@ public class MeteorParadigm {
@Optional.Method(modid = "gregtech")
private static void setGTOresNaturalIfNeeded(World world, int x, int y, int z) {
final TileEntity tileEntity = world.getTileEntity(x, y, z);
if (tileEntity instanceof TileEntityOres) {
((TileEntityOres) tileEntity).mNatural = true;
if (tileEntity instanceof GT_TileEntity_Ores) {
((GT_TileEntity_Ores) tileEntity).mNatural = true;
}
}
}