mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-21 20:42:35 +00:00
Merge pull request #1965 from temp1011/mc-1.12
Add IMC messages for dimension blacklist
This commit is contained in:
5 files changed
+37
-1
No files matched your search
@@ -65,4 +65,8 @@ public class HiveConfig {
|
||||
public static boolean isDimBlacklisted(int dimId) {
|
||||
return blacklistedDims.contains(dimId);
|
||||
}
|
||||
|
||||
public static void addBlacklistedDim(int dimId) {
|
||||
blacklistedDims.add(dimId);
|
||||
}
|
||||
}
|
||||
@@ -951,6 +951,12 @@ public class ModuleApiculture extends BlankForestryModule {
|
||||
String messageString = String.format("Received a '%s' request from mod '%s'. This IMC message has been replaced with the oreDictionary for 'slabWood'. Please contact the author and report this issue.", message.key, message.getSender());
|
||||
Log.warning(messageString);
|
||||
return true;
|
||||
} else if (message.key.equals("blacklist-hives-dimension")) {
|
||||
int[] dims = message.getNBTValue().getIntArray("dimensions");
|
||||
for(int dim : dims) {
|
||||
HiveConfig.addBlacklistedDim(dim);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -540,6 +540,12 @@ public class ModuleArboriculture extends BlankForestryModule {
|
||||
IMCUtil.logInvalidIMCMessage(message);
|
||||
}
|
||||
return true;
|
||||
} else if (message.key.equals("blacklist-trees-dimension")) {
|
||||
int[] dims = message.getNBTValue().getIntArray("dimensions");
|
||||
for(int dim : dims) {
|
||||
Config.blacklistTreeDim(dim);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -461,6 +461,18 @@ public class ModuleCore extends BlankForestryModule {
|
||||
return new PacketRegistryCore();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processIMCMessage(IMCMessage message) {
|
||||
if (message.key.equals("blacklist-ores-dimension")) {
|
||||
int[] dims = message.getNBTValue().getIntArray("dimensions");
|
||||
for(int dim : dims) {
|
||||
Config.blacklistOreDim(dim);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPickupHandler getPickupHandler() {
|
||||
return new PickupHandlerCore();
|
||||
|
||||
@@ -152,6 +152,14 @@ public class Config {
|
||||
public static boolean isMagicalCropsSupportEnabled() {
|
||||
return enableMagicalCropsSupport;
|
||||
}
|
||||
|
||||
public static void blacklistTreeDim(int dimID) {
|
||||
blacklistedTreeDims.add(dimID);
|
||||
}
|
||||
|
||||
public static void blacklistOreDim(int dimID) {
|
||||
blacklistedOreDims.add(dimID);
|
||||
}
|
||||
|
||||
public static void load(Side side) {
|
||||
File configCommonFile = new File(Forestry.instance.getConfigFolder(), CATEGORY_COMMON + ".cfg");
|
||||
|
||||
Reference in new issue
Block a user