use of com.bewitchment.api.ritual.EnumGlyphType in project Bewitchment by Um-Mitternacht.
the class TileEntityGlyph method checkFirst.
private boolean checkFirst(EnumGlyphType typeFirst) {
EnumGlyphType lastFound = null;
for (int[] c : small) {
BlockPos bp = pos.add(c[0], 0, c[1]);
IBlockState bs = world.getBlockState(bp);
if (!bs.getBlock().equals(ModBlocks.ritual_glyphs) || bs.getValue(BlockCircleGlyph.TYPE).equals(EnumGlyphType.GOLDEN) || (!bs.getValue(BlockCircleGlyph.TYPE).equals(typeFirst) && !typeFirst.equals(EnumGlyphType.ANY))) {
return false;
}
EnumGlyphType thisOne = bs.getValue(BlockCircleGlyph.TYPE);
if (lastFound != null && lastFound != thisOne)
return false;
lastFound = thisOne;
}
return true;
}
use of com.bewitchment.api.ritual.EnumGlyphType in project Bewitchment by Um-Mitternacht.
the class TileEntityGlyph method checkThird.
private boolean checkThird(EnumGlyphType typeThird) {
EnumGlyphType lastFound = null;
for (int[] c : big) {
BlockPos bp = pos.add(c[0], 0, c[1]);
IBlockState bs = world.getBlockState(bp);
if (!bs.getBlock().equals(ModBlocks.ritual_glyphs) || bs.getValue(BlockCircleGlyph.TYPE).equals(EnumGlyphType.GOLDEN) || (!bs.getValue(BlockCircleGlyph.TYPE).equals(typeThird) && !typeThird.equals(EnumGlyphType.ANY))) {
return false;
}
EnumGlyphType thisOne = bs.getValue(BlockCircleGlyph.TYPE);
if (lastFound != null && lastFound != thisOne)
return false;
lastFound = thisOne;
}
return true;
}
use of com.bewitchment.api.ritual.EnumGlyphType in project Bewitchment by Um-Mitternacht.
the class TileEntityGlyph method checkSecond.
private boolean checkSecond(EnumGlyphType typeSecond) {
EnumGlyphType lastFound = null;
for (int[] c : medium) {
BlockPos bp = pos.add(c[0], 0, c[1]);
IBlockState bs = world.getBlockState(bp);
if (!bs.getBlock().equals(ModBlocks.ritual_glyphs) || bs.getValue(BlockCircleGlyph.TYPE).equals(EnumGlyphType.GOLDEN) || (!bs.getValue(BlockCircleGlyph.TYPE).equals(typeSecond) && !typeSecond.equals(EnumGlyphType.ANY))) {
return false;
}
EnumGlyphType thisOne = bs.getValue(BlockCircleGlyph.TYPE);
if (lastFound != null && lastFound != thisOne)
return false;
lastFound = thisOne;
}
return true;
}
use of com.bewitchment.api.ritual.EnumGlyphType in project Bewitchment by Um-Mitternacht.
the class TileEntityGlyph method hasCircles.
private boolean hasCircles(AdapterIRitual rit) {
int requiredCircles = rit.getCircles() & 3;
if (requiredCircles == 3)
return false;
EnumGlyphType typeFirst = EnumGlyphType.fromMeta(rit.getCircles() >> 2 & 3);
EnumGlyphType typeSecond = EnumGlyphType.fromMeta(rit.getCircles() >> 4 & 3);
EnumGlyphType typeThird = EnumGlyphType.fromMeta(rit.getCircles() >> 6 & 3);
if (requiredCircles > 1)
if (!checkThird(typeThird)) {
return false;
}
if (requiredCircles > 0)
if (!checkSecond(typeSecond)) {
return false;
}
if (!checkFirst(typeFirst)) {
return false;
}
return true;
}
use of com.bewitchment.api.ritual.EnumGlyphType in project Bewitchment by Um-Mitternacht.
the class RitualWrapper method drawInfo.
@Override
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
FontRenderer fr = minecraft.fontRenderer;
String powerFlatDesc = I18n.format("jei.ritual.power.flat", powerStart);
String powerTickDesc = I18n.format("jei.ritual.power.tick", powerTick * 20);
int mult = (int) (powerTick > 0 ? 3.1 : 2);
if (powerStart > 0)
fr.drawString(powerFlatDesc, (recipeWidth - fr.getStringWidth(powerFlatDesc)) / 2, recipeHeight - mult * fr.FONT_HEIGHT, 0, false);
if (powerTick > 0)
fr.drawString(powerTickDesc, (recipeWidth - fr.getStringWidth(powerTickDesc)) / 2, recipeHeight - 2 * fr.FONT_HEIGHT, 0, false);
fr.drawString(name, (recipeWidth - fr.getStringWidth(name)) / 2, 0, 0);
int requiredCircles = circles & 3;
EnumGlyphType typeFirst = EnumGlyphType.fromMeta(circles >> 2 & 3);
EnumGlyphType typeSecond = EnumGlyphType.fromMeta(circles >> 4 & 3);
EnumGlyphType typeThird = EnumGlyphType.fromMeta(circles >> 6 & 3);
color(EnumGlyphType.GOLDEN, null, 0);
int dx = 53, dy = 35;
centerGlyph.draw(minecraft, dx, dy);
color(typeFirst, minecraft, 0);
circle1.draw(minecraft, dx, dy);
if (requiredCircles > 0) {
color(typeSecond, minecraft, 1);
circle2.draw(minecraft, dx, dy);
}
if (requiredCircles > 1) {
color(typeThird, minecraft, 2);
circle3.draw(minecraft, dx, dy);
}
}
Aggregations