Update #48 - Added some features from OptiFine

This commit is contained in:
lax1dude
2025-01-24 18:39:36 -08:00
parent 1f0d593a8c
commit e83a912e38
1056 changed files with 17706 additions and 898 deletions

View File

@ -0,0 +1,97 @@
package net.optifine.config;
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerTextureAtlasSprite;
import net.minecraft.block.state.BlockStateBase;
import net.minecraft.world.biome.BiomeGenBase;
public class Matches {
public static boolean block(BlockStateBase blockStateBase, MatchBlock[] matchBlocks) {
if (matchBlocks == null) {
return true;
} else {
for (int i = 0; i < matchBlocks.length; ++i) {
MatchBlock matchblock = matchBlocks[i];
if (matchblock.matches(blockStateBase)) {
return true;
}
}
return false;
}
}
public static boolean block(int blockId, int metadata, MatchBlock[] matchBlocks) {
if (matchBlocks == null) {
return true;
} else {
for (int i = 0; i < matchBlocks.length; ++i) {
MatchBlock matchblock = matchBlocks[i];
if (matchblock.matches(blockId, metadata)) {
return true;
}
}
return false;
}
}
public static boolean blockId(int blockId, MatchBlock[] matchBlocks) {
if (matchBlocks == null) {
return true;
} else {
for (int i = 0; i < matchBlocks.length; ++i) {
MatchBlock matchblock = matchBlocks[i];
if (matchblock.getBlockId() == blockId) {
return true;
}
}
return false;
}
}
public static boolean metadata(int metadata, int[] metadatas) {
if (metadatas == null) {
return true;
} else {
for (int i = 0; i < metadatas.length; ++i) {
if (metadatas[i] == metadata) {
return true;
}
}
return false;
}
}
public static boolean sprite(EaglerTextureAtlasSprite sprite, EaglerTextureAtlasSprite[] sprites) {
if (sprites == null) {
return true;
} else {
for (int i = 0; i < sprites.length; ++i) {
if (sprites[i] == sprite) {
return true;
}
}
return false;
}
}
public static boolean biome(BiomeGenBase biome, BiomeGenBase[] biomes) {
if (biomes == null) {
return true;
} else {
for (int i = 0; i < biomes.length; ++i) {
if (biomes[i] == biome) {
return true;
}
}
return false;
}
}
}