Skip to content

Commit

Permalink
updated for ForgeGradle 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
AbrarSyed committed Mar 19, 2014
1 parent 0cd40e7 commit ff6143d
Show file tree
Hide file tree
Showing 53 changed files with 512 additions and 510 deletions.
2 changes: 1 addition & 1 deletion fml/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.1-SNAPSHOT'
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
}
}

Expand Down
12 changes: 6 additions & 6 deletions fml/patches/minecraft/net/minecraft/client/Minecraft.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
Display.setVSyncEnabled(this.field_71474_y.field_74352_v);
}

@@ -916,9 +926,11 @@
@@ -915,9 +925,11 @@

if (!this.field_71454_w)
{
Expand All @@ -77,7 +77,7 @@
}

GL11.glFlush();
@@ -1496,6 +1508,8 @@
@@ -1495,6 +1507,8 @@
--this.field_71467_ac;
}

Expand All @@ -86,23 +86,23 @@
this.field_71424_I.func_76320_a("gui");

if (!this.field_71445_n)
@@ -1646,6 +1660,7 @@
@@ -1645,6 +1659,7 @@
this.field_71462_r.func_146274_d();
}
}
+ FMLCommonHandler.instance().fireMouseInput();
}

if (this.field_71429_W > 0)
@@ -1787,6 +1802,7 @@
@@ -1786,6 +1801,7 @@
}
}
}
+ FMLCommonHandler.instance().fireKeyInput();
}
}

@@ -1978,12 +1994,15 @@
@@ -1977,12 +1993,15 @@
this.field_71453_ak.func_74428_b();
}

Expand All @@ -118,7 +118,7 @@
this.func_71403_a((WorldClient)null);
System.gc();
ISaveHandler isavehandler = this.field_71469_aa.func_75804_a(p_71371_1_, false);
@@ -2094,6 +2113,7 @@
@@ -2093,6 +2112,7 @@
this.field_110448_aq.func_148529_f();
this.func_71351_a((ServerData)null);
this.field_71455_al = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import io.netty.bootstrap.Bootstrap;
@@ -148,6 +149,7 @@
@@ -147,6 +148,7 @@
p_147224_1_.func_147407_a((String)null);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import io.netty.buffer.ByteBuf;
@@ -385,6 +389,7 @@
@@ -381,6 +385,7 @@
{
if (this.func_71197_b())
{
+ FMLCommonHandler.instance().handleServerStarted();
long i = func_130071_aq();
long l = 0L;
this.field_147147_p.func_151315_a(new ChatComponentText(this.field_71286_C));
@@ -429,6 +434,7 @@
@@ -425,6 +430,7 @@
Thread.sleep(1L);
this.field_71296_Q = true;
}
+ FMLCommonHandler.instance().handleServerStopping();
}
else
{
@@ -466,7 +472,10 @@
@@ -462,7 +468,10 @@
{
try
{
Expand All @@ -38,7 +38,7 @@
this.field_71316_v = true;
}
catch (Throwable throwable)
@@ -475,6 +484,8 @@
@@ -471,6 +480,8 @@
}
finally
{
Expand All @@ -47,39 +47,39 @@
this.func_71240_o();
}
}
@@ -517,6 +528,7 @@
@@ -513,6 +524,7 @@
{
long i = System.nanoTime();
AxisAlignedBB.func_72332_a().func_72298_a();
+ FMLCommonHandler.instance().onPreServerTick();
++this.field_71315_w;

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();
+ FMLCommonHandler.instance().onPostServerTick();
}

public void func_71190_q()
@@ -597,6 +610,7 @@
@@ -593,6 +606,7 @@
}

this.field_71304_b.func_76320_a("tick");
+ FMLCommonHandler.instance().onPreWorldTick(worldserver);
CrashReport crashreport;

try
@@ -621,6 +635,7 @@
@@ -617,6 +631,7 @@
throw new ReportedException(crashreport);
}

+ FMLCommonHandler.instance().onPostWorldTick(worldserver);
this.field_71304_b.func_76319_b();
this.field_71304_b.func_76320_a("tracker");
worldserver.func_73039_n().func_72788_a();
@@ -699,7 +714,7 @@
@@ -695,7 +710,7 @@

public String getServerModName()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}

public MinecraftServerGui(DedicatedServer p_i2362_1_)
@@ -165,8 +167,15 @@
@@ -164,8 +166,15 @@
return jpanel;
}

