Skip to content

Commit 1d21919

Browse files
committed
Back to Thermos
1 parent ef27595 commit 1d21919

File tree

540 files changed

+10649
-14961
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

540 files changed

+10649
-14961
lines changed

LICENSE

+13-670
Large diffs are not rendered by default.

build.gradle

+7-3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ minecraft {
6161
tweakClass = 'cpw.mods.fml.common.launcher.FMLTweaker'
6262
installerVersion = "1.4"
6363
srgExtra "PK: org/bukkit/craftbukkit org/bukkit/craftbukkit/v1_7_R4"
64+
tasks.withType(JavaCompile) {
65+
options.encoding = "UTF-8"
66+
}
6467
}
6568

6669
group = 'red.mohist'
@@ -81,7 +84,7 @@ configurations {
8184

8285

8386
dependencies {
84-
bootstrap 'pw.prok:KBootstrap:0.2.+'
87+
bootstrap 'pw.prok:KBootstrapX:0.2.+'
8588
libraries 'org.ow2.asm:asm-all:5.0.3'
8689
libraries 'com.typesafe.akka:akka-actor_2.11:2.3.3'
8790
libraries 'com.typesafe:config:1.3.1'
@@ -111,8 +114,9 @@ dependencies {
111114
libraries 'net.openhft:affinity:3.0.1'
112115
libraries 'org.fusesource.jansi:jansi:1.11'
113116
libraries 'java3d:vecmath:1.3.1'
114-
libraries 'colt:colt:1.2.0'
115-
libraries 'org.jetbrains.kotlin:kotlin-runtime:1.1.4-2'
117+
libraries 'com.koloboke:koloboke-api-jdk8:1.0.0'
118+
libraries 'com.koloboke:koloboke-impl-common-jdk8:1.0.0'
119+
libraries 'com.koloboke:koloboke-impl-jdk8:1.0.0'
116120
}
117121

118122
packageUniversal {

patches/cpw/mods/fml/common/FMLCommonHandler.java.patch

+16-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
--- ../src-base/minecraft/cpw/mods/fml/common/FMLCommonHandler.java
22
+++ ../src-work/minecraft/cpw/mods/fml/common/FMLCommonHandler.java
3-
@@ -37,6 +37,10 @@
3+
@@ -31,12 +31,17 @@
4+
import net.minecraft.network.INetHandler;
5+
import net.minecraft.network.NetworkManager;
6+
import net.minecraft.server.MinecraftServer;
7+
+import net.minecraft.server.management.ServerConfigurationManager;
8+
import net.minecraft.world.World;
9+
import net.minecraft.world.storage.SaveHandler;
10+
import net.minecraft.world.storage.WorldInfo;
411

512
import org.apache.logging.log4j.Level;
613
import org.apache.logging.log4j.Logger;
@@ -11,7 +18,7 @@
1118

1219
import com.google.common.base.Joiner;
1320
import com.google.common.base.Strings;
14-
@@ -151,13 +155,7 @@
21+
@@ -151,13 +156,7 @@
1522
*/
1623
public Side getEffectiveSide()
1724
{
@@ -26,14 +33,6 @@
2633
}
2734
/**
2835
* Raise an exception
29-
@@ -245,6 +243,7 @@
30-
public void onPostServerTick()
31-
{
32-
bus().post(new TickEvent.ServerTickEvent(Phase.END));
33-
+ cc.uraniummc.ChunkGenerator.INSTANCE.chunkGeneratorCycle(); // KCauldron
34-
}
35-
36-
/**
3736
@@ -385,10 +384,11 @@
3837
{
3938
return;
@@ -54,22 +53,26 @@
5453
- List<String> modNames = Lists.newArrayListWithExpectedSize(3);
5554
+ // Cauldron start
5655
+ List<String> modNames = Lists.newArrayListWithExpectedSize(6);
57-
+ modNames.add("uranium");
58-
+ modNames.add("kcauldron");
56+
+ modNames.add("thermos");
5957
+ modNames.add("cauldron");
6058
+ modNames.add("craftbukkit");
6159
+ modNames.add("mcpc");
60+
+ modNames.add("kcauldron");
6261
+ // Cauldron end
6362
modNames.add("fml");
6463
if (!noForge)
6564
{
66-
@@ -540,8 +547,17 @@
65+
@@ -540,8 +547,21 @@
6766
bus().post(new InputEvent.KeyInputEvent());
6867
}
6968

7069
+ // Cauldron start - wrapper to notify plugins for mods that bypass ServerConfigurationManager
7170
public void firePlayerChangedDimensionEvent(EntityPlayer player, int fromDim, int toDim)
7271
{
72+
+ // Thermos - (Robotia) Ok so turns out whoever wrote this bit didn't get enough sleep.
73+
+ // It should've gotten the dim from the fromDim ID, not the player world.
74+
+ // The player world returns the world the player is in after transfer...!
75+
+ // It should be fine now though.
7376
+ this.firePlayerChangedDimensionEvent(player, fromDim, toDim, MinecraftServer.getServer().worldServerForDimension(fromDim).getWorld());
7477
+ }
7578
+

patches/cpw/mods/fml/common/discovery/ModDiscoverer.java.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
}
1515
}
1616

17-
+ if (!"false".equals(System.getProperty("kcauldron.fastcraft.disable", "true"))) {
17+
+ if (!"false".equals(System.getProperty("thermos.fastcraft.disable", "true"))) {
1818
+ java.util.Iterator<ModContainer> iterator = modList.iterator();
1919
+ while(iterator.hasNext()) {
2020
+ ModContainer container = iterator.next();
2121
+ if ("FastCraft".equals(container.getModId())) {
22-
+ FMLLog.log(Level.WARN, "Found FastCraft mod, removing it...");
22+
+ FMLLog.log(Level.WARN, "[Thermos] Sorry, the FastCraft mod will not be loaded due to Thermos compatibility issues. If you still wish to enable it, add \"-thermos.fastcraft.disable=false\" to your server launch script.");
2323
+ iterator.remove();
2424
+ }
2525
+ }

patches/cpw/mods/fml/common/network/FMLEventChannel.java.patch

-43
This file was deleted.

patches/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState.java.patch

+13-12
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
--- ../src-base/minecraft/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState.java
22
+++ ../src-work/minecraft/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState.java
3-
@@ -9,6 +9,7 @@
4-
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
5-
import cpw.mods.fml.common.registry.GameData;
6-
import cpw.mods.fml.relauncher.Side;
7-
+import net.minecraft.server.MinecraftServer;
8-
9-
enum FMLHandshakeServerState implements IHandshakeState<FMLHandshakeServerState>
10-
{
11-
@@ -37,8 +38,13 @@
3+
@@ -19,6 +19,10 @@
4+
{
5+
NetworkDispatcher dispatcher = ctx.channel().attr(NetworkDispatcher.FML_DISPATCHER).get();
6+
int overrideDim = dispatcher.serverInitiateHandshake();
7+
+ if(overrideDim == -100000)
8+
+ {
9+
+ return ERROR;
10+
+ }
11+
ctx.writeAndFlush(FMLHandshakeMessage.makeCustomChannelRegistration(NetworkRegistry.INSTANCE.channelNamesFor(Side.SERVER))).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE);
12+
ctx.writeAndFlush(new FMLHandshakeMessage.ServerHello(overrideDim)).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE);
13+
return HELLO;
14+
@@ -37,7 +41,11 @@
1215
}
1316

1417
FMLHandshakeMessage.ModList client = (FMLHandshakeMessage.ModList)msg;
1518
- FMLLog.info("Client attempting to join with %d mods : %s", client.modListSize(), client.modListAsString());
16-
+ if (net.minecraft.server.MinecraftServer.uraniumConfig.loggingClientModList.getValue()) {
19+
+ if (net.minecraft.server.MinecraftServer.thermosConfig.loggingClientModList.getValue()) {
1720
+ FMLLog.info("Client attempting to join with %d mods : %s", client.modListSize(), client.modListAsString());
1821
+ } else {
1922
+ FMLLog.info("Client attempting to join with %d mods", client.modListSize());
2023
+ }
2124
String result = FMLNetworkHandler.checkModList(client, Side.CLIENT);
22-
+
2325
if (result != null)
2426
{
25-
NetworkDispatcher dispatcher = ctx.channel().attr(NetworkDispatcher.FML_DISPATCHER).get();

patches/cpw/mods/fml/common/network/internal/FMLNetworkHandler.java.patch

+4-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- ../src-base/minecraft/cpw/mods/fml/common/network/internal/FMLNetworkHandler.java
22
+++ ../src-work/minecraft/cpw/mods/fml/common/network/internal/FMLNetworkHandler.java
3-
@@ -47,6 +47,17 @@
3+
@@ -47,6 +47,16 @@
44
import cpw.mods.fml.common.registry.EntityRegistry.EntityRegistration;
55
import cpw.mods.fml.relauncher.Side;
66
import cpw.mods.fml.relauncher.SideOnly;
@@ -13,12 +13,11 @@
1313
+import org.bukkit.craftbukkit.inventory.CraftInventory;
1414
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
1515
+import org.bukkit.event.inventory.InventoryType;
16-
+import red.mohist.configuration.MohistConfig;
1716
+// Cauldron end
1817

1918
public class FMLNetworkHandler
2019
{
21-
@@ -75,6 +86,31 @@
20+
@@ -75,6 +85,31 @@
2221
Container remoteGuiContainer = NetworkRegistry.INSTANCE.getRemoteGuiContainer(mc, entityPlayerMP, modGuiId, world, x, y, z);
2322
if (remoteGuiContainer != null)
2423
{
@@ -50,15 +49,15 @@
5049
entityPlayerMP.getNextWindowId();
5150
entityPlayerMP.closeContainer();
5251
int windowId = entityPlayerMP.currentWindowId;
53-
@@ -131,6 +167,7 @@
52+
@@ -131,6 +166,7 @@
5453
public static String checkModList(Map<String,String> listData, Side side)
5554
{
5655
List<ModContainer> rejects = Lists.newArrayList();
5756
+ List<ModContainer> hackpacks = Lists.newArrayList();
5857
for (Entry<ModContainer, NetworkModHolder> networkMod : NetworkRegistry.INSTANCE.registry().entrySet())
5958
{
6059
boolean result = networkMod.getValue().check(listData, side);
61-
@@ -138,9 +175,15 @@
60+
@@ -138,9 +174,15 @@
6261
{
6362
rejects.add(networkMod.getKey());
6463
}
@@ -74,12 +73,3 @@
7473
return null;
7574
}
7675
else
77-
@@ -188,7 +231,7 @@
78-
public static void enhanceStatusQuery(JsonObject jsonobject)
79-
{
80-
JsonObject fmlData = new JsonObject();
81-
- fmlData.addProperty("type", "FML");
82-
+ fmlData.addProperty("type", MohistConfig.instance.server_type.getValue());
83-
JsonArray modList = new JsonArray();
84-
for (ModContainer mc : Loader.instance().getActiveModList())
85-
{

patches/cpw/mods/fml/common/network/internal/HandshakeCompletionHandler.java.patch

+4-20
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,17 @@
11
--- ../src-base/minecraft/cpw/mods/fml/common/network/internal/HandshakeCompletionHandler.java
22
+++ ../src-work/minecraft/cpw/mods/fml/common/network/internal/HandshakeCompletionHandler.java
3-
@@ -8,13 +8,29 @@
4-
import io.netty.channel.SimpleChannelInboundHandler;
5-
import io.netty.channel.ChannelHandler.Sharable;
6-
7-
+import java.util.concurrent.Executor;
8-
+import java.util.concurrent.ExecutorService;
9-
+import java.util.concurrent.Executors;
10-
+
11-
@Sharable
12-
public class HandshakeCompletionHandler extends SimpleChannelInboundHandler<FMLMessage.CompleteHandshake> {
13-
+ private ExecutorService pool= Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
3+
@@ -13,8 +13,14 @@
144
@Override
15-
- protected void channelRead0(ChannelHandlerContext ctx, CompleteHandshake msg) throws Exception
16-
+ protected void channelRead0(ChannelHandlerContext ctx, final CompleteHandshake msg) throws Exception
5+
protected void channelRead0(ChannelHandlerContext ctx, CompleteHandshake msg) throws Exception
176
{
187
- NetworkDispatcher dispatcher = ctx.channel().attr(NetworkDispatcher.FML_DISPATCHER).getAndRemove();
198
- dispatcher.completeHandshake(msg.target);
209
+ // Cauldron start - attempt to fix race condition with attr being null
2110
+ io.netty.util.Attribute<NetworkDispatcher> attr = ctx.channel().attr(NetworkDispatcher.FML_DISPATCHER);
2211
+ if (attr != null)
2312
+ {
24-
+ final NetworkDispatcher dispatcher = attr.getAndRemove();
25-
+ if (dispatcher != null) pool.execute(new Runnable() {
26-
+ @Override
27-
+ public void run() {
28-
+ dispatcher.completeHandshake(msg.target);
29-
+ }
30-
+ });
13+
+ NetworkDispatcher dispatcher = attr.getAndRemove();
14+
+ if (dispatcher != null) dispatcher.completeHandshake(msg.target);
3115
+ }
3216
+ // Cauldron end
3317
}

patches/cpw/mods/fml/common/network/simpleimpl/SimpleChannelHandlerWrapper.java.patch

-46
This file was deleted.

patches/cpw/mods/fml/common/registry/GameData.java.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
+ Item item = itemRegistry.getRaw(id);
3535
+ // inject item materials into Bukkit for FML
3636
+ org.bukkit.Material material = org.bukkit.Material.addMaterial(id, itemRegistry.getNameForObject(item), false);
37-
+ if (material != null && net.minecraft.server.MinecraftServer.uraniumConfig.loggingMaterialInjection.getValue())
37+
+ if (material != null)
3838
+ {
3939
+ FMLLog.info("Injected new Forge item material %s with ID %d.", material.name(), material.getId());
4040
+ }
@@ -59,7 +59,7 @@
5959
+ Block block = blockRegistry.getRaw(id);
6060
+ // inject block materials into Bukkit for FML
6161
+ org.bukkit.Material material = org.bukkit.Material.addMaterial(id, blockRegistry.getNameForObject(block), true);
62-
+ if (material != null && net.minecraft.server.MinecraftServer.uraniumConfig.loggingMaterialInjection.getValue())
62+
+ if (material != null)
6363
+ {
6464
+ FMLLog.info("Injected new Forge block material %s with ID %d.", material.name(), material.getId());
6565
+ }

patches/cpw/mods/fml/relauncher/CoreModManager.java.patch

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
private static final Attributes.Name MODTYPE = new Attributes.Name("ModType");
66
private static final Attributes.Name MODSIDE = new Attributes.Name("ModSide");
77
- private static String[] rootPlugins = { "cpw.mods.fml.relauncher.FMLCorePlugin", "net.minecraftforge.classloading.FMLForgePlugin" };
8-
+ private static String[] rootPlugins = { "cpw.mods.fml.relauncher.FMLCorePlugin", "net.minecraftforge.classloading.FMLForgePlugin", "pw.prok.imagine.ImagineLoadingPlugin","cc.uraniummc.UraniumPlusCore"};
8+
+ private static String[] rootPlugins = { "cpw.mods.fml.relauncher.FMLCorePlugin", "net.minecraftforge.classloading.FMLForgePlugin", "pw.prok.imagine.ImagineLoadingPlugin" };
99
private static List<String> loadedCoremods = Lists.newArrayList();
1010
private static List<FMLPluginWrapper> loadPlugins;
1111
private static boolean deobfuscatedEnvironment;
@@ -51,7 +51,7 @@
5151
String cascadedTweaker = mfAttributes.getValue("TweakClass");
5252
if (cascadedTweaker != null)
5353
{
54-
+ if ("fastcraft.Tweaker".equals(cascadedTweaker) && !"false".equals(System.getProperty("kcauldron.fastcraft.disable", "true"))) {
54+
+ if ("fastcraft.Tweaker".equals(cascadedTweaker) && !"false".equals(System.getProperty("thermos.fastcraft.disable", "true"))) {
5555
+ FMLRelaunchLog.info("Found FastCraft tweaker, skipping...");
5656
+ continue;
5757
+ }
@@ -62,7 +62,7 @@
6262
FMLRelaunchLog.fine("Not found coremod data in %s", coreMod.getName());
6363
continue;
6464
}
65-
+ if ("fastcraft.LoadingPlugin".equals(fmlCorePlugin) && !"false".equals(System.getProperty("kcauldron.fastcraft.disable", "true"))) {
65+
+ if ("fastcraft.LoadingPlugin".equals(fmlCorePlugin) && !"false".equals(System.getProperty("thermos.fastcraft.disable", "true"))) {
6666
+ FMLRelaunchLog.warning("Found FastCraft coremod, skipping...");
6767
+ continue;
6868
+ }

patches/cpw/mods/fml/relauncher/FMLLaunchHandler.java.patch

-17
This file was deleted.

0 commit comments

Comments
 (0)