Merge branch '1.7.10' of https://github.com/aidancbrady/Mekanism into 1.7.10

This commit is contained in:
clienthax 2016-10-10 12:30:13 +01:00
commit c149941034
9 changed files with 66 additions and 59 deletions

View file

@ -4,4 +4,4 @@ FMP_version=1.1.2.331
CCLIB_version=1.1.3.136 CCLIB_version=1.1.3.136
NEI_version=1.0.4.101 NEI_version=1.0.4.101
CCC_version=1.0.6.39 CCC_version=1.0.6.39
mod_version=9.1.0 mod_version=9.1.1

View file

@ -142,7 +142,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
* @author AidanBrady * @author AidanBrady
* *
*/ */
@Mod(modid = "Mekanism", name = "Mekanism", version = "9.1.0", guiFactory = "mekanism.client.gui.ConfigGuiFactory", @Mod(modid = "Mekanism", name = "Mekanism", version = "9.1.1", guiFactory = "mekanism.client.gui.ConfigGuiFactory",
dependencies = "after:ForgeMultipart;after:BuildCraft;after:BuildCraftAPI;after:IC2;after:CoFHCore;" + dependencies = "after:ForgeMultipart;after:BuildCraft;after:BuildCraftAPI;after:IC2;after:CoFHCore;" +
"after:ComputerCraft;after:Galacticraft API;after:MetallurgyCore") "after:ComputerCraft;after:Galacticraft API;after:MetallurgyCore")
public class Mekanism public class Mekanism
@ -168,7 +168,7 @@ public class Mekanism
public static Configuration configuration; public static Configuration configuration;
/** Mekanism version number */ /** Mekanism version number */
public static Version versionNumber = new Version(9, 1, 0); public static Version versionNumber = new Version(9, 1, 1);
/** MultiblockManagers for various structrures */ /** MultiblockManagers for various structrures */
public static MultiblockManager<SynchronizedTankData> tankManager = new MultiblockManager<SynchronizedTankData>("dynamicTank"); public static MultiblockManager<SynchronizedTankData> tankManager = new MultiblockManager<SynchronizedTankData>("dynamicTank");

View file

@ -1,6 +1,9 @@
package mekanism.common; package mekanism.common;
import java.util.List;
import mekanism.common.util.MekanismUtils; import mekanism.common.util.MekanismUtils;
import cpw.mods.fml.relauncher.FMLInjectionData;
/** /**
* Thread used to retrieve data from the Mekanism server. * Thread used to retrieve data from the Mekanism server.
@ -18,9 +21,27 @@ public class ThreadGetData extends Thread
@Override @Override
public void run() public void run()
{ {
Mekanism.latestVersionNumber = MekanismUtils.getLatestVersion(); List<String> ret = MekanismUtils.getHTML("https://dl.dropbox.com/u/90411166/Versions/Mekanism.txt");
Mekanism.recentNews = MekanismUtils.getRecentNews();
Mekanism.latestVersionNumber = "null";
Mekanism.recentNews = "null";
for(String s : ret)
{
String[] text = s.split(":");
if(text.length == 3 && !text[0].contains("UTF-8") && !text[0].contains("HTML") && !text[0].contains("http"))
{
if(Version.get(text[0]) != null && Version.get(text[0]).equals(Version.get((String)FMLInjectionData.data()[4])))
{
Mekanism.latestVersionNumber = text[1];
Mekanism.recentNews = text[2];
break;
}
}
}
MekanismUtils.updateDonators(); MekanismUtils.updateDonators();
} }
} }

View file

@ -1,7 +1,7 @@
package mekanism.common; package mekanism.common;
/** /**
* Version v1.0.4. Simple version handling for Mekanism. * Version v2.0.0. Simple version handling for Mekanism.
* @author AidanBrady * @author AidanBrady
* *
*/ */
@ -127,4 +127,29 @@ public class Version
return major + "." + minor + "." + build; return major + "." + minor + "." + build;
} }
} }
@Override
public int hashCode()
{
int result = 1;
result = 31 * result + build;
result = 31 * result + major;
result = 31 * result + minor;
return result;
}
@Override
public boolean equals(Object obj)
{
if(obj == null || getClass() != obj.getClass())
{
return false;
}
Version other = (Version)obj;
return build == other.build && major == other.major && minor == other.minor;
}
} }

