diff --git a/dependencies.gradle b/dependencies.gradle index 2a3efc1..6f0ca27 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -34,12 +34,14 @@ * For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph */ dependencies { -// api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-673-GTNH:dev") +// api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-723-GTNH:dev") api("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") - compileOnly("com.github.GTNewHorizons:BloodMagic:1.7.48:dev") + compileOnly("com.github.GTNewHorizons:BloodMagic:1.8.5:dev") compileOnly(rfg.deobf("curse.maven:botania-225643:2249359")) compileOnly(rfg.deobf("curse.maven:customnpcs-221826:2495406")) - compileOnly("com.github.GTNewHorizons:ThaumicEnergistics:1.7.11-GTNH:dev") + compileOnly("com.github.GTNewHorizons:ThaumicEnergistics:1.7.14-GTNH:dev") runtimeOnly("com.azanor.baubles:Baubles:1.0.1.10:deobf") + compileOnly(rfg.deobf("curse.maven:ubc-72744:2304497")) + compileOnly("curse.maven:cofhcore-69162:2388751") } diff --git a/gradle.properties b/gradle.properties index 2639a8d..9c98157 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,7 +14,7 @@ modId = blightbuster modGroup = talonos.blightbuster # Whether to use modGroup as the maven publishing group. -# Due to a history of using JitPack, the default is com.github.GTNewHorizons for all mods. +# When false, com.github.GTNewHorizons is used. useModGroupForPublishing = false # Updates your build.gradle and settings.gradle automatically whenever an update is available. @@ -76,13 +76,20 @@ accessTransformersFile = # Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled! usesMixins = true +# Set to a non-empty string to configure mixins in a separate source set under src/VALUE, instead of src/main. +# This can speed up compile times thanks to not running the mixin annotation processor on all input sources. +# Mixin classes will have access to "main" classes, but not the other way around. +separateMixinSourceSet = + # Adds some debug arguments like verbose output and class export. usesMixinDebug = false # Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise. mixinPlugin = -# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail! +# Specify the package that contains all of your Mixins. The package must exist or +# the build will fail. If you have a package property defined in your mixins..json, +# it must match with this or the build will fail. mixinsPackage = mixins # Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin! @@ -108,9 +115,15 @@ minimizeShadowedDependencies = true # If disabled, won't rename the shadowed classes. relocateShadowedDependencies = true -# Adds the GTNH maven, CurseMaven, Modrinth, and some more well-known 1.7.10 repositories. +# Adds CurseMaven, Modrinth, and some more well-known 1.7.10 repositories. includeWellKnownRepositories = true +# A list of repositories to exclude from the includeWellKnownRepositories setting. Should be a space separated +# list of strings, with the acceptable keys being(case does not matter): +# cursemaven +# modrinth +excludeWellKnownRepositories = + # Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven. # Authenticate with the MAVEN_USER and MAVEN_PASSWORD environment variables. # If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle. @@ -131,7 +144,7 @@ modrinthProjectId = # type can be one of [project, version], # and the name is the Modrinth project or version slug/id of the other mod. # Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech -# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true +# Note: UniMixins is automatically set as a required dependency if usesMixins = true. modrinthRelations = # Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens. diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index d64cd49..e644113 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a441313..37f853b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 1aa94a4..b740cf1 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/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/. diff --git a/settings.gradle b/settings.gradle index 1b1ee64..77bb6c2 100644 --- a/settings.gradle +++ b/settings.gradle @@ -17,5 +17,5 @@ pluginManagement { } plugins { - id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.23' + id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.47' } diff --git a/src/api/java/Zeno410Utils/BlockState.java b/src/api/java/Zeno410Utils/BlockState.java deleted file mode 100644 index 5afd238..0000000 --- a/src/api/java/Zeno410Utils/BlockState.java +++ /dev/null @@ -1,14 +0,0 @@ -package Zeno410Utils; - -import net.minecraft.block.Block; - -public class BlockState { - - public final Block block; - public final int metadata; - - public BlockState(Block block, int metadata) { - this.block = block; - this.metadata = metadata; - } -} diff --git a/src/api/java/Zeno410Utils/Zeno410Logger.java b/src/api/java/Zeno410Utils/Zeno410Logger.java deleted file mode 100644 index ea75b53..0000000 --- a/src/api/java/Zeno410Utils/Zeno410Logger.java +++ /dev/null @@ -1,33 +0,0 @@ -package Zeno410Utils; - -import java.util.logging.FileHandler; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.logging.SimpleFormatter; - -public class Zeno410Logger { - - private static FileHandler fileTxt; - private static SimpleFormatter formatterTxt; - public static final boolean suppress = true; - private Logger logger; - - public static void crashIfRecording(RuntimeException toThrow) {} - - public static Logger globalLogger() { - Logger logger = Logger.getLogger("global"); - - logger.setLevel(Level.ALL); - - logger.info("Starting"); - return logger; - } - - public Logger logger() { - return this.logger; - } - - public Zeno410Logger(String name) { - this.logger = Logger.getLogger(name); - } -} diff --git a/src/api/java/cofh/api/CoFHAPIProps.java b/src/api/java/cofh/api/CoFHAPIProps.java deleted file mode 100644 index c32bfde..0000000 --- a/src/api/java/cofh/api/CoFHAPIProps.java +++ /dev/null @@ -1,11 +0,0 @@ -package cofh.api; - -public class CoFHAPIProps { - - private CoFHAPIProps() { - - } - - public static final String VERSION = "1.7.10R1.0.2"; - -} diff --git a/src/api/java/cofh/api/energy/EnergyStorage.java b/src/api/java/cofh/api/energy/EnergyStorage.java deleted file mode 100644 index 697bf3d..0000000 --- a/src/api/java/cofh/api/energy/EnergyStorage.java +++ /dev/null @@ -1,160 +0,0 @@ -package cofh.api.energy; - -import net.minecraft.nbt.NBTTagCompound; - -/** - * Reference implementation of {@link IEnergyStorage}. Use/extend this or implement your own. - * - * @author King Lemming - * - */ -public class EnergyStorage implements IEnergyStorage { - - protected int energy; - protected int capacity; - protected int maxReceive; - protected int maxExtract; - - public EnergyStorage(int capacity) { - - this(capacity, capacity, capacity); - } - - public EnergyStorage(int capacity, int maxTransfer) { - - this(capacity, maxTransfer, maxTransfer); - } - - public EnergyStorage(int capacity, int maxReceive, int maxExtract) { - - this.capacity = capacity; - this.maxReceive = maxReceive; - this.maxExtract = maxExtract; - } - - public EnergyStorage readFromNBT(NBTTagCompound nbt) { - - this.energy = nbt.getInteger("Energy"); - - if (energy > capacity) { - energy = capacity; - } - return this; - } - - public NBTTagCompound writeToNBT(NBTTagCompound nbt) { - - if (energy < 0) { - energy = 0; - } - nbt.setInteger("Energy", energy); - return nbt; - } - - public void setCapacity(int capacity) { - - this.capacity = capacity; - - if (energy > capacity) { - energy = capacity; - } - } - - public void setMaxTransfer(int maxTransfer) { - - setMaxReceive(maxTransfer); - setMaxExtract(maxTransfer); - } - - public void setMaxReceive(int maxReceive) { - - this.maxReceive = maxReceive; - } - - public void setMaxExtract(int maxExtract) { - - this.maxExtract = maxExtract; - } - - public int getMaxReceive() { - - return maxReceive; - } - - public int getMaxExtract() { - - return maxExtract; - } - - /** - * This function is included to allow for server -> client sync. Do not call this externally to the containing - * Tile Entity, as not all IEnergyHandlers - * are guaranteed to have it. - * - * @param energy - */ - public void setEnergyStored(int energy) { - - this.energy = energy; - - if (this.energy > capacity) { - this.energy = capacity; - } else if (this.energy < 0) { - this.energy = 0; - } - } - - /** - * This function is included to allow the containing tile to directly and efficiently modify the energy contained in - * the EnergyStorage. Do not rely on this - * externally, as not all IEnergyHandlers are guaranteed to have it. - * - * @param energy - */ - public void modifyEnergyStored(int energy) { - - this.energy += energy; - - if (this.energy > capacity) { - this.energy = capacity; - } else if (this.energy < 0) { - this.energy = 0; - } - } - - /* IEnergyStorage */ - @Override - public int receiveEnergy(int maxReceive, boolean simulate) { - - int energyReceived = Math.min(capacity - energy, Math.min(this.maxReceive, maxReceive)); - - if (!simulate) { - energy += energyReceived; - } - return energyReceived; - } - - @Override - public int extractEnergy(int maxExtract, boolean simulate) { - - int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract)); - - if (!simulate) { - energy -= energyExtracted; - } - return energyExtracted; - } - - @Override - public int getEnergyStored() { - - return energy; - } - - @Override - public int getMaxEnergyStored() { - - return capacity; - } - -} diff --git a/src/api/java/cofh/api/energy/IEnergyConnection.java b/src/api/java/cofh/api/energy/IEnergyConnection.java deleted file mode 100644 index 3ad83f2..0000000 --- a/src/api/java/cofh/api/energy/IEnergyConnection.java +++ /dev/null @@ -1,22 +0,0 @@ -package cofh.api.energy; - -import net.minecraftforge.common.util.ForgeDirection; - -/** - * Implement this interface on TileEntities which should connect to energy transportation blocks. This is intended for - * blocks which generate energy but do not - * accept it; otherwise just use IEnergyHandler. - *

- * Note that {@link IEnergyHandler} is an extension of this. - * - * @author King Lemming - * - */ -public interface IEnergyConnection { - - /** - * Returns TRUE if the TileEntity can connect on a given side. - */ - boolean canConnectEnergy(ForgeDirection from); - -} diff --git a/src/api/java/cofh/api/energy/IEnergyContainerItem.java b/src/api/java/cofh/api/energy/IEnergyContainerItem.java deleted file mode 100644 index 5374506..0000000 --- a/src/api/java/cofh/api/energy/IEnergyContainerItem.java +++ /dev/null @@ -1,54 +0,0 @@ -package cofh.api.energy; - -import net.minecraft.item.ItemStack; - -/** - * Implement this interface on Item classes that support external manipulation of their internal energy storages. - *

- * A reference implementation is provided {@link ItemEnergyContainer}. - * - * @author King Lemming - * - */ -public interface IEnergyContainerItem { - - /** - * Adds energy to a container item. Returns the quantity of energy that was accepted. This should always return 0 if - * the item cannot be externally charged. - * - * @param container - * ItemStack to be charged. - * @param maxReceive - * Maximum amount of energy to be sent into the item. - * @param simulate - * If TRUE, the charge will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) received by the item. - */ - int receiveEnergy(ItemStack container, int maxReceive, boolean simulate); - - /** - * Removes energy from a container item. Returns the quantity of energy that was removed. This should always return - * 0 if the item cannot be externally - * discharged. - * - * @param container - * ItemStack to be discharged. - * @param maxExtract - * Maximum amount of energy to be extracted from the item. - * @param simulate - * If TRUE, the discharge will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) extracted from the item. - */ - int extractEnergy(ItemStack container, int maxExtract, boolean simulate); - - /** - * Get the amount of energy currently stored in the container item. - */ - int getEnergyStored(ItemStack container); - - /** - * Get the max amount of energy that can be stored in the container item. - */ - int getMaxEnergyStored(ItemStack container); - -} diff --git a/src/api/java/cofh/api/energy/IEnergyHandler.java b/src/api/java/cofh/api/energy/IEnergyHandler.java deleted file mode 100644 index 82945b3..0000000 --- a/src/api/java/cofh/api/energy/IEnergyHandler.java +++ /dev/null @@ -1,59 +0,0 @@ -package cofh.api.energy; - -import net.minecraftforge.common.util.ForgeDirection; - -/** - * Implement this interface on Tile Entities which should handle energy, generally storing it in one or more internal - * {@link IEnergyStorage} objects. - *

- * A reference implementation is provided {@link TileEnergyHandler}. - * - * @author King Lemming - * - */ -public interface IEnergyHandler extends IEnergyProvider, IEnergyReceiver { - - // merely a convenience interface (remove these methods in 1.8; provided here for back-compat via compiler doing - // things) - - /** - * Add energy to an IEnergyReceiver, internal distribution is left entirely to the IEnergyReceiver. - * - * @param from - * Orientation the energy is received from. - * @param maxReceive - * Maximum amount of energy to receive. - * @param simulate - * If TRUE, the charge will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) received. - */ - @Override - int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate); - - /** - * Remove energy from an IEnergyProvider, internal distribution is left entirely to the IEnergyProvider. - * - * @param from - * Orientation the energy is extracted from. - * @param maxExtract - * Maximum amount of energy to extract. - * @param simulate - * If TRUE, the extraction will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) extracted. - */ - @Override - int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate); - - /** - * Returns the amount of energy currently stored. - */ - @Override - int getEnergyStored(ForgeDirection from); - - /** - * Returns the maximum amount of energy that can be stored. - */ - @Override - int getMaxEnergyStored(ForgeDirection from); - -} diff --git a/src/api/java/cofh/api/energy/IEnergyProvider.java b/src/api/java/cofh/api/energy/IEnergyProvider.java deleted file mode 100644 index 22e73d9..0000000 --- a/src/api/java/cofh/api/energy/IEnergyProvider.java +++ /dev/null @@ -1,39 +0,0 @@ -package cofh.api.energy; - -import net.minecraftforge.common.util.ForgeDirection; - -/** - * Implement this interface on Tile Entities which should provide energy, generally storing it in one or more internal - * {@link IEnergyStorage} objects. - *

- * A reference implementation is provided {@link TileEnergyHandler}. - * - * @author King Lemming - * - */ -public interface IEnergyProvider extends IEnergyConnection { - - /** - * Remove energy from an IEnergyProvider, internal distribution is left entirely to the IEnergyProvider. - * - * @param from - * Orientation the energy is extracted from. - * @param maxExtract - * Maximum amount of energy to extract. - * @param simulate - * If TRUE, the extraction will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) extracted. - */ - int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate); - - /** - * Returns the amount of energy currently stored. - */ - int getEnergyStored(ForgeDirection from); - - /** - * Returns the maximum amount of energy that can be stored. - */ - int getMaxEnergyStored(ForgeDirection from); - -} diff --git a/src/api/java/cofh/api/energy/IEnergyReceiver.java b/src/api/java/cofh/api/energy/IEnergyReceiver.java deleted file mode 100644 index c3901e6..0000000 --- a/src/api/java/cofh/api/energy/IEnergyReceiver.java +++ /dev/null @@ -1,39 +0,0 @@ -package cofh.api.energy; - -import net.minecraftforge.common.util.ForgeDirection; - -/** - * Implement this interface on Tile Entities which should receive energy, generally storing it in one or more internal - * {@link IEnergyStorage} objects. - *

- * A reference implementation is provided {@link TileEnergyHandler}. - * - * @author King Lemming - * - */ -public interface IEnergyReceiver extends IEnergyConnection { - - /** - * Add energy to an IEnergyReceiver, internal distribution is left entirely to the IEnergyReceiver. - * - * @param from - * Orientation the energy is received from. - * @param maxReceive - * Maximum amount of energy to receive. - * @param simulate - * If TRUE, the charge will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) received. - */ - int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate); - - /** - * Returns the amount of energy currently stored. - */ - int getEnergyStored(ForgeDirection from); - - /** - * Returns the maximum amount of energy that can be stored. - */ - int getMaxEnergyStored(ForgeDirection from); - -} diff --git a/src/api/java/cofh/api/energy/IEnergyStorage.java b/src/api/java/cofh/api/energy/IEnergyStorage.java deleted file mode 100644 index 94529e5..0000000 --- a/src/api/java/cofh/api/energy/IEnergyStorage.java +++ /dev/null @@ -1,46 +0,0 @@ -package cofh.api.energy; - -/** - * An energy storage is the unit of interaction with Energy inventories.
- * This is not to be implemented on TileEntities. This is for internal use only. - *

- * A reference implementation can be found at {@link EnergyStorage}. - * - * @author King Lemming - * - */ -public interface IEnergyStorage { - - /** - * Adds energy to the storage. Returns quantity of energy that was accepted. - * - * @param maxReceive - * Maximum amount of energy to be inserted. - * @param simulate - * If TRUE, the insertion will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) accepted by the storage. - */ - int receiveEnergy(int maxReceive, boolean simulate); - - /** - * Removes energy from the storage. Returns quantity of energy that was removed. - * - * @param maxExtract - * Maximum amount of energy to be extracted. - * @param simulate - * If TRUE, the extraction will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) extracted from the storage. - */ - int extractEnergy(int maxExtract, boolean simulate); - - /** - * Returns the amount of energy currently stored. - */ - int getEnergyStored(); - - /** - * Returns the maximum amount of energy that can be stored. - */ - int getMaxEnergyStored(); - -} diff --git a/src/api/java/cofh/api/energy/ItemEnergyContainer.java b/src/api/java/cofh/api/energy/ItemEnergyContainer.java deleted file mode 100644 index 3a95748..0000000 --- a/src/api/java/cofh/api/energy/ItemEnergyContainer.java +++ /dev/null @@ -1,110 +0,0 @@ -package cofh.api.energy; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -/** - * Reference implementation of {@link IEnergyContainerItem}. Use/extend this or implement your own. - * - * @author King Lemming - * - */ -public class ItemEnergyContainer extends Item implements IEnergyContainerItem { - - protected int capacity; - protected int maxReceive; - protected int maxExtract; - - public ItemEnergyContainer() { - - } - - public ItemEnergyContainer(int capacity) { - - this(capacity, capacity, capacity); - } - - public ItemEnergyContainer(int capacity, int maxTransfer) { - - this(capacity, maxTransfer, maxTransfer); - } - - public ItemEnergyContainer(int capacity, int maxReceive, int maxExtract) { - - this.capacity = capacity; - this.maxReceive = maxReceive; - this.maxExtract = maxExtract; - } - - public ItemEnergyContainer setCapacity(int capacity) { - - this.capacity = capacity; - return this; - } - - public void setMaxTransfer(int maxTransfer) { - - setMaxReceive(maxTransfer); - setMaxExtract(maxTransfer); - } - - public void setMaxReceive(int maxReceive) { - - this.maxReceive = maxReceive; - } - - public void setMaxExtract(int maxExtract) { - - this.maxExtract = maxExtract; - } - - /* IEnergyContainerItem */ - @Override - public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) { - - if (container.stackTagCompound == null) { - container.stackTagCompound = new NBTTagCompound(); - } - int energy = container.stackTagCompound.getInteger("Energy"); - int energyReceived = Math.min(capacity - energy, Math.min(this.maxReceive, maxReceive)); - - if (!simulate) { - energy += energyReceived; - container.stackTagCompound.setInteger("Energy", energy); - } - return energyReceived; - } - - @Override - public int extractEnergy(ItemStack container, int maxExtract, boolean simulate) { - - if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Energy")) { - return 0; - } - int energy = container.stackTagCompound.getInteger("Energy"); - int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract)); - - if (!simulate) { - energy -= energyExtracted; - container.stackTagCompound.setInteger("Energy", energy); - } - return energyExtracted; - } - - @Override - public int getEnergyStored(ItemStack container) { - - if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Energy")) { - return 0; - } - return container.stackTagCompound.getInteger("Energy"); - } - - @Override - public int getMaxEnergyStored(ItemStack container) { - - return capacity; - } - -} diff --git a/src/api/java/cofh/api/energy/TileEnergyHandler.java b/src/api/java/cofh/api/energy/TileEnergyHandler.java deleted file mode 100644 index e37fe7f..0000000 --- a/src/api/java/cofh/api/energy/TileEnergyHandler.java +++ /dev/null @@ -1,65 +0,0 @@ -package cofh.api.energy; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; - -/** - * Reference implementation of {@link IEnergyHandler}. Use/extend this or implement your own. - * - * @author King Lemming - * - */ -public class TileEnergyHandler extends TileEntity implements IEnergyHandler { - - protected EnergyStorage storage = new EnergyStorage(32000); - - @Override - public void readFromNBT(NBTTagCompound nbt) { - - super.readFromNBT(nbt); - storage.readFromNBT(nbt); - } - - @Override - public void writeToNBT(NBTTagCompound nbt) { - - super.writeToNBT(nbt); - storage.writeToNBT(nbt); - } - - /* IEnergyConnection */ - @Override - public boolean canConnectEnergy(ForgeDirection from) { - - return true; - } - - /* IEnergyReceiver */ - @Override - public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) { - - return storage.receiveEnergy(maxReceive, simulate); - } - - /* IEnergyProvider */ - @Override - public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) { - - return storage.extractEnergy(maxExtract, simulate); - } - - /* IEnergyReceiver and IEnergyProvider */ - @Override - public int getEnergyStored(ForgeDirection from) { - - return storage.getEnergyStored(); - } - - @Override - public int getMaxEnergyStored(ForgeDirection from) { - - return storage.getMaxEnergyStored(); - } - -} diff --git a/src/api/java/cofh/api/energy/package-info.java b/src/api/java/cofh/api/energy/package-info.java deleted file mode 100644 index 921f109..0000000 --- a/src/api/java/cofh/api/energy/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -/** - * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub - * http://www.teamcofh.com - */ -@API(apiVersion = CoFHAPIProps.VERSION, owner = "CoFHAPI", provides = "CoFHAPI|energy") -package cofh.api.energy; - -import cofh.api.CoFHAPIProps; -import cpw.mods.fml.common.API; diff --git a/src/api/java/cofh/api/package-info.java b/src/api/java/cofh/api/package-info.java deleted file mode 100644 index 22f29a0..0000000 --- a/src/api/java/cofh/api/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/** - * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub - * http://www.teamcofh.com - */ -@API(apiVersion = CoFHAPIProps.VERSION, owner = "CoFHLib", provides = "CoFHAPI") -package cofh.api; - -import cpw.mods.fml.common.API; diff --git a/src/api/java/cofh/core/item/IEqualityOverrideItem.java b/src/api/java/cofh/core/item/IEqualityOverrideItem.java deleted file mode 100644 index 5144cb0..0000000 --- a/src/api/java/cofh/core/item/IEqualityOverrideItem.java +++ /dev/null @@ -1,9 +0,0 @@ -package cofh.core.item; - -import net.minecraft.item.ItemStack; - -public interface IEqualityOverrideItem { - - public boolean isLastHeldItemEqual(ItemStack current, ItemStack previous); - -} diff --git a/src/api/java/exterminatorJeff/undergroundBiomes/api/BiomeGenUndergroundBase.java b/src/api/java/exterminatorJeff/undergroundBiomes/api/BiomeGenUndergroundBase.java deleted file mode 100644 index 71a311c..0000000 --- a/src/api/java/exterminatorJeff/undergroundBiomes/api/BiomeGenUndergroundBase.java +++ /dev/null @@ -1,47 +0,0 @@ -package exterminatorJeff.undergroundBiomes.api; - -public class BiomeGenUndergroundBase { - - public String biomeName = ""; - public final int biomeID; - public boolean hasStrata = false; - public StrataLayer[] strata; - public final PerlinNoiseGenerator strataNoise; - public final UBStoneCodes fillerBlockCodes; - - public BiomeGenUndergroundBase(int ID, NamedBlock filler, int metadataValue, BiomeGenUndergroundBase[] biomeList) { - this.biomeID = ID; - this.fillerBlockCodes = new UBStoneCodes(filler, metadataValue); - this.strataNoise = new PerlinNoiseGenerator(1L); - biomeList[ID] = this; - } - - public BiomeGenUndergroundBase(int ID, NamedBlock filler, int metadataValue, BiomeGenUndergroundBase[] biomeList, - StrataLayer[] strataLayers) { - this.biomeID = ID; - this.fillerBlockCodes = new UBStoneCodes(filler, metadataValue); - this.strataNoise = new PerlinNoiseGenerator(1L); - biomeList[ID] = this; - AddStrataLayers(strataLayers); - } - - public BiomeGenUndergroundBase AddStrataLayers(StrataLayer[] strata) { - this.hasStrata = true; - this.strata = strata; - return this; - } - - public UBStoneCodes getStrataBlockAtLayer(int y) { - for (int i = 0; i < this.strata.length; i++) { - if (this.strata[i].valueIsInLayer(y) == true) { - return this.strata[i].codes; - } - } - return this.fillerBlockCodes; - } - - public BiomeGenUndergroundBase setName(String name) { - this.biomeName = name; - return this; - } -} diff --git a/src/api/java/exterminatorJeff/undergroundBiomes/api/BlockCodes.java b/src/api/java/exterminatorJeff/undergroundBiomes/api/BlockCodes.java deleted file mode 100644 index a580d36..0000000 --- a/src/api/java/exterminatorJeff/undergroundBiomes/api/BlockCodes.java +++ /dev/null @@ -1,48 +0,0 @@ -package exterminatorJeff.undergroundBiomes.api; - -import net.minecraft.block.Block; - -import Zeno410Utils.BlockState; - -public class BlockCodes extends BlockState { - - public final NamedBlock name; - public final BlockCodes onDrop; - private final int metadataHashcode; - - public BlockCodes(Block block, int metadata) { - super(block, metadata); - this.name = null; - this.onDrop = this; - this.metadataHashcode = new Integer(metadata).hashCode(); - } - - public BlockCodes(NamedBlock namer, int metadata) { - super(namer.block(), metadata); - this.name = namer; - if (this.block == null) { - throw new RuntimeException("couldn't find block for " + namer.internal()); - } - this.onDrop = this; - this.metadataHashcode = new Integer(metadata).hashCode(); - } - - public BlockCodes(NamedBlock namer, int metadata, BlockCodes onDrop) { - super(namer.block(), metadata); - this.name = namer; - this.onDrop = onDrop; - this.metadataHashcode = new Integer(metadata).hashCode(); - } - - public int hashcode() { - return this.block.hashCode() + this.metadataHashcode; - } - - public boolean equals(Object compared) { - if ((compared instanceof BlockCodes)) { - BlockCodes comparedCodes = (BlockCodes) compared; - if ((this.block == comparedCodes.block) && (this.metadata == comparedCodes.metadata)) return true; - } - return false; - } -} diff --git a/src/api/java/exterminatorJeff/undergroundBiomes/api/NamedBlock.java b/src/api/java/exterminatorJeff/undergroundBiomes/api/NamedBlock.java deleted file mode 100644 index 26d75d8..0000000 --- a/src/api/java/exterminatorJeff/undergroundBiomes/api/NamedBlock.java +++ /dev/null @@ -1,67 +0,0 @@ -package exterminatorJeff.undergroundBiomes.api; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class NamedBlock extends Names { - - protected int id; - public Block block; - public static final String modid = "undergroundBiomes"; - - public NamedBlock(String internalName) { - super(internalName); - } - - public void gameRegister(Block _block, Class itemClass) { - this.block = _block; - GameRegistry.registerBlock(this.block, itemClass, internal()); - } - - public void register(int _id, Block _block) { - if (this.block != null) { - throw duplicateRegistry(); - } - - reRegister(_id, _block); - } - - public void reRegister(int _id, Block _block) { - this.id = _id; - this.block = _block; - this.block.setBlockName(external()); - Block current = Block.getBlockById(_id); - if (current != this.block) { - if (current != null) { - throw new RuntimeException(internal() + " has been replaced by " + current.toString()); - } - Block.blockRegistry.addObject(this.id, internal(), _block); - } - } - - public Block block() { - return this.block; - } - - public boolean matches(Item compared) { - if ((compared instanceof ItemBlock)) { - return ((ItemBlock) compared).field_150939_a.equals(this.block); - } - return false; - } - - public boolean matches(Block compared) { - return compared.equals(block()); - } - - public int ID() { - return Block.getIdFromBlock(block()); - } - - public Item matchingItem(Block block) { - return Item.getItemById(Block.getIdFromBlock(block)); - } -} diff --git a/src/api/java/exterminatorJeff/undergroundBiomes/api/NamedItem.java b/src/api/java/exterminatorJeff/undergroundBiomes/api/NamedItem.java deleted file mode 100644 index f7aa3c0..0000000 --- a/src/api/java/exterminatorJeff/undergroundBiomes/api/NamedItem.java +++ /dev/null @@ -1,62 +0,0 @@ -package exterminatorJeff.undergroundBiomes.api; - -import java.util.Iterator; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.item.Item; -import net.minecraft.util.IIcon; - -public class NamedItem extends Names { - - protected int id; - protected Item item; - - public NamedItem(String internalName) { - super(internalName); - } - - public NamedItem(NamedBlock block) { - this(block.internal()); - } - - public void register(int _id, Item _item) { - reRegister(_id, _item); - } - - public void reRegister(int _id, Item _item) { - this.id = _id; - this.item = _item; - Item current = Item.getItemById(_id); - if (current != _item) Item.itemRegistry.addObject(_id, internal(), _item); - } - - public Item cachedItem() { - if (this.item == null) { - this.item = ((Item) Item.itemRegistry.getObject(external())); - if (this.item == null) throw new RuntimeException(internal() + " has no item"); - } - return this.item; - } - - public Item registeredItem() { - Item result = (Item) Item.itemRegistry.getObject(internal()); - if (result == null) { - result = (Item) Item.itemRegistry.getObject(external()); - if (result == null) { - Object key; - for (Iterator i$ = Item.itemRegistry.getKeys() - .iterator(); i$.hasNext(); key = i$.next()); - throw new RuntimeException(); - } - } - return result; - } - - public IIcon registerIcons(IIconRegister iconRegister) { - return iconRegister.registerIcon(external()); - } - - public boolean matches(Item matched) { - return this.item.equals(matched); - } -} diff --git a/src/api/java/exterminatorJeff/undergroundBiomes/api/NamedSlabPair.java b/src/api/java/exterminatorJeff/undergroundBiomes/api/NamedSlabPair.java deleted file mode 100644 index 21a579d..0000000 --- a/src/api/java/exterminatorJeff/undergroundBiomes/api/NamedSlabPair.java +++ /dev/null @@ -1,34 +0,0 @@ -package exterminatorJeff.undergroundBiomes.api; - -import java.util.logging.Logger; - -import net.minecraft.block.Block; - -import Zeno410Utils.Zeno410Logger; - -public class NamedSlabPair { - - public static final Logger logger = new Zeno410Logger("NamedSlabPair").logger(); - public final NamedBlock half; - public final NamedBlock full; - - public NamedSlabPair(NamedBlock material) { - this.half = new NamedSlab(material.internal() + "HalfSlab"); - this.full = new NamedSlab(material.internal() + "FullSlab"); - } - - public static class NamedSlab extends NamedBlock { - - public NamedSlab(String name) { - super(name); - } - - public Block block() { - Block result = Block.getBlockFromName(internal()); - if (result == null) { - result = Block.getBlockFromName(external()); - } - return result; - } - } -} diff --git a/src/api/java/exterminatorJeff/undergroundBiomes/api/NamedVanillaBlock.java b/src/api/java/exterminatorJeff/undergroundBiomes/api/NamedVanillaBlock.java deleted file mode 100644 index f8eb970..0000000 --- a/src/api/java/exterminatorJeff/undergroundBiomes/api/NamedVanillaBlock.java +++ /dev/null @@ -1,48 +0,0 @@ -package exterminatorJeff.undergroundBiomes.api; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; - -public class NamedVanillaBlock extends NamedBlock { - - public static final NamedBlock cobblestone = new NamedVanillaBlock(Blocks.cobblestone); - public static final NamedBlock cobblestone_wall = new NamedVanillaBlock(Blocks.cobblestone_wall); - public static final NamedBlock dispenser = new NamedVanillaBlock(Blocks.dispenser); - public static final NamedBlock furnace = new NamedVanillaBlock(Blocks.furnace); - - public static final NamedBlock lever = new NamedVanillaBlock(Blocks.lever); - public static final NamedBlock piston = new NamedVanillaBlock(Blocks.piston); - public static final NamedBlock planks = new NamedVanillaBlock(Blocks.planks); - public static final NamedBlock stone_pressure_plate = new NamedVanillaBlock(Blocks.stone_pressure_plate); - - public static final NamedBlock sand = new NamedVanillaBlock(Blocks.sand); - public static final NamedBlock sandstone = new NamedVanillaBlock(Blocks.sandstone); - public static final NamedBlock smoothSandstone = new NamedVanillaBlock(Blocks.sandstone); - public static final NamedBlock stairsCobblestone = new NamedVanillaBlock(Blocks.stone_stairs); - public static final NamedBlock stairsStoneBrick = new NamedVanillaBlock(Blocks.stone_brick_stairs); - public static final NamedBlock stone = new NamedVanillaBlock(Blocks.stone); - public static final NamedBlock stoneBrick = new NamedVanillaBlock(Blocks.stonebrick); - public static final NamedBlock stoneButton = new NamedVanillaBlock(Blocks.stone_button); - public static final NamedBlock stoneSingleSlab = new NamedVanillaBlock(Blocks.stone_slab); - public static final NamedBlock torchRedstoneActive = new NamedVanillaBlock(Blocks.redstone_torch); - - public NamedVanillaBlock(String name) { - super(name); - this.id = UBIDs.blockID(name); - this.block = UBIDs.blockNamed(name); - } - - public NamedVanillaBlock(Block _block) { - super(_block.getUnlocalizedName()); - this.id = Block.getIdFromBlock(_block); - this.block = _block; - } - - public Block block() { - if (this.block == null) { - this.block = UBIDs.blockNamed(internal()); - } - - return this.block; - } -} diff --git a/src/api/java/exterminatorJeff/undergroundBiomes/api/Names.java b/src/api/java/exterminatorJeff/undergroundBiomes/api/Names.java deleted file mode 100644 index e948968..0000000 --- a/src/api/java/exterminatorJeff/undergroundBiomes/api/Names.java +++ /dev/null @@ -1,30 +0,0 @@ -package exterminatorJeff.undergroundBiomes.api; - -public class Names { - - private final String internal; - - public Names(String internalName) { - this.internal = internalName; - } - - public final String internal() { - return this.internal; - } - - public final String external() { - return UBIDs.publicName(this.internal); - } - - public final String iconName() { - return UBIDs.iconName(this.internal); - } - - public final RuntimeException duplicateRegistry() { - return new RuntimeException("duplication registry for Block " + external()); - } - - public String toString() { - return external(); - } -} diff --git a/src/api/java/exterminatorJeff/undergroundBiomes/api/NoiseGenerator.java b/src/api/java/exterminatorJeff/undergroundBiomes/api/NoiseGenerator.java deleted file mode 100644 index e559feb..0000000 --- a/src/api/java/exterminatorJeff/undergroundBiomes/api/NoiseGenerator.java +++ /dev/null @@ -1,79 +0,0 @@ -package exterminatorJeff.undergroundBiomes.api; - -public abstract class NoiseGenerator { - - protected final int[] perm = new int[512]; - protected double offsetX; - protected double offsetY; - protected double offsetZ; - - public static int floor(double x) { - return x >= 0.0D ? (int) x : (int) x - 1; - } - - protected static double fade(double x) { - return x * x * x * (x * (x * 6.0D - 15.0D) + 10.0D); - } - - protected static double lerp(double x, double y, double z) { - return y + x * (z - y); - } - - protected static double grad(int hash, double x, double y, double z) { - hash &= 15; - double u = hash < 8 ? x : y; - double v = (hash == 12) || (hash == 14) ? x : hash < 4 ? y : z; - return ((hash & 0x1) == 0 ? u : -u) + ((hash & 0x2) == 0 ? v : -v); - } - - public double noise(double x) { - return noise(x, 0.0D, 0.0D); - } - - public double noise(double x, double y) { - return noise(x, y, 0.0D); - } - - public abstract double noise(double paramDouble1, double paramDouble2, double paramDouble3); - - public double noise(double x, int octaves, double frequency, double amplitude) { - return noise(x, 0.0D, 0.0D, octaves, frequency, amplitude); - } - - public double noise(double x, int octaves, double frequency, double amplitude, boolean normalized) { - return noise(x, 0.0D, 0.0D, octaves, frequency, amplitude, normalized); - } - - public double noise(double x, double y, int octaves, double frequency, double amplitude) { - return noise(x, y, 0.0D, octaves, frequency, amplitude); - } - - public double noise(double x, double y, int octaves, double frequency, double amplitude, boolean normalized) { - return noise(x, y, 0.0D, octaves, frequency, amplitude, normalized); - } - - public double noise(double x, double y, double z, int octaves, double frequency, double amplitude) { - return noise(x, y, z, octaves, frequency, amplitude, false); - } - - public double noise(double x, double y, double z, int octaves, double frequency, double amplitude, - boolean normalized) { - double result = 0.0D; - double amp = 1.0D; - double freq = 1.0D; - double max = 0.0D; - - for (int i = 0; i < octaves; i++) { - result += noise(x * freq, y * freq, z * freq) * amp; - max += amp; - freq *= frequency; - amp *= amplitude; - } - - if (normalized) { - result /= max; - } - - return result; - } -} diff --git a/src/api/java/exterminatorJeff/undergroundBiomes/api/PerlinNoiseGenerator.java b/src/api/java/exterminatorJeff/undergroundBiomes/api/PerlinNoiseGenerator.java deleted file mode 100644 index 8692abf..0000000 --- a/src/api/java/exterminatorJeff/undergroundBiomes/api/PerlinNoiseGenerator.java +++ /dev/null @@ -1,121 +0,0 @@ -package exterminatorJeff.undergroundBiomes.api; - -import java.util.Random; - -public class PerlinNoiseGenerator extends NoiseGenerator { - - protected static final int[][] grad3 = { { 1, 1, 0 }, { -1, 1, 0 }, { 1, -1, 0 }, { -1, -1, 0 }, { 1, 0, 1 }, - { -1, 0, 1 }, { 1, 0, -1 }, { -1, 0, -1 }, { 0, 1, 1 }, { 0, -1, 1 }, { 0, 1, -1 }, { 0, -1, -1 } }; - - private static final PerlinNoiseGenerator instance = new PerlinNoiseGenerator(); - - protected PerlinNoiseGenerator() { - int[] p = { 151, 160, 137, 91, 90, 15, 131, 13, 201, 95, 96, 53, 194, 233, 7, 225, 140, 36, 103, 30, 69, 142, 8, - 99, 37, 240, 21, 10, 23, 190, 6, 148, 247, 120, 234, 75, 0, 26, 197, 62, 94, 252, 219, 203, 117, 35, 11, 32, - 57, 177, 33, 88, 237, 149, 56, 87, 174, 20, 125, 136, 171, 168, 68, 175, 74, 165, 71, 134, 139, 48, 27, 166, - 77, 146, 158, 231, 83, 111, 229, 122, 60, 211, 133, 230, 220, 105, 92, 41, 55, 46, 245, 40, 244, 102, 143, - 54, 65, 25, 63, 161, 1, 216, 80, 73, 209, 76, 132, 187, 208, 89, 18, 169, 200, 196, 135, 130, 116, 188, 159, - 86, 164, 100, 109, 198, 173, 186, 3, 64, 52, 217, 226, 250, 124, 123, 5, 202, 38, 147, 118, 126, 255, 82, - 85, 212, 207, 206, 59, 227, 47, 16, 58, 17, 182, 189, 28, 42, 223, 183, 170, 213, 119, 248, 152, 2, 44, 154, - 163, 70, 221, 153, 101, 155, 167, 43, 172, 9, 129, 22, 39, 253, 19, 98, 108, 110, 79, 113, 224, 232, 178, - 185, 112, 104, 218, 246, 97, 228, 251, 34, 242, 193, 238, 210, 144, 12, 191, 179, 162, 241, 81, 51, 145, - 235, 249, 14, 239, 107, 49, 192, 214, 31, 181, 199, 106, 157, 184, 84, 204, 176, 115, 121, 50, 45, 127, 4, - 150, 254, 138, 236, 205, 93, 222, 114, 67, 29, 24, 72, 243, 141, 128, 195, 78, 66, 215, 61, 156, 180 }; - - for (int i = 0; i < 512; i++) this.perm[i] = p[(i & 0xFF)]; - } - - public PerlinNoiseGenerator(long seed) { - this(new Random(seed)); - } - - public PerlinNoiseGenerator(Random rand) { - this.offsetX = (rand.nextDouble() * 256.0D); - this.offsetY = (rand.nextDouble() * 256.0D); - this.offsetZ = (rand.nextDouble() * 256.0D); - - for (int i = 0; i < 256; i++) { - this.perm[i] = rand.nextInt(256); - } - - for (int i = 0; i < 256; i++) { - int pos = rand.nextInt(256 - i) + i; - int old = this.perm[i]; - - this.perm[i] = this.perm[pos]; - this.perm[pos] = old; - this.perm[(i + 256)] = this.perm[i]; - } - } - - public static double getNoise(double x) { - return instance.noise(x); - } - - public static double getNoise(double x, double y) { - return instance.noise(x, y); - } - - public static double getNoise(double x, double y, double z) { - return instance.noise(x, y, z); - } - - public static PerlinNoiseGenerator getInstance() { - return instance; - } - - public double noise(double x, double y, double z) { - x += this.offsetX; - y += this.offsetY; - z += this.offsetZ; - - int floorX = floor(x); - int floorY = floor(y); - int floorZ = floor(z); - - int X = floorX & 0xFF; - int Y = floorY & 0xFF; - int Z = floorZ & 0xFF; - - x -= floorX; - y -= floorY; - z -= floorZ; - - double fX = fade(x); - double fY = fade(y); - double fZ = fade(z); - - int A = this.perm[X] + Y; - int AA = this.perm[A] + Z; - int AB = this.perm[(A + 1)] + Z; - int B = this.perm[(X + 1)] + Y; - int BA = this.perm[B] + Z; - int BB = this.perm[(B + 1)] + Z; - - return lerp( - fZ, - lerp( - fY, - lerp(fX, grad(this.perm[AA], x, y, z), grad(this.perm[BA], x - 1.0D, y, z)), - lerp(fX, grad(this.perm[AB], x, y - 1.0D, z), grad(this.perm[BB], x - 1.0D, y - 1.0D, z))), - lerp( - fY, - lerp(fX, grad(this.perm[(AA + 1)], x, y, z - 1.0D), grad(this.perm[(BA + 1)], x - 1.0D, y, z - 1.0D)), - lerp( - fX, - grad(this.perm[(AB + 1)], x, y - 1.0D, z - 1.0D), - grad(this.perm[(BB + 1)], x - 1.0D, y - 1.0D, z - 1.0D)))); - } - - public static double getNoise(double x, int octaves, double frequency, double amplitude) { - return instance.noise(x, octaves, frequency, amplitude); - } - - public static double getNoise(double x, double y, int octaves, double frequency, double amplitude) { - return instance.noise(x, y, octaves, frequency, amplitude); - } - - public static double getNoise(double x, double y, double z, int octaves, double frequency, double amplitude) { - return instance.noise(x, y, z, octaves, frequency, amplitude); - } -} diff --git a/src/api/java/exterminatorJeff/undergroundBiomes/api/StrataLayer.java b/src/api/java/exterminatorJeff/undergroundBiomes/api/StrataLayer.java deleted file mode 100644 index 51990c0..0000000 --- a/src/api/java/exterminatorJeff/undergroundBiomes/api/StrataLayer.java +++ /dev/null @@ -1,25 +0,0 @@ -package exterminatorJeff.undergroundBiomes.api; - -public class StrataLayer { - - public final NamedBlock layerBlock; - public final int layerMetadataID; - public final int layerMin; - public final int layerMax; - public final UBStoneCodes codes; - - public StrataLayer(NamedBlock layerBlock, int layerMetadataID, int layerMin, int layerMax) { - this.layerBlock = layerBlock; - this.layerMetadataID = layerMetadataID; - this.layerMin = layerMin; - this.layerMax = layerMax; - this.codes = new UBStoneCodes(layerBlock, layerMetadataID); - } - - public boolean valueIsInLayer(int y) { - if ((y >= this.layerMin) && (y <= this.layerMax)) { - return true; - } - return false; - } -} diff --git a/src/api/java/exterminatorJeff/undergroundBiomes/api/UBAPIHook.java b/src/api/java/exterminatorJeff/undergroundBiomes/api/UBAPIHook.java deleted file mode 100644 index e8af93b..0000000 --- a/src/api/java/exterminatorJeff/undergroundBiomes/api/UBAPIHook.java +++ /dev/null @@ -1,9 +0,0 @@ -package exterminatorJeff.undergroundBiomes.api; - -public class UBAPIHook { - - public static final UBAPIHook ubAPIHook = new UBAPIHook(); - public UBDimensionalStrataColumnProvider dimensionalStrataColumnProvider; - public UBOreTexturizer ubOreTexturizer; - public UBSetProviderRegistry ubSetProviderRegistry; -} diff --git a/src/api/java/exterminatorJeff/undergroundBiomes/api/UBDimensionalStrataColumnProvider.java b/src/api/java/exterminatorJeff/undergroundBiomes/api/UBDimensionalStrataColumnProvider.java deleted file mode 100644 index cc1594e..0000000 --- a/src/api/java/exterminatorJeff/undergroundBiomes/api/UBDimensionalStrataColumnProvider.java +++ /dev/null @@ -1,6 +0,0 @@ -package exterminatorJeff.undergroundBiomes.api; - -public abstract interface UBDimensionalStrataColumnProvider { - - public abstract UBStrataColumnProvider ubStrataColumnProvider(int paramInt); -} diff --git a/src/api/java/exterminatorJeff/undergroundBiomes/api/UBIDs.java b/src/api/java/exterminatorJeff/undergroundBiomes/api/UBIDs.java deleted file mode 100644 index 273b2f0..0000000 --- a/src/api/java/exterminatorJeff/undergroundBiomes/api/UBIDs.java +++ /dev/null @@ -1,99 +0,0 @@ -package exterminatorJeff.undergroundBiomes.api; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; - -public class UBIDs { - - public static final int version = 3; - public static final NamedBlock igneousStoneName = new NamedBlock("igneousStone"); - public static final NamedBlock igneousCobblestoneName = new NamedBlock("igneousCobblestone"); - public static final NamedBlock igneousStoneBrickName = new NamedBlock("igneousStoneBrick"); - public static final NamedBlock metamorphicStoneName = new NamedBlock("metamorphicStone"); - public static final NamedBlock metamorphicCobblestoneName = new NamedBlock("metamorphicCobblestone"); - public static final NamedBlock metamorphicStoneBrickName = new NamedBlock("metamorphicStoneBrick"); - public static final NamedBlock sedimentaryStoneName = new NamedBlock("sedimentaryStone"); - - public static final NamedItem ligniteCoalName = new NamedItem("ligniteCoal"); - public static final NamedItem fossilPieceName = new NamedItem("fossilPiece"); - - public static final NamedSlabPair igneousBrickSlabName = new NamedSlabPair(igneousStoneBrickName); - public static final NamedSlabPair metamorphicBrickSlabName = new NamedSlabPair(metamorphicStoneBrickName); - public static final NamedSlabPair igneousStoneSlabName = new NamedSlabPair(igneousStoneName); - public static final NamedSlabPair metamorphicStoneSlabName = new NamedSlabPair(metamorphicStoneName); - public static final NamedSlabPair igneousCobblestoneSlabName = new NamedSlabPair(igneousCobblestoneName); - public static final NamedSlabPair metamorphicCobblestoneSlabName = new NamedSlabPair(metamorphicCobblestoneName); - public static final NamedSlabPair sedimentaryStoneSlabName = new NamedSlabPair(sedimentaryStoneName); - - public static final NamedBlock UBButtonName = new NamedBlock("button"); - public static final NamedBlock UBStairsName = new NamedBlock("stairs"); - public static final NamedBlock UBWallsName = new NamedBlock("wall"); - public static final NamedItem UBButtonItemName = new NamedItem(UBButtonName); - public static final NamedItem UBStairsItemName = new NamedItem(UBStairsName); - public static final NamedItem UBWallsItemName = new NamedItem(UBWallsName); - public static final NamedBlock IconTrap = new NamedBlock("iconTrap"); - - public static final String ubPrefix() { - return "UndergroundBiomes:"; - } - - public static final String ubIconPrefix() { - return "undergroundbiomes:"; - } - - public static String publicName(String inModName) { - if (inModName.contains(ubPrefix())) return inModName; - return ubPrefix() + inModName; - } - - public static String iconName(String inModName) { - if (inModName.contains(ubIconPrefix())) return inModName; - return ubIconPrefix() + inModName; - } - - public static Item itemNamed(String name) { - return (Item) Item.itemRegistry.getObject(name); - } - - public static Block blockNamed(String name) { - return Block.getBlockFromName(name); - } - - public static int itemID(String name) { - return Item.getIdFromItem(itemNamed(name)); - } - - public static int blockID(String name) { - return Block.getIdFromBlock(Block.getBlockFromName(name)); - } - - public static NamedBlock slabVersionID(NamedBlock ubStone) { - if (ubStone == igneousStoneName) return igneousStoneSlabName.half; - if (ubStone == igneousCobblestoneName) return igneousCobblestoneSlabName.half; - if (ubStone == igneousStoneBrickName) return igneousBrickSlabName.half; - if (ubStone == metamorphicStoneName) return metamorphicStoneSlabName.half; - if (ubStone == metamorphicCobblestoneName) return metamorphicCobblestoneSlabName.half; - if (ubStone == metamorphicStoneBrickName) return metamorphicBrickSlabName.half; - if (ubStone == sedimentaryStoneName) return sedimentaryStoneSlabName.half; - if (ubStone == NamedVanillaBlock.sandstone) return NamedVanillaBlock.stoneSingleSlab; - if (ubStone == NamedVanillaBlock.stone) return NamedVanillaBlock.stoneSingleSlab; - if (ubStone == NamedVanillaBlock.cobblestone) return NamedVanillaBlock.stoneSingleSlab; - if (ubStone == NamedVanillaBlock.sand) return NamedVanillaBlock.stoneSingleSlab; - throw new RuntimeException("" + ubStone + " is not not usable as an Underground Biomes stone code"); - } - - public static NamedBlock brickVersionID(NamedBlock ubStone) { - if (ubStone == igneousStoneName) return igneousStoneBrickName; - if (ubStone == igneousCobblestoneName) return igneousStoneBrickName; - if (ubStone == igneousStoneBrickName) return igneousStoneBrickName; - if (ubStone == metamorphicStoneName) return metamorphicStoneBrickName; - if (ubStone == metamorphicCobblestoneName) return metamorphicStoneBrickName; - if (ubStone == metamorphicStoneBrickName) return metamorphicStoneBrickName; - if (ubStone == sedimentaryStoneName) return sedimentaryStoneName; - if (ubStone == NamedVanillaBlock.sandstone) return NamedVanillaBlock.smoothSandstone; - if (ubStone == NamedVanillaBlock.stone) return NamedVanillaBlock.stoneBrick; - if (ubStone == NamedVanillaBlock.cobblestone) return NamedVanillaBlock.stoneBrick; - if (ubStone == NamedVanillaBlock.sand) return NamedVanillaBlock.sandstone; - throw new RuntimeException("" + ubStone + " is not usable as an Underground Biomes stone code"); - } -} diff --git a/src/api/java/exterminatorJeff/undergroundBiomes/api/UBOreTexturizer.java b/src/api/java/exterminatorJeff/undergroundBiomes/api/UBOreTexturizer.java deleted file mode 100644 index c39b65d..0000000 --- a/src/api/java/exterminatorJeff/undergroundBiomes/api/UBOreTexturizer.java +++ /dev/null @@ -1,70 +0,0 @@ -package exterminatorJeff.undergroundBiomes.api; - -import net.minecraft.block.Block; -import net.minecraft.world.World; - -import cpw.mods.fml.common.event.FMLPreInitializationEvent; - -public abstract interface UBOreTexturizer { - - public static final String amber_overlay = "undergroundbiomes:amber_overlay"; - public static final String cinnabar_overlay = "undergroundbiomes:cinnabar_overlay"; - public static final String coal_overlay = "undergroundbiomes:coal_overlay"; - public static final String copper_overlay = "undergroundbiomes:copper_overlay"; - public static final String diamond_overlay = "undergroundbiomes:diamond_overlay"; - public static final String emerald_overlay = "undergroundbiomes:emerald_overlay"; - public static final String gold_overlay = "undergroundbiomes:gold_overlay"; - public static final String iron_overlay = "undergroundbiomes:iron_overlay"; - public static final String lapis_overlay = "undergroundbiomes:lapis_overlay"; - public static final String lead_overlay = "undergroundbiomes:lead_overlay"; - public static final String olivine_peridot_overlay = "undergroundbiomes:olivine-peridot_overlay"; - public static final String redstone_overlay = "undergroundbiomes:redstone_overlay"; - public static final String ruby_overlay = "undergroundbiomes:ruby_overlay"; - public static final String sapphire_overlay = "undergroundbiomes:sapphire_overlay"; - public static final String tin_overlay = "undergroundbiomes:tin_overlay"; - public static final String uranium_overlay = "undergroundbiomes:uranium_overlay"; - - public abstract void setupUBOre(Block paramBlock, String paramString, - FMLPreInitializationEvent paramFMLPreInitializationEvent); - - @Deprecated - public abstract void setupUBOre(Block paramBlock, int paramInt, String paramString, - FMLPreInitializationEvent paramFMLPreInitializationEvent); - - public abstract void setupUBOre(Block paramBlock, int paramInt, String paramString1, String paramString2, - FMLPreInitializationEvent paramFMLPreInitializationEvent); - - public abstract void requestUBOreSetup(Block paramBlock, String paramString) - throws UBOreTexturizer.BlocksAreAlreadySet; - - @Deprecated - public abstract void requestUBOreSetup(Block paramBlock, int paramInt, String paramString) - throws UBOreTexturizer.BlocksAreAlreadySet; - - public abstract void requestUBOreSetup(Block paramBlock, int paramInt, String paramString1, String paramString2) - throws UBOreTexturizer.BlocksAreAlreadySet; - - public abstract void redoOres(int paramInt1, int paramInt2, World paramWorld); - - public static class BlocksAreAlreadySet extends RuntimeException { - - public final Block oreBlock; - public final String overlayName; - - public BlocksAreAlreadySet(Block oreBlock, String overlayName) { - this.oreBlock = oreBlock; - this.overlayName = overlayName; - } - - public String toString() { - String blockDescription = "undefined block"; - String overlayDescription = "undefined overlay"; - if (this.oreBlock != null) blockDescription = this.oreBlock.getUnlocalizedName(); - if (this.overlayName != null) overlayDescription = this.overlayName; - return "Attempt to create Underground Biomes ore for " + blockDescription - + " with " - + overlayDescription - + " after blocks have already been defined"; - } - } -} diff --git a/src/api/java/exterminatorJeff/undergroundBiomes/api/UBSetProviderRegistry.java b/src/api/java/exterminatorJeff/undergroundBiomes/api/UBSetProviderRegistry.java deleted file mode 100644 index 96cd88a..0000000 --- a/src/api/java/exterminatorJeff/undergroundBiomes/api/UBSetProviderRegistry.java +++ /dev/null @@ -1,6 +0,0 @@ -package exterminatorJeff.undergroundBiomes.api; - -public abstract interface UBSetProviderRegistry { - - public abstract void register(UndergroundBiomeSetProvider paramUndergroundBiomeSetProvider); -} diff --git a/src/api/java/exterminatorJeff/undergroundBiomes/api/UBStoneCodes.java b/src/api/java/exterminatorJeff/undergroundBiomes/api/UBStoneCodes.java deleted file mode 100644 index 1a8e68a..0000000 --- a/src/api/java/exterminatorJeff/undergroundBiomes/api/UBStoneCodes.java +++ /dev/null @@ -1,92 +0,0 @@ -package exterminatorJeff.undergroundBiomes.api; - -public class UBStoneCodes extends BlockCodes { - - public UBStoneCodes(NamedBlock name, int _metadata) { - super(name, _metadata, cobbleVersion(name, _metadata)); - } - - public final UBStoneCodes slabVersionEquivalent() { - return new UBStoneCodes(UBIDs.slabVersionID(this.name), this.metadata); - } - - public final UBStoneCodes brickVersionEquivalent() { - return new UBStoneCodes(UBIDs.brickVersionID(this.name), this.metadata); - } - - public static BlockCodes cobbleVersion(NamedBlock name, int metadata) { - if (name == UBIDs.igneousStoneName) { - return new BlockCodes(UBIDs.igneousCobblestoneName, metadata); - } - if (name == UBIDs.metamorphicStoneName) { - return new BlockCodes(UBIDs.metamorphicCobblestoneName, metadata); - } - if (name == UBIDs.sedimentaryStoneName) { - return new BlockCodes(UBIDs.sedimentaryStoneName, metadata); - } - - if ((name == NamedVanillaBlock.stone) && (metadata == 0)) { - return new BlockCodes(NamedVanillaBlock.cobblestone, metadata); - } - - if ((name == NamedVanillaBlock.sandstone) && (metadata == 0)) { - return new BlockCodes(NamedVanillaBlock.sandstone, metadata); - } - - if ((name == NamedVanillaBlock.sand) && (metadata == 0)) { - return new BlockCodes(NamedVanillaBlock.sandstone, metadata); - } - - if (name == UBIDs.igneousCobblestoneName) { - return new BlockCodes(UBIDs.igneousCobblestoneName, metadata); - } - if (name == UBIDs.metamorphicCobblestoneName) { - return new BlockCodes(UBIDs.metamorphicCobblestoneName, metadata); - } - - if (name == UBIDs.igneousStoneBrickName) { - return new BlockCodes(UBIDs.igneousStoneBrickName, metadata); - } - if (name == UBIDs.metamorphicStoneBrickName) { - return new BlockCodes(UBIDs.metamorphicStoneBrickName, metadata); - } - - if (name == UBIDs.igneousStoneSlabName.half) { - return new BlockCodes(UBIDs.igneousCobblestoneSlabName.half, metadata); - } - if (name == UBIDs.metamorphicStoneSlabName.half) { - return new BlockCodes(UBIDs.metamorphicCobblestoneSlabName.half, metadata); - } - if (name == UBIDs.sedimentaryStoneSlabName.half) { - return new BlockCodes(UBIDs.sedimentaryStoneSlabName.half, metadata); - } - - if (name == UBIDs.igneousCobblestoneSlabName.half) { - return new BlockCodes(UBIDs.igneousCobblestoneSlabName.half, metadata); - } - if (name == UBIDs.metamorphicCobblestoneSlabName.half) { - return new BlockCodes(UBIDs.metamorphicCobblestoneSlabName.half, metadata); - } - - if (name == UBIDs.igneousBrickSlabName.half) { - return new BlockCodes(UBIDs.igneousBrickSlabName.half, metadata); - } - if (name == UBIDs.metamorphicBrickSlabName.half) { - return new BlockCodes(UBIDs.metamorphicBrickSlabName.half, metadata); - } - - if (name == NamedVanillaBlock.stoneBrick) { - return new BlockCodes(NamedVanillaBlock.stoneBrick, metadata); - } - - if (name == NamedVanillaBlock.stoneSingleSlab) { - return new BlockCodes(NamedVanillaBlock.stoneSingleSlab, metadata); - } - - return new BlockCodes(NamedVanillaBlock.cobblestone, metadata); - } - - public final BlockCodes cobblestoneEquivalent() { - return this.onDrop; - } -} diff --git a/src/api/java/exterminatorJeff/undergroundBiomes/api/UBStrataColumn.java b/src/api/java/exterminatorJeff/undergroundBiomes/api/UBStrataColumn.java deleted file mode 100644 index fa4706a..0000000 --- a/src/api/java/exterminatorJeff/undergroundBiomes/api/UBStrataColumn.java +++ /dev/null @@ -1,12 +0,0 @@ -package exterminatorJeff.undergroundBiomes.api; - -public abstract interface UBStrataColumn { - - public abstract BlockCodes stone(int paramInt); - - public abstract BlockCodes cobblestone(int paramInt); - - public abstract BlockCodes stone(); - - public abstract BlockCodes cobblestone(); -} diff --git a/src/api/java/exterminatorJeff/undergroundBiomes/api/UBStrataColumnProvider.java b/src/api/java/exterminatorJeff/undergroundBiomes/api/UBStrataColumnProvider.java deleted file mode 100644 index c816437..0000000 --- a/src/api/java/exterminatorJeff/undergroundBiomes/api/UBStrataColumnProvider.java +++ /dev/null @@ -1,12 +0,0 @@ -package exterminatorJeff.undergroundBiomes.api; - -import net.minecraft.world.chunk.IChunkProvider; - -public abstract interface UBStrataColumnProvider { - - public abstract UBStrataColumn strataColumn(int paramInt1, int paramInt2); - - public abstract IChunkProvider UBChunkProvider(IChunkProvider paramIChunkProvider); - - public abstract boolean inChunkGenerationAllowed(); -} diff --git a/src/api/java/exterminatorJeff/undergroundBiomes/api/UndergroundBiomeSet.java b/src/api/java/exterminatorJeff/undergroundBiomes/api/UndergroundBiomeSet.java deleted file mode 100644 index bc4aaea..0000000 --- a/src/api/java/exterminatorJeff/undergroundBiomes/api/UndergroundBiomeSet.java +++ /dev/null @@ -1,13 +0,0 @@ -package exterminatorJeff.undergroundBiomes.api; - -public abstract class UndergroundBiomeSet { - - public final StrataLayer[][] strataLayers; - public final BiomeGenUndergroundBase[] biomeList = new BiomeGenUndergroundBase[256]; - - public UndergroundBiomeSet(StrataLayer[][] strataLayers) { - this.strataLayers = strataLayers; - } - - public abstract BiomeGenUndergroundBase[] allowedBiomes(); -} diff --git a/src/api/java/exterminatorJeff/undergroundBiomes/api/UndergroundBiomeSetProvider.java b/src/api/java/exterminatorJeff/undergroundBiomes/api/UndergroundBiomeSetProvider.java deleted file mode 100644 index 1bef0dc..0000000 --- a/src/api/java/exterminatorJeff/undergroundBiomes/api/UndergroundBiomeSetProvider.java +++ /dev/null @@ -1,7 +0,0 @@ -package exterminatorJeff.undergroundBiomes.api; - -public abstract interface UndergroundBiomeSetProvider { - - public abstract UndergroundBiomeSet modifiedBiomeSet(int paramInt, long paramLong, - UndergroundBiomeSet paramUndergroundBiomeSet); -} diff --git a/src/api/java/mcp/mobius/waila/api/IWailaBlock.java b/src/api/java/mcp/mobius/waila/api/IWailaBlock.java deleted file mode 100644 index 4bbc04e..0000000 --- a/src/api/java/mcp/mobius/waila/api/IWailaBlock.java +++ /dev/null @@ -1,44 +0,0 @@ -package mcp.mobius.waila.api; - -import java.util.List; - -import net.minecraft.item.ItemStack; - -@Deprecated -public interface IWailaBlock { - - /* - * Use this method to return an item stack in case the default lookup system fails. - * Return null if you want to use the default lookup system. - * You get the world, the player and the location of the block. With that, it is easy to gather information & tile - * entities - */ - ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config); - - /* - * Waila HUD is divided into 3 zones. The head corresponds to the item name, - * body to where you mostly want to put informations, and I reserve the tail for modname display - */ - - /* - * Those 2 methods works exactly the same way, except they are related to a different zone in Waila HUD. - * You get in input world, player and the block location. You also get the itemstack as returned by the default - * lookup system or getWailaStack(). - * ConfigHandler provides the current Waila config state so you can show/hide elements depending on the - * configuration. Refer the ConfigHandler class for more info. - * currenttip represents the current list of text lines in the tooltip zone. - * For example, getWailaHead() will have the current item name as currenttip. - * You can modify the tips, add more, remove some, etc. - * When you are done, just returns the currenttip and it will display in Waila. - * Always return the currenttip is you don't want to modify the current zone. - */ - - List getWailaHead(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, - IWailaConfigHandler config); - - List getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, - IWailaConfigHandler config); - - List getWailaTail(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, - IWailaConfigHandler config); -} diff --git a/src/api/java/mcp/mobius/waila/api/IWailaBlockDecorator.java b/src/api/java/mcp/mobius/waila/api/IWailaBlockDecorator.java deleted file mode 100644 index ee16f59..0000000 --- a/src/api/java/mcp/mobius/waila/api/IWailaBlockDecorator.java +++ /dev/null @@ -1,9 +0,0 @@ -package mcp.mobius.waila.api; - -import net.minecraft.item.ItemStack; - -public interface IWailaBlockDecorator { - - void decorateBlock(ItemStack itemStack, IWailaDataAccessor accessor, IWailaConfigHandler config); - -} diff --git a/src/api/java/mcp/mobius/waila/api/IWailaConfigHandler.java b/src/api/java/mcp/mobius/waila/api/IWailaConfigHandler.java deleted file mode 100644 index aee09e2..0000000 --- a/src/api/java/mcp/mobius/waila/api/IWailaConfigHandler.java +++ /dev/null @@ -1,29 +0,0 @@ -package mcp.mobius.waila.api; - -import java.util.HashMap; -import java.util.Set; - -public interface IWailaConfigHandler { - - /* Returns a set of all the currently loaded modules in the config handler */ - public Set getModuleNames(); - - /* Returns all the currently available options for a given module */ - public HashMap getConfigKeys(String modName); - - /* - * Add a new option to a given module - * modName is the name of the module to add the option to (ie : Buildcraft, IndustrialCraft2, etc) - * key is the config key (ie : bc.tankcontent, ic2.inputvalue) - * name is the human readable name of the option (ie : "Tank content", "Max EU Input") - */ - // public void addConfig(String modName, String key, String name); - - /* Returns the current value of an option (true/false) with a default value defvalue if not set */ - public boolean getConfig(String key, boolean defvalue); - - /* Returns the current value of an option (true/false) with a default value true if not set */ - public boolean getConfig(String key); - - // public void setConfig(String key, boolean value); -} diff --git a/src/api/java/mcp/mobius/waila/api/IWailaDataAccessor.java b/src/api/java/mcp/mobius/waila/api/IWailaDataAccessor.java deleted file mode 100644 index 53fb1f5..0000000 --- a/src/api/java/mcp/mobius/waila/api/IWailaDataAccessor.java +++ /dev/null @@ -1,46 +0,0 @@ -package mcp.mobius.waila.api; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; - -/* - * The Accessor is used to get some basic data out of the game without having to request - * direct access to the game engine. - * It will also return things that are unmodified by the overriding systems (like getWailaStack). - */ - -public interface IWailaDataAccessor { - - World getWorld(); - - EntityPlayer getPlayer(); - - Block getBlock(); - - int getBlockID(); - - int getMetadata(); - - TileEntity getTileEntity(); - - MovingObjectPosition getPosition(); - - Vec3 getRenderingPosition(); - - NBTTagCompound getNBTData(); - - int getNBTInteger(NBTTagCompound tag, String keyname); - - double getPartialFrame(); - - ForgeDirection getSide(); - - ItemStack getStack(); -} diff --git a/src/api/java/mcp/mobius/waila/api/IWailaDataProvider.java b/src/api/java/mcp/mobius/waila/api/IWailaDataProvider.java deleted file mode 100644 index f3cb3c5..0000000 --- a/src/api/java/mcp/mobius/waila/api/IWailaDataProvider.java +++ /dev/null @@ -1,43 +0,0 @@ -package mcp.mobius.waila.api; - -import java.util.List; - -import net.minecraft.item.ItemStack; - -public interface IWailaDataProvider { - - /* - * Use this method to return an item stack in case the default lookup system fails. - * Return null if you want to use the default lookup system. - * You get the world, the player and the location of the block. With that, it is easy to gather information & tile - * entities - */ - ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config); - - /* - * Waila HUD is divided into 3 zones. The head corresponds to the item name, - * body to where you mostly want to put informations, and I reserve the tail for modname display - */ - - /* - * Those 2 methods works exactly the same way, except they are related to a different zone in Waila HUD. - * You get in input world, player and the block location. You also get the itemstack as returned by the default - * lookup system or getWailaStack(). - * ConfigHandler provides the current Waila config state so you can show/hide elements depending on the - * configuration. Refer the ConfigHandler class for more info. - * currenttip represents the current list of text lines in the tooltip zone. - * For example, getWailaHead() will have the current item name as currenttip. - * You can modify the tips, add more, remove some, etc. - * When you are done, just returns the currenttip and it will display in Waila. - * Always return the currenttip is you don't want to modify the current zone. - */ - - List getWailaHead(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, - IWailaConfigHandler config); - - List getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, - IWailaConfigHandler config); - - List getWailaTail(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, - IWailaConfigHandler config); -} diff --git a/src/api/java/mcp/mobius/waila/api/IWailaEntityAccessor.java b/src/api/java/mcp/mobius/waila/api/IWailaEntityAccessor.java deleted file mode 100644 index bee89bb..0000000 --- a/src/api/java/mcp/mobius/waila/api/IWailaEntityAccessor.java +++ /dev/null @@ -1,33 +0,0 @@ -package mcp.mobius.waila.api; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; - -/* - * The Accessor is used to get some basic data out of the game without having to request - * direct access to the game engine. - * It will also return things that are unmodified by the overriding systems (like getWailaStack). - */ - -public interface IWailaEntityAccessor { - - World getWorld(); - - EntityPlayer getPlayer(); - - Entity getEntity(); - - MovingObjectPosition getPosition(); - - Vec3 getRenderingPosition(); - - NBTTagCompound getNBTData(); - - int getNBTInteger(NBTTagCompound tag, String keyname); - - double getPartialFrame(); -} diff --git a/src/api/java/mcp/mobius/waila/api/IWailaEntityProvider.java b/src/api/java/mcp/mobius/waila/api/IWailaEntityProvider.java deleted file mode 100644 index 44867b6..0000000 --- a/src/api/java/mcp/mobius/waila/api/IWailaEntityProvider.java +++ /dev/null @@ -1,21 +0,0 @@ -package mcp.mobius.waila.api; - -import java.util.List; - -import net.minecraft.entity.Entity; - -public interface IWailaEntityProvider { - - /* A way to get an override on the entity returned by the raytracing */ - Entity getWailaOverride(IWailaEntityAccessor accessor, IWailaConfigHandler config); - - /* The classical HEAD/BODY/TAIL text getters */ - List getWailaHead(Entity entity, List currenttip, IWailaEntityAccessor accessor, - IWailaConfigHandler config); - - List getWailaBody(Entity entity, List currenttip, IWailaEntityAccessor accessor, - IWailaConfigHandler config); - - List getWailaTail(Entity entity, List currenttip, IWailaEntityAccessor accessor, - IWailaConfigHandler config); -} diff --git a/src/api/java/mcp/mobius/waila/api/IWailaFMPAccessor.java b/src/api/java/mcp/mobius/waila/api/IWailaFMPAccessor.java deleted file mode 100644 index c127da6..0000000 --- a/src/api/java/mcp/mobius/waila/api/IWailaFMPAccessor.java +++ /dev/null @@ -1,37 +0,0 @@ -package mcp.mobius.waila.api; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; - -/* - * The Accessor is used to get some basic data out of the game without having to request - * direct access to the game engine. - * It will also return things that are unmodified by the overriding systems (like getWailaStack). - */ - -public interface IWailaFMPAccessor { - - World getWorld(); - - EntityPlayer getPlayer(); - - TileEntity getTileEntity(); - - MovingObjectPosition getPosition(); - - NBTTagCompound getNBTData(); - - NBTTagCompound getFullNBTData(); - - int getNBTInteger(NBTTagCompound tag, String keyname); - - double getPartialFrame(); - - Vec3 getRenderingPosition(); - - String getID(); -} diff --git a/src/api/java/mcp/mobius/waila/api/IWailaFMPDecorator.java b/src/api/java/mcp/mobius/waila/api/IWailaFMPDecorator.java deleted file mode 100644 index fe089e5..0000000 --- a/src/api/java/mcp/mobius/waila/api/IWailaFMPDecorator.java +++ /dev/null @@ -1,8 +0,0 @@ -package mcp.mobius.waila.api; - -import net.minecraft.item.ItemStack; - -public interface IWailaFMPDecorator { - - void decorateBlock(ItemStack itemStack, IWailaFMPAccessor accessor, IWailaConfigHandler config); -} diff --git a/src/api/java/mcp/mobius/waila/api/IWailaFMPProvider.java b/src/api/java/mcp/mobius/waila/api/IWailaFMPProvider.java deleted file mode 100644 index 94b0f27..0000000 --- a/src/api/java/mcp/mobius/waila/api/IWailaFMPProvider.java +++ /dev/null @@ -1,18 +0,0 @@ -package mcp.mobius.waila.api; - -import java.util.List; - -import net.minecraft.item.ItemStack; - -public interface IWailaFMPProvider { - - /* The classical HEAD/BODY/TAIL text getters */ - List getWailaHead(ItemStack itemStack, List currenttip, IWailaFMPAccessor accessor, - IWailaConfigHandler config); - - List getWailaBody(ItemStack itemStack, List currenttip, IWailaFMPAccessor accessor, - IWailaConfigHandler config); - - List getWailaTail(ItemStack itemStack, List currenttip, IWailaFMPAccessor accessor, - IWailaConfigHandler config); -} diff --git a/src/api/java/mcp/mobius/waila/api/IWailaRegistrar.java b/src/api/java/mcp/mobius/waila/api/IWailaRegistrar.java deleted file mode 100644 index 5824746..0000000 --- a/src/api/java/mcp/mobius/waila/api/IWailaRegistrar.java +++ /dev/null @@ -1,58 +0,0 @@ -package mcp.mobius.waila.api; - -public interface IWailaRegistrar { - - /* Add a config option in the section modname with displayed text configtext and access key keyname */ - public void addConfig(String modname, String keyname, String configtext); - - public void addConfigRemote(String modname, String keyname, String configtext); - - public void addConfig(String modname, String keyname); - - public void addConfigRemote(String modname, String keyname); - - /* Register a stack overrider for the given blockID */ - public void registerStackProvider(IWailaDataProvider dataProvider, Class block); - - /* Same thing, but works on a class hierarchy instead */ - public void registerHeadProvider(IWailaDataProvider dataProvider, Class block); - - public void registerBodyProvider(IWailaDataProvider dataProvider, Class block); - - public void registerTailProvider(IWailaDataProvider dataProvider, Class block); - - /* Entity text registration methods */ - public void registerHeadProvider(IWailaEntityProvider dataProvider, Class entity); - - public void registerBodyProvider(IWailaEntityProvider dataProvider, Class entity); - - public void registerTailProvider(IWailaEntityProvider dataProvider, Class entity); - - public void registerOverrideEntityProvider(IWailaEntityProvider dataProvider, Class entity); - - /* FMP Providers */ - public void registerHeadProvider(IWailaFMPProvider dataProvider, String name); - - public void registerBodyProvider(IWailaFMPProvider dataProvider, String name); - - public void registerTailProvider(IWailaFMPProvider dataProvider, String name); - - /* The block decorators */ - public void registerDecorator(IWailaBlockDecorator decorator, Class block); - - public void registerDecorator(IWailaFMPDecorator decorator, String name); - - /* - * Selective NBT key syncing. Will register a key to sync over the network for the given class (block, te or ent). - * Accept * as a ending wildcard - * registerNBTKey("bob.*", MyBlock.class) - * registerNBTKey("data.life", MyEntity.class) - * registerNBTKey("*", MyTileEntity.class) will reproduce the full tag syncing from 1.4.5 - */ - public void registerSyncedNBTKey(String key, Class target); - - /* UNUSED FOR NOW (Will be used for the ingame wiki */ - public void registerDocTextFile(String filename); - - public void registerShortDataProvider(IWailaSummaryProvider dataProvider, Class item); -} diff --git a/src/api/java/mcp/mobius/waila/api/IWailaSummaryProvider.java b/src/api/java/mcp/mobius/waila/api/IWailaSummaryProvider.java deleted file mode 100644 index 7fcaba3..0000000 --- a/src/api/java/mcp/mobius/waila/api/IWailaSummaryProvider.java +++ /dev/null @@ -1,22 +0,0 @@ -package mcp.mobius.waila.api; - -import java.util.LinkedHashMap; - -import net.minecraft.item.ItemStack; - -public interface IWailaSummaryProvider { - /* This interface is used to control the display data in the description screen */ - - /* BASIC TOOLS & ITEMS DATA */ - // EnumToolMaterial getMaterial(ItemStack stack); - // String getMaterialName(ItemStack stack); - // String getEffectiveBlock(ItemStack stack); - // int getHarvestLevel(ItemStack stack); - // float getEfficiencyOnProperMaterial(ItemStack stack); - // int getEnchantability(ItemStack stack); - // int getDamageVsEntity(ItemStack stack); - // int getDurability(ItemStack stack); - - LinkedHashMap getSummary(ItemStack stack, LinkedHashMap currentSummary, - IWailaConfigHandler config); -} diff --git a/src/api/java/mcp/mobius/waila/api/SpecialChars.java b/src/api/java/mcp/mobius/waila/api/SpecialChars.java deleted file mode 100644 index 4c7b0a1..0000000 --- a/src/api/java/mcp/mobius/waila/api/SpecialChars.java +++ /dev/null @@ -1,40 +0,0 @@ -package mcp.mobius.waila.api; - -public class SpecialChars { - - public static String MCStyle = "\u00A7"; - - public static String BLACK = MCStyle + "0"; - public static String DBLUE = MCStyle + "1"; - public static String DGREEN = MCStyle + "2"; - public static String DAQUA = MCStyle + "3"; - public static String DRED = MCStyle + "4"; - public static String DPURPLE = MCStyle + "5"; - public static String GOLD = MCStyle + "6"; - public static String GRAY = MCStyle + "7"; - public static String DGRAY = MCStyle + "8"; - public static String BLUE = MCStyle + "9"; - public static String GREEN = MCStyle + "a"; - public static String AQUA = MCStyle + "b"; - public static String RED = MCStyle + "c"; - public static String LPURPLE = MCStyle + "d"; - public static String YELLOW = MCStyle + "e"; - public static String WHITE = MCStyle + "f"; - - public static String OBF = MCStyle + "k"; - public static String BOLD = MCStyle + "l"; - public static String STRIKE = MCStyle + "m"; - public static String UNDER = MCStyle + "n"; - public static String ITALIC = MCStyle + "o"; - public static String RESET = MCStyle + "r"; - - public static String WailaStyle = "\u00A4"; - public static String WailaIcon = "\u00A5"; - public static String TAB = WailaStyle + WailaStyle + "a"; - public static String ALIGNRIGHT = WailaStyle + WailaStyle + "b"; - public static String ALIGNCENTER = WailaStyle + WailaStyle + "c"; - public static String HEART = WailaStyle + WailaIcon + "a"; - public static String HHEART = WailaStyle + WailaIcon + "b"; - public static String EHEART = WailaStyle + WailaIcon + "c"; - -} diff --git a/src/api/java/mcp/mobius/waila/api/package-info.java b/src/api/java/mcp/mobius/waila/api/package-info.java deleted file mode 100644 index 340c070..0000000 --- a/src/api/java/mcp/mobius/waila/api/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -@API(apiVersion = "1.0", owner = "Waila", provides = "WailaAPI") -package mcp.mobius.waila.api; - -import cpw.mods.fml.common.API; diff --git a/src/api/java/morph/api/Ability.java b/src/api/java/morph/api/Ability.java deleted file mode 100644 index 4c0e6f8..0000000 --- a/src/api/java/morph/api/Ability.java +++ /dev/null @@ -1,229 +0,0 @@ -package morph.api; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * - * Abstract ability class. - * Think of it like the Entity class, extend it to make your own types. - * Some abilities may seem more like traits, but let's just call it an ability for simplicity's sake. - * Please take note that entities inherit their superclass' abilities. - * - * @author iChun - * - */ -public abstract class Ability { - - /** - * Ability parent field. Will be null for instances used in registration. Ability is then cloned and parent assigned - * later on. - */ - private EntityLivingBase parent; - - /** - * Flag for Ability activity. If true, tick/postRender/kill will notbe called. - */ - public boolean inactive; - - /** - * Basic constructor (but you didn't really need me to tell you that ;D ) - */ - public Ability() { - parent = null; - } - - /** - * Function for mod mob support, with args. - */ - public Ability parse(String[] args) { - return this; - } - - /** - * Since parent is private it needs a setter. - * - * @param newParent - */ - public void setParent(EntityLivingBase ent) { - parent = ent; - } - - /** - * Get's the parent entity for this ability - * - * @return Entity the ability takes effect on - */ - public EntityLivingBase getParent() { - return parent; - } - - /** - * Each ability has to return a String type. - * This is used for comparison, saving, as well as construction/loading of Ability. - * Think of it like the way Minecraft registers entities. - * - * @return Ability type - */ - public abstract String getType(); - - /** - * Ticks every world tick, basically an ability onUpdate, similar to Entity's onUpdate. - * Will only tick if getParent() is not null. - * Please remember that getParent is not necessarily a player. - */ - public abstract void tick(); - - /** - * Called when the ability is finally removed when the parent demorphs or morphs into a state that does not have - * this ability type. - * This will NOT be called if the parent morphs into another morph that has this type of ability. - */ - public abstract void kill(); - - /** - * Creates a copy of this ability for use with parents. - * As previously stated before the ability instance used during registration is a base so it needs to be cloned for - * use with parents. - */ - public abstract Ability clone(); - - /** - * Return true for this if you need an inactive copy of this morph in-between morph states (abilities of the next - * morph are only swapped over when morph is complete) - * Currently used for AbilitySwim to adjust the fog render. - * - * @return requiresInactiveClone - */ - public boolean requiresInactiveClone() { - return false; - } - - /** - * Saving of ability to NBTTagCompound. - * Mainly used for synching Abilities between the client-server for mod mobs which do not use the API to add - * abilities. - * The ability type (getType()) is appended to nbt before function is called. - * Not actually used. - * - * @param NBTTagCompound saveData - */ - public abstract void save(NBTTagCompound tag); - - /** - * Loading of ability from NBTTagCompound. - * Mainly used to load custom fields from NBT. - * Not actually used. - * - * @param NBTTagCompound saveData - */ - public abstract void load(NBTTagCompound tag); - - /** - * Rendering to be done post-render. - * EG: Used by AbilitySwim to render air bubbles whilst on land. - */ - @SideOnly(Side.CLIENT) - public abstract void postRender(); - - /** - * Icon location for ability. Can be null. - * Mod's default icons are 32x32. Can be any resolution though. - * - * @return resourcelocation for icon - */ - @SideOnly(Side.CLIENT) - public abstract ResourceLocation getIcon(); - - @SideOnly(Side.CLIENT) - public boolean entityHasAbility(EntityLivingBase living) { - return true; - } - - /** - * Registers the ability so the mod can look up the class when attempting to load Ability save data. - * Call this no later than PostInit. - * - * @param ability type - * @param AbilityClass - */ - public static void registerAbility(String name, Class clz) { - try { - Class.forName("morph.common.ability.AbilityHandler") - .getDeclaredMethod("registerAbility", String.class, Class.class) - .invoke(null, name, clz); - } catch (Exception e) {} - } - - /** - * Maps abilities to an Entity. - * Adds on to the previous ability list, so this allows you to add abilities to Entity classes which already have - * abilities mapped. - * However, only one ability of the same type is allowed for each entity. This method will overwrite abilities of - * the same type that were already mapped. - * This will also register new abilities which were not registered before (just in case). - * Call this no later than PostInit. - * - * @param entClass - * @param abilities - */ - public static void mapAbilities(Class entClass, Ability... abilities) { - try { - Class.forName("morph.common.ability.AbilityHandler") - .getDeclaredMethod("mapAbilities", Class.class, Ability[].class) - .invoke(null, entClass, abilities); - } catch (Exception e) {} - } - - /** - * Superman's kryptonite. - * - * @param Entity class to remove ability from - * @param Ability type - */ - public static void removeAbility(Class entClass, String type) { - try { - Class.forName("morph.common.ability.AbilityHandler") - .getDeclaredMethod("removeAbility", Class.class, String.class) - .invoke(null, entClass, type); - } catch (Exception e) {} - } - - /** - * Checks to see if the entity class has a mapped ability type. - * - * @param entClass - * @param Ability type - * @return Entity class has ability type - */ - public static boolean hasAbility(Class entClass, String type) { - try { - return (Boolean) Class.forName("morph.common.ability.AbilityHandler") - .getDeclaredMethod("hasAbility", Class.class, String.class) - .invoke(null, entClass, type); - } catch (Exception e) { - return false; - } - } - - /** - * Creates an ability by type. - * Check out AbilityHandler to see each Ability type and the parse function in their respective classes for the - * arguments. - * - * @return - */ - public static Ability createNewAbilityByType(String type, String[] arguments) { - try { - return (Ability) Class.forName("morph.common.ability.AbilityHandler") - .getDeclaredMethod("createNewAbilityByType", String.class, String[].class) - .invoke(null, type, arguments); - } catch (Exception e) { - return null; - } - } -} diff --git a/src/api/java/morph/api/Api.java b/src/api/java/morph/api/Api.java deleted file mode 100644 index 83d874b..0000000 --- a/src/api/java/morph/api/Api.java +++ /dev/null @@ -1,188 +0,0 @@ -package morph.api; - -import net.minecraft.client.entity.AbstractClientPlayer; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.util.ResourceLocation; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public final class Api { - - /** - * Returns if a player is has a morph. If morph progress < 1.0F, player is mid-morphing. - * Players demorphing are considered as a player with a morph until the demorph is complete. - * - * @param Player Username - * @param Clientside (false for Serverside) - */ - public static boolean hasMorph(String playerName, boolean isClient) { - try { - return (Boolean) Class.forName("morph.common.core.ApiHandler") - .getDeclaredMethod("hasMorph", String.class, boolean.class) - .invoke(null, playerName, isClient); - } catch (Exception e) { - return false; - } - } - - /** - * Returns morph progression of a player. Time per morph is 80 ticks. - * If player does not have a morph, 1.0F will be returned. - * - * @param Player Username - * @param Clientside (false for Serverside) - */ - public static float morphProgress(String playerName, boolean isClient) { - try { - return (Float) Class.forName("morph.common.core.ApiHandler") - .getDeclaredMethod("morphProgress", String.class, boolean.class) - .invoke(null, playerName, isClient); - } catch (Exception e) { - return 1.0F; - } - } - - /** - * Returns previous entity instance used to render the morph. - * If player does not have a previous morph state, null will be returned. - * - * @param Player Username - * @param Clientside (false for Serverside) - */ - public static EntityLivingBase getPrevMorphEntity(String playerName, boolean isClient) { - try { - return (EntityLivingBase) Class.forName("morph.common.core.ApiHandler") - .getDeclaredMethod("getPrevMorphEntity", String.class, boolean.class) - .invoke(null, playerName, isClient); - } catch (Exception e) { - return null; - } - } - - /** - * Returns entity instance used to render the morph. - * If player does not have a morph, null will be returned. - * - * @param Player Username - * @param Clientside (false for Serverside) - */ - public static EntityLivingBase getMorphEntity(String playerName, boolean isClient) { - try { - return (EntityLivingBase) Class.forName("morph.common.core.ApiHandler") - .getDeclaredMethod("getMorphEntity", String.class, boolean.class) - .invoke(null, playerName, isClient); - } catch (Exception e) { - return null; - } - } - - /** - * Blacklists an entity from being morphed into. - * Previously saved morphs of the classtype will not be removed. - * - * @param Class (extends EntityLivingBase) - */ - public static void blacklistEntity(Class clz) { - try { - Class.forName("morph.common.core.ApiHandler") - .getDeclaredMethod("blacklistEntity", Class.class) - .invoke(null, clz); - } catch (Exception e) {} - } - - /** - * Forces a player to morph into an EntityLivingBase, also adds said entity to the morph list. - * Called Serverside only. - * - * @param player - * @param living - * @return morphSuccessful - */ - public static boolean forceMorph(EntityPlayerMP player, EntityLivingBase living) { - try { - return (Boolean) Class.forName("morph.common.core.ApiHandler") - .getDeclaredMethod("forceMorph", EntityPlayerMP.class, EntityLivingBase.class) - .invoke(null, player, living); - } catch (Exception e) { - return false; - } - } - - /** - * Forces a player to demorph. - * Called Serverside only. - * - * @param player - */ - public static void forceDemorph(EntityPlayerMP player) { - try { - Class.forName("morph.common.core.ApiHandler") - .getDeclaredMethod("forceDemorph", EntityPlayerMP.class) - .invoke(null, player); - } catch (Exception e) {} - } - - /** - * Checks if the entity passed on is a Morph. - * If it is, the player name will be passed, else null. - * - * @param EntityLivingBase instance - * @param Clientside (false for Serverside) - */ - public static String isEntityAMorph(EntityLivingBase living, boolean isClient) { - try { - return (String) Class.forName("morph.common.core.ApiHandler") - .getDeclaredMethod("isEntityAMorph", EntityLivingBase.class, boolean.class) - .invoke(null, living, isClient); - } catch (Exception e) { - return null; - } - } - - /** - * Allows the rendering of the next player rendered. - * Prevents Morph from cancelling the player render event to render the morphed entity. - */ - public static void allowNextPlayerRender() { - try { - Class.forName("morph.common.core.ApiHandler") - .getDeclaredMethod("allowNextPlayerRender") - .invoke(null); - } catch (Exception e) {} - } - - /** - * Returns the black grainy morph skin that overlays the player when the player is morphing - * - * @return Morph Skin Resource Location - */ - @SideOnly(Side.CLIENT) - public static ResourceLocation getMorphSkinTexture() { - try { - return (ResourceLocation) Class.forName("morph.common.core.ApiHandler") - .getDeclaredMethod("getMorphSkinTexture") - .invoke(null); - } catch (Exception e) { - return AbstractClientPlayer.locationStevePng; - } - } - - /** - * Assign a specific arm to a model for rendering in First Person. - * - * @param model Model which arm you are registering for - * @param arm The arm in a ModelRenderer form. - */ - @SideOnly(Side.CLIENT) - public static void registerArmForModel(ModelBase model, ModelRenderer arm) { - try { - Class.forName("morph.common.core.ApiHandler") - .getDeclaredMethod("registerArmForModel", ModelBase.class, ModelRenderer.class) - .invoke(null, model, arm); - } catch (Exception e) {} - } -} diff --git a/src/api/java/powercrystals/minefactoryreloaded/api/FactoryRegistry.java b/src/api/java/powercrystals/minefactoryreloaded/api/FactoryRegistry.java deleted file mode 100644 index 42e23a6..0000000 --- a/src/api/java/powercrystals/minefactoryreloaded/api/FactoryRegistry.java +++ /dev/null @@ -1,113 +0,0 @@ -package powercrystals.minefactoryreloaded.api; - -import java.lang.reflect.Constructor; -import java.lang.reflect.Method; - -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.event.FMLInterModComms; -import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage; - -/** - * @author PowerCrystals - * - * Class used to register plants and other farming-related things with MFR. Will do nothing if MFR does not - * exist. - * - */ -public class FactoryRegistry { - - /* - * This may be called at any time during pre-init, init or post-init, assuming all blocks and items - * that are being accessed from the registry have been appropriately registered. - * Possible messages: - * // Registration: - * addLaserPreferredOre | NBTTag with an ItemStack saved on it, with the color on the "value" attribute, - * | A ValuedItem with item and value set. - * registerAutoSpawnerBlacklist | The String identifier of an entity, - * | A subclass of EntityLivingBase. - * registerFertilizable | An instance of IFactoryFertilizable. - * registerFertilizer | An instance of IFactoryFertilizer. - * registerFruitLog | The String identifier of a block. - * registerGrindable | An instance of IFactoryGrindable. - * registerGrinderBlacklist | A subclass of EntityLivingBase. - * registerHarvestable | An instance of IFactoryHarvestable. - * registerLaserOre | NBTTag with an ItemStack saved on it, with the weight on the "value" attribute, - * | A ValuedItem with item and value set. - * registerLiquidDrinkHandler | A ValuedItem with key and object set; ILiquidDrinkHandler expected. - * registerMobEggHandler | An instance of IMobEggHandler. - * registerPickableFruit | An instance of IFactoryFruit. - * registerPlantable | An instance of IFactoryPlantable. - * registerRanchable | An instance of IFactoryRanchable. - * registerRedNetLogicCircuit | An instance of IRedNetLogicCircuit. - * registerRubberTreeBiome | The biomeName field of a biome to white list for rubber trees to spawn in. - * registerSafariNetBlacklist | A subclass of EntityLivingBase. - * registerSafariNetHandler | An instance of ISafariNetHandler. - * registerSludgeDrop | NBTTag with an ItemStack saved on it, with the weight on the "value" attribute, - * | A ValuedItem with item and value set. - * registerSpawnHandler | An instance of IMobSpawnHandler. - * registerVillagerTradeMob | An instance of IRandomMobProvider. - * // Simple implementations: - * { Harvestables - * registerHarvestable_Standard | The String identifier of a block. - * registerHarvestable_Log | The String identifier of a block. - * registerHarvestable_Leaves | The String identifier of a block. - * registerHarvestable_Vine | The String identifier of a block. - * registerHarvestable_Shrub | The String identifier of a block. - * registerHarvestable_Mushroom | The String identifier of a block. - * registerHarvestable_Crop | An ItemStack of a block, with a damage value indicating the meta value to harvest at. - * | A ValuedItem with value and object set; Block expected. - * registerHarvestable_Gourd | An NBTTag with the stem and fruit attributes, both String identifiers of blocks. - * } - * { Plantables - * registerPlantable_Standard | An NBTTag with the seed (Item, String identifier), and - * crop (Block, String identifier) attributes set, optionally - * also having the meta (Integer, placed metadata value) attribute set. - * No special checks for location, just sustainability. - * registerPlantable_Crop | An NBTTag with the seed (Item, String identifier), and - * crop (Block, String identifier) attributes set, optionally - * also having the meta (Integer, placed metadata value) attribute set. - * Will automatically hoe dirt and grass into farmland when planting. - * registerPlantable_Sapling | An NBTTag with the sapling (Block, String identifier), and optionally - * the seed (Item, String identifier) attributes set. - * } - * { Fertilizer - * registerFertilizer | An NBTTag with the fert (Item, String identifier), meta (Integer), and - * type (Integer, index into FertilizerType.values()) attributes set. - * } - * { Fertilizables - * registerFertilizable_Grass | The String identifier of a block. Will bonemeal the block and expect - * tall grass be planted above and around it, must be IGrowable. Works with - * the GrowPlant and Grass type fertilizers, not recommended for crop plants. - * registerFertilizable_Gourd | The String identifier of a block. Must be IGrowable, and expects identical - * behavior to vanilla stems. Works with the GrowPlant fertilizers. - * registerFertilizable_Crop | An NBTTag with the plant (Block, String identifier, IGrowable), and - * meta (Integer, max growth phase) attributes set, optionally also having - * the type (Integer, index into FertilizerType) attribute set. - * registerFertilizable_Cocoa | An NBTTag with the plant (Block, String identifier), and optionally also - * the type (Integer, index into FertilizerType) attributes set. - * Expects metadata of the block to exactly match cocoa pods. - * registerFertilizable_Standard | An NBTTag with the plant (Block, String identifier, IGrowable), and - * optionally also the type (Integer, index into FertilizerType) attributes set. - * Expects the block to change when successfully grown (e.g., saplings). - * } - */ - public static void sendMessage(String message, Object value) { - if (!Loader.isModLoaded("MineFactoryReloaded") || Loader.instance() - .activeModContainer() == null) return; - try { - Method m = FMLInterModComms.class - .getDeclaredMethod("enqueueMessage", Object.class, String.class, IMCMessage.class); - m.setAccessible(true); - Constructor c = IMCMessage.class.getDeclaredConstructor(String.class, Object.class); - c.setAccessible(true); - m.invoke( - null, - Loader.instance() - .activeModContainer(), - "MineFactoryReloaded", - c.newInstance(message, value)); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/src/api/java/powercrystals/minefactoryreloaded/api/HarvestType.java b/src/api/java/powercrystals/minefactoryreloaded/api/HarvestType.java deleted file mode 100644 index ccd5daa..0000000 --- a/src/api/java/powercrystals/minefactoryreloaded/api/HarvestType.java +++ /dev/null @@ -1,43 +0,0 @@ -package powercrystals.minefactoryreloaded.api; - -/** - * @author PowerCrystals - * - * Determines what algorithm the Harvester uses when it encounters this IFactoryHarvestable in the world. - */ -public enum HarvestType { - /** - * Just break the single block - no special action needed. e.g. Carrots, flowers, wheat. - */ - Normal, - /** - * Search for harvestable blocks adjacent to this block but leave this block. e.g. Pumpkin, melon - */ - Gourd, - /** - * Search for identical blocks above. - */ - Column, - /** - * Search for identical blocks above but leave the bottom one for the future. e.g. Cactus, sugarcane. - */ - LeaveBottom, - /** - * This block is the base of a tree and the harvester should enter tree-cutting mode. - */ - Tree, - /** - * This block is the base of the tree and the harvester should enter tree-cutting mode. - * The tree is searched for in the negative y axis instead. - */ - TreeFlipped, - /** - * This block is part of a tree as above. - */ - TreeLeaf, - /** - * This block is part of a tree as above, but fruits are cut before logs. e.g. cocoa - * The tree is not searched for. - */ - TreeFruit -} diff --git a/src/api/java/powercrystals/minefactoryreloaded/api/IFactoryGrindable.java b/src/api/java/powercrystals/minefactoryreloaded/api/IFactoryGrindable.java deleted file mode 100644 index 6736a29..0000000 --- a/src/api/java/powercrystals/minefactoryreloaded/api/IFactoryGrindable.java +++ /dev/null @@ -1,36 +0,0 @@ -package powercrystals.minefactoryreloaded.api; - -import java.util.List; -import java.util.Random; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.world.World; - -/** - * @author PowerCrystals - * - * Defines a grindable entity for the Grinder. - */ -public interface IFactoryGrindable { - - /** - * @return The class that this grindable instance is handling. This must be a subtype of EntityLivingBase or the - * entity will never - * be noticed by the Grinder. - */ - public Class getGrindableEntity(); - - /** - * @param world The world this entity is in. - * @param entity The entity instance being ground. - * @param random A Random instance. - * @return The drops generated when this entity is killed. - */ - public List grind(World world, EntityLivingBase entity, Random random); - - /** - * @param entity The entity instance being ground. - * @return Whether this entity has been fully processed or not. - */ - public boolean processEntity(EntityLivingBase entity); -} diff --git a/src/api/java/powercrystals/minefactoryreloaded/api/IFactoryHarvestable.java b/src/api/java/powercrystals/minefactoryreloaded/api/IFactoryHarvestable.java deleted file mode 100644 index 1f39fee..0000000 --- a/src/api/java/powercrystals/minefactoryreloaded/api/IFactoryHarvestable.java +++ /dev/null @@ -1,76 +0,0 @@ -package powercrystals.minefactoryreloaded.api; - -import java.util.List; -import java.util.Map; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -/** - * @author PowerCrystals - * - * Defines a harvestable block for the Harvester. - */ -public interface IFactoryHarvestable { - - /** - * @return The block this harvestable instance is managing. - */ - public Block getPlant(); - - /** - * @return The type of harvest the Harvester should perform on this block. - */ - public HarvestType getHarvestType(); - - /** - * @return Whether or not the Harvester should break the block when harvesting. If false, no changes will be - * performed by the Harvester itself. - */ - public boolean breakBlock(); - - /** - * @param world The world this block is in. - * @param harvesterSettings The harvester's current settings. Do not modify these. - * @param x The X coordinate of the block being harvested. - * @param y The Y coordinate of the block being harvested. - * @param z The Z coordinate of the block being harvested. - * @return True if this block can be harvested. - */ - public boolean canBeHarvested(World world, Map harvesterSettings, int x, int y, int z); - - /** - * @param world The world this block is in. - * @param rand A Random instance to use when generating drops. - * @param harvesterSettings The harvester's current settings. Do not modify these. - * @param x The X coordinate of the block being harvested. - * @param y The Y coordinate of the block being harvested. - * @param z The Z coordinate of the block being harvested. - * @return The drops generated by breaking this block. For a default implementation, calling Block.getBlockDropped() - * is usually sufficient. - */ - public List getDrops(World world, Random rand, Map harvesterSettings, int x, int y, - int z); - - /** - * Called before the block is going to be harvested. Usually empty. - * - * @param world The world this block is in. - * @param x The X coordinate of the block being harvested. - * @param y The Y coordinate of the block being harvested. - * @param z The Z coordinate of the block being harvested. - */ - public void preHarvest(World world, int x, int y, int z); - - /** - * Called after the block is going to be harvested. Used to re-till soil, for example. - * - * @param world The world this block is in. - * @param x The X coordinate of the block being harvested. - * @param y The Y coordinate of the block being harvested. - * @param z The Z coordinate of the block being harvested. - */ - public void postHarvest(World world, int x, int y, int z); -} diff --git a/src/api/java/powercrystals/minefactoryreloaded/api/ILiquidDrinkHandler.java b/src/api/java/powercrystals/minefactoryreloaded/api/ILiquidDrinkHandler.java deleted file mode 100644 index 63c838a..0000000 --- a/src/api/java/powercrystals/minefactoryreloaded/api/ILiquidDrinkHandler.java +++ /dev/null @@ -1,8 +0,0 @@ -package powercrystals.minefactoryreloaded.api; - -import net.minecraft.entity.EntityLivingBase; - -public interface ILiquidDrinkHandler { - - public void onDrink(EntityLivingBase player); -} diff --git a/src/api/java/powercrystals/minefactoryreloaded/api/MobDrop.java b/src/api/java/powercrystals/minefactoryreloaded/api/MobDrop.java deleted file mode 100644 index c2d0a96..0000000 --- a/src/api/java/powercrystals/minefactoryreloaded/api/MobDrop.java +++ /dev/null @@ -1,19 +0,0 @@ -package powercrystals.minefactoryreloaded.api; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.WeightedRandom; - -public class MobDrop extends WeightedRandom.Item { - - private ItemStack _stack; - - public MobDrop(int weight, ItemStack stack) { - super(weight); - _stack = stack; - } - - public ItemStack getStack() { - if (_stack == null) return null; - return _stack.copy(); - } -} diff --git a/src/api/java/powercrystals/minefactoryreloaded/api/ValuedItem.java b/src/api/java/powercrystals/minefactoryreloaded/api/ValuedItem.java deleted file mode 100644 index 7efc7dd..0000000 --- a/src/api/java/powercrystals/minefactoryreloaded/api/ValuedItem.java +++ /dev/null @@ -1,65 +0,0 @@ -package powercrystals.minefactoryreloaded.api; - -import net.minecraft.item.ItemStack; - -public class ValuedItem { - - public final int value; - public final ItemStack item; - public final String key; - public final Object object; - - public ValuedItem(int v, ItemStack i) { - value = v; - item = i; - key = null; - object = null; - } - - public ValuedItem(String v, Object i) { - value = -1; - item = null; - key = v; - object = i; - } - - /** - * Presently unused but included so that if they do get used in the future, - * people including this in their jar and loading before MFR don't destroy everyone - */ - - public ValuedItem(int v, Object i) { - value = v; - item = null; - key = null; - object = i; - } - - public ValuedItem(String v, ItemStack i) { - value = -1; - item = i; - key = v; - object = null; - } - - public ValuedItem(int v, String k, ItemStack i) { - value = v; - item = i; - key = k; - object = null; - } - - public ValuedItem(int v, String k, Object i) { - value = v; - item = null; - key = k; - object = i; - } - - public ValuedItem(int v, String k, ItemStack i, Object o) { - value = v; - item = i; - key = k; - object = o; - } -} diff --git a/src/api/resources/CoFH_at.cfg b/src/api/resources/CoFH_at.cfg deleted file mode 100644 index df9e3e9..0000000 --- a/src/api/resources/CoFH_at.cfg +++ /dev/null @@ -1,77 +0,0 @@ -# NetherOres -public net.minecraft.entity.monster.EntityPigZombie func_70835_c(Lnet/minecraft/entity/Entity;)V # becomeAngryAt -public net.minecraft.entity.monster.EntitySilverfish field_70843_d # allySummonCooldown -public-f net.minecraft.init.Blocks field_150449_bY # oreNetherQuartz - -# MineFactory Reloaded -protected net.minecraft.util.WeightedRandomFishable * # need it all -public net.minecraft.entity.EntityList field_75624_e # classToIDMapping -public net.minecraft.entity.EntityList field_75622_f # stringToIDMapping -public net.minecraft.entity.monster.EntitySlime func_70799_a(I)V # setSlimeSize -public net.minecraft.entity.monster.EntityZombie func_82228_a(I)V # startConversion -public net.minecraft.entity.EntityLivingBase field_70718_bc # recentlyHit -public-f net.minecraft.init.Blocks field_150432_aD # ice -public-f net.minecraft.init.Blocks field_150410_aZ # glass_pane -public-f net.minecraft.init.Items field_151117_aB # milkBucket -protected net.minecraft.block.Block field_149770_b # unlocalizedName -public net.minecraft.server.management.PlayerManager func_72690_a(IIZ)Lnet/minecraft/server/management/PlayerManager$PlayerInstance; # getOrCreateChunkWatcher -public net.minecraft.server.management.PlayerManager$PlayerInstance -public net.minecraft.server.management.PlayerManager$PlayerInstance field_73263_b # playersWatchingChunk -public net.minecraft.entity.EntityLiving field_70728_aV # experienceValue -public net.minecraft.entity.EntityLiving field_82174_bp # equipmentDropChances - -# ThermalDynamics -public net.minecraft.client.renderer.Tessellator field_147569_p # rawBufferIndex -public net.minecraft.client.renderer.Tessellator field_78408_v # xOffset -public net.minecraft.client.renderer.Tessellator field_78407_w # yOffset -public net.minecraft.client.renderer.Tessellator field_78417_x # zOffset -public net.minecraft.client.renderer.Tessellator field_78406_i # rawBuffer -public net.minecraft.client.renderer.Tessellator field_78405_h # vertexCount - -# Thermal Expansion -public net.minecraft.entity.Entity field_83001_bt # invulnerable -public net.minecraft.entity.Entity field_70178_ae # isImmuneToFire -public net.minecraft.entity.player.EntityPlayer field_71074_e # itemInUse -public net.minecraft.server.management.ItemInWorldManager field_73094_o #durabilityRemainingOnBlock - -# PC Core -public net.minecraft.client.gui.GuiScreen field_146289_q # fontRenderer -public net.minecraft.client.gui.inventory.GuiContainer field_147003_i # guiLeft -public net.minecraft.client.gui.inventory.GuiContainer field_147009_r # guiTop -public net.minecraft.world.WorldServer field_73068_P # allPlayersSleeping - -# CoFH Core -protected net.minecraft.inventory.Container * # senseless to have private stuff here -protected net.minecraft.client.gui.inventory.GuiContainer * # senseless to have private stuff here -protected net.minecraft.client.gui.FontRenderer func_111272_d()V # all of it -protected net.minecraft.client.gui.FontRenderer func_98306_d()V # all of it -protected net.minecraft.client.gui.FontRenderer func_78278_a(ICZ)F # all of it -protected net.minecraft.client.gui.FontRenderer func_111271_a(I)Lnet/minecraft/util/ResourceLocation; # all of it -protected net.minecraft.client.gui.FontRenderer func_78257_a(I)V # all of it -protected net.minecraft.client.gui.FontRenderer func_78277_a(CZ)F # all of it -protected net.minecraft.client.gui.FontRenderer func_147647_b(Ljava/lang/String;)Ljava/lang/String; # all of it -protected net.minecraft.client.gui.FontRenderer func_78265_b()V # all of it -protected net.minecraft.client.gui.FontRenderer func_78255_a(Ljava/lang/String;Z)V # all of it -protected net.minecraft.client.gui.FontRenderer func_78274_b(Ljava/lang/String;IIIIZ)I # all of it -protected net.minecraft.client.gui.FontRenderer func_78258_a(Ljava/lang/String;IIIZ)I # all of it -protected net.minecraft.client.gui.FontRenderer func_78273_d(Ljava/lang/String;)Ljava/lang/String; # all of it -protected net.minecraft.client.gui.FontRenderer func_78268_b(Ljava/lang/String;IIIZ)V # all of it -protected net.minecraft.client.gui.FontRenderer func_78280_d(Ljava/lang/String;I)Ljava/lang/String; # all of it -protected net.minecraft.client.gui.FontRenderer func_78272_b(C)Z # all of it -protected net.minecraft.client.gui.FontRenderer func_78270_c(C)Z # all of it -protected net.minecraft.client.gui.FontRenderer func_78282_e(Ljava/lang/String;)Ljava/lang/String; # all of it -protected net.minecraft.client.gui.FontRenderer *()V # all of it -protected net.minecraft.client.gui.FontRenderer * # all of it -public net.minecraft.entity.projectile.EntityFishHook * # (nearly) literally everything is private - -protected net.minecraft.entity.player.EntityPlayer field_71072_f # itemInUseCount -public net.minecraft.item.ItemPickaxe field_150915_c # blocksEffectiveAgainst -public net.minecraft.item.ItemSpade field_150916_c # blocksEffectiveAgainst -public net.minecraft.item.ItemAxe field_150917_c # blocksEffectiveAgainst -public net.minecraft.util.RegistrySimple field_82596_a # registryObjects -public-f net.minecraft.util.RegistryNamespaced field_148759_a # underlyingIntegerMap -public net.minecraft.world.World field_72998_d # collidingBoundingBoxes - -# WorldProxy -public-f net.minecraft.world.World *()V # Doesn't matter what it is, we need it public -public-f net.minecraft.world.WorldServer *()V # Doesn't matter what it is, we need it public diff --git a/src/api/resources/MFR_at.cfg b/src/api/resources/MFR_at.cfg deleted file mode 100644 index cf0649a..0000000 --- a/src/api/resources/MFR_at.cfg +++ /dev/null @@ -1,3 +0,0 @@ -protected net.minecraft.client.gui.FontRenderer *()V # all of it -protected net.minecraft.client.gui.FontRenderer * # all of it - diff --git a/src/api/resources/TConstruct_at.cfg b/src/api/resources/TConstruct_at.cfg deleted file mode 100644 index e00d0b1..0000000 --- a/src/api/resources/TConstruct_at.cfg +++ /dev/null @@ -1,43 +0,0 @@ -# Tinkers Construct -- Access Transformer -# Required for any build system. -# Last update: Minecraft 1.7.2 - 2014 Feb 02 by Progwml6 -# EntityArrow - Grabbed 'em all, since so much is accessed -public net.minecraft.entity.projectile.EntityArrow field_145789_f -public net.minecraft.entity.projectile.EntityArrow field_145790_g -public net.minecraft.entity.projectile.EntityArrow field_145791_d -public net.minecraft.entity.projectile.EntityArrow field_145792_e -public net.minecraft.entity.projectile.EntityArrow field_70254_i -public net.minecraft.entity.projectile.EntityArrow field_70252_j -public net.minecraft.entity.projectile.EntityArrow field_70253_h -public net.minecraft.entity.projectile.EntityArrow field_70257_an -public net.minecraft.entity.projectile.EntityArrow field_70255_ao -public net.minecraft.entity.projectile.EntityArrow field_70256_ap -public net.minecraft.entity.projectile.EntityArrow *() #we need waaaaaaay to much in here to bother going through it -# RenderGlobal -public net.minecraft.client.renderer.RenderGlobal field_147592_B -# Blocks -public-f net.minecraft.block.Block field_149764_J -public net.minecraft.block.BlockLeavesBase field_150121_P -public net.minecraft.block.BlockRailBase$Rail func_150650_a()I -# GuiContainer -public net.minecraft.client.gui.inventory.GuiContainer field_146999_f -public net.minecraft.client.gui.inventory.GuiContainer field_147009_r -public net.minecraft.client.gui.inventory.GuiContainer field_147003_i -public net.minecraft.client.gui.inventory.GuiContainer func_146977_a(Lnet/minecraft/inventory/Slot;)V #renderSlot -public net.minecraft.client.gui.inventory.GuiContainer func_146981_a(Lnet/minecraft/inventory/Slot;II)Z #isMouseOverSlot -# GuiScreen -public net.minecraft.client.gui.GuiScreen field_146292_n #buttonList -# ThreadDownloadImageData -public net.minecraft.client.renderer.ThreadDownloadImageData field_110559_g #field_110559_g -public net.minecraft.client.renderer.ThreadDownloadImageData field_110560_d #field_110560_d -public net.minecraft.world.gen.structure.StructureVillagePieces$Village #cant make village houses w/o this -public net.minecraft.client.renderer.Tessellator field_78415_z -public net.minecraft.client.renderer.entity.RenderPlayer field_77109_a #modelBipedMain -# PlayerControllerMP and ItemInWorldManager for blockbreaking -public net.minecraft.client.multiplayer.PlayerControllerMP func_85182_a(III)Z #sameToolAndBlock -public net.minecraft.server.management.ItemInWorldManager field_73086_f -public net.minecraft.server.management.ItemInWorldManager field_73087_g -public net.minecraft.server.management.ItemInWorldManager field_73099_h -# EntitySlime -public net.minecraft.entity.monster.EntitySlime func_70799_a(I)V #setSlimeSize -# needs to have a space at the end of every line or SS will derp diff --git a/src/api/resources/ThaumicTinkerer_at.cfg b/src/api/resources/ThaumicTinkerer_at.cfg deleted file mode 100644 index 32157c8..0000000 --- a/src/api/resources/ThaumicTinkerer_at.cfg +++ /dev/null @@ -1,36 +0,0 @@ -#Potion Effect duration -public net.minecraft.potion.PotionEffect field_76460_b - -#Entity Creeper timeSinceIgnited -public net.minecraft.entity.monster.EntityCreeper field_70833_d - -#EntityAIAvoidEntity -public net.minecraft.entity.ai.EntityAIAvoidEntity field_75381_h #targetEntityClass - -#EntityAINearestAttackableTarge -public-f net.minecraft.entity.ai.EntityAINearestAttackableTarget field_75307_b #targetClass - -# Potion -public net.minecraft.potion.Potion func_76398_f #isBadEffect - -# Player -public net.minecraft.entity.player.EntityPlayer field_71074_e #itemInUse -public net.minecraft.entity.player.EntityPlayer field_71072_f #itemInUseCount - -#Blocks -public-f net.minecraft.init.Blocks field_150357_h #bedrock - -#EntitySlime -public net.minecraft.entity.monster.EntitySlime func_70799_a #setSlimeSize - -#NetHandlerPlayServer -public net.minecraft.network.NetHandlerPlayServer field_147365_f #floatingTickCount - -#Block -public net.minecraft.block.Block field_149782_v #blockHardness - -#EntitySlime -public net.minecraft.entity.monster.EntitySlime func_70799_a(I)V #setSlimeSize - -#Block -public net.minecraft.block.Block field_149770_b #unlocalizedName \ No newline at end of file diff --git a/src/main/java/talonos/blightbuster/handlers/TalonosWandTriggerManager.java b/src/main/java/talonos/blightbuster/handlers/TalonosWandTriggerManager.java index d1f08d3..3b30c9f 100644 --- a/src/main/java/talonos/blightbuster/handlers/TalonosWandTriggerManager.java +++ b/src/main/java/talonos/blightbuster/handlers/TalonosWandTriggerManager.java @@ -257,7 +257,7 @@ private void pairDawnChargerToDawnMachine(World world, ItemStack wand, int x, in } private boolean createDawnMachine(ItemStack stack, EntityPlayer player, World world, int x, int y, int z) { - if (world.isRemote || DawnMachineTileEntity.coords != null) { + if (world.isRemote) { return false; } @@ -268,8 +268,7 @@ private boolean createDawnMachine(ItemStack stack, EntityPlayer player, World wo final Pair entry = BBBlock.dawnMachineMultiblock .getEntry(world, x, y, z, -1, block, meta); - if (entry != null && wand.consumeAllVisCrafting(stack, player, new AspectList().add(Aspect.ORDER, 20), true) - && !world.isRemote) { + if (entry != null && wand.consumeAllVisCrafting(stack, player, new AspectList().add(Aspect.ORDER, 20), true)) { BBBlock.dawnMachineMultiblock .convertMultiblockWithOrientationFromSideBlock(world, x, y, z, entry.getValue(), false, entry.getKey()); TileEntity newTile = world.getTileEntity(x, y, z); diff --git a/src/main/java/talonos/blightbuster/lib/Coordinates.java b/src/main/java/talonos/blightbuster/lib/Coordinates.java new file mode 100644 index 0000000..61709e0 --- /dev/null +++ b/src/main/java/talonos/blightbuster/lib/Coordinates.java @@ -0,0 +1,29 @@ +package talonos.blightbuster.lib; + +public class Coordinates { + + public int x; + public int y; + public int z; + + public Coordinates(int x, int y, int z) { + this.x = x; + this.y = y; + this.z = z; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) return true; + if (!(obj instanceof Coordinates other)) return false; + return x == other.x && y == other.y && z == other.z; + } + + @Override + public int hashCode() { + int result = Integer.hashCode(x); + result = 31 * result + Integer.hashCode(y); + result = 31 * result + Integer.hashCode(z); + return result; + } +} diff --git a/src/main/java/talonos/blightbuster/mixins/Mixins.java b/src/main/java/talonos/blightbuster/mixins/Mixins.java index fb2f23b..da04b1b 100644 --- a/src/main/java/talonos/blightbuster/mixins/Mixins.java +++ b/src/main/java/talonos/blightbuster/mixins/Mixins.java @@ -38,6 +38,11 @@ public enum Mixins { .setSide(Side.BOTH) .setPhase(Phase.LATE) .addMixinClasses("MixinFluxGoo") + .setApplyIf(() -> true)), + DISABLE_BIOME_SPREAD(new Builder("Disables biome taint spread").addTargetedMod(TargetedMod.THAUMCRAFT) + .setSide(Side.BOTH) + .setPhase(Phase.LATE) + .addMixinClasses("MixinUtils") .setApplyIf(() -> true)); private final List mixinClasses; diff --git a/src/main/java/talonos/blightbuster/mixins/late/MixinBlockTaintFibres.java b/src/main/java/talonos/blightbuster/mixins/late/MixinBlockTaintFibres.java index bfead72..6ed20f9 100644 --- a/src/main/java/talonos/blightbuster/mixins/late/MixinBlockTaintFibres.java +++ b/src/main/java/talonos/blightbuster/mixins/late/MixinBlockTaintFibres.java @@ -1,8 +1,10 @@ package talonos.blightbuster.mixins.late; +import java.util.List; import java.util.Random; import net.minecraft.block.Block; +import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; import org.spongepowered.asm.mixin.Mixin; @@ -20,38 +22,24 @@ public abstract class MixinBlockTaintFibres { @Inject(method = "taintBiomeSpread", at = @At(value = "HEAD", remap = false), cancellable = true) private static void taintBiomeSpreadMixin(World world, int x, int y, int z, Random rand, Block block, CallbackInfo ci) { - if (DawnMachineTileEntity.coords != null) { - int[] coords = DawnMachineTileEntity.coords; - DawnMachineTileEntity tile = (DawnMachineTileEntity) world.getTileEntity(coords[0], coords[1], coords[2]); - if (tile != null) { - int chunkX = x / 16; - int chunkZ = z / 16; - for (int i = 0; i < tile.cleansedChunks.size(); i++) { - int[] chunkCoords = tile.cleansedChunks.get(i); - if (chunkCoords[0] == chunkX && chunkCoords[1] == chunkZ) { - ci.cancel(); - return; - } - } + List tiles = DawnMachineTileEntity.getDawnMachines(world); + ChunkCoordIntPair chunk = new ChunkCoordIntPair(x >> 4, z >> 4); + for (DawnMachineTileEntity tile : tiles) { + if (tile.cleansedChunks.contains(chunk)) { + ci.cancel(); + return; } } } @Inject(method = "spreadFibres", at = @At(value = "HEAD", remap = false), cancellable = true) private static void spreadFibresMixin(World world, int x, int y, int z, CallbackInfoReturnable cir) { - if (DawnMachineTileEntity.coords != null) { - int[] coords = DawnMachineTileEntity.coords; - DawnMachineTileEntity tile = (DawnMachineTileEntity) world.getTileEntity(coords[0], coords[1], coords[2]); - if (tile != null) { - int chunkX = x / 16; - int chunkZ = z / 16; - for (int i = 0; i < tile.cleansedChunks.size(); i++) { - int[] chunkCoords = tile.cleansedChunks.get(i); - if (chunkCoords[0] == chunkX && chunkCoords[1] == chunkZ) { - cir.setReturnValue(false); - return; - } - } + List tiles = DawnMachineTileEntity.getDawnMachines(world); + ChunkCoordIntPair chunk = new ChunkCoordIntPair(x >> 4, z >> 4); + for (DawnMachineTileEntity tile : tiles) { + if (tile.cleansedChunks.contains(chunk)) { + cir.setReturnValue(true); + return; } } } diff --git a/src/main/java/talonos/blightbuster/mixins/late/MixinFluxGoo.java b/src/main/java/talonos/blightbuster/mixins/late/MixinFluxGoo.java index 6394f7e..57bf04e 100644 --- a/src/main/java/talonos/blightbuster/mixins/late/MixinFluxGoo.java +++ b/src/main/java/talonos/blightbuster/mixins/late/MixinFluxGoo.java @@ -1,7 +1,9 @@ package talonos.blightbuster.mixins.late; +import java.util.List; import java.util.Random; +import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; import org.spongepowered.asm.mixin.Mixin; @@ -17,19 +19,14 @@ public abstract class MixinFluxGoo { @Inject(method = "updateTick", at = @At(value = "HEAD"), cancellable = true) private void updateTickMixin(World world, int x, int y, int z, Random rand, CallbackInfo ci) { - if (DawnMachineTileEntity.coords != null) { - int[] coords = DawnMachineTileEntity.coords; - DawnMachineTileEntity tile = (DawnMachineTileEntity) world.getTileEntity(coords[0], coords[1], coords[2]); - if (tile != null) { - int meta = world.getBlockMetadata(x, y, z); - if (meta >= 6 && world.isAirBlock(x, y + 1, z)) { - for (int i = 0; i < tile.cleansedChunks.size(); i++) { - int[] chunkCoords = tile.cleansedChunks.get(i); - if (chunkCoords[0] == x / 16 && chunkCoords[1] == z / 16) { - ci.cancel(); - return; - } - } + List tiles = DawnMachineTileEntity.getDawnMachines(world); + ChunkCoordIntPair chunk = new ChunkCoordIntPair(x >> 4, z >> 4); + for (DawnMachineTileEntity tile : tiles) { + int meta = world.getBlockMetadata(x, y, z); + if (meta >= 6 && world.isAirBlock(x, y + 1, z)) { + if (tile.cleansedChunks.contains(chunk)) { + ci.cancel(); + return; } } } diff --git a/src/main/java/talonos/blightbuster/mixins/late/MixinTaintedCreeper.java b/src/main/java/talonos/blightbuster/mixins/late/MixinTaintedCreeper.java index 608abb7..98366d2 100644 --- a/src/main/java/talonos/blightbuster/mixins/late/MixinTaintedCreeper.java +++ b/src/main/java/talonos/blightbuster/mixins/late/MixinTaintedCreeper.java @@ -1,36 +1,58 @@ package talonos.blightbuster.mixins.late; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; + import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import com.llamalad7.mixinextras.injector.wrapoperation.Operation; +import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; + import talonos.blightbuster.tileentity.DawnMachineTileEntity; import thaumcraft.common.entities.monster.EntityTaintCreeper; @Mixin(value = EntityTaintCreeper.class) -public abstract class MixinTaintedCreeper { +public abstract class MixinTaintedCreeper extends EntityMob { @Shadow(remap = false) private int timeSinceIgnited; + public MixinTaintedCreeper(World world) { + super(world); + } + @Inject(method = "onUpdate", at = @At(value = "HEAD")) private void onUpdateMixin(CallbackInfo c) { - if (DawnMachineTileEntity.coords != null) { - int[] coords = DawnMachineTileEntity.coords; - EntityTaintCreeper tmp = (EntityTaintCreeper) (Object) this; - DawnMachineTileEntity tile = (DawnMachineTileEntity) tmp.worldObj - .getTileEntity(coords[0], coords[1], coords[2]); - if (tile != null) { - for (int i = 0; i < tile.cleansedChunks.size(); i++) { - int[] chunkCoords = tile.cleansedChunks.get(i); - if (chunkCoords[0] == (int) tmp.posX / 16 && chunkCoords[1] == (int) tmp.posZ / 16) { - this.timeSinceIgnited = 0; - return; - } - } + List tiles = DawnMachineTileEntity.getDawnMachines(this.worldObj); + ChunkCoordIntPair chunk = new ChunkCoordIntPair(this.chunkCoordX, this.chunkCoordZ); + for (DawnMachineTileEntity tile : tiles) { + if (tile.cleansedChunks.contains(chunk)) { + this.timeSinceIgnited = 0; + return; + } + } + } + + @WrapOperation( + method = "onUpdate", + at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;setBlock(IIILnet/minecraft/block/Block;II)Z")) + private boolean wrapSetBlock(World world, int x, int y, int z, Block block, int meta, int flags, + Operation original) { + List tiles = DawnMachineTileEntity.getDawnMachines(this.worldObj); + ChunkCoordIntPair chunk = new ChunkCoordIntPair(x >> 4, z >> 4); + for (DawnMachineTileEntity tile : tiles) { + if (tile.cleansedChunks.contains(chunk)) { + return false; } } + return original.call(world, x, y, z, block, meta, flags); } } diff --git a/src/main/java/talonos/blightbuster/mixins/late/MixinTaintedSheepAI.java b/src/main/java/talonos/blightbuster/mixins/late/MixinTaintedSheepAI.java index c304f55..e6262aa 100644 --- a/src/main/java/talonos/blightbuster/mixins/late/MixinTaintedSheepAI.java +++ b/src/main/java/talonos/blightbuster/mixins/late/MixinTaintedSheepAI.java @@ -1,6 +1,9 @@ package talonos.blightbuster.mixins.late; +import java.util.List; + import net.minecraft.entity.EntityLiving; +import net.minecraft.world.ChunkCoordIntPair; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -19,18 +22,12 @@ public abstract class MixinTaintedSheepAI { @Inject(method = "shouldExecute", at = @At(value = "HEAD"), cancellable = true) private void updateTaskMixin(CallbackInfoReturnable cir) { - if (DawnMachineTileEntity.coords != null) { - int[] coords = DawnMachineTileEntity.coords; - DawnMachineTileEntity tile = (DawnMachineTileEntity) entity.worldObj - .getTileEntity(coords[0], coords[1], coords[2]); - if (tile != null) { - for (int i = 0; i < tile.cleansedChunks.size(); i++) { - int[] chunkCoords = tile.cleansedChunks.get(i); - if (chunkCoords[0] == entity.chunkCoordX && chunkCoords[1] == entity.chunkCoordZ) { - cir.setReturnValue(false); - return; - } - } + List tiles = DawnMachineTileEntity.getDawnMachines(entity.worldObj); + ChunkCoordIntPair chunk = new ChunkCoordIntPair(entity.chunkCoordX, entity.chunkCoordZ); + for (DawnMachineTileEntity tile : tiles) { + if (tile.cleansedChunks.contains(chunk)) { + cir.setReturnValue(false); + return; } } } diff --git a/src/main/java/talonos/blightbuster/mixins/late/MixinTileNode.java b/src/main/java/talonos/blightbuster/mixins/late/MixinTileNode.java index 0ecaa61..a11cd6f 100644 --- a/src/main/java/talonos/blightbuster/mixins/late/MixinTileNode.java +++ b/src/main/java/talonos/blightbuster/mixins/late/MixinTileNode.java @@ -1,33 +1,30 @@ package talonos.blightbuster.mixins.late; +import java.util.List; + +import net.minecraft.world.ChunkCoordIntPair; + import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import com.llamalad7.mixinextras.injector.wrapmethod.WrapMethod; +import com.llamalad7.mixinextras.injector.wrapoperation.Operation; import talonos.blightbuster.tileentity.DawnMachineTileEntity; +import thaumcraft.api.TileThaumcraft; import thaumcraft.common.tiles.TileNode; @Mixin(value = TileNode.class, remap = false) -public abstract class MixinTileNode { +public abstract class MixinTileNode extends TileThaumcraft { - @Inject(method = "handleTaintNode", at = @At(value = "HEAD", remap = false), cancellable = true) - private void handleTaintNodeMixin(boolean change, CallbackInfoReturnable cir) { - // BlightBuster.logger.info("Mixed into handleTaintNode"); - if (DawnMachineTileEntity.coords != null) { - int[] coords = DawnMachineTileEntity.coords; - TileNode tmp = (TileNode) (Object) this; - DawnMachineTileEntity tile = (DawnMachineTileEntity) tmp.getWorldObj() - .getTileEntity(coords[0], coords[1], coords[2]); - if (tile != null) { - for (int i = 0; i < tile.cleansedChunks.size(); i++) { - int[] chunkCoords = tile.cleansedChunks.get(i); - if (chunkCoords[0] == tmp.xCoord / 16 && chunkCoords[1] == tmp.zCoord / 16) { - cir.setReturnValue(false); - return; - } - } + @WrapMethod(method = "handleTaintNode") + private boolean handleTaintNodeMixin(boolean change, Operation original) { + List tiles = DawnMachineTileEntity.getDawnMachines(this.worldObj); + ChunkCoordIntPair chunk = new ChunkCoordIntPair(this.xCoord >> 4, this.zCoord >> 4); + for (DawnMachineTileEntity tile : tiles) { + if (tile.cleansedChunks.contains(chunk)) { + return change; } } + return original.call(change); } } diff --git a/src/main/java/talonos/blightbuster/mixins/late/MixinUtils.java b/src/main/java/talonos/blightbuster/mixins/late/MixinUtils.java new file mode 100644 index 0000000..36284f5 --- /dev/null +++ b/src/main/java/talonos/blightbuster/mixins/late/MixinUtils.java @@ -0,0 +1,31 @@ +package talonos.blightbuster.mixins.late; + +import java.util.List; + +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +import org.spongepowered.asm.mixin.Mixin; + +import com.llamalad7.mixinextras.injector.wrapmethod.WrapMethod; +import com.llamalad7.mixinextras.injector.wrapoperation.Operation; + +import talonos.blightbuster.tileentity.DawnMachineTileEntity; +import thaumcraft.common.lib.utils.Utils; + +@Mixin(Utils.class) +public class MixinUtils { + + @WrapMethod(method = "setBiomeAt", remap = false) + private static void setBiomeAt(World world, int x, int z, BiomeGenBase biome, Operation original) { + List tiles = DawnMachineTileEntity.getDawnMachines(world); + ChunkCoordIntPair chunk = new ChunkCoordIntPair(x >> 4, z >> 4); + for (DawnMachineTileEntity tile : tiles) { + if (tile.cleansedChunks.contains(chunk)) { + return; + } + } + original.call(world, x, z, biome); + } +} diff --git a/src/main/java/talonos/blightbuster/tileentity/DawnMachineTileEntity.java b/src/main/java/talonos/blightbuster/tileentity/DawnMachineTileEntity.java index 2cd5ebd..6e153dc 100644 --- a/src/main/java/talonos/blightbuster/tileentity/DawnMachineTileEntity.java +++ b/src/main/java/talonos/blightbuster/tileentity/DawnMachineTileEntity.java @@ -5,11 +5,13 @@ import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Random; +import java.util.Set; import java.util.function.Function; import net.minecraft.block.Block; @@ -49,6 +51,7 @@ import talonos.blightbuster.BlightBuster; import talonos.blightbuster.BlightbusterConfig; import talonos.blightbuster.lib.CleansingHelper; +import talonos.blightbuster.lib.Coordinates; import talonos.blightbuster.network.BlightbusterNetwork; import talonos.blightbuster.network.packets.SpawnCleanseParticlesPacket; import talonos.blightbuster.tileentity.dawnmachine.DawnMachineResource; @@ -76,7 +79,7 @@ public class DawnMachineTileEntity extends TileEntity implements IAspectSource, IAspectContainer, IEnergyReceiver, IEnergyStorage, ISparkAttachable, IFluidTank, IFluidHandler { - public static int[] coords = null; + private static final ArrayList dawnMachines = new ArrayList<>(); // FLUID INTEGRATION (Blood Magic) private static final int MAX_BLOOD = 100000; @@ -173,7 +176,7 @@ public class DawnMachineTileEntity extends TileEntity implements IAspectSource, // Denotes if waiting for chunk to load private boolean waiting = false; - public final ArrayList cleansedChunks = new ArrayList<>(); + public final Set cleansedChunks = new HashSet<>(); public boolean isActive = false; @@ -197,9 +200,11 @@ public void updateEntity() { return; } if (this.init) { + // this all has to wait for the first tick because the tileentity isn't fully initialized until then - coords = new int[] { this.xCoord, this.yCoord, this.zCoord }; - this.dawnMachineBlockCoords = new int[] { this.xCoord, this.zCoord }; + Coordinates coords = new Coordinates(this.xCoord, this.yCoord, this.zCoord); + dawnMachines.add(coords); + this.dawnMachineBlockCoords = new int[] { coords.x, coords.y }; this.scanlineCoords = this.generateScanlineCoords(); this.scanlineAerCoords = this.generateScanlineAerCoords(); this.dawnMachineChunkCoords = this.getDawnMachineChunkCoords(); @@ -248,7 +253,7 @@ public void updateEntity() { if (anythingToDo) { this.executeCleanse(chunk); try { - cleansedChunks.add(new int[] { this.chunkX, this.chunkZ }); + cleansedChunks.add(new ChunkCoordIntPair(this.chunkX, this.chunkZ)); } catch (Exception e) { BlightBuster.logger.error(e); worldObj.playerEntities.get(0) @@ -914,7 +919,7 @@ public static Chunk getChunk(World world, int x, int z) { } private int[] getDawnMachineChunkCoords() { - return new int[] { (int) Math.floor(this.xCoord / 16.0), (int) Math.floor(this.zCoord / 16.0) }; + return new int[] { this.xCoord >> 4, this.zCoord >> 4 }; } // END HELPER FUNCTIONS @@ -941,7 +946,7 @@ private void readCustomNBT(NBTTagCompound tag) { cleansedChunks.clear(); for (int i = 0; i < unpackedCoords.length - 1; i += 2) { try { - cleansedChunks.add(new int[] { unpackedCoords[i], unpackedCoords[i + 1] }); + cleansedChunks.add(new ChunkCoordIntPair(unpackedCoords[i], unpackedCoords[i + 1])); } catch (Exception e) { BlightBuster.logger.error(e); worldObj.playerEntities.get(0) @@ -968,11 +973,10 @@ private void writeCustomNBT(NBTTagCompound tag) { tag.setInteger("CurrentRF", this.currentRF); tag.setInteger("Blood", this.fluid.amount); tag.setInteger("Mana", this.currentMana); - // int[] tmpArray = ArrayUtils.toPrimitive(cleansedChunks.toArray(new Integer[0])); ArrayList unpackedCoords = new ArrayList<>(); - for (int[] coords : cleansedChunks) { - unpackedCoords.add(coords[0]); - unpackedCoords.add(coords[1]); + for (ChunkCoordIntPair coords : cleansedChunks) { + unpackedCoords.add(coords.chunkXPos); + unpackedCoords.add(coords.chunkZPos); } tag.setIntArray("CleansedChunks", ArrayUtils.toPrimitive(unpackedCoords.toArray(new Integer[0]))); } @@ -1424,8 +1428,22 @@ public void updatePos() { } public static void deconstruct(World world, int x, int y, int z) { - coords = null; + Coordinates coords = new Coordinates(x, y, z); + DawnMachineTileEntity.dawnMachines.remove(coords); } + public static List getDawnMachines(World world) { + ArrayList tiles = new ArrayList<>(); + synchronized (dawnMachines) { + for (Coordinates coords : dawnMachines) { + TileEntity te = world.getTileEntity(coords.x, coords.y, coords.z); + if (te instanceof DawnMachineTileEntity) { + tiles.add((DawnMachineTileEntity) te); + } + } + } + + return tiles; + } // END MISC. FUNCTIONS }