Expand Down
54 changes: 27 additions & 27 deletions fml/src/main/java/cpw/mods/fml/client/FMLClientHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public void beginMinecraftLoading(Minecraft minecraft, @SuppressWarnings("rawtyp
this.resourcePackList = resourcePackList;
this.resourceManager = resourceManager;
this.resourcePackMap = Maps.newHashMap();
if (minecraft.func_71355_q())
if (minecraft.isDemo())
{
FMLLog.severe("DEMO MODE DETECTED, FML will not work. Finishing now.");
haltGame("FML will not run in demo mode", new RuntimeException());
Expand Down Expand Up @@ -247,7 +247,7 @@ public void beginMinecraftLoading(Minecraft minecraft, @SuppressWarnings("rawtyp
@Override
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);
}
/**
Expand Down Expand Up @@ -279,8 +279,8 @@ public void finishMinecraftLoading()
}

// Reload resources
client.func_110436_a();
RenderingRegistry.instance().loadEntityRenderers((Map<Class<? extends Entity>, Render>)RenderManager.field_78727_a.field_78729_o);
client.refreshResources();
RenderingRegistry.instance().loadEntityRenderers((Map<Class<? extends Entity>, Render>)RenderManager.instance.entityRenderMap);
guiFactories = HashBiMap.create();
for (ModContainer mc : Loader.instance().getActiveModList())
{
Expand All @@ -302,7 +302,7 @@ public void finishMinecraftLoading()
}
}
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")
Expand Down Expand Up @@ -380,8 +380,8 @@ public static FMLClientHandler instance()
*/
public void displayGuiScreen(EntityPlayer player, GuiScreen gui)
{
if (client.field_71439_g==player && gui != null) {
client.func_147108_a(gui);
if (client.thePlayer==player && gui != null) {
client.displayGuiScreen(gui);
}
}

Expand Down Expand Up @@ -421,17 +421,17 @@ public boolean hasOptifine()
public void showGuiScreen(Object clientGuiElement)
{
GuiScreen gui = (GuiScreen) clientGuiElement;
client.func_147108_a(gui);
client.displayGuiScreen(gui);
}

public WorldClient getWorldClient()
{
return client.field_71441_e;
return client.theWorld;
}

public EntityClientPlayerMP getClientPlayerEntity()
{
return client.field_71439_g;
return client.thePlayer;
}

@Override
Expand All @@ -450,7 +450,7 @@ public void finishServerLoading()
@Override
public MinecraftServer getServer()
{
return client.func_71401_C();
return client.getIntegratedServer();
}

public void displayMissingMods(Object modMissingPacket)
Expand Down Expand Up @@ -480,7 +480,7 @@ public boolean shouldServerShouldBeKilledQuietly()
*/
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);
}


Expand Down Expand Up @@ -513,7 +513,7 @@ public void addModAsResource(ModContainer container)
@Override
public void updateResourcePackList()
{
client.func_110436_a();
client.refreshResources();
}

public IResourcePack getResourcePackFor(String modId)
Expand All @@ -524,7 +524,7 @@ public IResourcePack getResourcePackFor(String modId)
@Override
public String getCurrentLanguage()
{
return client.func_135016_M().func_135041_c().func_135034_a();
return client.getLanguageManager().getCurrentLanguage().getLanguageCode();
}

@Override
Expand All @@ -533,7 +533,7 @@ public void serverStopped()
// If the server crashes during startup, it might hang the client- reset the client so it can abend properly.
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");
}
Expand All @@ -547,14 +547,14 @@ public INetHandler getClientPlayHandler()
@Override
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)
{
NetworkManager client = getClientToServerNetworkManager();
// ONLY revert a non-local connection
if (client != null && !client.func_150731_c())
if (client != null && !client.isLocalChannel())
{
GameData.revertToFrozen();
}
Expand All @@ -567,30 +567,30 @@ public void startIntegratedServer(String id, String name, WorldSettings settings

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)
{
File dir = new File(getSavesDir(), dirName);
NBTTagCompound leveldat;
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)
{
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)
{
FMLLog.warning("There appears to be a problem loading the save %s, both level files are unreadable.", dirName);
return;
}
}
NBTTagCompound fmlData = leveldat.func_74775_l("FML");
if (fmlData.func_74764_b("ModItemData"))
NBTTagCompound fmlData = leveldat.getCompoundTag("FML");
if (fmlData.hasKey("ModItemData"))
{
showGuiScreen(new GuiOldSaveLoadConfirm(dirName, saveName, selectWorldGUI));
}
Expand All @@ -614,7 +614,7 @@ public void launchIntegratedServerCallback(String dirName, String saveName)
Thread.interrupted();
gameReleaseLatch = new CountDownLatch(1);
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());
gameReleaseLatch.await();
}
Expand All @@ -626,7 +626,7 @@ public void launchIntegratedServerCallback(String dirName, String saveName)
}
catch (GameRegistryException gre)
{
client.func_71403_a(null);
client.loadWorld(null);
showGuiScreen(new GuiModItemsMissing(gre.getItems(), gre.getMessage()));
}
Thread.interrupted();
Expand Down Expand Up @@ -676,7 +676,7 @@ public void bindServerListData(ServerData data, ServerStatusResponse originalRes
}
else
{
String serverDescription = data.field_78843_d;
String serverDescription = data.serverMOTD;
boolean moddedClientAllowed = true;
if (!Strings.isNullOrEmpty(serverDescription))
{
Expand Down Expand Up @@ -729,7 +729,7 @@ else if ("VANILLA".equals(extendedData.type))
{
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);
if (blocked)
{
Expand Down Expand Up @@ -874,7 +874,7 @@ public Void call() throws Exception

public boolean handlingCrash(CrashReport report)
{
return report.func_71505_b() instanceof GameRegistryException;
return report.getCrashCause() instanceof GameRegistryException;
}

@Override
Expand Down
Loading

0 comments on commit ff6143d

Please sign in to comment.