View file

@ -16,7 +16,7 @@ import net.minecraft.item.ItemStack;
public class TankUpdateProtocol extends UpdateProtocol<SynchronizedTankData> public class TankUpdateProtocol extends UpdateProtocol<SynchronizedTankData>
{ {
public static final int FLUID_PER_TANK = 16000; public static final int FLUID_PER_TANK = 64000;
public TankUpdateProtocol(TileEntityDynamicTank tileEntity) public TankUpdateProtocol(TileEntityDynamicTank tileEntity)
{ {

View file

@ -116,7 +116,7 @@ public class ContainerFactory extends Container
{ {
ItemStack stack = null; ItemStack stack = null;
Slot currentSlot = (Slot)inventorySlots.get(slotID); Slot currentSlot = (Slot)inventorySlots.get(slotID);
if(currentSlot != null && currentSlot.getHasStack()) if(currentSlot != null && currentSlot.getHasStack())
{ {
ItemStack slotStack = currentSlot.getStack(); ItemStack slotStack = currentSlot.getStack();
@ -178,7 +178,7 @@ public class ContainerFactory extends Container
} }
else if(tileEntity.recipeType.getItemGas(slotStack) != null) else if(tileEntity.recipeType.getItemGas(slotStack) != null)
{ {
if(slotID > tileEntity.inventory.length-1) if(slotID >= tileEntity.inventory.length-1)
{ {
if(!mergeItemStack(slotStack, 3, 4, false)) if(!mergeItemStack(slotStack, 3, 4, false))
{ {
@ -194,7 +194,7 @@ public class ContainerFactory extends Container
} }
else if(tileEntity.recipeType == RecipeType.INFUSING && InfuseRegistry.getObject(slotStack) != null && (tileEntity.infuseStored.type == null || tileEntity.infuseStored.type == InfuseRegistry.getObject(slotStack).type)) else if(tileEntity.recipeType == RecipeType.INFUSING && InfuseRegistry.getObject(slotStack) != null && (tileEntity.infuseStored.type == null || tileEntity.infuseStored.type == InfuseRegistry.getObject(slotStack).type))
{ {
if(slotID > tileEntity.inventory.length-1) if(slotID >= tileEntity.inventory.length-1)
{ {
if(!mergeItemStack(slotStack, 3, 4, false)) if(!mergeItemStack(slotStack, 3, 4, false))
{ {
@ -267,25 +267,11 @@ public class ContainerFactory extends Container
public boolean isInputSlot(int slot) public boolean isInputSlot(int slot)
{ {
if(tileEntity.tier == Tier.FactoryTier.BASIC) return slot >= 4 && slot < 4+tileEntity.tier.processes;
return slot >= 4 && slot <= 6;
if(tileEntity.tier == Tier.FactoryTier.ADVANCED)
return slot >= 4 && slot <= 8;
if(tileEntity.tier == Tier.FactoryTier.ELITE)
return slot >= 4 && slot <= 10;
return false;
} }
public boolean isOutputSlot(int slot) public boolean isOutputSlot(int slot)
{ {
if(tileEntity.tier == Tier.FactoryTier.BASIC) return slot >= 4+tileEntity.tier.processes && slot < 4+tileEntity.tier.processes*2;
return slot >= 7 && slot <= 9;
if(tileEntity.tier == Tier.FactoryTier.ADVANCED)
return slot >= 9 && slot <= 13;
if(tileEntity.tier == Tier.FactoryTier.ELITE)
return slot >= 11 && slot <= 17;
return false;
} }
} }

View file

@ -160,28 +160,6 @@ public final class MekanismUtils
return false; return false;
} }
/**
* Gets the latest version using getHTML and returns it as a string.
* @return latest version
*/
public static String getLatestVersion()
{
String[] text = merge(getHTML("https://dl.dropbox.com/u/90411166/Mod%20Versions/Mekanism.txt")).split(":");
if(text.length > 1 && !text[0].contains("UTF-8") && !text[0].contains("HTML") && !text[0].contains("http")) return text[0];
return "null";
}
/**
* Gets the recent news using getHTML and returns it as a string.
* @return recent news
*/
public static String getRecentNews()
{
String[] text = merge(getHTML("https://dl.dropbox.com/u/90411166/Mod%20Versions/Mekanism.txt")).split(":");
if(text.length > 1 && !text[1].contains("UTF-8") && !text[1].contains("HTML") && !text[1].contains("http")) return text[1];
return "null";
}
/** /**
* Updates the donator list by retrieving the most recent information from a foreign document. * Updates the donator list by retrieving the most recent information from a foreign document.
*/ */
@ -202,17 +180,14 @@ public final class MekanismUtils
*/ */
public static List<String> getHTML(String urlToRead) public static List<String> getHTML(String urlToRead)
{ {
URL url;
HttpURLConnection conn;
BufferedReader rd;
String line; String line;
List<String> result = new ArrayList<String>(); List<String> result = new ArrayList<String>();
try { try {
url = new URL(urlToRead); URL url = new URL(urlToRead);
conn = (HttpURLConnection)url.openConnection(); HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("GET"); conn.setRequestMethod("GET");
rd = new BufferedReader(new InputStreamReader(conn.getInputStream())); BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
while((line = rd.readLine()) != null) while((line = rd.readLine()) != null)
{ {

View file

@ -44,7 +44,7 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.network.NetworkRegistry;
@Mod(modid = "MekanismGenerators", name = "MekanismGenerators", version = "9.1.0", dependencies = "required-after:Mekanism", guiFactory = "mekanism.generators.client.gui.GeneratorsGuiFactory") @Mod(modid = "MekanismGenerators", name = "MekanismGenerators", version = "9.1.1", dependencies = "required-after:Mekanism", guiFactory = "mekanism.generators.client.gui.GeneratorsGuiFactory")
public class MekanismGenerators implements IModule public class MekanismGenerators implements IModule
{ {
@SidedProxy(clientSide = "mekanism.generators.client.GeneratorsClientProxy", serverSide = "mekanism.generators.common.GeneratorsCommonProxy") @SidedProxy(clientSide = "mekanism.generators.client.GeneratorsClientProxy", serverSide = "mekanism.generators.common.GeneratorsCommonProxy")
@ -54,7 +54,7 @@ public class MekanismGenerators implements IModule
public static MekanismGenerators instance; public static MekanismGenerators instance;
/** MekanismGenerators version number */ /** MekanismGenerators version number */
public static Version versionNumber = new Version(9, 1, 0); public static Version versionNumber = new Version(9, 1, 1);
public static MultiblockManager<SynchronizedTurbineData> turbineManager = new MultiblockManager<SynchronizedTurbineData>("industrialTurbine"); public static MultiblockManager<SynchronizedTurbineData> turbineManager = new MultiblockManager<SynchronizedTurbineData>("industrialTurbine");

View file

@ -29,7 +29,7 @@ import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent;
@Mod(modid = "MekanismTools", name = "MekanismTools", version = "9.1.0", dependencies = "required-after:Mekanism", guiFactory = "mekanism.tools.client.gui.ToolsGuiFactory") @Mod(modid = "MekanismTools", name = "MekanismTools", version = "9.1.1", dependencies = "required-after:Mekanism", guiFactory = "mekanism.tools.client.gui.ToolsGuiFactory")
public class MekanismTools implements IModule public class MekanismTools implements IModule
{ {
@SidedProxy(clientSide = "mekanism.tools.client.ToolsClientProxy", serverSide = "mekanism.tools.common.ToolsCommonProxy") @SidedProxy(clientSide = "mekanism.tools.client.ToolsClientProxy", serverSide = "mekanism.tools.common.ToolsCommonProxy")
@ -39,7 +39,7 @@ public class MekanismTools implements IModule
public static MekanismTools instance; public static MekanismTools instance;
/** MekanismTools version number */ /** MekanismTools version number */
public static Version versionNumber = new Version(9, 1, 0); public static Version versionNumber = new Version(9, 1, 1);
//Enums: Tools //Enums: Tools
public static ToolMaterial toolOBSIDIAN; public static ToolMaterial toolOBSIDIAN;