Fixed NEI showing Air and Forcefield blocks
This commit is contained in:
parent
fb3e05c790
commit
83358340f7
4 changed files with 33 additions and 4 deletions
|
@ -1,5 +1,6 @@
|
||||||
package cr0s.warpdrive;
|
package cr0s.warpdrive;
|
||||||
|
|
||||||
|
import cr0s.warpdrive.config.WarpDriveConfig;
|
||||||
import cr0s.warpdrive.data.VectorI;
|
import cr0s.warpdrive.data.VectorI;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
@ -35,6 +36,8 @@ import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.Optional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Common static methods
|
* Common static methods
|
||||||
*/
|
*/
|
||||||
|
@ -526,4 +529,15 @@ public class Commons {
|
||||||
+ (clamp(0, 255, green) << 8)
|
+ (clamp(0, 255, green) << 8)
|
||||||
+ clamp(0, 255, blue );
|
+ clamp(0, 255, blue );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Optional.Method(modid = "NotEnoughItems")
|
||||||
|
public static void NEI_hideItemStack(final ItemStack itemStack) {
|
||||||
|
codechicken.nei.api.API.hideItem(itemStack);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void hideItemStack(final ItemStack itemStack) {
|
||||||
|
if (WarpDriveConfig.isNotEnoughItemsLoaded) {
|
||||||
|
NEI_hideItemStack(itemStack);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,20 @@
|
||||||
package cr0s.warpdrive.block.breathing;
|
package cr0s.warpdrive.block.breathing;
|
||||||
|
|
||||||
|
import cr0s.warpdrive.Commons;
|
||||||
import cr0s.warpdrive.WarpDrive;
|
import cr0s.warpdrive.WarpDrive;
|
||||||
import cr0s.warpdrive.block.BlockAbstractBase;
|
import cr0s.warpdrive.block.BlockAbstractBase;
|
||||||
import cr0s.warpdrive.config.WarpDriveConfig;
|
import cr0s.warpdrive.config.WarpDriveConfig;
|
||||||
import cr0s.warpdrive.render.RenderBlockStandard;
|
import cr0s.warpdrive.render.RenderBlockStandard;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
@ -61,6 +65,15 @@ public abstract class BlockAbstractAir extends BlockAbstractBase {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void getSubBlocks(Item item, CreativeTabs creativeTab, List list) {
|
||||||
|
// hide in NEI
|
||||||
|
for (int i = 0; i < 16; i++) {
|
||||||
|
Commons.hideItemStack(new ItemStack(item, 1, i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getRenderBlockPass() {
|
public int getRenderBlockPass() {
|
||||||
// 1 is required to apply alpha transparency
|
// 1 is required to apply alpha transparency
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package cr0s.warpdrive.block.forcefield;
|
package cr0s.warpdrive.block.forcefield;
|
||||||
|
|
||||||
|
import cr0s.warpdrive.Commons;
|
||||||
import cr0s.warpdrive.WarpDrive;
|
import cr0s.warpdrive.WarpDrive;
|
||||||
import cr0s.warpdrive.api.IDamageReceiver;
|
import cr0s.warpdrive.api.IDamageReceiver;
|
||||||
import cr0s.warpdrive.block.hull.BlockHullGlass;
|
import cr0s.warpdrive.block.hull.BlockHullGlass;
|
||||||
|
@ -87,11 +88,10 @@ public class BlockForceField extends BlockAbstractForceField implements IDamageR
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubBlocks(Item item, CreativeTabs creativeTab, List list) {
|
public void getSubBlocks(Item item, CreativeTabs creativeTab, List list) {
|
||||||
/* Hide in NEI
|
// hide in NEI
|
||||||
for (int i = 0; i < 16; i++) {
|
for (int i = 0; i < 16; i++) {
|
||||||
list.add(new ItemStack(item, 1, i));
|
Commons.hideItemStack(new ItemStack(item, 1, i));
|
||||||
}
|
}
|
||||||
/**/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
|
|
|
@ -114,6 +114,7 @@ public class WarpDriveConfig {
|
||||||
public static boolean isGregTech5Loaded = false;
|
public static boolean isGregTech5Loaded = false;
|
||||||
public static boolean isEnderIOLoaded = false;
|
public static boolean isEnderIOLoaded = false;
|
||||||
public static boolean isAdvancedRepulsionSystemLoaded = false;
|
public static boolean isAdvancedRepulsionSystemLoaded = false;
|
||||||
|
public static boolean isNotEnoughItemsLoaded = false;
|
||||||
|
|
||||||
public static ItemStack IC2_compressedAir;
|
public static ItemStack IC2_compressedAir;
|
||||||
public static ItemStack IC2_emptyCell;
|
public static ItemStack IC2_emptyCell;
|
||||||
|
@ -967,6 +968,7 @@ public class WarpDriveConfig {
|
||||||
if (isAdvancedRepulsionSystemLoaded) {
|
if (isAdvancedRepulsionSystemLoaded) {
|
||||||
CompatAdvancedRepulsionSystems.register();
|
CompatAdvancedRepulsionSystems.register();
|
||||||
}
|
}
|
||||||
|
isNotEnoughItemsLoaded = Loader.isModLoaded("NotEnoughItems");
|
||||||
|
|
||||||
boolean isBotaniaLoaded = Loader.isModLoaded("Botania");
|
boolean isBotaniaLoaded = Loader.isModLoaded("Botania");
|
||||||
if (isBotaniaLoaded) {
|
if (isBotaniaLoaded) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue