Added Matter Overdrive android breathing integration by IteratorW (#448)

This commit is contained in:
Robert 2020-05-08 02:45:27 +03:00 committed by Unknown
parent 55aa32d259
commit c7fd47ff06
8 changed files with 37 additions and 1 deletions

View file

@ -142,6 +142,7 @@ dependencies {
provided curse.resolve("icbm-classic", "${config.ICBMclassic_fileid}")
provided "li.cil.oc:OpenComputers:${config.OpenComputers_version}"
provided "vazkii.patchouli:Patchouli:${config.Patchouli_version}"
provided curse.resolve("matteroverdrive", "${config.MatterOverdrive_fileid}") // "${config.MatterOverdrive_version}"
// compileOnly "mezz.jei:jei_1.10.2:3.13.+"
// compileOnly "mcp.mobius.waila:Waila:1.7.0-B3_1.9.4"

View file

@ -13,5 +13,7 @@ ImmersiveEngineering_version=0.12-+
OpenComputers_version=MC1.12.2-1.7.2.+
Patchouli_version=1.0-+
RedstoneFlux_version=1.12-2.1.+
MatterOverdrive_version=1.12.2-0.7.0.0
MatterOverdrive_fileid=2699215
mod_version=1.5.13

View file

@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists

View file

@ -221,6 +221,7 @@ import javax.annotation.Nullable;
+ "after:gregtech;"
+ "after:ic2;"
+ "after:icbmclassic@[1.12.2-4.0.0,);"
+ "after:matteroverdrive;"
+ "after:metalchests@[v5.8.1,);"
+ "after:opencomputers;"
// + "after:sgcraft@[2.0.0,);"

View file

@ -0,0 +1,15 @@
package cr0s.warpdrive.compat;
import javax.annotation.Nonnull;
import matteroverdrive.entity.android_player.AndroidPlayer;
import matteroverdrive.entity.player.MOPlayerCapabilityProvider;
import net.minecraft.entity.player.EntityPlayer;
public class CompatMatterOverdrive {
public static boolean isAndroid(@Nonnull final EntityPlayer player) {
final AndroidPlayer playerCapability = MOPlayerCapabilityProvider.GetAndroidCapability(player);
return playerCapability != null && playerCapability.isAndroid();
}
}

View file

@ -1,5 +1,6 @@
package cr0s.warpdrive.config;
import cr0s.warpdrive.compat.CompatMatterOverdrive;
import cr0s.warpdrive.WarpDrive;
import cr0s.warpdrive.block.BlockAbstractBase;
import cr0s.warpdrive.block.BlockAbstractContainer;
@ -17,6 +18,7 @@ import java.util.Map.Entry;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
@ -816,6 +818,12 @@ public class Dictionary {
}
public static boolean isLivingWithoutAir(final Entity entity) {
// bypass for androids
if ( WarpDriveConfig.isMatterOverdriveLoaded
&& entity instanceof EntityPlayer ) {
return CompatMatterOverdrive.isAndroid((EntityPlayer) entity);
}
final ResourceLocation resourceLocation = EntityList.getKey(entity);
return ENTITIES_LIVING_WITHOUT_AIR.contains(resourceLocation);
}

View file

@ -147,6 +147,7 @@ public class WarpDriveConfig {
public static boolean isGregtechLoaded = false;
public static boolean isICBMClassicLoaded = false;
public static boolean isIndustrialCraft2Loaded = false;
public static boolean isMatterOverdriveLoaded = false;
public static boolean isNotEnoughItemsLoaded = false;
public static boolean isOpenComputersLoaded = false;
public static boolean isThermalExpansionLoaded = false;
@ -767,6 +768,7 @@ public class WarpDriveConfig {
isAdvancedRepulsionSystemLoaded = Loader.isModLoaded("AdvancedRepulsionSystems");
isForgeMultipartLoaded = Loader.isModLoaded("forgemultipartcbe");
isICBMClassicLoaded = Loader.isModLoaded("icbmclassic");
isMatterOverdriveLoaded = Loader.isModLoaded("matteroverdrive");
isNotEnoughItemsLoaded = Loader.isModLoaded("NotEnoughItems");
isThermalExpansionLoaded = Loader.isModLoaded("thermalexpansion");
isThermalFoundationLoaded = Loader.isModLoaded("thermalfoundation");

View file

@ -1,5 +1,6 @@
package cr0s.warpdrive.render;
import cr0s.warpdrive.compat.CompatMatterOverdrive;
import cr0s.warpdrive.BreathingManager;
import cr0s.warpdrive.api.ExceptionChunkNotLoaded;
import cr0s.warpdrive.block.breathing.BlockAirShield;
@ -61,6 +62,12 @@ public class RenderOverlayAir {
return;
}
// bypass for androids
if ( WarpDriveConfig.isMatterOverdriveLoaded
&& CompatMatterOverdrive.isAndroid(entityPlayer) ) {
return;
}
// get air stats
final int rangeToVoid = getRangeToVoid(entityPlayer, x, y, z);
final boolean hasValidSetup = BreathingManager.hasValidSetup(entityPlayer);