Merge branch 'master' of https://github.com/MinecraftForge/FML
Conflicts: src/main/java/cpw/mods/fml/client/FMLClientHandler.java src/main/java/cpw/mods/fml/client/GuiModItemsMissing.java src/main/java/cpw/mods/fml/common/FMLContainer.java src/main/java/cpw/mods/fml/common/registry/FMLControlledNamespacedRegistry.java src/main/java/cpw/mods/fml/common/registry/GameData.java
This commit is contained in:
commit
e013f1514d
57 changed files with 562 additions and 556 deletions
|
@ -12,7 +12,7 @@ buildscript {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'net.minecraftforge.gradle:ForgeGradle:1.1-SNAPSHOT'
|
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
BIN
fml/gradle/wrapper/gradle-wrapper.jar
vendored
BIN
fml/gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
4
fml/gradle/wrapper/gradle-wrapper.properties
vendored
4
fml/gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,6 +1,6 @@
|
||||||
#Tue Oct 29 18:00:54 CDT 2013
|
#Wed Mar 26 13:33:58 CDT 2014
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-bin.zip
|
distributionUrl=http\://services.gradle.org/distributions/gradle-1.11-bin.zip
|
||||||
|
|
|
@ -11,7 +11,7 @@ buildscript {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'net.minecraftforge.gradle:ForgeGradle:1.1-SNAPSHOT'
|
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,8 +25,13 @@ minecraft {
|
||||||
version = "${version}"
|
version = "${version}"
|
||||||
assetDir = "eclipse/assets"
|
assetDir = "eclipse/assets"
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources
|
processResources
|
||||||
{
|
{
|
||||||
|
// this will ensure that this task is redone when the versions change.
|
||||||
|
inputs.property "version", project.version
|
||||||
|
inputs.property "mcversion", project.minecraft.version
|
||||||
|
|
||||||
// replace stuff in mcmod.info, nothing else
|
// replace stuff in mcmod.info, nothing else
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
include 'mcmod.info'
|
include 'mcmod.info'
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
@@ -312,6 +313,11 @@
|
@@ -312,6 +313,11 @@
|
||||||
this.func_73731_b(fontrenderer, s, k - fontrenderer.func_78256_a(s) - 2, 2, 14737632);
|
this.func_73731_b(fontrenderer, s, k - fontrenderer.func_78256_a(s) - 2, 2, 14737632);
|
||||||
s = "Allocated memory: " + k5 * 100L / i5 + "% (" + k5 / 1024L / 1024L + "MB)";
|
s = "Allocated memory: " + j5 * 100L / i5 + "% (" + j5 / 1024L / 1024L + "MB)";
|
||||||
this.func_73731_b(fontrenderer, s, k - fontrenderer.func_78256_a(s) - 2, 12, 14737632);
|
this.func_73731_b(fontrenderer, s, k - fontrenderer.func_78256_a(s) - 2, 12, 14737632);
|
||||||
+ int offset = 22;
|
+ int offset = 22;
|
||||||
+ for (String brd : FMLCommonHandler.instance().getBrandings(false))
|
+ for (String brd : FMLCommonHandler.instance().getBrandings(false))
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import io.netty.bootstrap.Bootstrap;
|
import io.netty.bootstrap.Bootstrap;
|
||||||
@@ -148,6 +149,7 @@
|
@@ -147,6 +148,7 @@
|
||||||
p_147224_1_.func_147407_a((String)null);
|
p_147224_1_.func_147407_a((String)null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public int func_82145_z()
|
public int func_82145_z()
|
||||||
@@ -1986,6 +1991,11 @@
|
@@ -2032,6 +2037,11 @@
|
||||||
return uuid;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
+ public void openGui(Object mod, int modGuiId, World world, int x, int y, int z)
|
+ public void openGui(Object mod, int modGuiId, World world, int x, int y, int z)
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
@@ -385,6 +389,7 @@
|
@@ -381,6 +385,7 @@
|
||||||
{
|
{
|
||||||
if (this.func_71197_b())
|
if (this.func_71197_b())
|
||||||
{
|
{
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
long i = func_130071_aq();
|
long i = func_130071_aq();
|
||||||
long l = 0L;
|
long l = 0L;
|
||||||
this.field_147147_p.func_151315_a(new ChatComponentText(this.field_71286_C));
|
this.field_147147_p.func_151315_a(new ChatComponentText(this.field_71286_C));
|
||||||
@@ -429,6 +434,7 @@
|
@@ -425,6 +430,7 @@
|
||||||
Thread.sleep(1L);
|
Thread.sleep(1L);
|
||||||
this.field_71296_Q = true;
|
this.field_71296_Q = true;
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -466,7 +472,10 @@
|
@@ -462,7 +468,10 @@
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
this.field_71316_v = true;
|
this.field_71316_v = true;
|
||||||
}
|
}
|
||||||
catch (Throwable throwable)
|
catch (Throwable throwable)
|
||||||
@@ -475,6 +484,8 @@
|
@@ -471,6 +480,8 @@
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
this.func_71240_o();
|
this.func_71240_o();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -517,6 +528,7 @@
|
@@ -513,6 +524,7 @@
|
||||||
{
|
{
|
||||||
long i = System.nanoTime();
|
long i = System.nanoTime();
|
||||||
AxisAlignedBB.func_72332_a().func_72298_a();
|
AxisAlignedBB.func_72332_a().func_72298_a();
|
||||||
|
@ -55,7 +55,7 @@
|
||||||
++this.field_71315_w;
|
++this.field_71315_w;
|
||||||
|
|
||||||
if (this.field_71295_T)
|
if (this.field_71295_T)
|
||||||
@@ -570,6 +582,7 @@
|
@@ -566,6 +578,7 @@
|
||||||
|
|
||||||
this.field_71304_b.func_76319_b();
|
this.field_71304_b.func_76319_b();
|
||||||
this.field_71304_b.func_76319_b();
|
this.field_71304_b.func_76319_b();
|
||||||
|
@ -63,7 +63,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void func_71190_q()
|
public void func_71190_q()
|
||||||
@@ -597,6 +610,7 @@
|
@@ -593,6 +606,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
this.field_71304_b.func_76320_a("tick");
|
this.field_71304_b.func_76320_a("tick");
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
CrashReport crashreport;
|
CrashReport crashreport;
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -621,6 +635,7 @@
|
@@ -617,6 +631,7 @@
|
||||||
throw new ReportedException(crashreport);
|
throw new ReportedException(crashreport);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@
|
||||||
this.field_71304_b.func_76319_b();
|
this.field_71304_b.func_76319_b();
|
||||||
this.field_71304_b.func_76320_a("tracker");
|
this.field_71304_b.func_76320_a("tracker");
|
||||||
worldserver.func_73039_n().func_72788_a();
|
worldserver.func_73039_n().func_72788_a();
|
||||||
@@ -699,7 +714,7 @@
|
@@ -695,7 +710,7 @@
|
||||||
|
|
||||||
public String getServerModName()
|
public String getServerModName()
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public MinecraftServerGui(DedicatedServer p_i2362_1_)
|
public MinecraftServerGui(DedicatedServer p_i2362_1_)
|
||||||
@@ -165,8 +167,15 @@
|
@@ -164,8 +166,15 @@
|
||||||
return jpanel;
|
return jpanel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -175,7 +175,7 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||||
this.resourcePackList = resourcePackList;
|
this.resourcePackList = resourcePackList;
|
||||||
this.resourceManager = resourceManager;
|
this.resourceManager = resourceManager;
|
||||||
this.resourcePackMap = Maps.newHashMap();
|
this.resourcePackMap = Maps.newHashMap();
|
||||||
if (minecraft.func_71355_q())
|
if (minecraft.isDemo())
|
||||||
{
|
{
|
||||||
FMLLog.severe("DEMO MODE DETECTED, FML will not work. Finishing now.");
|
FMLLog.severe("DEMO MODE DETECTED, FML will not work. Finishing now.");
|
||||||
haltGame("FML will not run in demo mode", new RuntimeException());
|
haltGame("FML will not run in demo mode", new RuntimeException());
|
||||||
|
@ -247,7 +247,7 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||||
@Override
|
@Override
|
||||||
public void haltGame(String message, Throwable t)
|
public void haltGame(String message, Throwable t)
|
||||||
{
|
{
|
||||||
client.func_71377_b(new CrashReport(message, t));
|
client.displayCrashReport(new CrashReport(message, t));
|
||||||
throw Throwables.propagate(t);
|
throw Throwables.propagate(t);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -279,8 +279,8 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reload resources
|
// Reload resources
|
||||||
client.func_110436_a();
|
client.refreshResources();
|
||||||
RenderingRegistry.instance().loadEntityRenderers((Map<Class<? extends Entity>, Render>)RenderManager.field_78727_a.field_78729_o);
|
RenderingRegistry.instance().loadEntityRenderers((Map<Class<? extends Entity>, Render>)RenderManager.instance.entityRenderMap);
|
||||||
guiFactories = HashBiMap.create();
|
guiFactories = HashBiMap.create();
|
||||||
for (ModContainer mc : Loader.instance().getActiveModList())
|
for (ModContainer mc : Loader.instance().getActiveModList())
|
||||||
{
|
{
|
||||||
|
@ -302,7 +302,7 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
loading = false;
|
loading = false;
|
||||||
client.field_71474_y.func_74300_a(); //Reload options to load any mod added keybindings.
|
client.gameSettings.loadOptions(); //Reload options to load any mod added keybindings.
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
|
@ -380,8 +380,8 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||||
*/
|
*/
|
||||||
public void displayGuiScreen(EntityPlayer player, GuiScreen gui)
|
public void displayGuiScreen(EntityPlayer player, GuiScreen gui)
|
||||||
{
|
{
|
||||||
if (client.field_71439_g==player && gui != null) {
|
if (client.thePlayer==player && gui != null) {
|
||||||
client.func_147108_a(gui);
|
client.displayGuiScreen(gui);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -421,17 +421,17 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||||
public void showGuiScreen(Object clientGuiElement)
|
public void showGuiScreen(Object clientGuiElement)
|
||||||
{
|
{
|
||||||
GuiScreen gui = (GuiScreen) clientGuiElement;
|
GuiScreen gui = (GuiScreen) clientGuiElement;
|
||||||
client.func_147108_a(gui);
|
client.displayGuiScreen(gui);
|
||||||
}
|
}
|
||||||
|
|
||||||
public WorldClient getWorldClient()
|
public WorldClient getWorldClient()
|
||||||
{
|
{
|
||||||
return client.field_71441_e;
|
return client.theWorld;
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntityClientPlayerMP getClientPlayerEntity()
|
public EntityClientPlayerMP getClientPlayerEntity()
|
||||||
{
|
{
|
||||||
return client.field_71439_g;
|
return client.thePlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -450,7 +450,7 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||||
@Override
|
@Override
|
||||||
public MinecraftServer getServer()
|
public MinecraftServer getServer()
|
||||||
{
|
{
|
||||||
return client.func_71401_C();
|
return client.getIntegratedServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void displayMissingMods(Object modMissingPacket)
|
public void displayMissingMods(Object modMissingPacket)
|
||||||
|
@ -480,7 +480,7 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||||
*/
|
*/
|
||||||
public boolean isGUIOpen(Class<? extends GuiScreen> gui)
|
public boolean isGUIOpen(Class<? extends GuiScreen> gui)
|
||||||
{
|
{
|
||||||
return client.field_71462_r != null && client.field_71462_r.getClass().equals(gui);
|
return client.currentScreen != null && client.currentScreen.getClass().equals(gui);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -513,7 +513,7 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||||
@Override
|
@Override
|
||||||
public void updateResourcePackList()
|
public void updateResourcePackList()
|
||||||
{
|
{
|
||||||
client.func_110436_a();
|
client.refreshResources();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IResourcePack getResourcePackFor(String modId)
|
public IResourcePack getResourcePackFor(String modId)
|
||||||
|
@ -524,7 +524,7 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||||
@Override
|
@Override
|
||||||
public String getCurrentLanguage()
|
public String getCurrentLanguage()
|
||||||
{
|
{
|
||||||
return client.func_135016_M().func_135041_c().func_135034_a();
|
return client.getLanguageManager().getCurrentLanguage().getLanguageCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -533,7 +533,7 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||||
// If the server crashes during startup, it might hang the client- reset the client so it can abend properly.
|
// If the server crashes during startup, it might hang the client- reset the client so it can abend properly.
|
||||||
MinecraftServer server = getServer();
|
MinecraftServer server = getServer();
|
||||||
|
|
||||||
if (server != null && !server.func_71200_ad())
|
if (server != null && !server.serverIsInRunLoop())
|
||||||
{
|
{
|
||||||
ObfuscationReflectionHelper.setPrivateValue(MinecraftServer.class, server, true, "field_71296"+"_Q","serverIs"+"Running");
|
ObfuscationReflectionHelper.setPrivateValue(MinecraftServer.class, server, true, "field_71296"+"_Q","serverIs"+"Running");
|
||||||
}
|
}
|
||||||
|
@ -547,14 +547,14 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||||
@Override
|
@Override
|
||||||
public NetworkManager getClientToServerNetworkManager()
|
public NetworkManager getClientToServerNetworkManager()
|
||||||
{
|
{
|
||||||
return this.client.func_147114_u()!=null ? this.client.func_147114_u().func_147298_b() : null;
|
return this.client.getNetHandler()!=null ? this.client.getNetHandler().getNetworkManager() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleClientWorldClosing(WorldClient world)
|
public void handleClientWorldClosing(WorldClient world)
|
||||||
{
|
{
|
||||||
NetworkManager client = getClientToServerNetworkManager();
|
NetworkManager client = getClientToServerNetworkManager();
|
||||||
// ONLY revert a non-local connection
|
// ONLY revert a non-local connection
|
||||||
if (client != null && !client.func_150731_c())
|
if (client != null && !client.isLocalChannel())
|
||||||
{
|
{
|
||||||
GameData.revertToFrozen();
|
GameData.revertToFrozen();
|
||||||
}
|
}
|
||||||
|
@ -567,7 +567,7 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||||
|
|
||||||
public File getSavesDir()
|
public File getSavesDir()
|
||||||
{
|
{
|
||||||
return new File(client.field_71412_D, "saves");
|
return new File(client.mcDataDir, "saves");
|
||||||
}
|
}
|
||||||
public void tryLoadExistingWorld(GuiSelectWorld selectWorldGUI, String dirName, String saveName)
|
public void tryLoadExistingWorld(GuiSelectWorld selectWorldGUI, String dirName, String saveName)
|
||||||
{
|
{
|
||||||
|
@ -575,13 +575,13 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||||
NBTTagCompound leveldat;
|
NBTTagCompound leveldat;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
leveldat = CompressedStreamTools.func_74796_a(new FileInputStream(new File(dir, "level.dat")));
|
leveldat = CompressedStreamTools.readCompressed(new FileInputStream(new File(dir, "level.dat")));
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
leveldat = CompressedStreamTools.func_74796_a(new FileInputStream(new File(dir, "level.dat_old")));
|
leveldat = CompressedStreamTools.readCompressed(new FileInputStream(new File(dir, "level.dat_old")));
|
||||||
}
|
}
|
||||||
catch (Exception e1)
|
catch (Exception e1)
|
||||||
{
|
{
|
||||||
|
@ -589,8 +589,8 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NBTTagCompound fmlData = leveldat.func_74775_l("FML");
|
NBTTagCompound fmlData = leveldat.getCompoundTag("FML");
|
||||||
if (fmlData.func_74764_b("ModItemData"))
|
if (fmlData.hasKey("ModItemData"))
|
||||||
{
|
{
|
||||||
showGuiScreen(new GuiOldSaveLoadConfirm(dirName, saveName, selectWorldGUI));
|
showGuiScreen(new GuiOldSaveLoadConfirm(dirName, saveName, selectWorldGUI));
|
||||||
}
|
}
|
||||||
|
@ -614,7 +614,7 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||||
Thread.interrupted();
|
Thread.interrupted();
|
||||||
gameReleaseLatch = new CountDownLatch(1);
|
gameReleaseLatch = new CountDownLatch(1);
|
||||||
clientWaiter = Thread.currentThread();
|
clientWaiter = Thread.currentThread();
|
||||||
client.func_71371_a(dirName, saveName, (WorldSettings)null);
|
client.launchIntegratedServer(dirName, saveName, (WorldSettings)null);
|
||||||
System.out.printf("POKEE %b\n", Thread.currentThread().isInterrupted());
|
System.out.printf("POKEE %b\n", Thread.currentThread().isInterrupted());
|
||||||
gameReleaseLatch.await();
|
gameReleaseLatch.await();
|
||||||
}
|
}
|
||||||
|
@ -626,7 +626,7 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||||
}
|
}
|
||||||
catch (GameRegistryException gre)
|
catch (GameRegistryException gre)
|
||||||
{
|
{
|
||||||
client.func_71403_a(null);
|
client.loadWorld(null);
|
||||||
showGuiScreen(new GuiModItemsMissing(gre.getItems()));
|
showGuiScreen(new GuiModItemsMissing(gre.getItems()));
|
||||||
}
|
}
|
||||||
Thread.interrupted();
|
Thread.interrupted();
|
||||||
|
@ -676,7 +676,7 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
String serverDescription = data.field_78843_d;
|
String serverDescription = data.serverMOTD;
|
||||||
boolean moddedClientAllowed = true;
|
boolean moddedClientAllowed = true;
|
||||||
if (!Strings.isNullOrEmpty(serverDescription))
|
if (!Strings.isNullOrEmpty(serverDescription))
|
||||||
{
|
{
|
||||||
|
@ -729,7 +729,7 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
this.client.func_110434_K().func_110577_a(iconSheet);
|
this.client.getTextureManager().bindTexture(iconSheet);
|
||||||
Gui.func_146110_a(x + width - 18, y + 10, 0, (float)idx, 16, 16, 256.0f, 256.0f);
|
Gui.func_146110_a(x + width - 18, y + 10, 0, (float)idx, 16, 16, 256.0f, 256.0f);
|
||||||
if (blocked)
|
if (blocked)
|
||||||
{
|
{
|
||||||
|
@ -874,7 +874,7 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||||
|
|
||||||
public boolean handlingCrash(CrashReport report)
|
public boolean handlingCrash(CrashReport report)
|
||||||
{
|
{
|
||||||
return report.func_71505_b() instanceof GameRegistryException;
|
return report.getCrashCause() instanceof GameRegistryException;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -20,26 +20,26 @@ public class FMLConfigGuiFactory implements IModGuiFactory {
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public void func_73866_w_()
|
public void initGui()
|
||||||
{
|
{
|
||||||
this.field_146292_n.add(new GuiButton(1, this.field_146294_l / 2 - 75, this.field_146295_m - 38, I18n.func_135052_a("gui.done")));
|
this.buttonList.add(new GuiButton(1, this.width / 2 - 75, this.height - 38, I18n.format("gui.done")));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void func_146284_a(GuiButton p_73875_1_)
|
protected void actionPerformed(GuiButton p_73875_1_)
|
||||||
{
|
{
|
||||||
if (p_73875_1_.field_146124_l && p_73875_1_.field_146127_k == 1)
|
if (p_73875_1_.enabled && p_73875_1_.id == 1)
|
||||||
{
|
{
|
||||||
FMLClientHandler.instance().showGuiScreen(parent);
|
FMLClientHandler.instance().showGuiScreen(parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
||||||
{
|
{
|
||||||
this.func_146276_q_();
|
this.drawDefaultBackground();
|
||||||
this.func_73732_a(this.field_146289_q, "Forge Mod Loader test config screen", this.field_146294_l / 2, 40, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, "Forge Mod Loader test config screen", this.width / 2, 40, 0xFFFFFF);
|
||||||
super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_);
|
super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,16 +26,16 @@ public class FMLFileResourcePack extends FileResourcePack {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String func_130077_b()
|
public String getPackName()
|
||||||
{
|
{
|
||||||
return "FMLFileResourcePack:"+container.getName();
|
return "FMLFileResourcePack:"+container.getName();
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected InputStream func_110591_a(String resourceName) throws IOException
|
protected InputStream getInputStreamByName(String resourceName) throws IOException
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return super.func_110591_a(resourceName);
|
return super.getInputStreamByName(resourceName);
|
||||||
}
|
}
|
||||||
catch (IOException ioe)
|
catch (IOException ioe)
|
||||||
{
|
{
|
||||||
|
@ -54,8 +54,8 @@ public class FMLFileResourcePack extends FileResourcePack {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BufferedImage func_110586_a() throws IOException
|
public BufferedImage getPackImage() throws IOException
|
||||||
{
|
{
|
||||||
return ImageIO.read(func_110591_a(container.getMetadata().logoFile));
|
return ImageIO.read(getInputStreamByName(container.getMetadata().logoFile));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,21 +26,21 @@ public class FMLFolderResourcePack extends FolderResourcePack {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean func_110593_b(String p_110593_1_)
|
protected boolean hasResourceName(String p_110593_1_)
|
||||||
{
|
{
|
||||||
return super.func_110593_b(p_110593_1_);
|
return super.hasResourceName(p_110593_1_);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public String func_130077_b()
|
public String getPackName()
|
||||||
{
|
{
|
||||||
return "FMLFileResourcePack:"+container.getName();
|
return "FMLFileResourcePack:"+container.getName();
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected InputStream func_110591_a(String resourceName) throws IOException
|
protected InputStream getInputStreamByName(String resourceName) throws IOException
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return super.func_110591_a(resourceName);
|
return super.getInputStreamByName(resourceName);
|
||||||
}
|
}
|
||||||
catch (IOException ioe)
|
catch (IOException ioe)
|
||||||
{
|
{
|
||||||
|
@ -59,9 +59,9 @@ public class FMLFolderResourcePack extends FolderResourcePack {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BufferedImage func_110586_a() throws IOException
|
public BufferedImage getPackImage() throws IOException
|
||||||
{
|
{
|
||||||
return ImageIO.read(func_110591_a(container.getMetadata().logoFile));
|
return ImageIO.read(getInputStreamByName(container.getMetadata().logoFile));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,27 +29,27 @@ public class GuiAccessDenied extends GuiScreen
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public void func_73866_w_()
|
public void initGui()
|
||||||
{
|
{
|
||||||
this.field_146292_n.add(new GuiButton(1, this.field_146294_l / 2 - 75, this.field_146295_m - 38, I18n.func_135052_a("gui.done")));
|
this.buttonList.add(new GuiButton(1, this.width / 2 - 75, this.height - 38, I18n.format("gui.done")));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void func_146284_a(GuiButton p_73875_1_)
|
protected void actionPerformed(GuiButton p_73875_1_)
|
||||||
{
|
{
|
||||||
if (p_73875_1_.field_146124_l && p_73875_1_.field_146127_k == 1)
|
if (p_73875_1_.enabled && p_73875_1_.id == 1)
|
||||||
{
|
{
|
||||||
FMLClientHandler.instance().showGuiScreen(parent);
|
FMLClientHandler.instance().showGuiScreen(parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
||||||
{
|
{
|
||||||
this.func_146276_q_();
|
this.drawDefaultBackground();
|
||||||
int offset = Math.max(85 - 2 * 10, 10);
|
int offset = Math.max(85 - 2 * 10, 10);
|
||||||
this.func_73732_a(this.field_146289_q, "Forge Mod Loader could not connect to this server", this.field_146294_l / 2, offset, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, "Forge Mod Loader could not connect to this server", this.width / 2, offset, 0xFFFFFF);
|
||||||
offset += 10;
|
offset += 10;
|
||||||
this.func_73732_a(this.field_146289_q, String.format("The server %s has forbidden modded access", data.field_78847_a), this.field_146294_l / 2, offset, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, String.format("The server %s has forbidden modded access", data.serverName), this.width / 2, offset, 0xFFFFFF);
|
||||||
super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_);
|
super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,27 +29,27 @@ public class GuiBackupFailed extends GuiScreen
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public void func_73866_w_()
|
public void initGui()
|
||||||
{
|
{
|
||||||
this.field_146292_n.add(new GuiButton(1, this.field_146294_l / 2 - 75, this.field_146295_m - 38, I18n.func_135052_a("gui.done")));
|
this.buttonList.add(new GuiButton(1, this.width / 2 - 75, this.height - 38, I18n.format("gui.done")));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void func_146284_a(GuiButton p_73875_1_)
|
protected void actionPerformed(GuiButton p_73875_1_)
|
||||||
{
|
{
|
||||||
if (p_73875_1_.field_146124_l && p_73875_1_.field_146127_k == 1)
|
if (p_73875_1_.enabled && p_73875_1_.id == 1)
|
||||||
{
|
{
|
||||||
FMLClientHandler.instance().showGuiScreen(parent);
|
FMLClientHandler.instance().showGuiScreen(parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
||||||
{
|
{
|
||||||
this.func_146276_q_();
|
this.drawDefaultBackground();
|
||||||
int offset = Math.max(85 - 2 * 10, 10);
|
int offset = Math.max(85 - 2 * 10, 10);
|
||||||
this.func_73732_a(this.field_146289_q, String.format("There was an error saving the archive %s", zipName.getName()), this.field_146294_l / 2, offset, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, String.format("There was an error saving the archive %s", zipName.getName()), this.width / 2, offset, 0xFFFFFF);
|
||||||
offset += 10;
|
offset += 10;
|
||||||
this.func_73732_a(this.field_146289_q, String.format("Please fix the problem and try again"), this.field_146294_l / 2, offset, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, String.format("Please fix the problem and try again"), this.width / 2, offset, 0xFFFFFF);
|
||||||
super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_);
|
super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,15 +23,15 @@ public class GuiCustomModLoadingErrorScreen extends GuiErrorScreen
|
||||||
this.customException = customException;
|
this.customException = customException;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void func_73866_w_()
|
public void initGui()
|
||||||
{
|
{
|
||||||
super.func_73866_w_();
|
super.initGui();
|
||||||
this.customException.initGui(this, field_146289_q);
|
this.customException.initGui(this, fontRendererObj);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
||||||
{
|
{
|
||||||
this.func_146276_q_();
|
this.drawDefaultBackground();
|
||||||
this.customException.drawScreen(this, field_146289_q, p_73863_1_, p_73863_2_, p_73863_3_);
|
this.customException.drawScreen(this, fontRendererObj, p_73863_1_, p_73863_2_, p_73863_3_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,25 +31,25 @@ public class GuiDupesFound extends GuiErrorScreen
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void func_73866_w_()
|
public void initGui()
|
||||||
{
|
{
|
||||||
super.func_73866_w_();
|
super.initGui();
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
||||||
{
|
{
|
||||||
this.func_146276_q_();
|
this.drawDefaultBackground();
|
||||||
int offset = Math.max(85 - dupes.dupes.size() * 10, 10);
|
int offset = Math.max(85 - dupes.dupes.size() * 10, 10);
|
||||||
this.func_73732_a(this.field_146289_q, "Forge Mod Loader has found a problem with your minecraft installation", this.field_146294_l / 2, offset, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, "Forge Mod Loader has found a problem with your minecraft installation", this.width / 2, offset, 0xFFFFFF);
|
||||||
offset+=10;
|
offset+=10;
|
||||||
this.func_73732_a(this.field_146289_q, "You have mod sources that are duplicate within your system", this.field_146294_l / 2, offset, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, "You have mod sources that are duplicate within your system", this.width / 2, offset, 0xFFFFFF);
|
||||||
offset+=10;
|
offset+=10;
|
||||||
this.func_73732_a(this.field_146289_q, "Mod Id : File name", this.field_146294_l / 2, offset, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, "Mod Id : File name", this.width / 2, offset, 0xFFFFFF);
|
||||||
offset+=5;
|
offset+=5;
|
||||||
for (Entry<ModContainer, File> mc : dupes.dupes.entries())
|
for (Entry<ModContainer, File> mc : dupes.dupes.entries())
|
||||||
{
|
{
|
||||||
offset+=10;
|
offset+=10;
|
||||||
this.func_73732_a(this.field_146289_q, String.format("%s : %s", mc.getKey().getModId(), mc.getValue().getName()), this.field_146294_l / 2, offset, 0xEEEEEE);
|
this.drawCenteredString(this.fontRendererObj, String.format("%s : %s", mc.getKey().getModId(), mc.getValue().getName()), this.width / 2, offset, 0xEEEEEE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,38 +18,38 @@ public class GuiIngameModOptions extends GuiScreen
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public void func_73866_w_()
|
public void initGui()
|
||||||
{
|
{
|
||||||
this.optionList=new GuiModOptionList(this);
|
this.optionList=new GuiModOptionList(this);
|
||||||
this.optionList.registerScrollButtons(this.field_146292_n, 7, 8);
|
this.optionList.registerScrollButtons(this.buttonList, 7, 8);
|
||||||
this.field_146292_n.add(new GuiButton(200, this.field_146294_l / 2 - 100, this.field_146295_m / 6 + 168, I18n.func_135052_a("gui.done", new Object[0])));
|
this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.format("gui.done", new Object[0])));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void func_146284_a(GuiButton p_146284_1_)
|
protected void actionPerformed(GuiButton p_146284_1_)
|
||||||
{
|
{
|
||||||
if (p_146284_1_.field_146124_l)
|
if (p_146284_1_.enabled)
|
||||||
{
|
{
|
||||||
if (p_146284_1_.field_146127_k == 200)
|
if (p_146284_1_.id == 200)
|
||||||
{
|
{
|
||||||
this.field_146297_k.field_71474_y.func_74303_b();
|
this.mc.gameSettings.saveOptions();
|
||||||
this.field_146297_k.func_147108_a(this.parentScreen);
|
this.mc.displayGuiScreen(this.parentScreen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
||||||
{
|
{
|
||||||
// force a non-transparent background
|
// force a non-transparent background
|
||||||
this.func_146276_q_();
|
this.drawDefaultBackground();
|
||||||
this.optionList.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
|
this.optionList.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
|
||||||
this.func_73732_a(this.field_146289_q, this.title, this.field_146294_l / 2, 15, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, this.title, this.width / 2, 15, 0xFFFFFF);
|
||||||
super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_);
|
super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
|
||||||
}
|
}
|
||||||
|
|
||||||
FontRenderer getFontRenderer() {
|
FontRenderer getFontRenderer() {
|
||||||
return field_146289_q;
|
return fontRendererObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,36 +30,36 @@ public class GuiModItemsMissing extends GuiScreen
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public void func_73866_w_()
|
public void initGui()
|
||||||
{
|
{
|
||||||
this.field_146292_n.add(new GuiButton(1, this.field_146294_l / 2 - 100, this.field_146295_m - 38, I18n.func_135052_a("gui.done")));
|
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height - 38, I18n.format("gui.done")));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void func_146284_a(GuiButton p_73875_1_)
|
protected void actionPerformed(GuiButton p_73875_1_)
|
||||||
{
|
{
|
||||||
if (p_73875_1_.field_146124_l && p_73875_1_.field_146127_k == 1)
|
if (p_73875_1_.enabled && p_73875_1_.id == 1)
|
||||||
{
|
{
|
||||||
FMLClientHandler.instance().showGuiScreen(null);
|
FMLClientHandler.instance().showGuiScreen(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
||||||
{
|
{
|
||||||
this.func_146276_q_();
|
this.drawDefaultBackground();
|
||||||
|
|
||||||
int spaceAvailable = this.field_146295_m - 38 - 20;
|
int spaceAvailable = this.height - 38 - 20;
|
||||||
int spaceRequired = Math.min(spaceAvailable, 10 + 6 * 10 + missingItems.size());
|
int spaceRequired = Math.min(spaceAvailable, 10 + 6 * 10 + missingItems.size());
|
||||||
|
|
||||||
int offset = 10 + (spaceAvailable - spaceRequired) / 2; // vertically centered
|
int offset = 10 + (spaceAvailable - spaceRequired) / 2; // vertically centered
|
||||||
this.func_73732_a(this.field_146289_q, "Forge Mod Loader could load this save", this.field_146294_l / 2, offset, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, "Forge Mod Loader could load this save", this.width / 2, offset, 0xFFFFFF);
|
||||||
offset += 20;
|
offset += 20;
|
||||||
this.func_73732_a(this.field_146289_q, String.format("There are %d unassigned blocks and items in this save", missingItems.size()), this.field_146294_l / 2, offset, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, String.format("There are %d unassigned blocks and items in this save", missingItems.size()), this.width / 2, offset, 0xFFFFFF);
|
||||||
offset += 10;
|
offset += 10;
|
||||||
this.func_73732_a(this.field_146289_q, "You will not be able to load until they are present again", this.field_146294_l / 2, offset, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, "You will not be able to load until they are present again", this.width / 2, offset, 0xFFFFFF);
|
||||||
offset += 20;
|
offset += 20;
|
||||||
|
|
||||||
this.func_73732_a(this.field_146289_q, "Missing Blocks/Items:", this.field_146294_l / 2, offset, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, "Missing Blocks/Items:", this.width / 2, offset, 0xFFFFFF);
|
||||||
offset += 10;
|
offset += 10;
|
||||||
|
|
||||||
Iterator<String> it = missingItems.iterator();
|
Iterator<String> it = missingItems.iterator();
|
||||||
|
@ -68,7 +68,7 @@ public class GuiModItemsMissing extends GuiScreen
|
||||||
{
|
{
|
||||||
String item = it.next();
|
String item = it.next();
|
||||||
|
|
||||||
this.func_73732_a(this.field_146289_q, item, this.field_146294_l / 2, offset, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, item, this.width / 2, offset, 0xFFFFFF);
|
||||||
offset += 10;
|
offset += 10;
|
||||||
|
|
||||||
if (offset >= spaceAvailable) break;
|
if (offset >= spaceAvailable) break;
|
||||||
|
@ -76,9 +76,9 @@ public class GuiModItemsMissing extends GuiScreen
|
||||||
|
|
||||||
if (it.hasNext())
|
if (it.hasNext())
|
||||||
{
|
{
|
||||||
this.func_73732_a(this.field_146289_q, "...", this.field_146294_l / 2, offset, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, "...", this.width / 2, offset, 0xFFFFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_);
|
super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,37 +89,37 @@ public class GuiModList extends GuiScreen
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public void func_73866_w_()
|
public void initGui()
|
||||||
{
|
{
|
||||||
for (ModContainer mod : mods) {
|
for (ModContainer mod : mods) {
|
||||||
listWidth=Math.max(listWidth,getFontRenderer().func_78256_a(mod.getName()) + 10);
|
listWidth=Math.max(listWidth,getFontRenderer().getStringWidth(mod.getName()) + 10);
|
||||||
listWidth=Math.max(listWidth,getFontRenderer().func_78256_a(mod.getVersion()) + 10);
|
listWidth=Math.max(listWidth,getFontRenderer().getStringWidth(mod.getVersion()) + 10);
|
||||||
}
|
}
|
||||||
listWidth=Math.min(listWidth, 150);
|
listWidth=Math.min(listWidth, 150);
|
||||||
this.field_146292_n.add(new GuiButton(6, this.field_146294_l / 2 - 75, this.field_146295_m - 38, I18n.func_135052_a("gui.done")));
|
this.buttonList.add(new GuiButton(6, this.width / 2 - 75, this.height - 38, I18n.format("gui.done")));
|
||||||
configModButton = new GuiButton(20, 10, this.field_146295_m - 60, this.listWidth, 20, "Config");
|
configModButton = new GuiButton(20, 10, this.height - 60, this.listWidth, 20, "Config");
|
||||||
disableModButton = new GuiButton(21, 10, this.field_146295_m - 38, this.listWidth, 20, "Disable");
|
disableModButton = new GuiButton(21, 10, this.height - 38, this.listWidth, 20, "Disable");
|
||||||
this.field_146292_n.add(configModButton);
|
this.buttonList.add(configModButton);
|
||||||
this.field_146292_n.add(disableModButton);
|
this.buttonList.add(disableModButton);
|
||||||
this.modList=new GuiSlotModList(this, mods, listWidth);
|
this.modList=new GuiSlotModList(this, mods, listWidth);
|
||||||
this.modList.registerScrollButtons(this.field_146292_n, 7, 8);
|
this.modList.registerScrollButtons(this.buttonList, 7, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void func_146284_a(GuiButton button) {
|
protected void actionPerformed(GuiButton button) {
|
||||||
if (button.field_146124_l)
|
if (button.enabled)
|
||||||
{
|
{
|
||||||
switch (button.field_146127_k)
|
switch (button.id)
|
||||||
{
|
{
|
||||||
case 6:
|
case 6:
|
||||||
this.field_146297_k.func_147108_a(this.mainMenu);
|
this.mc.displayGuiScreen(this.mainMenu);
|
||||||
return;
|
return;
|
||||||
case 20:
|
case 20:
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IModGuiFactory guiFactory = FMLClientHandler.instance().getGuiFactoryFor(selectedMod);
|
IModGuiFactory guiFactory = FMLClientHandler.instance().getGuiFactoryFor(selectedMod);
|
||||||
GuiScreen newScreen = guiFactory.mainConfigGuiClass().getConstructor(GuiScreen.class).newInstance(this);
|
GuiScreen newScreen = guiFactory.mainConfigGuiClass().getConstructor(GuiScreen.class).newInstance(this);
|
||||||
this.field_146297_k.func_147108_a(newScreen);
|
this.mc.displayGuiScreen(newScreen);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -128,34 +128,34 @@ public class GuiModList extends GuiScreen
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
super.func_146284_a(button);
|
super.actionPerformed(button);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int drawLine(String line, int offset, int shifty)
|
public int drawLine(String line, int offset, int shifty)
|
||||||
{
|
{
|
||||||
this.field_146289_q.func_78276_b(line, offset, shifty, 0xd7edea);
|
this.fontRendererObj.drawString(line, offset, shifty, 0xd7edea);
|
||||||
return shifty + 10;
|
return shifty + 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void func_73863_a(int p_571_1_, int p_571_2_, float p_571_3_)
|
public void drawScreen(int p_571_1_, int p_571_2_, float p_571_3_)
|
||||||
{
|
{
|
||||||
this.modList.drawScreen(p_571_1_, p_571_2_, p_571_3_);
|
this.modList.drawScreen(p_571_1_, p_571_2_, p_571_3_);
|
||||||
this.func_73732_a(this.field_146289_q, "Mod List", this.field_146294_l / 2, 16, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, "Mod List", this.width / 2, 16, 0xFFFFFF);
|
||||||
int offset = this.listWidth + 20;
|
int offset = this.listWidth + 20;
|
||||||
if (selectedMod != null) {
|
if (selectedMod != null) {
|
||||||
GL11.glEnable(GL11.GL_BLEND);
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
if (!selectedMod.getMetadata().autogenerated) {
|
if (!selectedMod.getMetadata().autogenerated) {
|
||||||
configModButton.field_146125_m = true;
|
configModButton.visible = true;
|
||||||
disableModButton.field_146125_m = true;
|
disableModButton.visible = true;
|
||||||
disableModButton.packedFGColour = 0xFF3377;
|
disableModButton.packedFGColour = 0xFF3377;
|
||||||
configModButton.field_146124_l = false;
|
configModButton.enabled = false;
|
||||||
int shifty = 35;
|
int shifty = 35;
|
||||||
String logoFile = selectedMod.getMetadata().logoFile;
|
String logoFile = selectedMod.getMetadata().logoFile;
|
||||||
if (!logoFile.isEmpty())
|
if (!logoFile.isEmpty())
|
||||||
{
|
{
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
TextureManager tm = field_146297_k.func_110434_K();
|
TextureManager tm = mc.getTextureManager();
|
||||||
IResourcePack pack = FMLClientHandler.instance().getResourcePackFor(selectedMod.getModId());
|
IResourcePack pack = FMLClientHandler.instance().getResourcePackFor(selectedMod.getModId());
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -164,7 +164,7 @@ public class GuiModList extends GuiScreen
|
||||||
BufferedImage logo = null;
|
BufferedImage logo = null;
|
||||||
if (pack!=null)
|
if (pack!=null)
|
||||||
{
|
{
|
||||||
logo = pack.func_110586_a();
|
logo = pack.getPackImage();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -176,13 +176,13 @@ public class GuiModList extends GuiScreen
|
||||||
}
|
}
|
||||||
if (logo != null)
|
if (logo != null)
|
||||||
{
|
{
|
||||||
cachedLogo = tm.func_110578_a("modlogo", new DynamicTexture(logo));
|
cachedLogo = tm.getDynamicTextureLocation("modlogo", new DynamicTexture(logo));
|
||||||
cachedLogoDimensions = new Dimension(logo.getWidth(), logo.getHeight());
|
cachedLogoDimensions = new Dimension(logo.getWidth(), logo.getHeight());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cachedLogo != null)
|
if (cachedLogo != null)
|
||||||
{
|
{
|
||||||
this.field_146297_k.field_71446_o.func_110577_a(cachedLogo);
|
this.mc.renderEngine.bindTexture(cachedLogo);
|
||||||
double scaleX = cachedLogoDimensions.width / 200.0;
|
double scaleX = cachedLogoDimensions.width / 200.0;
|
||||||
double scaleY = cachedLogoDimensions.height / 65.0;
|
double scaleY = cachedLogoDimensions.height / 65.0;
|
||||||
double scale = 1.0;
|
double scale = 1.0;
|
||||||
|
@ -193,13 +193,13 @@ public class GuiModList extends GuiScreen
|
||||||
cachedLogoDimensions.width *= scale;
|
cachedLogoDimensions.width *= scale;
|
||||||
cachedLogoDimensions.height *= scale;
|
cachedLogoDimensions.height *= scale;
|
||||||
int top = 32;
|
int top = 32;
|
||||||
Tessellator tess = Tessellator.field_78398_a;
|
Tessellator tess = Tessellator.instance;
|
||||||
tess.func_78382_b();
|
tess.startDrawingQuads();
|
||||||
tess.func_78374_a(offset, top + cachedLogoDimensions.height, field_73735_i, 0, 1);
|
tess.addVertexWithUV(offset, top + cachedLogoDimensions.height, zLevel, 0, 1);
|
||||||
tess.func_78374_a(offset + cachedLogoDimensions.width, top + cachedLogoDimensions.height, field_73735_i, 1, 1);
|
tess.addVertexWithUV(offset + cachedLogoDimensions.width, top + cachedLogoDimensions.height, zLevel, 1, 1);
|
||||||
tess.func_78374_a(offset + cachedLogoDimensions.width, top, field_73735_i, 1, 0);
|
tess.addVertexWithUV(offset + cachedLogoDimensions.width, top, zLevel, 1, 0);
|
||||||
tess.func_78374_a(offset, top, field_73735_i, 0, 0);
|
tess.addVertexWithUV(offset, top, zLevel, 0, 0);
|
||||||
tess.func_78381_a();
|
tess.draw();
|
||||||
|
|
||||||
shifty += 65;
|
shifty += 65;
|
||||||
}
|
}
|
||||||
|
@ -209,7 +209,7 @@ public class GuiModList extends GuiScreen
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.field_146289_q.func_78261_a(selectedMod.getMetadata().name, offset, shifty, 0xFFFFFF);
|
this.fontRendererObj.drawStringWithShadow(selectedMod.getMetadata().name, offset, shifty, 0xFFFFFF);
|
||||||
shifty += 12;
|
shifty += 12;
|
||||||
|
|
||||||
shifty = drawLine(String.format("Version: %s (%s)", selectedMod.getDisplayVersion(), selectedMod.getVersion()), offset, shifty);
|
shifty = drawLine(String.format("Version: %s (%s)", selectedMod.getDisplayVersion(), selectedMod.getVersion()), offset, shifty);
|
||||||
|
@ -220,67 +220,67 @@ public class GuiModList extends GuiScreen
|
||||||
shifty = drawLine(String.format("Authors: %s", selectedMod.getMetadata().getAuthorList()), offset, shifty);
|
shifty = drawLine(String.format("Authors: %s", selectedMod.getMetadata().getAuthorList()), offset, shifty);
|
||||||
shifty = drawLine(String.format("URL: %s", selectedMod.getMetadata().url), offset, shifty);
|
shifty = drawLine(String.format("URL: %s", selectedMod.getMetadata().url), offset, shifty);
|
||||||
shifty = drawLine(selectedMod.getMetadata().childMods.isEmpty() ? "No child mods for this mod" : String.format("Child mods: %s", selectedMod.getMetadata().getChildModList()), offset, shifty);
|
shifty = drawLine(selectedMod.getMetadata().childMods.isEmpty() ? "No child mods for this mod" : String.format("Child mods: %s", selectedMod.getMetadata().getChildModList()), offset, shifty);
|
||||||
int rightSide = this.field_146294_l - offset - 20;
|
int rightSide = this.width - offset - 20;
|
||||||
if (rightSide > 20)
|
if (rightSide > 20)
|
||||||
{
|
{
|
||||||
this.getFontRenderer().func_78279_b(selectedMod.getMetadata().description, offset, shifty + 10, rightSide, 0xDDDDDD);
|
this.getFontRenderer().drawSplitString(selectedMod.getMetadata().description, offset, shifty + 10, rightSide, 0xDDDDDD);
|
||||||
}
|
}
|
||||||
Disableable disableable = selectedMod.canBeDisabled();
|
Disableable disableable = selectedMod.canBeDisabled();
|
||||||
if (disableable == Disableable.RESTART)
|
if (disableable == Disableable.RESTART)
|
||||||
{
|
{
|
||||||
disableModButton.field_146124_l = true;
|
disableModButton.enabled = true;
|
||||||
disableModButton.field_146125_m = true;
|
disableModButton.visible = true;
|
||||||
disableModButton.packedFGColour = 0xFF3377;
|
disableModButton.packedFGColour = 0xFF3377;
|
||||||
}
|
}
|
||||||
else if (disableable == Disableable.YES)
|
else if (disableable == Disableable.YES)
|
||||||
{
|
{
|
||||||
disableModButton.field_146124_l = true;
|
disableModButton.enabled = true;
|
||||||
disableModButton.field_146125_m = true;
|
disableModButton.visible = true;
|
||||||
disableModButton.packedFGColour = 0;
|
disableModButton.packedFGColour = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
disableModButton.packedFGColour = 0;
|
disableModButton.packedFGColour = 0;
|
||||||
disableModButton.field_146125_m = true;
|
disableModButton.visible = true;
|
||||||
disableModButton.field_146124_l = false;
|
disableModButton.enabled = false;
|
||||||
}
|
}
|
||||||
IModGuiFactory guiFactory = FMLClientHandler.instance().getGuiFactoryFor(selectedMod);
|
IModGuiFactory guiFactory = FMLClientHandler.instance().getGuiFactoryFor(selectedMod);
|
||||||
if (guiFactory == null || guiFactory.mainConfigGuiClass() == null)
|
if (guiFactory == null || guiFactory.mainConfigGuiClass() == null)
|
||||||
{
|
{
|
||||||
configModButton.field_146125_m = true;
|
configModButton.visible = true;
|
||||||
configModButton.field_146124_l = false;
|
configModButton.enabled = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
configModButton.field_146125_m = true;
|
configModButton.visible = true;
|
||||||
configModButton.field_146124_l = true;
|
configModButton.enabled = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
offset = ( this.listWidth + this.field_146294_l ) / 2;
|
offset = ( this.listWidth + this.width ) / 2;
|
||||||
this.func_73732_a(this.field_146289_q, selectedMod.getName(), offset, 35, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, selectedMod.getName(), offset, 35, 0xFFFFFF);
|
||||||
this.func_73732_a(this.field_146289_q, String.format("Version: %s",selectedMod.getVersion()), offset, 45, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, String.format("Version: %s",selectedMod.getVersion()), offset, 45, 0xFFFFFF);
|
||||||
this.func_73732_a(this.field_146289_q, String.format("Mod State: %s",Loader.instance().getModState(selectedMod)), offset, 55, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, String.format("Mod State: %s",Loader.instance().getModState(selectedMod)), offset, 55, 0xFFFFFF);
|
||||||
this.func_73732_a(this.field_146289_q, "No mod information found", offset, 65, 0xDDDDDD);
|
this.drawCenteredString(this.fontRendererObj, "No mod information found", offset, 65, 0xDDDDDD);
|
||||||
this.func_73732_a(this.field_146289_q, "Ask your mod author to provide a mod mcmod.info file", offset, 75, 0xDDDDDD);
|
this.drawCenteredString(this.fontRendererObj, "Ask your mod author to provide a mod mcmod.info file", offset, 75, 0xDDDDDD);
|
||||||
configModButton.field_146125_m = false;
|
configModButton.visible = false;
|
||||||
disableModButton.field_146125_m = false;
|
disableModButton.visible = false;
|
||||||
}
|
}
|
||||||
GL11.glDisable(GL11.GL_BLEND);
|
GL11.glDisable(GL11.GL_BLEND);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
configModButton.field_146125_m = false;
|
configModButton.visible = false;
|
||||||
disableModButton.field_146125_m = false;
|
disableModButton.visible = false;
|
||||||
}
|
}
|
||||||
super.func_73863_a(p_571_1_, p_571_2_, p_571_3_);
|
super.drawScreen(p_571_1_, p_571_2_, p_571_3_);
|
||||||
}
|
}
|
||||||
|
|
||||||
Minecraft getMinecraftInstance() {
|
Minecraft getMinecraftInstance() {
|
||||||
return field_146297_k;
|
return mc;
|
||||||
}
|
}
|
||||||
|
|
||||||
FontRenderer getFontRenderer() {
|
FontRenderer getFontRenderer() {
|
||||||
return field_146289_q;
|
return fontRendererObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -8,7 +8,7 @@ public class GuiModOptionList extends GuiScrollingList {
|
||||||
|
|
||||||
public GuiModOptionList(GuiIngameModOptions parent)
|
public GuiModOptionList(GuiIngameModOptions parent)
|
||||||
{
|
{
|
||||||
super(parent.field_146297_k, 150, parent.field_146295_m, 32, parent.field_146295_m - 65 + 4, 10, 35);
|
super(parent.mc, 150, parent.height, 32, parent.height - 65 + 4, 10, 35);
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,9 +39,9 @@ public class GuiModOptionList extends GuiScrollingList {
|
||||||
@Override
|
@Override
|
||||||
protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5)
|
protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5)
|
||||||
{
|
{
|
||||||
this.parent.getFontRenderer().func_78276_b(this.parent.getFontRenderer().func_78269_a("Test 1", listWidth - 10), this.left + 3 , var3 + 2, 0xFF2222);
|
this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth("Test 1", listWidth - 10), this.left + 3 , var3 + 2, 0xFF2222);
|
||||||
this.parent.getFontRenderer().func_78276_b(this.parent.getFontRenderer().func_78269_a("TEST 2", listWidth - 10), this.left + 3 , var3 + 12, 0xFF2222);
|
this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth("TEST 2", listWidth - 10), this.left + 3 , var3 + 12, 0xFF2222);
|
||||||
this.parent.getFontRenderer().func_78276_b(this.parent.getFontRenderer().func_78269_a("DISABLED", listWidth - 10), this.left + 3 , var3 + 22, 0xFF2222);
|
this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth("DISABLED", listWidth - 10), this.left + 3 , var3 + 22, 0xFF2222);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,18 +29,18 @@ public class GuiModsMissing extends GuiErrorScreen
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void func_73866_w_()
|
public void initGui()
|
||||||
{
|
{
|
||||||
super.func_73866_w_();
|
super.initGui();
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
||||||
{
|
{
|
||||||
this.func_146276_q_();
|
this.drawDefaultBackground();
|
||||||
int offset = Math.max(85 - modsMissing.missingMods.size() * 10, 10);
|
int offset = Math.max(85 - modsMissing.missingMods.size() * 10, 10);
|
||||||
this.func_73732_a(this.field_146289_q, "Forge Mod Loader has found a problem with your minecraft installation", this.field_146294_l / 2, offset, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, "Forge Mod Loader has found a problem with your minecraft installation", this.width / 2, offset, 0xFFFFFF);
|
||||||
offset+=10;
|
offset+=10;
|
||||||
this.func_73732_a(this.field_146289_q, "The mods and versions listed below could not be found", this.field_146294_l / 2, offset, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, "The mods and versions listed below could not be found", this.width / 2, offset, 0xFFFFFF);
|
||||||
offset+=5;
|
offset+=5;
|
||||||
for (ArtifactVersion v : modsMissing.missingMods)
|
for (ArtifactVersion v : modsMissing.missingMods)
|
||||||
{
|
{
|
||||||
|
@ -50,13 +50,13 @@ public class GuiModsMissing extends GuiErrorScreen
|
||||||
DefaultArtifactVersion dav = (DefaultArtifactVersion)v;
|
DefaultArtifactVersion dav = (DefaultArtifactVersion)v;
|
||||||
if (dav.getRange() != null && dav.getRange().isUnboundedAbove())
|
if (dav.getRange() != null && dav.getRange().isUnboundedAbove())
|
||||||
{
|
{
|
||||||
this.func_73732_a(this.field_146289_q, String.format("%s : minimum version required is %s", v.getLabel(), dav.getRange().getLowerBoundString()), this.field_146294_l / 2, offset, 0xEEEEEE);
|
this.drawCenteredString(this.fontRendererObj, String.format("%s : minimum version required is %s", v.getLabel(), dav.getRange().getLowerBoundString()), this.width / 2, offset, 0xEEEEEE);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.func_73732_a(this.field_146289_q, String.format("%s : %s", v.getLabel(), v.getRangeString()), this.field_146294_l / 2, offset, 0xEEEEEE);
|
this.drawCenteredString(this.fontRendererObj, String.format("%s : %s", v.getLabel(), v.getRangeString()), this.width / 2, offset, 0xEEEEEE);
|
||||||
}
|
}
|
||||||
offset+=20;
|
offset+=20;
|
||||||
this.func_73732_a(this.field_146289_q, "The file 'ForgeModLoader-client-0.log' contains more information", this.field_146294_l / 2, offset, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, "The file 'ForgeModLoader-client-0.log' contains more information", this.width / 2, offset, 0xFFFFFF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,35 +29,35 @@ public class GuiModsMissingForServer extends GuiScreen
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public void func_73866_w_()
|
public void initGui()
|
||||||
{
|
{
|
||||||
this.field_146292_n.add(new GuiButton(1, this.field_146294_l / 2 - 75, this.field_146295_m - 38, I18n.func_135052_a("gui.done")));
|
this.buttonList.add(new GuiButton(1, this.width / 2 - 75, this.height - 38, I18n.format("gui.done")));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void func_146284_a(GuiButton p_73875_1_)
|
protected void actionPerformed(GuiButton p_73875_1_)
|
||||||
{
|
{
|
||||||
if (p_73875_1_.field_146124_l && p_73875_1_.field_146127_k == 1)
|
if (p_73875_1_.enabled && p_73875_1_.id == 1)
|
||||||
{
|
{
|
||||||
FMLClientHandler.instance().showGuiScreen(null);
|
FMLClientHandler.instance().showGuiScreen(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
||||||
{
|
{
|
||||||
this.func_146276_q_();
|
this.drawDefaultBackground();
|
||||||
int offset = Math.max(85 - modsMissing.missingMods.size() * 10, 10);
|
int offset = Math.max(85 - modsMissing.missingMods.size() * 10, 10);
|
||||||
this.func_73732_a(this.field_146289_q, "Forge Mod Loader could not connect to this server", this.field_146294_l / 2, offset, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, "Forge Mod Loader could not connect to this server", this.width / 2, offset, 0xFFFFFF);
|
||||||
offset += 10;
|
offset += 10;
|
||||||
this.func_73732_a(this.field_146289_q, "The mods and versions listed below could not be found", this.field_146294_l / 2, offset, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, "The mods and versions listed below could not be found", this.width / 2, offset, 0xFFFFFF);
|
||||||
offset += 10;
|
offset += 10;
|
||||||
this.func_73732_a(this.field_146289_q, "They are required to play on this server", this.field_146294_l / 2, offset, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, "They are required to play on this server", this.width / 2, offset, 0xFFFFFF);
|
||||||
offset += 5;
|
offset += 5;
|
||||||
for (ArtifactVersion v : modsMissing.missingMods)
|
for (ArtifactVersion v : modsMissing.missingMods)
|
||||||
{
|
{
|
||||||
offset += 10;
|
offset += 10;
|
||||||
this.func_73732_a(this.field_146289_q, String.format("%s : %s", v.getLabel(), v.getRangeString()), this.field_146294_l / 2, offset, 0xEEEEEE);
|
this.drawCenteredString(this.fontRendererObj, String.format("%s : %s", v.getLabel(), v.getRangeString()), this.width / 2, offset, 0xEEEEEE);
|
||||||
}
|
}
|
||||||
super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_);
|
super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,35 +22,35 @@ public class GuiOldSaveLoadConfirm extends GuiYesNo {
|
||||||
super(parent, "", "", 0);
|
super(parent, "", "", 0);
|
||||||
this.dirName = dirName;
|
this.dirName = dirName;
|
||||||
this.saveName = saveName;
|
this.saveName = saveName;
|
||||||
this.zip = new File(FMLClientHandler.instance().getClient().field_71412_D,String.format("%s-%2$td%2$tm%2$ty%2$tH%2$tM%2$tS.zip", saveName, System.currentTimeMillis()));
|
this.zip = new File(FMLClientHandler.instance().getClient().mcDataDir,String.format("%s-%2$td%2$tm%2$ty%2$tH%2$tM%2$tS.zip", saveName, System.currentTimeMillis()));
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
||||||
{
|
{
|
||||||
this.func_146276_q_();
|
this.drawDefaultBackground();
|
||||||
this.func_73732_a(this.field_146289_q, String.format("The world %s contains pre-update modding data", saveName), this.field_146294_l / 2, 50, 16777215);
|
this.drawCenteredString(this.fontRendererObj, String.format("The world %s contains pre-update modding data", saveName), this.width / 2, 50, 16777215);
|
||||||
this.func_73732_a(this.field_146289_q, String.format("There may be problems updating it to this version"), this.field_146294_l / 2, 70, 16777215);
|
this.drawCenteredString(this.fontRendererObj, String.format("There may be problems updating it to this version"), this.width / 2, 70, 16777215);
|
||||||
this.func_73732_a(this.field_146289_q, String.format("FML will save a zip to %s", zip.getName()), this.field_146294_l / 2, 90, 16777215);
|
this.drawCenteredString(this.fontRendererObj, String.format("FML will save a zip to %s", zip.getName()), this.width / 2, 90, 16777215);
|
||||||
this.func_73732_a(this.field_146289_q, String.format("Do you wish to continue loading?"), this.field_146294_l / 2, 110, 16777215);
|
this.drawCenteredString(this.fontRendererObj, String.format("Do you wish to continue loading?"), this.width / 2, 110, 16777215);
|
||||||
int k;
|
int k;
|
||||||
|
|
||||||
for (k = 0; k < this.field_146292_n.size(); ++k)
|
for (k = 0; k < this.buttonList.size(); ++k)
|
||||||
{
|
{
|
||||||
((GuiButton)this.field_146292_n.get(k)).func_146112_a(this.field_146297_k, p_73863_1_, p_73863_2_);
|
((GuiButton)this.buttonList.get(k)).drawButton(this.mc, p_73863_1_, p_73863_2_);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (k = 0; k < this.field_146293_o.size(); ++k)
|
for (k = 0; k < this.labelList.size(); ++k)
|
||||||
{
|
{
|
||||||
((GuiLabel)this.field_146293_o.get(k)).func_146159_a(this.field_146297_k, p_73863_1_, p_73863_2_);
|
((GuiLabel)this.labelList.get(k)).func_146159_a(this.mc, p_73863_1_, p_73863_2_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void func_146284_a(GuiButton p_146284_1_)
|
protected void actionPerformed(GuiButton p_146284_1_)
|
||||||
{
|
{
|
||||||
if (p_146284_1_.field_146127_k == 1)
|
if (p_146284_1_.id == 1)
|
||||||
{
|
{
|
||||||
ObfuscationReflectionHelper.setPrivateValue(GuiSelectWorld.class, (GuiSelectWorld)field_146355_a, false, "field_"+"146634_i");
|
ObfuscationReflectionHelper.setPrivateValue(GuiSelectWorld.class, (GuiSelectWorld)parentScreen, false, "field_"+"146634_i");
|
||||||
FMLClientHandler.instance().showGuiScreen(field_146355_a);
|
FMLClientHandler.instance().showGuiScreen(parentScreen);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -61,7 +61,7 @@ public class GuiOldSaveLoadConfirm extends GuiYesNo {
|
||||||
} catch (IOException e)
|
} catch (IOException e)
|
||||||
{
|
{
|
||||||
FMLLog.log(Level.WARN, e, "There was a problem saving the backup %s. Please fix and try again", zip.getName());
|
FMLLog.log(Level.WARN, e, "There was a problem saving the backup %s. Please fix and try again", zip.getName());
|
||||||
FMLClientHandler.instance().showGuiScreen(new GuiBackupFailed(field_146355_a, zip));
|
FMLClientHandler.instance().showGuiScreen(new GuiBackupFailed(parentScreen, zip));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
FMLClientHandler.instance().showGuiScreen(null);
|
FMLClientHandler.instance().showGuiScreen(null);
|
||||||
|
|
|
@ -133,15 +133,15 @@ public abstract class GuiScrollingList
|
||||||
|
|
||||||
public void actionPerformed(GuiButton button)
|
public void actionPerformed(GuiButton button)
|
||||||
{
|
{
|
||||||
if (button.field_146124_l)
|
if (button.enabled)
|
||||||
{
|
{
|
||||||
if (button.field_146127_k == this.scrollUpActionId)
|
if (button.id == this.scrollUpActionId)
|
||||||
{
|
{
|
||||||
this.scrollDistance -= (float)(this.slotHeight * 2 / 3);
|
this.scrollDistance -= (float)(this.slotHeight * 2 / 3);
|
||||||
this.initialMouseClickY = -2.0F;
|
this.initialMouseClickY = -2.0F;
|
||||||
this.applyScrollLimits();
|
this.applyScrollLimits();
|
||||||
}
|
}
|
||||||
else if (button.field_146127_k == this.scrollDownActionId)
|
else if (button.id == this.scrollDownActionId)
|
||||||
{
|
{
|
||||||
this.scrollDistance += (float)(this.slotHeight * 2 / 3);
|
this.scrollDistance += (float)(this.slotHeight * 2 / 3);
|
||||||
this.initialMouseClickY = -2.0F;
|
this.initialMouseClickY = -2.0F;
|
||||||
|
@ -263,8 +263,8 @@ public abstract class GuiScrollingList
|
||||||
}
|
}
|
||||||
|
|
||||||
this.applyScrollLimits();
|
this.applyScrollLimits();
|
||||||
Tessellator var18 = Tessellator.field_78398_a;
|
Tessellator var18 = Tessellator.instance;
|
||||||
if (this.client.field_71441_e != null)
|
if (this.client.theWorld != null)
|
||||||
{
|
{
|
||||||
this.drawGradientRect(this.left, this.top, this.right, this.bottom, -1072689136, -804253680);
|
this.drawGradientRect(this.left, this.top, this.right, this.bottom, -1072689136, -804253680);
|
||||||
}
|
}
|
||||||
|
@ -272,16 +272,16 @@ public abstract class GuiScrollingList
|
||||||
{
|
{
|
||||||
GL11.glDisable(GL11.GL_LIGHTING);
|
GL11.glDisable(GL11.GL_LIGHTING);
|
||||||
GL11.glDisable(GL11.GL_FOG);
|
GL11.glDisable(GL11.GL_FOG);
|
||||||
this.client.field_71446_o.func_110577_a(Gui.field_110325_k);
|
this.client.renderEngine.bindTexture(Gui.optionsBackground);
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
float var17 = 32.0F;
|
float var17 = 32.0F;
|
||||||
var18.func_78382_b();
|
var18.startDrawingQuads();
|
||||||
var18.func_78378_d(2105376);
|
var18.setColorOpaque_I(2105376);
|
||||||
var18.func_78374_a((double)this.left, (double)this.bottom, 0.0D, (double)((float)this.left / var17), (double)((float)(this.bottom + (int)this.scrollDistance) / var17));
|
var18.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, (double)((float)this.left / var17), (double)((float)(this.bottom + (int)this.scrollDistance) / var17));
|
||||||
var18.func_78374_a((double)this.right, (double)this.bottom, 0.0D, (double)((float)this.right / var17), (double)((float)(this.bottom + (int)this.scrollDistance) / var17));
|
var18.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, (double)((float)this.right / var17), (double)((float)(this.bottom + (int)this.scrollDistance) / var17));
|
||||||
var18.func_78374_a((double)this.right, (double)this.top, 0.0D, (double)((float)this.right / var17), (double)((float)(this.top + (int)this.scrollDistance) / var17));
|
var18.addVertexWithUV((double)this.right, (double)this.top, 0.0D, (double)((float)this.right / var17), (double)((float)(this.top + (int)this.scrollDistance) / var17));
|
||||||
var18.func_78374_a((double)this.left, (double)this.top, 0.0D, (double)((float)this.left / var17), (double)((float)(this.top + (int)this.scrollDistance) / var17));
|
var18.addVertexWithUV((double)this.left, (double)this.top, 0.0D, (double)((float)this.left / var17), (double)((float)(this.top + (int)this.scrollDistance) / var17));
|
||||||
var18.func_78381_a();
|
var18.draw();
|
||||||
}
|
}
|
||||||
// boxRight = this.listWidth / 2 - 92 - 16;
|
// boxRight = this.listWidth / 2 - 92 - 16;
|
||||||
var10 = this.top + 4 - (int)this.scrollDistance;
|
var10 = this.top + 4 - (int)this.scrollDistance;
|
||||||
|
@ -306,18 +306,18 @@ public abstract class GuiScrollingList
|
||||||
int var15 = boxRight;
|
int var15 = boxRight;
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||||
var18.func_78382_b();
|
var18.startDrawingQuads();
|
||||||
var18.func_78378_d(8421504);
|
var18.setColorOpaque_I(8421504);
|
||||||
var18.func_78374_a((double)var14, (double)(var19 + var13 + 2), 0.0D, 0.0D, 1.0D);
|
var18.addVertexWithUV((double)var14, (double)(var19 + var13 + 2), 0.0D, 0.0D, 1.0D);
|
||||||
var18.func_78374_a((double)var15, (double)(var19 + var13 + 2), 0.0D, 1.0D, 1.0D);
|
var18.addVertexWithUV((double)var15, (double)(var19 + var13 + 2), 0.0D, 1.0D, 1.0D);
|
||||||
var18.func_78374_a((double)var15, (double)(var19 - 2), 0.0D, 1.0D, 0.0D);
|
var18.addVertexWithUV((double)var15, (double)(var19 - 2), 0.0D, 1.0D, 0.0D);
|
||||||
var18.func_78374_a((double)var14, (double)(var19 - 2), 0.0D, 0.0D, 0.0D);
|
var18.addVertexWithUV((double)var14, (double)(var19 - 2), 0.0D, 0.0D, 0.0D);
|
||||||
var18.func_78378_d(0);
|
var18.setColorOpaque_I(0);
|
||||||
var18.func_78374_a((double)(var14 + 1), (double)(var19 + var13 + 1), 0.0D, 0.0D, 1.0D);
|
var18.addVertexWithUV((double)(var14 + 1), (double)(var19 + var13 + 1), 0.0D, 0.0D, 1.0D);
|
||||||
var18.func_78374_a((double)(var15 - 1), (double)(var19 + var13 + 1), 0.0D, 1.0D, 1.0D);
|
var18.addVertexWithUV((double)(var15 - 1), (double)(var19 + var13 + 1), 0.0D, 1.0D, 1.0D);
|
||||||
var18.func_78374_a((double)(var15 - 1), (double)(var19 - 1), 0.0D, 1.0D, 0.0D);
|
var18.addVertexWithUV((double)(var15 - 1), (double)(var19 - 1), 0.0D, 1.0D, 0.0D);
|
||||||
var18.func_78374_a((double)(var14 + 1), (double)(var19 - 1), 0.0D, 0.0D, 0.0D);
|
var18.addVertexWithUV((double)(var14 + 1), (double)(var19 - 1), 0.0D, 0.0D, 0.0D);
|
||||||
var18.func_78381_a();
|
var18.draw();
|
||||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -327,7 +327,7 @@ public abstract class GuiScrollingList
|
||||||
|
|
||||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||||
byte var20 = 4;
|
byte var20 = 4;
|
||||||
if (this.client.field_71441_e == null)
|
if (this.client.theWorld == null)
|
||||||
{
|
{
|
||||||
this.overlayBackground(0, this.top, 255, 255);
|
this.overlayBackground(0, this.top, 255, 255);
|
||||||
this.overlayBackground(this.bottom, this.listHeight, 255, 255);
|
this.overlayBackground(this.bottom, this.listHeight, 255, 255);
|
||||||
|
@ -337,22 +337,22 @@ public abstract class GuiScrollingList
|
||||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||||
var18.func_78382_b();
|
var18.startDrawingQuads();
|
||||||
var18.func_78384_a(0, 0);
|
var18.setColorRGBA_I(0, 0);
|
||||||
var18.func_78374_a((double)this.left, (double)(this.top + var20), 0.0D, 0.0D, 1.0D);
|
var18.addVertexWithUV((double)this.left, (double)(this.top + var20), 0.0D, 0.0D, 1.0D);
|
||||||
var18.func_78374_a((double)this.right, (double)(this.top + var20), 0.0D, 1.0D, 1.0D);
|
var18.addVertexWithUV((double)this.right, (double)(this.top + var20), 0.0D, 1.0D, 1.0D);
|
||||||
var18.func_78384_a(0, 255);
|
var18.setColorRGBA_I(0, 255);
|
||||||
var18.func_78374_a((double)this.right, (double)this.top, 0.0D, 1.0D, 0.0D);
|
var18.addVertexWithUV((double)this.right, (double)this.top, 0.0D, 1.0D, 0.0D);
|
||||||
var18.func_78374_a((double)this.left, (double)this.top, 0.0D, 0.0D, 0.0D);
|
var18.addVertexWithUV((double)this.left, (double)this.top, 0.0D, 0.0D, 0.0D);
|
||||||
var18.func_78381_a();
|
var18.draw();
|
||||||
var18.func_78382_b();
|
var18.startDrawingQuads();
|
||||||
var18.func_78384_a(0, 255);
|
var18.setColorRGBA_I(0, 255);
|
||||||
var18.func_78374_a((double)this.left, (double)this.bottom, 0.0D, 0.0D, 1.0D);
|
var18.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, 0.0D, 1.0D);
|
||||||
var18.func_78374_a((double)this.right, (double)this.bottom, 0.0D, 1.0D, 1.0D);
|
var18.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, 1.0D, 1.0D);
|
||||||
var18.func_78384_a(0, 0);
|
var18.setColorRGBA_I(0, 0);
|
||||||
var18.func_78374_a((double)this.right, (double)(this.bottom - var20), 0.0D, 1.0D, 0.0D);
|
var18.addVertexWithUV((double)this.right, (double)(this.bottom - var20), 0.0D, 1.0D, 0.0D);
|
||||||
var18.func_78374_a((double)this.left, (double)(this.bottom - var20), 0.0D, 0.0D, 0.0D);
|
var18.addVertexWithUV((double)this.left, (double)(this.bottom - var20), 0.0D, 0.0D, 0.0D);
|
||||||
var18.func_78381_a();
|
var18.draw();
|
||||||
var19 = this.getContentHeight() - (this.bottom - this.top - 4);
|
var19 = this.getContentHeight() - (this.bottom - this.top - 4);
|
||||||
|
|
||||||
if (var19 > 0)
|
if (var19 > 0)
|
||||||
|
@ -376,27 +376,27 @@ public abstract class GuiScrollingList
|
||||||
var14 = this.top;
|
var14 = this.top;
|
||||||
}
|
}
|
||||||
|
|
||||||
var18.func_78382_b();
|
var18.startDrawingQuads();
|
||||||
var18.func_78384_a(0, 255);
|
var18.setColorRGBA_I(0, 255);
|
||||||
var18.func_78374_a((double)scrollBarXStart, (double)this.bottom, 0.0D, 0.0D, 1.0D);
|
var18.addVertexWithUV((double)scrollBarXStart, (double)this.bottom, 0.0D, 0.0D, 1.0D);
|
||||||
var18.func_78374_a((double)scrollBarXEnd, (double)this.bottom, 0.0D, 1.0D, 1.0D);
|
var18.addVertexWithUV((double)scrollBarXEnd, (double)this.bottom, 0.0D, 1.0D, 1.0D);
|
||||||
var18.func_78374_a((double)scrollBarXEnd, (double)this.top, 0.0D, 1.0D, 0.0D);
|
var18.addVertexWithUV((double)scrollBarXEnd, (double)this.top, 0.0D, 1.0D, 0.0D);
|
||||||
var18.func_78374_a((double)scrollBarXStart, (double)this.top, 0.0D, 0.0D, 0.0D);
|
var18.addVertexWithUV((double)scrollBarXStart, (double)this.top, 0.0D, 0.0D, 0.0D);
|
||||||
var18.func_78381_a();
|
var18.draw();
|
||||||
var18.func_78382_b();
|
var18.startDrawingQuads();
|
||||||
var18.func_78384_a(8421504, 255);
|
var18.setColorRGBA_I(8421504, 255);
|
||||||
var18.func_78374_a((double)scrollBarXStart, (double)(var14 + var13), 0.0D, 0.0D, 1.0D);
|
var18.addVertexWithUV((double)scrollBarXStart, (double)(var14 + var13), 0.0D, 0.0D, 1.0D);
|
||||||
var18.func_78374_a((double)scrollBarXEnd, (double)(var14 + var13), 0.0D, 1.0D, 1.0D);
|
var18.addVertexWithUV((double)scrollBarXEnd, (double)(var14 + var13), 0.0D, 1.0D, 1.0D);
|
||||||
var18.func_78374_a((double)scrollBarXEnd, (double)var14, 0.0D, 1.0D, 0.0D);
|
var18.addVertexWithUV((double)scrollBarXEnd, (double)var14, 0.0D, 1.0D, 0.0D);
|
||||||
var18.func_78374_a((double)scrollBarXStart, (double)var14, 0.0D, 0.0D, 0.0D);
|
var18.addVertexWithUV((double)scrollBarXStart, (double)var14, 0.0D, 0.0D, 0.0D);
|
||||||
var18.func_78381_a();
|
var18.draw();
|
||||||
var18.func_78382_b();
|
var18.startDrawingQuads();
|
||||||
var18.func_78384_a(12632256, 255);
|
var18.setColorRGBA_I(12632256, 255);
|
||||||
var18.func_78374_a((double)scrollBarXStart, (double)(var14 + var13 - 1), 0.0D, 0.0D, 1.0D);
|
var18.addVertexWithUV((double)scrollBarXStart, (double)(var14 + var13 - 1), 0.0D, 0.0D, 1.0D);
|
||||||
var18.func_78374_a((double)(scrollBarXEnd - 1), (double)(var14 + var13 - 1), 0.0D, 1.0D, 1.0D);
|
var18.addVertexWithUV((double)(scrollBarXEnd - 1), (double)(var14 + var13 - 1), 0.0D, 1.0D, 1.0D);
|
||||||
var18.func_78374_a((double)(scrollBarXEnd - 1), (double)var14, 0.0D, 1.0D, 0.0D);
|
var18.addVertexWithUV((double)(scrollBarXEnd - 1), (double)var14, 0.0D, 1.0D, 0.0D);
|
||||||
var18.func_78374_a((double)scrollBarXStart, (double)var14, 0.0D, 0.0D, 0.0D);
|
var18.addVertexWithUV((double)scrollBarXStart, (double)var14, 0.0D, 0.0D, 0.0D);
|
||||||
var18.func_78381_a();
|
var18.draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.func_27257_b(mouseX, mouseY);
|
this.func_27257_b(mouseX, mouseY);
|
||||||
|
@ -408,18 +408,18 @@ public abstract class GuiScrollingList
|
||||||
|
|
||||||
private void overlayBackground(int p_22239_1_, int p_22239_2_, int p_22239_3_, int p_22239_4_)
|
private void overlayBackground(int p_22239_1_, int p_22239_2_, int p_22239_3_, int p_22239_4_)
|
||||||
{
|
{
|
||||||
Tessellator var5 = Tessellator.field_78398_a;
|
Tessellator var5 = Tessellator.instance;
|
||||||
this.client.field_71446_o.func_110577_a(Gui.field_110325_k);
|
this.client.renderEngine.bindTexture(Gui.optionsBackground);
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
float var6 = 32.0F;
|
float var6 = 32.0F;
|
||||||
var5.func_78382_b();
|
var5.startDrawingQuads();
|
||||||
var5.func_78384_a(4210752, p_22239_4_);
|
var5.setColorRGBA_I(4210752, p_22239_4_);
|
||||||
var5.func_78374_a(0.0D, (double)p_22239_2_, 0.0D, 0.0D, (double)((float)p_22239_2_ / var6));
|
var5.addVertexWithUV(0.0D, (double)p_22239_2_, 0.0D, 0.0D, (double)((float)p_22239_2_ / var6));
|
||||||
var5.func_78374_a((double)this.listWidth + 30, (double)p_22239_2_, 0.0D, (double)((float)(this.listWidth + 30) / var6), (double)((float)p_22239_2_ / var6));
|
var5.addVertexWithUV((double)this.listWidth + 30, (double)p_22239_2_, 0.0D, (double)((float)(this.listWidth + 30) / var6), (double)((float)p_22239_2_ / var6));
|
||||||
var5.func_78384_a(4210752, p_22239_3_);
|
var5.setColorRGBA_I(4210752, p_22239_3_);
|
||||||
var5.func_78374_a((double)this.listWidth + 30, (double)p_22239_1_, 0.0D, (double)((float)(this.listWidth + 30) / var6), (double)((float)p_22239_1_ / var6));
|
var5.addVertexWithUV((double)this.listWidth + 30, (double)p_22239_1_, 0.0D, (double)((float)(this.listWidth + 30) / var6), (double)((float)p_22239_1_ / var6));
|
||||||
var5.func_78374_a(0.0D, (double)p_22239_1_, 0.0D, 0.0D, (double)((float)p_22239_1_ / var6));
|
var5.addVertexWithUV(0.0D, (double)p_22239_1_, 0.0D, 0.0D, (double)((float)p_22239_1_ / var6));
|
||||||
var5.func_78381_a();
|
var5.draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawGradientRect(int par1, int par2, int par3, int par4, int par5, int par6)
|
protected void drawGradientRect(int par1, int par2, int par3, int par4, int par5, int par6)
|
||||||
|
@ -435,17 +435,17 @@ public abstract class GuiScrollingList
|
||||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||||
GL11.glEnable(GL11.GL_BLEND);
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||||
OpenGlHelper.func_148821_a(770, 771, 1, 0);
|
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||||
Tessellator tessellator = Tessellator.field_78398_a;
|
Tessellator tessellator = Tessellator.instance;
|
||||||
tessellator.func_78382_b();
|
tessellator.startDrawingQuads();
|
||||||
tessellator.func_78369_a(f1, f2, f3, f);
|
tessellator.setColorRGBA_F(f1, f2, f3, f);
|
||||||
tessellator.func_78377_a((double)par3, (double)par2, 0.0D);
|
tessellator.addVertex((double)par3, (double)par2, 0.0D);
|
||||||
tessellator.func_78377_a((double)par1, (double)par2, 0.0D);
|
tessellator.addVertex((double)par1, (double)par2, 0.0D);
|
||||||
tessellator.func_78369_a(f5, f6, f7, f4);
|
tessellator.setColorRGBA_F(f5, f6, f7, f4);
|
||||||
tessellator.func_78377_a((double)par1, (double)par4, 0.0D);
|
tessellator.addVertex((double)par1, (double)par4, 0.0D);
|
||||||
tessellator.func_78377_a((double)par3, (double)par4, 0.0D);
|
tessellator.addVertex((double)par3, (double)par4, 0.0D);
|
||||||
tessellator.func_78381_a();
|
tessellator.draw();
|
||||||
GL11.glShadeModel(GL11.GL_FLAT);
|
GL11.glShadeModel(GL11.GL_FLAT);
|
||||||
GL11.glDisable(GL11.GL_BLEND);
|
GL11.glDisable(GL11.GL_BLEND);
|
||||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class GuiSlotModList extends GuiScrollingList
|
||||||
|
|
||||||
public GuiSlotModList(GuiModList parent, ArrayList<ModContainer> mods, int listWidth)
|
public GuiSlotModList(GuiModList parent, ArrayList<ModContainer> mods, int listWidth)
|
||||||
{
|
{
|
||||||
super(parent.getMinecraftInstance(), listWidth, parent.field_146295_m, 32, parent.field_146295_m - 66 + 4, 10, 35);
|
super(parent.getMinecraftInstance(), listWidth, parent.height, 32, parent.height - 66 + 4, 10, 35);
|
||||||
this.parent=parent;
|
this.parent=parent;
|
||||||
this.mods=mods;
|
this.mods=mods;
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ public class GuiSlotModList extends GuiScrollingList
|
||||||
@Override
|
@Override
|
||||||
protected void drawBackground()
|
protected void drawBackground()
|
||||||
{
|
{
|
||||||
this.parent.func_146276_q_();
|
this.parent.drawDefaultBackground();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -72,15 +72,15 @@ public class GuiSlotModList extends GuiScrollingList
|
||||||
ModContainer mc=mods.get(listIndex);
|
ModContainer mc=mods.get(listIndex);
|
||||||
if (Loader.instance().getModState(mc)==ModState.DISABLED)
|
if (Loader.instance().getModState(mc)==ModState.DISABLED)
|
||||||
{
|
{
|
||||||
this.parent.getFontRenderer().func_78276_b(this.parent.getFontRenderer().func_78269_a(mc.getName(), listWidth - 10), this.left + 3 , var3 + 2, 0xFF2222);
|
this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth(mc.getName(), listWidth - 10), this.left + 3 , var3 + 2, 0xFF2222);
|
||||||
this.parent.getFontRenderer().func_78276_b(this.parent.getFontRenderer().func_78269_a(mc.getDisplayVersion(), listWidth - 10), this.left + 3 , var3 + 12, 0xFF2222);
|
this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth(mc.getDisplayVersion(), listWidth - 10), this.left + 3 , var3 + 12, 0xFF2222);
|
||||||
this.parent.getFontRenderer().func_78276_b(this.parent.getFontRenderer().func_78269_a("DISABLED", listWidth - 10), this.left + 3 , var3 + 22, 0xFF2222);
|
this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth("DISABLED", listWidth - 10), this.left + 3 , var3 + 22, 0xFF2222);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.parent.getFontRenderer().func_78276_b(this.parent.getFontRenderer().func_78269_a(mc.getName(), listWidth - 10), this.left + 3 , var3 + 2, 0xFFFFFF);
|
this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth(mc.getName(), listWidth - 10), this.left + 3 , var3 + 2, 0xFFFFFF);
|
||||||
this.parent.getFontRenderer().func_78276_b(this.parent.getFontRenderer().func_78269_a(mc.getDisplayVersion(), listWidth - 10), this.left + 3 , var3 + 12, 0xCCCCCC);
|
this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth(mc.getDisplayVersion(), listWidth - 10), this.left + 3 , var3 + 12, 0xCCCCCC);
|
||||||
this.parent.getFontRenderer().func_78276_b(this.parent.getFontRenderer().func_78269_a(mc.getMetadata() !=null ? mc.getMetadata().getChildModCountString() : "Metadata not found", listWidth - 10), this.left + 3 , var3 + 22, 0xCCCCCC);
|
this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth(mc.getMetadata() !=null ? mc.getMetadata().getChildModCountString() : "Metadata not found", listWidth - 10), this.left + 3 , var3 + 22, 0xCCCCCC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,31 +14,31 @@ public class GuiSortingProblem extends GuiScreen {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void func_73866_w_()
|
public void initGui()
|
||||||
{
|
{
|
||||||
super.func_73866_w_();
|
super.initGui();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
||||||
{
|
{
|
||||||
this.func_146276_q_();
|
this.drawDefaultBackground();
|
||||||
int offset = Math.max(85 - (failedList.getVisitedNodes().size() + 3) * 10, 10);
|
int offset = Math.max(85 - (failedList.getVisitedNodes().size() + 3) * 10, 10);
|
||||||
this.func_73732_a(this.field_146289_q, "Forge Mod Loader has found a problem with your minecraft installation", this.field_146294_l / 2, offset, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, "Forge Mod Loader has found a problem with your minecraft installation", this.width / 2, offset, 0xFFFFFF);
|
||||||
offset+=10;
|
offset+=10;
|
||||||
this.func_73732_a(this.field_146289_q, "A mod sorting cycle was detected and loading cannot continue", this.field_146294_l / 2, offset, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, "A mod sorting cycle was detected and loading cannot continue", this.width / 2, offset, 0xFFFFFF);
|
||||||
offset+=10;
|
offset+=10;
|
||||||
this.func_73732_a(this.field_146289_q, String.format("The first mod in the cycle is %s", failedList.getFirstBadNode()), this.field_146294_l / 2, offset, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, String.format("The first mod in the cycle is %s", failedList.getFirstBadNode()), this.width / 2, offset, 0xFFFFFF);
|
||||||
offset+=10;
|
offset+=10;
|
||||||
this.func_73732_a(this.field_146289_q, "The remainder of the cycle involves these mods", this.field_146294_l / 2, offset, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, "The remainder of the cycle involves these mods", this.width / 2, offset, 0xFFFFFF);
|
||||||
offset+=5;
|
offset+=5;
|
||||||
for (ModContainer mc : failedList.getVisitedNodes())
|
for (ModContainer mc : failedList.getVisitedNodes())
|
||||||
{
|
{
|
||||||
offset+=10;
|
offset+=10;
|
||||||
this.func_73732_a(this.field_146289_q, String.format("%s : before: %s, after: %s", mc.toString(), mc.getDependants(), mc.getDependencies()), this.field_146294_l / 2, offset, 0xEEEEEE);
|
this.drawCenteredString(this.fontRendererObj, String.format("%s : before: %s, after: %s", mc.toString(), mc.getDependants(), mc.getDependencies()), this.width / 2, offset, 0xEEEEEE);
|
||||||
}
|
}
|
||||||
offset+=20;
|
offset+=20;
|
||||||
this.func_73732_a(this.field_146289_q, "The file 'ForgeModLoader-client-0.log' contains more information", this.field_146294_l / 2, offset, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, "The file 'ForgeModLoader-client-0.log' contains more information", this.width / 2, offset, 0xFFFFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,22 +25,22 @@ public class GuiWrongMinecraft extends GuiErrorScreen
|
||||||
this.wrongMC = wrongMC;
|
this.wrongMC = wrongMC;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void func_73866_w_()
|
public void initGui()
|
||||||
{
|
{
|
||||||
super.func_73866_w_();
|
super.initGui();
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
||||||
{
|
{
|
||||||
this.func_146276_q_();
|
this.drawDefaultBackground();
|
||||||
int offset = 75;
|
int offset = 75;
|
||||||
this.func_73732_a(this.field_146289_q, "Forge Mod Loader has found a problem with your minecraft installation", this.field_146294_l / 2, offset, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, "Forge Mod Loader has found a problem with your minecraft installation", this.width / 2, offset, 0xFFFFFF);
|
||||||
offset+=10;
|
offset+=10;
|
||||||
this.func_73732_a(this.field_146289_q, String.format("The mod listed below does not want to run in Minecraft version %s", Loader.instance().getMinecraftModContainer().getVersion()), this.field_146294_l / 2, offset, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, String.format("The mod listed below does not want to run in Minecraft version %s", Loader.instance().getMinecraftModContainer().getVersion()), this.width / 2, offset, 0xFFFFFF);
|
||||||
offset+=5;
|
offset+=5;
|
||||||
offset+=10;
|
offset+=10;
|
||||||
this.func_73732_a(this.field_146289_q, String.format("%s (%s) wants Minecraft %s", wrongMC.mod.getName(), wrongMC.mod.getModId(), wrongMC.mod.acceptableMinecraftVersionRange()), this.field_146294_l / 2, offset, 0xEEEEEE);
|
this.drawCenteredString(this.fontRendererObj, String.format("%s (%s) wants Minecraft %s", wrongMC.mod.getName(), wrongMC.mod.getModId(), wrongMC.mod.acceptableMinecraftVersionRange()), this.width / 2, offset, 0xEEEEEE);
|
||||||
offset+=20;
|
offset+=20;
|
||||||
this.func_73732_a(this.field_146289_q, "The file 'ForgeModLoader-client-0.log' contains more information", this.field_146294_l / 2, offset, 0xFFFFFF);
|
this.drawCenteredString(this.fontRendererObj, "The file 'ForgeModLoader-client-0.log' contains more information", this.width / 2, offset, 0xFFFFFF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,12 +40,12 @@ public class ClientRegistry
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public static void bindTileEntitySpecialRenderer(Class <? extends TileEntity> tileEntityClass, TileEntitySpecialRenderer specialRenderer)
|
public static void bindTileEntitySpecialRenderer(Class <? extends TileEntity> tileEntityClass, TileEntitySpecialRenderer specialRenderer)
|
||||||
{
|
{
|
||||||
TileEntityRendererDispatcher.field_147556_a.field_147559_m.put(tileEntityClass, specialRenderer);
|
TileEntityRendererDispatcher.instance.mapSpecialRenderers.put(tileEntityClass, specialRenderer);
|
||||||
specialRenderer.func_147497_a(TileEntityRendererDispatcher.field_147556_a);
|
specialRenderer.func_147497_a(TileEntityRendererDispatcher.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void registerKeyBinding(KeyBinding key)
|
public static void registerKeyBinding(KeyBinding key)
|
||||||
{
|
{
|
||||||
Minecraft.func_71410_x().field_71474_y.field_74324_K = ArrayUtils.add(Minecraft.func_71410_x().field_71474_y.field_74324_K, key);
|
Minecraft.getMinecraft().gameSettings.keyBindings = ArrayUtils.add(Minecraft.getMinecraft().gameSettings.keyBindings, key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,8 +48,8 @@ public class RenderingRegistry
|
||||||
*/
|
*/
|
||||||
public static int addNewArmourRendererPrefix(String armor)
|
public static int addNewArmourRendererPrefix(String armor)
|
||||||
{
|
{
|
||||||
RenderBiped.field_82424_k = ObjectArrays.concat(RenderBiped.field_82424_k, armor);
|
RenderBiped.bipedArmorFilenamePrefix = ObjectArrays.concat(RenderBiped.bipedArmorFilenamePrefix, armor);
|
||||||
return RenderBiped.field_82424_k.length - 1;
|
return RenderBiped.bipedArmorFilenamePrefix.length - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -136,7 +136,7 @@ public class RenderingRegistry
|
||||||
for (EntityRendererInfo info : entityRenderers)
|
for (EntityRendererInfo info : entityRenderers)
|
||||||
{
|
{
|
||||||
rendererMap.put(info.target, info.renderer);
|
rendererMap.put(info.target, info.renderer);
|
||||||
info.renderer.func_76976_a(RenderManager.field_78727_a);
|
info.renderer.setRenderManager(RenderManager.instance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -341,7 +341,7 @@ public class FMLCommonHandler
|
||||||
{
|
{
|
||||||
for (ICrashCallable call: crashCallables)
|
for (ICrashCallable call: crashCallables)
|
||||||
{
|
{
|
||||||
category.func_71500_a(call.getLabel(), call);
|
category.addCrashSectionCallable(call.getLabel(), call);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -355,7 +355,7 @@ public class FMLCommonHandler
|
||||||
if (wac != null)
|
if (wac != null)
|
||||||
{
|
{
|
||||||
NBTTagCompound dataForWriting = wac.getDataForWriting(handler, worldInfo);
|
NBTTagCompound dataForWriting = wac.getDataForWriting(handler, worldInfo);
|
||||||
tagCompound.func_74782_a(mc.getModId(), dataForWriting);
|
tagCompound.setTag(mc.getModId(), dataForWriting);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -383,7 +383,7 @@ public class FMLCommonHandler
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
wac.readData(handler, worldInfo, additionalProperties, tagCompound.func_74775_l(mc.getModId()));
|
wac.readData(handler, worldInfo, additionalProperties, tagCompound.getCompoundTag(mc.getModId()));
|
||||||
}
|
}
|
||||||
catch (RuntimeException ex)
|
catch (RuntimeException ex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -94,45 +94,45 @@ public class FMLContainer extends DummyModContainer implements WorldAccessContai
|
||||||
for (ModContainer mc : Loader.instance().getActiveModList())
|
for (ModContainer mc : Loader.instance().getActiveModList())
|
||||||
{
|
{
|
||||||
NBTTagCompound mod = new NBTTagCompound();
|
NBTTagCompound mod = new NBTTagCompound();
|
||||||
mod.func_74778_a("ModId", mc.getModId());
|
mod.setString("ModId", mc.getModId());
|
||||||
mod.func_74778_a("ModVersion", mc.getVersion());
|
mod.setString("ModVersion", mc.getVersion());
|
||||||
list.func_74742_a(mod);
|
list.appendTag(mod);
|
||||||
}
|
}
|
||||||
fmlData.func_74782_a("ModList", list);
|
fmlData.setTag("ModList", list);
|
||||||
// name <-> id mappings
|
// name <-> id mappings
|
||||||
NBTTagList dataList = new NBTTagList();
|
NBTTagList dataList = new NBTTagList();
|
||||||
FMLLog.fine("Gathering id map for writing to world save %s", info.func_76065_j());
|
FMLLog.fine("Gathering id map for writing to world save %s", info.getWorldName());
|
||||||
Map<String,Integer> itemList = GameData.buildItemDataList();
|
Map<String,Integer> itemList = GameData.buildItemDataList();
|
||||||
for (Entry<String, Integer> item : itemList.entrySet())
|
for (Entry<String, Integer> item : itemList.entrySet())
|
||||||
{
|
{
|
||||||
NBTTagCompound tag = new NBTTagCompound();
|
NBTTagCompound tag = new NBTTagCompound();
|
||||||
tag.func_74778_a("K",item.getKey());
|
tag.setString("K",item.getKey());
|
||||||
tag.func_74768_a("V",item.getValue());
|
tag.setInteger("V",item.getValue());
|
||||||
dataList.func_74742_a(tag);
|
dataList.appendTag(tag);
|
||||||
}
|
}
|
||||||
fmlData.func_74782_a("ItemData", dataList);
|
fmlData.setTag("ItemData", dataList);
|
||||||
// blocked ids
|
// blocked ids
|
||||||
fmlData.func_74783_a("BlockedItemIds", GameData.getBlockedIds());
|
fmlData.setIntArray("BlockedItemIds", GameData.getBlockedIds());
|
||||||
// block aliases
|
// block aliases
|
||||||
NBTTagList blockAliasList = new NBTTagList();
|
NBTTagList blockAliasList = new NBTTagList();
|
||||||
for (Entry<String, String> entry : GameData.getBlockRegistry().getAliases().entrySet())
|
for (Entry<String, String> entry : GameData.getBlockRegistry().getAliases().entrySet())
|
||||||
{
|
{
|
||||||
NBTTagCompound tag = new NBTTagCompound();
|
NBTTagCompound tag = new NBTTagCompound();
|
||||||
tag.func_74778_a("K", entry.getKey());
|
tag.setString("K", entry.getKey());
|
||||||
tag.func_74778_a("V", entry.getValue());
|
tag.setString("V", entry.getValue());
|
||||||
blockAliasList.func_74742_a(tag);
|
blockAliasList.appendTag(tag);
|
||||||
}
|
}
|
||||||
fmlData.func_74782_a("BlockAliases", blockAliasList);
|
fmlData.setTag("BlockAliases", blockAliasList);
|
||||||
// item aliases
|
// item aliases
|
||||||
NBTTagList itemAliasList = new NBTTagList();
|
NBTTagList itemAliasList = new NBTTagList();
|
||||||
for (Entry<String, String> entry : GameData.getItemRegistry().getAliases().entrySet())
|
for (Entry<String, String> entry : GameData.getItemRegistry().getAliases().entrySet())
|
||||||
{
|
{
|
||||||
NBTTagCompound tag = new NBTTagCompound();
|
NBTTagCompound tag = new NBTTagCompound();
|
||||||
tag.func_74778_a("K", entry.getKey());
|
tag.setString("K", entry.getKey());
|
||||||
tag.func_74778_a("V", entry.getValue());
|
tag.setString("V", entry.getValue());
|
||||||
itemAliasList.func_74742_a(tag);
|
itemAliasList.appendTag(tag);
|
||||||
}
|
}
|
||||||
fmlData.func_74782_a("ItemAliases", itemAliasList);
|
fmlData.setTag("ItemAliases", itemAliasList);
|
||||||
|
|
||||||
return fmlData;
|
return fmlData;
|
||||||
}
|
}
|
||||||
|
@ -140,14 +140,14 @@ public class FMLContainer extends DummyModContainer implements WorldAccessContai
|
||||||
@Override
|
@Override
|
||||||
public void readData(SaveHandler handler, WorldInfo info, Map<String, NBTBase> propertyMap, NBTTagCompound tag)
|
public void readData(SaveHandler handler, WorldInfo info, Map<String, NBTBase> propertyMap, NBTTagCompound tag)
|
||||||
{
|
{
|
||||||
if (tag.func_74764_b("ModList"))
|
if (tag.hasKey("ModList"))
|
||||||
{
|
{
|
||||||
NBTTagList modList = tag.func_150295_c("ModList", (byte)10);
|
NBTTagList modList = tag.getTagList("ModList", (byte)10);
|
||||||
for (int i = 0; i < modList.func_74745_c(); i++)
|
for (int i = 0; i < modList.tagCount(); i++)
|
||||||
{
|
{
|
||||||
NBTTagCompound mod = modList.func_150305_b(i);
|
NBTTagCompound mod = modList.getCompoundTagAt(i);
|
||||||
String modId = mod.func_74779_i("ModId");
|
String modId = mod.getString("ModId");
|
||||||
String modVersion = mod.func_74779_i("ModVersion");
|
String modVersion = mod.getString("ModVersion");
|
||||||
ModContainer container = Loader.instance().getIndexedModList().get(modId);
|
ModContainer container = Loader.instance().getIndexedModList().get(modId);
|
||||||
if (container == null)
|
if (container == null)
|
||||||
{
|
{
|
||||||
|
@ -160,20 +160,20 @@ public class FMLContainer extends DummyModContainer implements WorldAccessContai
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (tag.func_74764_b("ModItemData"))
|
if (tag.hasKey("ModItemData"))
|
||||||
{
|
{
|
||||||
FMLLog.info("Attempting to convert old world data to new system. This may be trouble!");
|
FMLLog.info("Attempting to convert old world data to new system. This may be trouble!");
|
||||||
NBTTagList modList = tag.func_150295_c("ModItemData", (byte)10);
|
NBTTagList modList = tag.getTagList("ModItemData", (byte)10);
|
||||||
Map<String,Integer> dataList = Maps.newLinkedHashMap();
|
Map<String,Integer> dataList = Maps.newLinkedHashMap();
|
||||||
for (int i = 0; i < modList.func_74745_c(); i++)
|
for (int i = 0; i < modList.tagCount(); i++)
|
||||||
{
|
{
|
||||||
NBTTagCompound itemTag = modList.func_150305_b(i);
|
NBTTagCompound itemTag = modList.getCompoundTagAt(i);
|
||||||
String modId = itemTag.func_74779_i("ModId");
|
String modId = itemTag.getString("ModId");
|
||||||
String itemType = itemTag.func_74779_i("ItemType");
|
String itemType = itemTag.getString("ItemType");
|
||||||
int itemId = itemTag.func_74762_e("ItemId");
|
int itemId = itemTag.getInteger("ItemId");
|
||||||
int ordinal = itemTag.func_74762_e("ordinal");
|
int ordinal = itemTag.getInteger("ordinal");
|
||||||
String forcedModId = itemTag.func_74764_b("ForcedModId") ? itemTag.func_74779_i("ForcedModId") : null;
|
String forcedModId = itemTag.hasKey("ForcedModId") ? itemTag.getString("ForcedModId") : null;
|
||||||
String forcedName = itemTag.func_74764_b("ForcedName") ? itemTag.func_74779_i("ForcedName") : null;
|
String forcedName = itemTag.hasKey("ForcedName") ? itemTag.getString("ForcedName") : null;
|
||||||
if (forcedName == null)
|
if (forcedName == null)
|
||||||
{
|
{
|
||||||
FMLLog.warning("Found unlabelled item in world save, this may cause problems. The item type %s:%d will not be present", itemType, ordinal);
|
FMLLog.warning("Found unlabelled item in world save, this may cause problems. The item type %s:%d will not be present", itemType, ordinal);
|
||||||
|
@ -206,18 +206,18 @@ public class FMLContainer extends DummyModContainer implements WorldAccessContai
|
||||||
throw new GameRegistryException("Failed to load the world - there are fatal block and item id issues", failedElements);
|
throw new GameRegistryException("Failed to load the world - there are fatal block and item id issues", failedElements);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (tag.func_74764_b("ItemData"))
|
else if (tag.hasKey("ItemData"))
|
||||||
{
|
{
|
||||||
// name <-> id mappings
|
// name <-> id mappings
|
||||||
NBTTagList list = tag.func_150295_c("ItemData", 10);
|
NBTTagList list = tag.getTagList("ItemData", 10);
|
||||||
Map<String,Integer> dataList = Maps.newLinkedHashMap();
|
Map<String,Integer> dataList = Maps.newLinkedHashMap();
|
||||||
for (int i = 0; i < list.func_74745_c(); i++)
|
for (int i = 0; i < list.tagCount(); i++)
|
||||||
{
|
{
|
||||||
NBTTagCompound dataTag = list.func_150305_b(i);
|
NBTTagCompound dataTag = list.getCompoundTagAt(i);
|
||||||
dataList.put(dataTag.func_74779_i("K"), dataTag.func_74762_e("V"));
|
dataList.put(dataTag.getString("K"), dataTag.getInteger("V"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!tag.func_74764_b("BlockedItemIds")) // no blocked id info -> old 1.7 save
|
if (!tag.hasKey("BlockedItemIds")) // no blocked id info -> old 1.7 save
|
||||||
{
|
{
|
||||||
// old 1.7 save potentially affected by the registry mapping bug
|
// old 1.7 save potentially affected by the registry mapping bug
|
||||||
// fix the ids the best we can...
|
// fix the ids the best we can...
|
||||||
|
@ -225,22 +225,22 @@ public class FMLContainer extends DummyModContainer implements WorldAccessContai
|
||||||
}
|
}
|
||||||
|
|
||||||
// blocked ids
|
// blocked ids
|
||||||
int[] blockedIds = tag.func_74759_k("BlockedItemIds");
|
int[] blockedIds = tag.getIntArray("BlockedItemIds");
|
||||||
// block aliases
|
// block aliases
|
||||||
Map<String, String> blockAliases = new HashMap<String, String>();
|
Map<String, String> blockAliases = new HashMap<String, String>();
|
||||||
list = tag.func_150295_c("BlockAliases", 10);
|
list = tag.getTagList("BlockAliases", 10);
|
||||||
for (int i = 0; i < list.func_74745_c(); i++)
|
for (int i = 0; i < list.tagCount(); i++)
|
||||||
{
|
{
|
||||||
NBTTagCompound dataTag = list.func_150305_b(i);
|
NBTTagCompound dataTag = list.getCompoundTagAt(i);
|
||||||
blockAliases.put(dataTag.func_74779_i("K"), dataTag.func_74779_i("V"));
|
blockAliases.put(dataTag.getString("K"), dataTag.getString("V"));
|
||||||
}
|
}
|
||||||
// item aliases
|
// item aliases
|
||||||
Map<String, String> itemAliases = new HashMap<String, String>();
|
Map<String, String> itemAliases = new HashMap<String, String>();
|
||||||
list = tag.func_150295_c("ItemAliases", 10);
|
list = tag.getTagList("ItemAliases", 10);
|
||||||
for (int i = 0; i < list.func_74745_c(); i++)
|
for (int i = 0; i < list.tagCount(); i++)
|
||||||
{
|
{
|
||||||
NBTTagCompound dataTag = list.func_150305_b(i);
|
NBTTagCompound dataTag = list.getCompoundTagAt(i);
|
||||||
itemAliases.put(dataTag.func_74779_i("K"), dataTag.func_74779_i("V"));
|
itemAliases.put(dataTag.getString("K"), dataTag.getString("V"));
|
||||||
}
|
}
|
||||||
|
|
||||||
List<String> failedElements = GameData.injectWorldIDMap(dataList, blockedIds, blockAliases, itemAliases, true, true);
|
List<String> failedElements = GameData.injectWorldIDMap(dataList, blockedIds, blockAliases, itemAliases, true, true);
|
||||||
|
|
|
@ -193,4 +193,4 @@ public interface ILanguageAdapter {
|
||||||
// Nothing to do here.
|
// Nothing to do here.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class FMLServerStartingEvent extends FMLStateEvent
|
||||||
|
|
||||||
public void registerServerCommand(ICommand command)
|
public void registerServerCommand(ICommand command)
|
||||||
{
|
{
|
||||||
CommandHandler ch = (CommandHandler) getServer().func_71187_D();
|
CommandHandler ch = (CommandHandler) getServer().getCommandManager();
|
||||||
ch.func_71560_a(command);
|
ch.registerCommand(command);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,4 +10,4 @@ public class ArtifactVersionNameFunction implements Function<ArtifactVersion, St
|
||||||
{
|
{
|
||||||
return v.getLabel();
|
return v.getLabel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,7 +146,7 @@ public class ByteBufUtils {
|
||||||
PacketBuffer pb = new PacketBuffer(to);
|
PacketBuffer pb = new PacketBuffer(to);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
pb.func_150788_a(stack);
|
pb.writeItemStackToBuffer(stack);
|
||||||
} catch (IOException e)
|
} catch (IOException e)
|
||||||
{
|
{
|
||||||
// Unpossible?
|
// Unpossible?
|
||||||
|
@ -165,7 +165,7 @@ public class ByteBufUtils {
|
||||||
PacketBuffer pb = new PacketBuffer(from);
|
PacketBuffer pb = new PacketBuffer(from);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return pb.func_150791_c();
|
return pb.readItemStackFromBuffer();
|
||||||
} catch (IOException e)
|
} catch (IOException e)
|
||||||
{
|
{
|
||||||
// Unpossible?
|
// Unpossible?
|
||||||
|
@ -184,7 +184,7 @@ public class ByteBufUtils {
|
||||||
PacketBuffer pb = new PacketBuffer(to);
|
PacketBuffer pb = new PacketBuffer(to);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
pb.func_150786_a(tag);
|
pb.writeNBTTagCompoundToBuffer(tag);
|
||||||
} catch (IOException e)
|
} catch (IOException e)
|
||||||
{
|
{
|
||||||
// Unpossible?
|
// Unpossible?
|
||||||
|
@ -203,7 +203,7 @@ public class ByteBufUtils {
|
||||||
PacketBuffer pb = new PacketBuffer(from);
|
PacketBuffer pb = new PacketBuffer(from);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return pb.func_150793_b();
|
return pb.readNBTTagCompoundFromBuffer();
|
||||||
} catch (IOException e)
|
} catch (IOException e)
|
||||||
{
|
{
|
||||||
// Unpossible?
|
// Unpossible?
|
||||||
|
|
|
@ -64,4 +64,4 @@ public class FMLEmbeddedChannel extends EmbeddedChannel {
|
||||||
}
|
}
|
||||||
return targetName;
|
return targetName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ public class FMLEventChannel {
|
||||||
if (msg.handler() instanceof NetHandlerPlayClient)
|
if (msg.handler() instanceof NetHandlerPlayClient)
|
||||||
{
|
{
|
||||||
NetHandlerPlayClient client = (NetHandlerPlayClient) msg.handler();
|
NetHandlerPlayClient client = (NetHandlerPlayClient) msg.handler();
|
||||||
event = new FMLNetworkEvent.ClientCustomPacketEvent(client.func_147298_b(), msg);
|
event = new FMLNetworkEvent.ClientCustomPacketEvent(client.getNetworkManager(), msg);
|
||||||
}
|
}
|
||||||
else if (msg.handler() instanceof NetHandlerPlayServer)
|
else if (msg.handler() instanceof NetHandlerPlayServer)
|
||||||
{
|
{
|
||||||
|
|
|
@ -32,8 +32,8 @@ public class FMLNetworkEvent<T extends INetHandler> extends Event {
|
||||||
public final String connectionType;
|
public final String connectionType;
|
||||||
public ClientConnectedToServerEvent(NetworkManager manager, String connectionType)
|
public ClientConnectedToServerEvent(NetworkManager manager, String connectionType)
|
||||||
{
|
{
|
||||||
super((INetHandlerPlayClient) manager.func_150729_e(), INetHandlerPlayClient.class, manager);
|
super((INetHandlerPlayClient) manager.getNetHandler(), INetHandlerPlayClient.class, manager);
|
||||||
this.isLocal = manager.func_150731_c();
|
this.isLocal = manager.isLocalChannel();
|
||||||
this.connectionType = connectionType;
|
this.connectionType = connectionType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,8 +48,8 @@ public class FMLNetworkEvent<T extends INetHandler> extends Event {
|
||||||
public final boolean isLocal;
|
public final boolean isLocal;
|
||||||
public ServerConnectionFromClientEvent(NetworkManager manager)
|
public ServerConnectionFromClientEvent(NetworkManager manager)
|
||||||
{
|
{
|
||||||
super((INetHandlerPlayServer) manager.func_150729_e(), INetHandlerPlayServer.class, manager);
|
super((INetHandlerPlayServer) manager.getNetHandler(), INetHandlerPlayServer.class, manager);
|
||||||
this.isLocal = manager.func_150731_c();
|
this.isLocal = manager.isLocalChannel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -61,7 +61,7 @@ public class FMLNetworkEvent<T extends INetHandler> extends Event {
|
||||||
public static class ServerDisconnectionFromClientEvent extends FMLNetworkEvent<INetHandlerPlayServer> {
|
public static class ServerDisconnectionFromClientEvent extends FMLNetworkEvent<INetHandlerPlayServer> {
|
||||||
public ServerDisconnectionFromClientEvent(NetworkManager manager)
|
public ServerDisconnectionFromClientEvent(NetworkManager manager)
|
||||||
{
|
{
|
||||||
super((INetHandlerPlayServer) manager.func_150729_e(), INetHandlerPlayServer.class, manager);
|
super((INetHandlerPlayServer) manager.getNetHandler(), INetHandlerPlayServer.class, manager);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -73,7 +73,7 @@ public class FMLNetworkEvent<T extends INetHandler> extends Event {
|
||||||
public static class ClientDisconnectionFromServerEvent extends FMLNetworkEvent<INetHandlerPlayClient> {
|
public static class ClientDisconnectionFromServerEvent extends FMLNetworkEvent<INetHandlerPlayClient> {
|
||||||
public ClientDisconnectionFromServerEvent(NetworkManager manager)
|
public ClientDisconnectionFromServerEvent(NetworkManager manager)
|
||||||
{
|
{
|
||||||
super((INetHandlerPlayClient) manager.func_150729_e(), INetHandlerPlayClient.class, manager);
|
super((INetHandlerPlayClient) manager.getNetHandler(), INetHandlerPlayClient.class, manager);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ public class FMLNetworkEvent<T extends INetHandler> extends Event {
|
||||||
public final Side side;
|
public final Side side;
|
||||||
public CustomPacketRegistrationEvent(NetworkManager manager, Set<String> registrations, String operation, Side side, Class<S> type)
|
public CustomPacketRegistrationEvent(NetworkManager manager, Set<String> registrations, String operation, Side side, Class<S> type)
|
||||||
{
|
{
|
||||||
super(type.cast(manager.func_150729_e()), type, manager);
|
super(type.cast(manager.getNetHandler()), type, manager);
|
||||||
this.registrations = ImmutableSet.copyOf(registrations);
|
this.registrations = ImmutableSet.copyOf(registrations);
|
||||||
this.side = side;
|
this.side = side;
|
||||||
this.operation = operation;
|
this.operation = operation;
|
||||||
|
@ -124,7 +124,7 @@ public class FMLNetworkEvent<T extends INetHandler> extends Event {
|
||||||
public static class ClientCustomPacketEvent extends CustomPacketEvent<INetHandlerPlayClient> {
|
public static class ClientCustomPacketEvent extends CustomPacketEvent<INetHandlerPlayClient> {
|
||||||
public ClientCustomPacketEvent(NetworkManager manager, FMLProxyPacket packet)
|
public ClientCustomPacketEvent(NetworkManager manager, FMLProxyPacket packet)
|
||||||
{
|
{
|
||||||
super((INetHandlerPlayClient) manager.func_150729_e(), INetHandlerPlayClient.class, manager, packet);
|
super((INetHandlerPlayClient) manager.getNetHandler(), INetHandlerPlayClient.class, manager, packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -142,7 +142,7 @@ public class FMLNetworkEvent<T extends INetHandler> extends Event {
|
||||||
public static class ServerCustomPacketEvent extends CustomPacketEvent<INetHandlerPlayServer> {
|
public static class ServerCustomPacketEvent extends CustomPacketEvent<INetHandlerPlayServer> {
|
||||||
public ServerCustomPacketEvent(NetworkManager manager, FMLProxyPacket packet)
|
public ServerCustomPacketEvent(NetworkManager manager, FMLProxyPacket packet)
|
||||||
{
|
{
|
||||||
super((INetHandlerPlayServer) manager.func_150729_e(), INetHandlerPlayServer.class, manager, packet);
|
super((INetHandlerPlayServer) manager.getNetHandler(), INetHandlerPlayServer.class, manager, packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -106,7 +106,7 @@ public class FMLOutboundHandler extends ChannelOutboundHandlerAdapter {
|
||||||
public List<NetworkDispatcher> selectNetworks(Object args, ChannelHandlerContext context, FMLProxyPacket packet)
|
public List<NetworkDispatcher> selectNetworks(Object args, ChannelHandlerContext context, FMLProxyPacket packet)
|
||||||
{
|
{
|
||||||
EntityPlayerMP player = (EntityPlayerMP) args;
|
EntityPlayerMP player = (EntityPlayerMP) args;
|
||||||
NetworkDispatcher dispatcher = player.field_71135_a.field_147371_a.channel().attr(NetworkDispatcher.FML_DISPATCHER).get();
|
NetworkDispatcher dispatcher = player.playerNetServerHandler.netManager.channel().attr(NetworkDispatcher.FML_DISPATCHER).get();
|
||||||
return ImmutableList.of(dispatcher);
|
return ImmutableList.of(dispatcher);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -126,9 +126,9 @@ public class FMLOutboundHandler extends ChannelOutboundHandlerAdapter {
|
||||||
public List<NetworkDispatcher> selectNetworks(Object args, ChannelHandlerContext context, FMLProxyPacket packet)
|
public List<NetworkDispatcher> selectNetworks(Object args, ChannelHandlerContext context, FMLProxyPacket packet)
|
||||||
{
|
{
|
||||||
ImmutableList.Builder<NetworkDispatcher> builder = ImmutableList.<NetworkDispatcher>builder();
|
ImmutableList.Builder<NetworkDispatcher> builder = ImmutableList.<NetworkDispatcher>builder();
|
||||||
for (EntityPlayerMP player : (List<EntityPlayerMP>)FMLCommonHandler.instance().getMinecraftServerInstance().func_71203_ab().field_72404_b)
|
for (EntityPlayerMP player : (List<EntityPlayerMP>)FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager().playerEntityList)
|
||||||
{
|
{
|
||||||
NetworkDispatcher dispatcher = player.field_71135_a.field_147371_a.channel().attr(NetworkDispatcher.FML_DISPATCHER).get();
|
NetworkDispatcher dispatcher = player.playerNetServerHandler.netManager.channel().attr(NetworkDispatcher.FML_DISPATCHER).get();
|
||||||
builder.add(dispatcher);
|
builder.add(dispatcher);
|
||||||
}
|
}
|
||||||
return builder.build();
|
return builder.build();
|
||||||
|
@ -155,11 +155,11 @@ public class FMLOutboundHandler extends ChannelOutboundHandlerAdapter {
|
||||||
{
|
{
|
||||||
int dimension = (Integer)args;
|
int dimension = (Integer)args;
|
||||||
ImmutableList.Builder<NetworkDispatcher> builder = ImmutableList.<NetworkDispatcher>builder();
|
ImmutableList.Builder<NetworkDispatcher> builder = ImmutableList.<NetworkDispatcher>builder();
|
||||||
for (EntityPlayerMP player : (List<EntityPlayerMP>)FMLCommonHandler.instance().getMinecraftServerInstance().func_71203_ab().field_72404_b)
|
for (EntityPlayerMP player : (List<EntityPlayerMP>)FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager().playerEntityList)
|
||||||
{
|
{
|
||||||
if (dimension == player.field_71093_bK)
|
if (dimension == player.dimension)
|
||||||
{
|
{
|
||||||
NetworkDispatcher dispatcher = player.field_71135_a.field_147371_a.channel().attr(NetworkDispatcher.FML_DISPATCHER).get();
|
NetworkDispatcher dispatcher = player.playerNetServerHandler.netManager.channel().attr(NetworkDispatcher.FML_DISPATCHER).get();
|
||||||
builder.add(dispatcher);
|
builder.add(dispatcher);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -189,17 +189,17 @@ public class FMLOutboundHandler extends ChannelOutboundHandlerAdapter {
|
||||||
{
|
{
|
||||||
TargetPoint tp = (TargetPoint)args;
|
TargetPoint tp = (TargetPoint)args;
|
||||||
ImmutableList.Builder<NetworkDispatcher> builder = ImmutableList.<NetworkDispatcher>builder();
|
ImmutableList.Builder<NetworkDispatcher> builder = ImmutableList.<NetworkDispatcher>builder();
|
||||||
for (EntityPlayerMP player : (List<EntityPlayerMP>)FMLCommonHandler.instance().getMinecraftServerInstance().func_71203_ab().field_72404_b)
|
for (EntityPlayerMP player : (List<EntityPlayerMP>)FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager().playerEntityList)
|
||||||
{
|
{
|
||||||
if (player.field_71093_bK == tp.dimension)
|
if (player.dimension == tp.dimension)
|
||||||
{
|
{
|
||||||
double d4 = tp.x - player.field_70165_t;
|
double d4 = tp.x - player.posX;
|
||||||
double d5 = tp.y - player.field_70163_u;
|
double d5 = tp.y - player.posY;
|
||||||
double d6 = tp.z - player.field_70161_v;
|
double d6 = tp.z - player.posZ;
|
||||||
|
|
||||||
if (d4 * d4 + d5 * d5 + d6 * d6 < tp.range * tp.range)
|
if (d4 * d4 + d5 * d5 + d6 * d6 < tp.range * tp.range)
|
||||||
{
|
{
|
||||||
NetworkDispatcher dispatcher = player.field_71135_a.field_147371_a.channel().attr(NetworkDispatcher.FML_DISPATCHER).get();
|
NetworkDispatcher dispatcher = player.playerNetServerHandler.netManager.channel().attr(NetworkDispatcher.FML_DISPATCHER).get();
|
||||||
builder.add(dispatcher);
|
builder.add(dispatcher);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,4 +136,4 @@ enum FMLHandshakeClientState implements IHandshakeState<FMLHandshakeClientState>
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,4 +91,4 @@ enum FMLHandshakeServerState implements IHandshakeState<FMLHandshakeServerState>
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
|
||||||
this.handshakeChannel.attr(FML_DISPATCHER).set(this);
|
this.handshakeChannel.attr(FML_DISPATCHER).set(this);
|
||||||
this.handshakeChannel.attr(NetworkRegistry.CHANNEL_SOURCE).set(Side.SERVER);
|
this.handshakeChannel.attr(NetworkRegistry.CHANNEL_SOURCE).set(Side.SERVER);
|
||||||
this.handshakeChannel.attr(NetworkRegistry.FML_CHANNEL).set("FML|HS");
|
this.handshakeChannel.attr(NetworkRegistry.FML_CHANNEL).set("FML|HS");
|
||||||
this.handshakeChannel.attr(IS_LOCAL).set(manager.func_150731_c());
|
this.handshakeChannel.attr(IS_LOCAL).set(manager.isLocalChannel());
|
||||||
}
|
}
|
||||||
|
|
||||||
public NetworkDispatcher(NetworkManager manager, ServerConfigurationManager scm)
|
public NetworkDispatcher(NetworkManager manager, ServerConfigurationManager scm)
|
||||||
|
@ -102,7 +102,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
|
||||||
this.handshakeChannel.attr(FML_DISPATCHER).set(this);
|
this.handshakeChannel.attr(FML_DISPATCHER).set(this);
|
||||||
this.handshakeChannel.attr(NetworkRegistry.CHANNEL_SOURCE).set(Side.CLIENT);
|
this.handshakeChannel.attr(NetworkRegistry.CHANNEL_SOURCE).set(Side.CLIENT);
|
||||||
this.handshakeChannel.attr(NetworkRegistry.FML_CHANNEL).set("FML|HS");
|
this.handshakeChannel.attr(NetworkRegistry.FML_CHANNEL).set("FML|HS");
|
||||||
this.handshakeChannel.attr(IS_LOCAL).set(manager.func_150731_c());
|
this.handshakeChannel.attr(IS_LOCAL).set(manager.isLocalChannel());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void serverToClientHandshake(EntityPlayerMP player)
|
public void serverToClientHandshake(EntityPlayerMP player)
|
||||||
|
@ -139,17 +139,17 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
|
||||||
this.state = ConnectionState.AWAITING_HANDSHAKE;
|
this.state = ConnectionState.AWAITING_HANDSHAKE;
|
||||||
this.manager.channel().pipeline().addFirst("fml:vanilla_detector", new VanillaTimeoutWaiter());
|
this.manager.channel().pipeline().addFirst("fml:vanilla_detector", new VanillaTimeoutWaiter());
|
||||||
// Need to start the handler here, so we can send custompayload packets
|
// Need to start the handler here, so we can send custompayload packets
|
||||||
serverHandler = new NetHandlerPlayServer(scm.func_72365_p(), manager, player);
|
serverHandler = new NetHandlerPlayServer(scm.getServerInstance(), manager, player);
|
||||||
this.netHandler = serverHandler;
|
this.netHandler = serverHandler;
|
||||||
// NULL the play server here - we restore it further on. If not, there are packets sent before the login
|
// NULL the play server here - we restore it further on. If not, there are packets sent before the login
|
||||||
player.field_71135_a = null;
|
player.playerNetServerHandler = null;
|
||||||
// manually for the manager into the PLAY state, so we can send packets later
|
// manually for the manager into the PLAY state, so we can send packets later
|
||||||
this.manager.func_150723_a(EnumConnectionState.PLAY);
|
this.manager.setConnectionState(EnumConnectionState.PLAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void clientListenForServerHandshake()
|
void clientListenForServerHandshake()
|
||||||
{
|
{
|
||||||
manager.func_150723_a(EnumConnectionState.PLAY);
|
manager.setConnectionState(EnumConnectionState.PLAY);
|
||||||
FMLCommonHandler.instance().waitForPlayClient();
|
FMLCommonHandler.instance().waitForPlayClient();
|
||||||
this.netHandler = FMLCommonHandler.instance().getClientPlayHandler();
|
this.netHandler = FMLCommonHandler.instance().getClientPlayHandler();
|
||||||
this.state = ConnectionState.AWAITING_HANDSHAKE;
|
this.state = ConnectionState.AWAITING_HANDSHAKE;
|
||||||
|
@ -169,7 +169,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
|
||||||
FMLLog.info("[%s] Server side %s connection established", Thread.currentThread().getName(), this.connectionType.name().toLowerCase(Locale.ENGLISH));
|
FMLLog.info("[%s] Server side %s connection established", Thread.currentThread().getName(), this.connectionType.name().toLowerCase(Locale.ENGLISH));
|
||||||
this.state = ConnectionState.CONNECTED;
|
this.state = ConnectionState.CONNECTED;
|
||||||
FMLCommonHandler.instance().bus().post(new FMLNetworkEvent.ServerConnectionFromClientEvent(manager));
|
FMLCommonHandler.instance().bus().post(new FMLNetworkEvent.ServerConnectionFromClientEvent(manager));
|
||||||
scm.func_72355_a(manager, player, serverHandler);
|
scm.initializeConnectionToPlayer(manager, player, serverHandler);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void channelRead0(ChannelHandlerContext ctx, Packet msg) throws Exception
|
protected void channelRead0(ChannelHandlerContext ctx, Packet msg) throws Exception
|
||||||
|
@ -228,12 +228,12 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
|
||||||
private void kickWithMessage(String message)
|
private void kickWithMessage(String message)
|
||||||
{
|
{
|
||||||
final ChatComponentText chatcomponenttext = new ChatComponentText(message);
|
final ChatComponentText chatcomponenttext = new ChatComponentText(message);
|
||||||
manager.func_150725_a(new S40PacketDisconnect(chatcomponenttext), new GenericFutureListener<Future<?>>()
|
manager.scheduleOutboundPacket(new S40PacketDisconnect(chatcomponenttext), new GenericFutureListener<Future<?>>()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void operationComplete(Future<?> result)
|
public void operationComplete(Future<?> result)
|
||||||
{
|
{
|
||||||
manager.func_150718_a(chatcomponenttext);
|
manager.closeChannel(chatcomponenttext);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
manager.channel().config().setAutoRead(false);
|
manager.channel().config().setAutoRead(false);
|
||||||
|
@ -337,7 +337,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
|
||||||
|
|
||||||
public void sendProxy(FMLProxyPacket msg)
|
public void sendProxy(FMLProxyPacket msg)
|
||||||
{
|
{
|
||||||
manager.func_150725_a(msg);
|
manager.scheduleOutboundPacket(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void rejectHandshake(String result)
|
public void rejectHandshake(String result)
|
||||||
|
|
|
@ -41,12 +41,12 @@ public class EntitySpawnHandler extends SimpleChannelInboundHandler<FMLMessage.E
|
||||||
|
|
||||||
private void adjustEntity(EntityAdjustMessage msg)
|
private void adjustEntity(EntityAdjustMessage msg)
|
||||||
{
|
{
|
||||||
Entity ent = FMLClientHandler.instance().getWorldClient().func_73045_a(msg.entityId);
|
Entity ent = FMLClientHandler.instance().getWorldClient().getEntityByID(msg.entityId);
|
||||||
if (ent != null)
|
if (ent != null)
|
||||||
{
|
{
|
||||||
ent.field_70118_ct = msg.serverX;
|
ent.serverPosX = msg.serverX;
|
||||||
ent.field_70117_cu = msg.serverY;
|
ent.serverPosY = msg.serverY;
|
||||||
ent.field_70116_cv = msg.serverZ;
|
ent.serverPosZ = msg.serverZ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -72,50 +72,50 @@ public class EntitySpawnHandler extends SimpleChannelInboundHandler<FMLMessage.E
|
||||||
{
|
{
|
||||||
entity = (Entity) (cls.getConstructor(World.class).newInstance(wc));
|
entity = (Entity) (cls.getConstructor(World.class).newInstance(wc));
|
||||||
|
|
||||||
int offset = spawnMsg.entityId - entity.func_145782_y();
|
int offset = spawnMsg.entityId - entity.getEntityId();
|
||||||
entity.func_145769_d(spawnMsg.entityId);
|
entity.setEntityId(spawnMsg.entityId);
|
||||||
entity.func_70012_b(spawnMsg.scaledX, spawnMsg.scaledY, spawnMsg.scaledZ, spawnMsg.scaledYaw, spawnMsg.scaledPitch);
|
entity.setLocationAndAngles(spawnMsg.scaledX, spawnMsg.scaledY, spawnMsg.scaledZ, spawnMsg.scaledYaw, spawnMsg.scaledPitch);
|
||||||
if (entity instanceof EntityLiving)
|
if (entity instanceof EntityLiving)
|
||||||
{
|
{
|
||||||
((EntityLiving) entity).field_70759_as = spawnMsg.scaledHeadYaw;
|
((EntityLiving) entity).rotationYawHead = spawnMsg.scaledHeadYaw;
|
||||||
}
|
}
|
||||||
|
|
||||||
Entity parts[] = entity.func_70021_al();
|
Entity parts[] = entity.getParts();
|
||||||
if (parts != null)
|
if (parts != null)
|
||||||
{
|
{
|
||||||
for (int j = 0; j < parts.length; j++)
|
for (int j = 0; j < parts.length; j++)
|
||||||
{
|
{
|
||||||
parts[j].func_145769_d(parts[j].func_145782_y() + offset);
|
parts[j].setEntityId(parts[j].getEntityId() + offset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
entity.field_70118_ct = spawnMsg.rawX;
|
entity.serverPosX = spawnMsg.rawX;
|
||||||
entity.field_70117_cu = spawnMsg.rawY;
|
entity.serverPosY = spawnMsg.rawY;
|
||||||
entity.field_70116_cv = spawnMsg.rawZ;
|
entity.serverPosZ = spawnMsg.rawZ;
|
||||||
|
|
||||||
EntityClientPlayerMP clientPlayer = FMLClientHandler.instance().getClientPlayerEntity();
|
EntityClientPlayerMP clientPlayer = FMLClientHandler.instance().getClientPlayerEntity();
|
||||||
if (entity instanceof IThrowableEntity)
|
if (entity instanceof IThrowableEntity)
|
||||||
{
|
{
|
||||||
Entity thrower = clientPlayer.func_145782_y() == spawnMsg.throwerId ? clientPlayer : wc.func_73045_a(spawnMsg.throwerId);
|
Entity thrower = clientPlayer.getEntityId() == spawnMsg.throwerId ? clientPlayer : wc.getEntityByID(spawnMsg.throwerId);
|
||||||
((IThrowableEntity) entity).setThrower(thrower);
|
((IThrowableEntity) entity).setThrower(thrower);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spawnMsg.dataWatcherList != null)
|
if (spawnMsg.dataWatcherList != null)
|
||||||
{
|
{
|
||||||
entity.func_70096_w().func_75687_a((List<?>) spawnMsg.dataWatcherList);
|
entity.getDataWatcher().updateWatchedObjectsFromList((List<?>) spawnMsg.dataWatcherList);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spawnMsg.throwerId > 0)
|
if (spawnMsg.throwerId > 0)
|
||||||
{
|
{
|
||||||
entity.func_70016_h(spawnMsg.speedScaledX, spawnMsg.speedScaledY, spawnMsg.speedScaledZ);
|
entity.setVelocity(spawnMsg.speedScaledX, spawnMsg.speedScaledY, spawnMsg.speedScaledZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entity instanceof IEntityAdditionalSpawnData)
|
if (entity instanceof IEntityAdditionalSpawnData)
|
||||||
{
|
{
|
||||||
((IEntityAdditionalSpawnData) entity).readSpawnData(spawnMsg.dataStream);
|
((IEntityAdditionalSpawnData) entity).readSpawnData(spawnMsg.dataStream);
|
||||||
}
|
}
|
||||||
wc.func_73027_a(spawnMsg.entityId, entity);
|
wc.addEntityToWorld(spawnMsg.entityId, entity);
|
||||||
System.out.println("Entity spawned on client");
|
System.out.println("Entity spawned on client");
|
||||||
} catch (Exception e)
|
} catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -94,7 +94,7 @@ public abstract class FMLMessage {
|
||||||
@Override
|
@Override
|
||||||
void toBytes(ByteBuf buf)
|
void toBytes(ByteBuf buf)
|
||||||
{
|
{
|
||||||
buf.writeInt(entity.func_145782_y());
|
buf.writeInt(entity.getEntityId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -170,23 +170,23 @@ public abstract class FMLMessage {
|
||||||
ByteBufUtils.writeUTF8String(buf, modId);
|
ByteBufUtils.writeUTF8String(buf, modId);
|
||||||
buf.writeInt(modEntityTypeId);
|
buf.writeInt(modEntityTypeId);
|
||||||
// posX, posY, posZ
|
// posX, posY, posZ
|
||||||
buf.writeInt(MathHelper.func_76128_c(entity.field_70165_t * 32D));
|
buf.writeInt(MathHelper.floor_double(entity.posX * 32D));
|
||||||
buf.writeInt(MathHelper.func_76128_c(entity.field_70163_u * 32D));
|
buf.writeInt(MathHelper.floor_double(entity.posY * 32D));
|
||||||
buf.writeInt(MathHelper.func_76128_c(entity.field_70161_v * 32D));
|
buf.writeInt(MathHelper.floor_double(entity.posZ * 32D));
|
||||||
// yaw, pitch
|
// yaw, pitch
|
||||||
buf.writeByte((byte)(entity.field_70177_z * 256.0F / 360.0F));
|
buf.writeByte((byte)(entity.rotationYaw * 256.0F / 360.0F));
|
||||||
buf.writeByte((byte) (entity.field_70125_A * 256.0F / 360.0F));
|
buf.writeByte((byte) (entity.rotationPitch * 256.0F / 360.0F));
|
||||||
// head yaw
|
// head yaw
|
||||||
if (entity instanceof EntityLivingBase)
|
if (entity instanceof EntityLivingBase)
|
||||||
{
|
{
|
||||||
buf.writeByte((byte) (((EntityLivingBase)entity).field_70759_as * 256.0F / 360.0F));
|
buf.writeByte((byte) (((EntityLivingBase)entity).rotationYawHead * 256.0F / 360.0F));
|
||||||
}
|
}
|
||||||
|
|
||||||
ByteBuf tmpBuf = Unpooled.buffer();
|
ByteBuf tmpBuf = Unpooled.buffer();
|
||||||
PacketBuffer pb = new PacketBuffer(tmpBuf);
|
PacketBuffer pb = new PacketBuffer(tmpBuf);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
entity.func_70096_w().func_151509_a(pb);
|
entity.getDataWatcher().func_151509_a(pb);
|
||||||
} catch (IOException e)
|
} catch (IOException e)
|
||||||
{
|
{
|
||||||
// Sigh
|
// Sigh
|
||||||
|
@ -196,11 +196,11 @@ public abstract class FMLMessage {
|
||||||
if (entity instanceof IThrowableEntity)
|
if (entity instanceof IThrowableEntity)
|
||||||
{
|
{
|
||||||
Entity owner = ((IThrowableEntity)entity).getThrower();
|
Entity owner = ((IThrowableEntity)entity).getThrower();
|
||||||
buf.writeInt(owner == null ? entity.func_145782_y() : owner.func_145782_y());
|
buf.writeInt(owner == null ? entity.getEntityId() : owner.getEntityId());
|
||||||
double maxVel = 3.9D;
|
double maxVel = 3.9D;
|
||||||
double mX = entity.field_70159_w;
|
double mX = entity.motionX;
|
||||||
double mY = entity.field_70181_x;
|
double mY = entity.motionY;
|
||||||
double mZ = entity.field_70179_y;
|
double mZ = entity.motionZ;
|
||||||
if (mX < -maxVel) mX = -maxVel;
|
if (mX < -maxVel) mX = -maxVel;
|
||||||
if (mY < -maxVel) mY = -maxVel;
|
if (mY < -maxVel) mY = -maxVel;
|
||||||
if (mZ < -maxVel) mZ = -maxVel;
|
if (mZ < -maxVel) mZ = -maxVel;
|
||||||
|
@ -239,7 +239,7 @@ public abstract class FMLMessage {
|
||||||
scaledHeadYaw = dat.readByte() * 360F / 256F;
|
scaledHeadYaw = dat.readByte() * 360F / 256F;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
dataWatcherList = DataWatcher.func_151508_b(new PacketBuffer(dat));
|
dataWatcherList = DataWatcher.readWatchedListFromPacketBuffer(new PacketBuffer(dat));
|
||||||
} catch (IOException e)
|
} catch (IOException e)
|
||||||
{
|
{
|
||||||
// Sigh
|
// Sigh
|
||||||
|
|
|
@ -75,17 +75,17 @@ public class FMLNetworkHandler
|
||||||
Container remoteGuiContainer = NetworkRegistry.INSTANCE.getRemoteGuiContainer(mc, entityPlayerMP, modGuiId, world, x, y, z);
|
Container remoteGuiContainer = NetworkRegistry.INSTANCE.getRemoteGuiContainer(mc, entityPlayerMP, modGuiId, world, x, y, z);
|
||||||
if (remoteGuiContainer != null)
|
if (remoteGuiContainer != null)
|
||||||
{
|
{
|
||||||
entityPlayerMP.func_71117_bO();
|
entityPlayerMP.getNextWindowId();
|
||||||
entityPlayerMP.func_71128_l();
|
entityPlayerMP.closeContainer();
|
||||||
int windowId = entityPlayerMP.field_71139_cq;
|
int windowId = entityPlayerMP.currentWindowId;
|
||||||
FMLMessage.OpenGui openGui = new FMLMessage.OpenGui(windowId, mc.getModId(), modGuiId, x, y, z);
|
FMLMessage.OpenGui openGui = new FMLMessage.OpenGui(windowId, mc.getModId(), modGuiId, x, y, z);
|
||||||
EmbeddedChannel embeddedChannel = channelPair.get(Side.SERVER);
|
EmbeddedChannel embeddedChannel = channelPair.get(Side.SERVER);
|
||||||
embeddedChannel.attr(FMLOutboundHandler.FML_MESSAGETARGET).set(OutboundTarget.PLAYER);
|
embeddedChannel.attr(FMLOutboundHandler.FML_MESSAGETARGET).set(OutboundTarget.PLAYER);
|
||||||
embeddedChannel.attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(entityPlayerMP);
|
embeddedChannel.attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(entityPlayerMP);
|
||||||
embeddedChannel.writeOutbound(openGui);
|
embeddedChannel.writeOutbound(openGui);
|
||||||
entityPlayerMP.field_71070_bA = remoteGuiContainer;
|
entityPlayerMP.openContainer = remoteGuiContainer;
|
||||||
entityPlayerMP.field_71070_bA.field_75152_c = windowId;
|
entityPlayerMP.openContainer.windowId = windowId;
|
||||||
entityPlayerMP.field_71070_bA.func_75132_a(entityPlayerMP);
|
entityPlayerMP.openContainer.addCraftingToCrafters(entityPlayerMP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (FMLCommonHandler.instance().getSide().equals(Side.CLIENT))
|
else if (FMLCommonHandler.instance().getSide().equals(Side.CLIENT))
|
||||||
|
|
|
@ -47,19 +47,19 @@ public class FMLProxyPacket extends Packet {
|
||||||
this.payload = payload;
|
this.payload = payload;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void func_148837_a(PacketBuffer packetbuffer) throws IOException
|
public void readPacketData(PacketBuffer packetbuffer) throws IOException
|
||||||
{
|
{
|
||||||
// NOOP - we are not built this way
|
// NOOP - we are not built this way
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void func_148840_b(PacketBuffer packetbuffer) throws IOException
|
public void writePacketData(PacketBuffer packetbuffer) throws IOException
|
||||||
{
|
{
|
||||||
// NOOP - we are not built this way
|
// NOOP - we are not built this way
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void func_148833_a(INetHandler inethandler)
|
public void processPacket(INetHandler inethandler)
|
||||||
{
|
{
|
||||||
this.netHandler = inethandler;
|
this.netHandler = inethandler;
|
||||||
EmbeddedChannel internalChannel = NetworkRegistry.INSTANCE.getChannel(this.channel, this.target);
|
EmbeddedChannel internalChannel = NetworkRegistry.INSTANCE.getChannel(this.channel, this.target);
|
||||||
|
|
|
@ -12,9 +12,9 @@ public class OpenGuiHandler extends SimpleChannelInboundHandler<FMLMessage.OpenG
|
||||||
@Override
|
@Override
|
||||||
protected void channelRead0(ChannelHandlerContext ctx, OpenGui msg) throws Exception
|
protected void channelRead0(ChannelHandlerContext ctx, OpenGui msg) throws Exception
|
||||||
{
|
{
|
||||||
EntityPlayer player = FMLClientHandler.instance().getClient().field_71439_g;
|
EntityPlayer player = FMLClientHandler.instance().getClient().thePlayer;
|
||||||
player.openGui(msg.modId, msg.modGuiId, player.field_70170_p, msg.x, msg.y, msg.z);
|
player.openGui(msg.modId, msg.modGuiId, player.worldObj, msg.x, msg.y, msg.z);
|
||||||
player.field_71070_bA.field_75152_c = msg.windowId;
|
player.openContainer.windowId = msg.windowId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -25,7 +25,7 @@ import cpw.mods.fml.relauncher.Side;
|
||||||
* should be unique for this channelName - it is used to discriminate between different types of message that might
|
* should be unique for this channelName - it is used to discriminate between different types of message that might
|
||||||
* occur on this channel (a simple form of message channel multiplexing, if you will).
|
* occur on this channel (a simple form of message channel multiplexing, if you will).
|
||||||
* <li>To get a packet suitable for presenting to the rest of minecraft, you can call {@link #getPacketFrom(IMessage)}. The return result
|
* <li>To get a packet suitable for presenting to the rest of minecraft, you can call {@link #getPacketFrom(IMessage)}. The return result
|
||||||
* is suitable for returning from things like {@link TileEntity#func_145844_m()} for example.
|
* is suitable for returning from things like {@link TileEntity#func_145844_m} for example.
|
||||||
* <li>Finally, use the sendXXX to send unsolicited messages to various classes of recipients.
|
* <li>Finally, use the sendXXX to send unsolicited messages to various classes of recipients.
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
|
@ -87,7 +87,7 @@ public class SimpleNetworkWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a minecraft packet from the supplied message. Can be used where minecraft packets are required, such as
|
* Construct a minecraft packet from the supplied message. Can be used where minecraft packets are required, such as
|
||||||
* {@link TileEntity#func_145844_m()}.
|
* {@link TileEntity#func_145844_m}.
|
||||||
*
|
*
|
||||||
* @param message The message to translate into packet form
|
* @param message The message to translate into packet form
|
||||||
* @return A minecraft {@link Packet} suitable for use in minecraft APIs
|
* @return A minecraft {@link Packet} suitable for use in minecraft APIs
|
||||||
|
|
|
@ -127,7 +127,7 @@ public class EntityRegistry
|
||||||
{
|
{
|
||||||
availableIndicies = new BitSet(256);
|
availableIndicies = new BitSet(256);
|
||||||
availableIndicies.set(1,255);
|
availableIndicies.set(1,255);
|
||||||
for (Object id : EntityList.field_75623_d.keySet())
|
for (Object id : EntityList.IDtoClassMapping.keySet())
|
||||||
{
|
{
|
||||||
availableIndicies.clear((Integer)id);
|
availableIndicies.clear((Integer)id);
|
||||||
}
|
}
|
||||||
|
@ -158,11 +158,11 @@ public class EntityRegistry
|
||||||
{
|
{
|
||||||
entityClassRegistrations.put(entityClass, er);
|
entityClassRegistrations.put(entityClass, er);
|
||||||
entityNames.put(entityName, mc);
|
entityNames.put(entityName, mc);
|
||||||
if (!EntityList.field_75626_c.containsKey(entityClass))
|
if (!EntityList.classToStringMapping.containsKey(entityClass))
|
||||||
{
|
{
|
||||||
String entityModName = String.format("%s.%s", mc.getModId(), entityName);
|
String entityModName = String.format("%s.%s", mc.getModId(), entityName);
|
||||||
EntityList.field_75626_c.put(entityClass, entityModName);
|
EntityList.classToStringMapping.put(entityClass, entityModName);
|
||||||
EntityList.field_75625_b.put(entityModName, entityClass);
|
EntityList.stringToClassMapping.put(entityModName, entityClass);
|
||||||
FMLLog.finer("Automatically registered mod %s entity %s as %s", mc.getModId(), entityName, entityModName);
|
FMLLog.finer("Automatically registered mod %s entity %s as %s", mc.getModId(), entityName, entityModName);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -180,7 +180,7 @@ public class EntityRegistry
|
||||||
|
|
||||||
public static void registerGlobalEntityID(Class <? extends Entity > entityClass, String entityName, int id)
|
public static void registerGlobalEntityID(Class <? extends Entity > entityClass, String entityName, int id)
|
||||||
{
|
{
|
||||||
if (EntityList.field_75626_c.containsKey(entityClass))
|
if (EntityList.classToStringMapping.containsKey(entityClass))
|
||||||
{
|
{
|
||||||
ModContainer activeModContainer = Loader.instance().activeModContainer();
|
ModContainer activeModContainer = Loader.instance().activeModContainer();
|
||||||
String modId = "unknown";
|
String modId = "unknown";
|
||||||
|
@ -196,7 +196,7 @@ public class EntityRegistry
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
id = instance().validateAndClaimId(id);
|
id = instance().validateAndClaimId(id);
|
||||||
EntityList.func_75618_a(entityClass, entityName, id);
|
EntityList.addMapping(entityClass, entityName, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
private int validateAndClaimId(int id)
|
private int validateAndClaimId(int id)
|
||||||
|
@ -232,7 +232,7 @@ public class EntityRegistry
|
||||||
|
|
||||||
public static void registerGlobalEntityID(Class <? extends Entity > entityClass, String entityName, int id, int backgroundEggColour, int foregroundEggColour)
|
public static void registerGlobalEntityID(Class <? extends Entity > entityClass, String entityName, int id, int backgroundEggColour, int foregroundEggColour)
|
||||||
{
|
{
|
||||||
if (EntityList.field_75626_c.containsKey(entityClass))
|
if (EntityList.classToStringMapping.containsKey(entityClass))
|
||||||
{
|
{
|
||||||
ModContainer activeModContainer = Loader.instance().activeModContainer();
|
ModContainer activeModContainer = Loader.instance().activeModContainer();
|
||||||
String modId = "unknown";
|
String modId = "unknown";
|
||||||
|
@ -248,7 +248,7 @@ public class EntityRegistry
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
instance().validateAndClaimId(id);
|
instance().validateAndClaimId(id);
|
||||||
EntityList.func_75614_a(entityClass, entityName, id, backgroundEggColour, foregroundEggColour);
|
EntityList.addMapping(entityClass, entityName, id, backgroundEggColour, foregroundEggColour);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addSpawn(Class <? extends EntityLiving > entityClass, int weightedProb, int min, int max, EnumCreatureType typeOfCreature, BiomeGenBase... biomes)
|
public static void addSpawn(Class <? extends EntityLiving > entityClass, int weightedProb, int min, int max, EnumCreatureType typeOfCreature, BiomeGenBase... biomes)
|
||||||
|
@ -256,16 +256,16 @@ public class EntityRegistry
|
||||||
for (BiomeGenBase biome : biomes)
|
for (BiomeGenBase biome : biomes)
|
||||||
{
|
{
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
List<SpawnListEntry> spawns = biome.func_76747_a(typeOfCreature);
|
List<SpawnListEntry> spawns = biome.getSpawnableList(typeOfCreature);
|
||||||
|
|
||||||
for (SpawnListEntry entry : spawns)
|
for (SpawnListEntry entry : spawns)
|
||||||
{
|
{
|
||||||
//Adjusting an existing spawn entry
|
//Adjusting an existing spawn entry
|
||||||
if (entry.field_76300_b == entityClass)
|
if (entry.entityClass == entityClass)
|
||||||
{
|
{
|
||||||
entry.field_76292_a = weightedProb;
|
entry.itemWeight = weightedProb;
|
||||||
entry.field_76301_c = min;
|
entry.minGroupCount = min;
|
||||||
entry.field_76299_d = max;
|
entry.maxGroupCount = max;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -277,7 +277,7 @@ public class EntityRegistry
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public static void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType spawnList, BiomeGenBase... biomes)
|
public static void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType spawnList, BiomeGenBase... biomes)
|
||||||
{
|
{
|
||||||
Class <? extends Entity > entityClazz = (Class<? extends Entity>) EntityList.field_75625_b.get(entityName);
|
Class <? extends Entity > entityClazz = (Class<? extends Entity>) EntityList.stringToClassMapping.get(entityName);
|
||||||
|
|
||||||
if (EntityLiving.class.isAssignableFrom(entityClazz))
|
if (EntityLiving.class.isAssignableFrom(entityClazz))
|
||||||
{
|
{
|
||||||
|
@ -290,12 +290,12 @@ public class EntityRegistry
|
||||||
for (BiomeGenBase biome : biomes)
|
for (BiomeGenBase biome : biomes)
|
||||||
{
|
{
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
Iterator<SpawnListEntry> spawns = biome.func_76747_a(typeOfCreature).iterator();
|
Iterator<SpawnListEntry> spawns = biome.getSpawnableList(typeOfCreature).iterator();
|
||||||
|
|
||||||
while (spawns.hasNext())
|
while (spawns.hasNext())
|
||||||
{
|
{
|
||||||
SpawnListEntry entry = spawns.next();
|
SpawnListEntry entry = spawns.next();
|
||||||
if (entry.field_76300_b == entityClass)
|
if (entry.entityClass == entityClass)
|
||||||
{
|
{
|
||||||
spawns.remove();
|
spawns.remove();
|
||||||
}
|
}
|
||||||
|
@ -306,7 +306,7 @@ public class EntityRegistry
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public static void removeSpawn(String entityName, EnumCreatureType spawnList, BiomeGenBase... biomes)
|
public static void removeSpawn(String entityName, EnumCreatureType spawnList, BiomeGenBase... biomes)
|
||||||
{
|
{
|
||||||
Class <? extends Entity > entityClazz = (Class<? extends Entity>) EntityList.field_75625_b.get(entityName);
|
Class <? extends Entity > entityClazz = (Class<? extends Entity>) EntityList.stringToClassMapping.get(entityName);
|
||||||
|
|
||||||
if (EntityLiving.class.isAssignableFrom(entityClazz))
|
if (EntityLiving.class.isAssignableFrom(entityClazz))
|
||||||
{
|
{
|
||||||
|
@ -361,7 +361,7 @@ public class EntityRegistry
|
||||||
EntityRegistration er = lookupModSpawn(entity.getClass(), true);
|
EntityRegistration er = lookupModSpawn(entity.getClass(), true);
|
||||||
if (er != null)
|
if (er != null)
|
||||||
{
|
{
|
||||||
entityTracker.func_72785_a(entity, er.getTrackingRange(), er.getUpdateFrequency(), er.sendsVelocityUpdates());
|
entityTracker.addEntityToTracker(entity, er.getTrackingRange(), er.getUpdateFrequency(), er.sendsVelocityUpdates());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -6,10 +6,12 @@ import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import net.minecraft.util.ObjectIntIdentityMap;
|
import net.minecraft.util.ObjectIntIdentityMap;
|
||||||
import net.minecraft.util.RegistryNamespaced;
|
import net.minecraft.util.RegistryNamespaced;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
import cpw.mods.fml.common.FMLLog;
|
import cpw.mods.fml.common.FMLLog;
|
||||||
import cpw.mods.fml.common.Loader;
|
import cpw.mods.fml.common.Loader;
|
||||||
import cpw.mods.fml.common.ModContainer;
|
import cpw.mods.fml.common.ModContainer;
|
||||||
|
@ -45,12 +47,12 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespaced {
|
||||||
this.minId = registry.minId;
|
this.minId = registry.minId;
|
||||||
this.aliases.clear();
|
this.aliases.clear();
|
||||||
this.aliases.putAll(registry.aliases);
|
this.aliases.putAll(registry.aliases);
|
||||||
field_148759_a = new ObjectIntIdentityMap();
|
underlyingIntegerMap = new ObjectIntIdentityMap();
|
||||||
field_82596_a.clear();
|
registryObjects.clear();
|
||||||
|
|
||||||
for (I thing : (Iterable<I>) registry)
|
for (I thing : (Iterable<I>) registry)
|
||||||
{
|
{
|
||||||
super.func_148756_a(registry.getId(thing), registry.func_148750_c(thing), thing);
|
super.addObject(registry.getId(thing), registry.getNameForObject(thing), thing);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,49 +65,41 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespaced {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public void func_148756_a(int id, String name, Object thing)
|
public void addObject(int id, String name, Object thing)
|
||||||
{
|
{
|
||||||
GameData.getMain().register(thing, name, id);
|
GameData.getMain().register(thing, name, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public I func_82594_a(String name)
|
public I getObject(String name)
|
||||||
{
|
{
|
||||||
I object = getRaw(name);
|
I object = getRaw(name);
|
||||||
return object == null ? this.optionalDefaultObject : object;
|
return object == null ? this.optionalDefaultObject : object;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public I func_148754_a(int id)
|
public I getObjectById(int id)
|
||||||
{
|
{
|
||||||
I object = getRaw(id);
|
I object = getRaw(id);
|
||||||
return object == null ? this.optionalDefaultObject : object;
|
return object == null ? this.optionalDefaultObject : object;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the object identified by the specified id.
|
* @deprecated use getObjectById instead
|
||||||
*
|
|
||||||
* The default object is the air block for the block registry or null for the item registry.
|
|
||||||
*
|
|
||||||
* @param id Block/Item id.
|
|
||||||
* @return Block/Item object or the default object if it wasn't found.
|
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public I get(int id)
|
public I get(int id)
|
||||||
{
|
{
|
||||||
return func_148754_a(id);
|
return getObjectById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the object identified by the specified name.
|
* @deprecated use getObject instead
|
||||||
*
|
|
||||||
* The default object is the air block for the block registry or null for the item registry.
|
|
||||||
*
|
|
||||||
* @param name Block/Item name.
|
|
||||||
* @return Block/Item object or the default object if it wasn't found.
|
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public I get(String name)
|
public I get(String name)
|
||||||
{
|
{
|
||||||
return func_82594_a(name);
|
return getObject(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -121,7 +115,7 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespaced {
|
||||||
*/
|
*/
|
||||||
public int getId(I thing)
|
public int getId(I thing)
|
||||||
{
|
{
|
||||||
return func_148757_b(thing);
|
return getIDForObject(thing);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -132,7 +126,7 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespaced {
|
||||||
*/
|
*/
|
||||||
public I getRaw(int id)
|
public I getRaw(int id)
|
||||||
{
|
{
|
||||||
return superType.cast(super.func_148754_a(id));
|
return superType.cast(super.getObjectById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -143,7 +137,7 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespaced {
|
||||||
*/
|
*/
|
||||||
public I getRaw(String name)
|
public I getRaw(String name)
|
||||||
{
|
{
|
||||||
I ret = superType.cast(super.func_82594_a(name));
|
I ret = superType.cast(super.getObject(name));
|
||||||
|
|
||||||
if (ret == null) // no match, try aliases recursively
|
if (ret == null) // no match, try aliases recursively
|
||||||
{
|
{
|
||||||
|
@ -156,15 +150,15 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespaced {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean func_148741_d(String name)
|
public boolean containsKey(String name)
|
||||||
{
|
{
|
||||||
boolean ret = super.func_148741_d(name);
|
boolean ret = super.containsKey(name);
|
||||||
|
|
||||||
if (!ret) // no match, try aliases recursively
|
if (!ret) // no match, try aliases recursively
|
||||||
{
|
{
|
||||||
name = aliases.get(name);
|
name = aliases.get(name);
|
||||||
|
|
||||||
if (name != null) return func_148741_d(name);
|
if (name != null) return containsKey(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -189,9 +183,13 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespaced {
|
||||||
return getId(obj);
|
return getId(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated use containsKey instead
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
public boolean contains(String itemName)
|
public boolean contains(String itemName)
|
||||||
{
|
{
|
||||||
return func_148741_d(itemName);
|
return containsKey(itemName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// internal
|
// internal
|
||||||
|
@ -201,7 +199,7 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespaced {
|
||||||
{
|
{
|
||||||
for (I thing : (Iterable<I>) this)
|
for (I thing : (Iterable<I>) this)
|
||||||
{
|
{
|
||||||
idMapping.put(discriminator+func_148750_c(thing), getId(thing));
|
idMapping.put(discriminator+getNameForObject(thing), getId(thing));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,6 +210,7 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespaced {
|
||||||
|
|
||||||
int add(int id, String name, I thing, BitSet availabilityMap)
|
int add(int id, String name, I thing, BitSet availabilityMap)
|
||||||
{
|
{
|
||||||
|
if (thing == null) throw new NullPointerException("Can't add null-object to the registry.");
|
||||||
if (name.equals(optionalDefaultName))
|
if (name.equals(optionalDefaultName))
|
||||||
{
|
{
|
||||||
this.optionalDefaultObject = thing;
|
this.optionalDefaultObject = thing;
|
||||||
|
@ -233,7 +232,7 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespaced {
|
||||||
String prefix = mc.getModId();
|
String prefix = mc.getModId();
|
||||||
name = prefix + ":"+ name;
|
name = prefix + ":"+ name;
|
||||||
}
|
}
|
||||||
super.func_148756_a(idToUse, name, thing);
|
super.addObject(idToUse, name, thing);
|
||||||
FMLLog.finer("Add : %s %d %s", name, idToUse, thing);
|
FMLLog.finer("Add : %s %d %s", name, idToUse, thing);
|
||||||
return idToUse;
|
return idToUse;
|
||||||
}
|
}
|
||||||
|
@ -250,7 +249,7 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespaced {
|
||||||
|
|
||||||
for (I thing : (Iterable<I>) this)
|
for (I thing : (Iterable<I>) this)
|
||||||
{
|
{
|
||||||
if (!registry.field_148758_b.containsKey(thing)) ret.put(func_148750_c(thing), getId(thing));
|
if (!registry.field_148758_b.containsKey(thing)) ret.put(getNameForObject(thing), getId(thing));
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -272,7 +271,7 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespaced {
|
||||||
for (int id : ids)
|
for (int id : ids)
|
||||||
{
|
{
|
||||||
I thing = getRaw(id);
|
I thing = getRaw(id);
|
||||||
FMLLog.finer("Registry : %s %d %s", func_148750_c(thing), id, thing);
|
FMLLog.finer("Registry : %s %d %s", getNameForObject(thing), id, thing);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,13 +156,13 @@ public class GameData {
|
||||||
|
|
||||||
static Item findItem(String modId, String name)
|
static Item findItem(String modId, String name)
|
||||||
{
|
{
|
||||||
return (Item) getMain().iItemRegistry.func_82594_a(modId + ":" + name);
|
return (Item) getMain().iItemRegistry.getObject(modId + ":" + name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Block findBlock(String modId, String name)
|
static Block findBlock(String modId, String name)
|
||||||
{
|
{
|
||||||
String key = modId + ":" + name;
|
String key = modId + ":" + name;
|
||||||
return getMain().iBlockRegistry.contains(key) ? getMain().iBlockRegistry.func_82594_a(key) : null;
|
return getMain().iBlockRegistry.containsKey(key) ? getMain().iBlockRegistry.getObject(key) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ItemStack findItemStack(String modId, String name)
|
static ItemStack findItemStack(String modId, String name)
|
||||||
|
@ -195,7 +195,7 @@ public class GameData {
|
||||||
static UniqueIdentifier getUniqueName(Block block)
|
static UniqueIdentifier getUniqueName(Block block)
|
||||||
{
|
{
|
||||||
if (block == null) return null;
|
if (block == null) return null;
|
||||||
String name = getMain().iBlockRegistry.func_148750_c(block);
|
String name = getMain().iBlockRegistry.getNameForObject(block);
|
||||||
UniqueIdentifier ui = new UniqueIdentifier(name);
|
UniqueIdentifier ui = new UniqueIdentifier(name);
|
||||||
if (customItemStacks.contains(ui.modId, ui.name))
|
if (customItemStacks.contains(ui.modId, ui.name))
|
||||||
{
|
{
|
||||||
|
@ -208,7 +208,7 @@ public class GameData {
|
||||||
static UniqueIdentifier getUniqueName(Item item)
|
static UniqueIdentifier getUniqueName(Item item)
|
||||||
{
|
{
|
||||||
if (item == null) return null;
|
if (item == null) return null;
|
||||||
String name = getMain().iItemRegistry.func_148750_c(item);
|
String name = getMain().iItemRegistry.getNameForObject(item);
|
||||||
UniqueIdentifier ui = new UniqueIdentifier(name);
|
UniqueIdentifier ui = new UniqueIdentifier(name);
|
||||||
if (customItemStacks.contains(ui.modId, ui.name))
|
if (customItemStacks.contains(ui.modId, ui.name))
|
||||||
{
|
{
|
||||||
|
@ -360,7 +360,7 @@ public class GameData {
|
||||||
isBlock ? "block" : "item",
|
isBlock ? "block" : "item",
|
||||||
itemName,
|
itemName,
|
||||||
newId,
|
newId,
|
||||||
isBlock ? newData.iBlockRegistry.get(newId) : newData.iItemRegistry.get(newId)));
|
isBlock ? newData.iBlockRegistry.getObjectById(newId) : newData.iItemRegistry.getObjectById(newId)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -387,11 +387,11 @@ public class GameData {
|
||||||
|
|
||||||
if (isBlock)
|
if (isBlock)
|
||||||
{
|
{
|
||||||
newId = newData.registerBlock(frozen.iBlockRegistry.get(itemName), itemName, null, currId);
|
newId = newData.registerBlock(frozen.iBlockRegistry.getRaw(itemName), itemName, null, currId);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
newId = newData.registerItem(frozen.iItemRegistry.get(itemName), itemName, null, currId);
|
newId = newData.registerItem(frozen.iItemRegistry.getRaw(itemName), itemName, null, currId);
|
||||||
}
|
}
|
||||||
|
|
||||||
FMLLog.info("Injected new block/item %s : %d (was %d)", itemName, newId, currId);
|
FMLLog.info("Injected new block/item %s : %d (was %d)", itemName, newId, currId);
|
||||||
|
@ -432,7 +432,7 @@ public class GameData {
|
||||||
if (remap.type == Type.BLOCK)
|
if (remap.type == Type.BLOCK)
|
||||||
{
|
{
|
||||||
currId = getMain().iBlockRegistry.getId((Block) remap.getTarget());
|
currId = getMain().iBlockRegistry.getId((Block) remap.getTarget());
|
||||||
newName = getMain().iBlockRegistry.func_148750_c(remap.getTarget());
|
newName = getMain().iBlockRegistry.getNameForObject(remap.getTarget());
|
||||||
FMLLog.fine("The Block %s is being remapped to %s.", remap.name, newName);
|
FMLLog.fine("The Block %s is being remapped to %s.", remap.name, newName);
|
||||||
|
|
||||||
newId = gameData.registerBlock((Block) remap.getTarget(), newName, null, remap.id);
|
newId = gameData.registerBlock((Block) remap.getTarget(), newName, null, remap.id);
|
||||||
|
@ -441,7 +441,7 @@ public class GameData {
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
currId = getMain().iItemRegistry.getId((Item) remap.getTarget());
|
currId = getMain().iItemRegistry.getId((Item) remap.getTarget());
|
||||||
newName = getMain().iItemRegistry.func_148750_c(remap.getTarget());
|
newName = getMain().iItemRegistry.getNameForObject(remap.getTarget());
|
||||||
FMLLog.fine("The Item %s is being remapped to %s.", remap.name, newName);
|
FMLLog.fine("The Item %s is being remapped to %s.", remap.name, newName);
|
||||||
|
|
||||||
newId = gameData.registerItem((Item) remap.getTarget(), newName, null, remap.id);
|
newId = gameData.registerItem((Item) remap.getTarget(), newName, null, remap.id);
|
||||||
|
@ -597,9 +597,9 @@ public class GameData {
|
||||||
throw new RuntimeException("Cannot register an itemblock before its block");
|
throw new RuntimeException("Cannot register an itemblock before its block");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iItemRegistry.get(idHint) != null)
|
if (iItemRegistry.getObjectById(idHint) != null)
|
||||||
{
|
{
|
||||||
throw new IllegalStateException(String.format("The Item Registry slot %d is already used by %s", idHint, iItemRegistry.get(idHint)));
|
throw new IllegalStateException(String.format("The Item Registry slot %d is already used by %s", idHint, iItemRegistry.getObjectById(idHint)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!freeSlot(idHint)) // temporarily free the slot occupied by the Block for the ItemBlock registration
|
if (!freeSlot(idHint)) // temporarily free the slot occupied by the Block for the ItemBlock registration
|
||||||
|
|
|
@ -90,7 +90,7 @@ public class GameRegistry
|
||||||
{
|
{
|
||||||
computeSortedGeneratorList();
|
computeSortedGeneratorList();
|
||||||
}
|
}
|
||||||
long worldSeed = world.func_72905_C();
|
long worldSeed = world.getSeed();
|
||||||
Random fmlRandom = new Random(worldSeed);
|
Random fmlRandom = new Random(worldSeed);
|
||||||
long xSeed = fmlRandom.nextLong() >> 2 + 1L;
|
long xSeed = fmlRandom.nextLong() >> 2 + 1L;
|
||||||
long zSeed = fmlRandom.nextLong() >> 2 + 1L;
|
long zSeed = fmlRandom.nextLong() >> 2 + 1L;
|
||||||
|
@ -214,38 +214,38 @@ public class GameRegistry
|
||||||
|
|
||||||
public static IRecipe addShapedRecipe(ItemStack output, Object... params)
|
public static IRecipe addShapedRecipe(ItemStack output, Object... params)
|
||||||
{
|
{
|
||||||
return CraftingManager.func_77594_a().func_92103_a(output, params);
|
return CraftingManager.getInstance().addRecipe(output, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addShapelessRecipe(ItemStack output, Object... params)
|
public static void addShapelessRecipe(ItemStack output, Object... params)
|
||||||
{
|
{
|
||||||
CraftingManager.func_77594_a().func_77596_b(output, params);
|
CraftingManager.getInstance().addShapelessRecipe(output, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public static void addRecipe(IRecipe recipe)
|
public static void addRecipe(IRecipe recipe)
|
||||||
{
|
{
|
||||||
CraftingManager.func_77594_a().func_77592_b().add(recipe);
|
CraftingManager.getInstance().getRecipeList().add(recipe);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addSmelting(Block input, ItemStack output, float xp)
|
public static void addSmelting(Block input, ItemStack output, float xp)
|
||||||
{
|
{
|
||||||
FurnaceRecipes.func_77602_a().func_151393_a(input, output, xp);
|
FurnaceRecipes.smelting().func_151393_a(input, output, xp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addSmelting(Item input, ItemStack output, float xp)
|
public static void addSmelting(Item input, ItemStack output, float xp)
|
||||||
{
|
{
|
||||||
FurnaceRecipes.func_77602_a().func_151396_a(input, output, xp);
|
FurnaceRecipes.smelting().func_151396_a(input, output, xp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addSmelting(ItemStack input, ItemStack output, float xp)
|
public static void addSmelting(ItemStack input, ItemStack output, float xp)
|
||||||
{
|
{
|
||||||
FurnaceRecipes.func_77602_a().func_151394_a(input, output, xp);
|
FurnaceRecipes.smelting().func_151394_a(input, output, xp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void registerTileEntity(Class<? extends TileEntity> tileEntityClass, String id)
|
public static void registerTileEntity(Class<? extends TileEntity> tileEntityClass, String id)
|
||||||
{
|
{
|
||||||
TileEntity.func_145826_a(tileEntityClass, id);
|
TileEntity.addMapping(tileEntityClass, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -258,8 +258,8 @@ public class GameRegistry
|
||||||
*/
|
*/
|
||||||
public static void registerTileEntityWithAlternatives(Class<? extends TileEntity> tileEntityClass, String id, String... alternatives)
|
public static void registerTileEntityWithAlternatives(Class<? extends TileEntity> tileEntityClass, String id, String... alternatives)
|
||||||
{
|
{
|
||||||
TileEntity.func_145826_a(tileEntityClass, id);
|
TileEntity.addMapping(tileEntityClass, id);
|
||||||
Map<String,Class<?>> teMappings = ObfuscationReflectionHelper.getPrivateValue(TileEntity.class, null, "field_" + "145855_i", "field_145855_i");
|
Map<String,Class<?>> teMappings = ObfuscationReflectionHelper.getPrivateValue(TileEntity.class, null, "field_" + "145855_i", "nameToClassMap");
|
||||||
for (String s: alternatives)
|
for (String s: alternatives)
|
||||||
{
|
{
|
||||||
if (!teMappings.containsKey(s))
|
if (!teMappings.containsKey(s))
|
||||||
|
@ -334,8 +334,8 @@ public class GameRegistry
|
||||||
ItemStack foundStack = GameData.findItemStack(modId, name);
|
ItemStack foundStack = GameData.findItemStack(modId, name);
|
||||||
if (foundStack != null)
|
if (foundStack != null)
|
||||||
{
|
{
|
||||||
ItemStack is = foundStack.func_77946_l();
|
ItemStack is = foundStack.copy();
|
||||||
is.field_77994_a = Math.min(stackSize, is.func_77976_d());
|
is.stackSize = Math.min(stackSize, is.getMaxStackSize());
|
||||||
return is;
|
return is;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -127,11 +127,11 @@ public class LanguageRegistry
|
||||||
{
|
{
|
||||||
String objectName;
|
String objectName;
|
||||||
if (objectToName instanceof Item) {
|
if (objectToName instanceof Item) {
|
||||||
objectName=((Item)objectToName).func_77658_a();
|
objectName=((Item)objectToName).getUnlocalizedName();
|
||||||
} else if (objectToName instanceof Block) {
|
} else if (objectToName instanceof Block) {
|
||||||
objectName=((Block)objectToName).func_149739_a();
|
objectName=((Block)objectToName).getUnlocalizedName();
|
||||||
} else if (objectToName instanceof ItemStack) {
|
} else if (objectToName instanceof ItemStack) {
|
||||||
objectName=((ItemStack)objectToName).func_77973_b().func_77667_c((ItemStack)objectToName);
|
objectName=((ItemStack)objectToName).getItem().getUnlocalizedName((ItemStack)objectToName);
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException(String.format("Illegal object for naming %s",objectToName));
|
throw new IllegalArgumentException(String.format("Illegal object for naming %s",objectToName));
|
||||||
}
|
}
|
||||||
|
|
|
@ -217,7 +217,7 @@ public class VillagerRegistry
|
||||||
public static Object getVillageComponent(StructureVillagePieces.PieceWeight villagePiece, StructureVillagePieces.Start startPiece, @SuppressWarnings("rawtypes") List pieces, Random random,
|
public static Object getVillageComponent(StructureVillagePieces.PieceWeight villagePiece, StructureVillagePieces.Start startPiece, @SuppressWarnings("rawtypes") List pieces, Random random,
|
||||||
int p1, int p2, int p3, int p4, int p5)
|
int p1, int p2, int p3, int p4, int p5)
|
||||||
{
|
{
|
||||||
return instance().villageCreationHandlers.get(villagePiece.field_75090_a).buildComponent(villagePiece, startPiece, pieces, random, p1, p2, p3, p4, p5);
|
return instance().villageCreationHandlers.get(villagePiece.villagePieceClass).buildComponent(villagePiece, startPiece, pieces, random, p1, p2, p3, p4, p5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ public class VillagerRegistry
|
||||||
{
|
{
|
||||||
if (min > 0 && max > 0)
|
if (min > 0 && max > 0)
|
||||||
{
|
{
|
||||||
EntityVillager.field_70958_bB.put(item, new Tuple(min, max));
|
EntityVillager.villagersSellingList.put(item, new Tuple(min, max));
|
||||||
}
|
}
|
||||||
EntityVillager.func_146091_a(list, item, random, chance);
|
EntityVillager.func_146091_a(list, item, random, chance);
|
||||||
}
|
}
|
||||||
|
@ -236,7 +236,7 @@ public class VillagerRegistry
|
||||||
{
|
{
|
||||||
if (min > 0 && max > 0)
|
if (min > 0 && max > 0)
|
||||||
{
|
{
|
||||||
EntityVillager.field_70960_bC.put(item, new Tuple(min, max));
|
EntityVillager.blacksmithSellingList.put(item, new Tuple(min, max));
|
||||||
}
|
}
|
||||||
EntityVillager.func_146089_b(list, item, random, chance);
|
EntityVillager.func_146089_b(list, item, random, chance);
|
||||||
}
|
}
|
||||||
|
@ -245,6 +245,6 @@ public class VillagerRegistry
|
||||||
{
|
{
|
||||||
int extra = instance().newVillagerIds.size();
|
int extra = instance().newVillagerIds.size();
|
||||||
int trade = rand.nextInt(5 + extra);
|
int trade = rand.nextInt(5 + extra);
|
||||||
villager.func_70938_b(trade < 5 ? trade : instance().newVillagerIds.get(trade - 5));
|
villager.setProfession(trade < 5 ? trade : instance().newVillagerIds.get(trade - 5));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
1
fml/src/main/resources/fml.exc
Normal file
1
fml/src/main/resources/fml.exc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
net/minecraft/server/management/ServerConfigurationManager.initializeConnectionToPlayer(Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;Lnet/minecraft/network/NetHandlerPlayServer;)V=|p_72355_1_,p_72355_2_,nethandlerplayserver
|
1
fml/src/main/resources/fml.srg
Normal file
1
fml/src/main/resources/fml.srg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
MD: net/minecraft/server/management/ServerConfigurationManager/initializeConnectionToPlayer (Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;Lnet/minecraft/network/NetHandlerPlayServer;)V net/minecraft/server/management/ServerConfigurationManager/func_72355_a (Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;Lnet/minecraft/network/NetHandlerPlayServer;)V
|
Loading…
Reference in a new issue