use of minechem.item.blueprint.BlueprintBlock in project Minechem by iopleke.
the class BlueprintProjectorGui method drawBlueprintInfo.
private void drawBlueprintInfo(ItemStack blueprintStack) {
MinechemBlueprint blueprint = MinechemItemsRegistration.blueprint.getBlueprint(blueprintStack);
if (blueprint == null) {
return;
}
String name = blueprintStack.getDisplayName().replace("Blueprint", "");
this.fontRendererObj.drawStringWithShadow(name, 64, 12, 0xFFFFFF);
HashMap<Integer, Integer> blockCount = getBlockCount(blueprint);
HashMap<Integer, BlueprintBlock> blockLookup = blueprint.getBlockLookup();
int y = 23;
Iterator<Entry<Integer, Integer>> it = blockCount.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<Integer, Integer> entry = it.next();
BlueprintBlock block = blockLookup.get(entry.getKey());
if (block != null) {
ItemStack itemstack = new ItemStack(block.block, 1, block.metadata);
String info = String.format("%dx%s", entry.getValue(), itemstack.getDisplayName());
this.fontRendererObj.drawString(info, 64, y, 0xDDDDDD);
y += 10;
}
}
}
use of minechem.item.blueprint.BlueprintBlock in project Minechem by iopleke.
the class MultiBlockTileEntity method checkBlock.
private MultiBlockStatusEnum checkBlock(int x, int y, int z) {
if (x == blueprint.getManagerPosX() && y == blueprint.getManagerPosY() && z == blueprint.getManagerPosZ()) {
return MultiBlockStatusEnum.CORRECT;
}
int worldX = xCoord + (offsetX + x);
int worldY = yCoord + (offsetY + y);
int worldZ = zCoord + (offsetZ + z);
Integer structureID = structure[y][x][z];
Block block = worldObj.getBlock(worldX, worldY, worldZ);
if (structureID == MinechemBlueprint.wildcard) {
return MultiBlockStatusEnum.CORRECT;
} else if (structureID == air) {
if (block == Blocks.air) {
return MultiBlockStatusEnum.CORRECT;
} else {
return MultiBlockStatusEnum.INCORRECT;
}
} else {
HashMap<Integer, BlueprintBlock> lut = blueprint.getBlockLookup();
BlueprintBlock blueprintBlock = lut.get(structureID);
if (block == blueprintBlock.block && worldObj.getBlockMetadata(worldX, worldY, worldZ) == blueprintBlock.metadata) {
return MultiBlockStatusEnum.CORRECT;
} else {
return MultiBlockStatusEnum.INCORRECT;
}
}
}
Aggregations