use of mekanism.api.text.EnumColor in project Mekanism by mekanism.
the class PlasticSlabsRecipeProvider method registerPlasticSlabs.
private void registerPlasticSlabs(Consumer<IFinishedRecipe> consumer, Map<EnumColor, ? extends IItemProvider> blocks, Map<EnumColor, ? extends IItemProvider> plastic, ITag<Item> blockType, boolean transparent, String basePath) {
for (Map.Entry<EnumColor, ? extends IItemProvider> entry : blocks.entrySet()) {
EnumColor color = entry.getKey();
registerPlasticSlab(consumer, color, entry.getValue(), plastic.get(color), blockType, transparent, basePath);
}
}
use of mekanism.api.text.EnumColor in project Mekanism by mekanism.
the class ModelFluidTank method render.
public void render(@Nonnull MatrixStack matrix, @Nonnull IRenderTypeBuffer renderer, int light, int overlayLight, FluidTankTier tier, boolean hasEffect) {
renderToBuffer(matrix, getVertexBuilder(renderer, RENDER_TYPE, hasEffect), light, overlayLight, 1, 1, 1, 1);
EnumColor color = tier.getBaseTier().getColor();
// TODO: Try to make it so the lines can still show up on the back walls of the tank in first person
renderGlass(matrix, getVertexBuilder(renderer, GLASS_RENDER_TYPE, hasEffect), light, overlayLight, color.getColor(0), color.getColor(1), color.getColor(2), 1);
}
use of mekanism.api.text.EnumColor in project Mekanism by mekanism.
the class GuiMekanismTile method drawForegroundText.
@Override
protected void drawForegroundText(@Nonnull MatrixStack matrix, int mouseX, int mouseY) {
super.drawForegroundText(matrix, mouseX, mouseY);
if (tile instanceof ISideConfiguration) {
ItemStack stack = getMinecraft().player.inventory.getCarried();
if (!stack.isEmpty() && stack.getItem() instanceof ItemConfigurator) {
for (int i = 0; i < menu.slots.size(); i++) {
Slot slot = menu.slots.get(i);
if (isMouseOverSlot(slot, mouseX, mouseY)) {
DataType data = getFromSlot(slot);
if (data != null) {
EnumColor color = data.getColor();
displayTooltip(matrix, MekanismLang.GENERIC_WITH_PARENTHESIS.translateColored(color, data, color.getName()), mouseX - leftPos, mouseY - topPos);
}
break;
}
}
}
}
}
use of mekanism.api.text.EnumColor in project Mekanism by mekanism.
the class TransporterPathfinder method checkPath.
private static boolean checkPath(InventoryNetwork network, List<BlockPos> path, TransporterStack stack) {
for (int i = path.size() - 1; i > 0; i--) {
LogisticalTransporterBase transmitter = network.getTransmitter(path.get(i));
if (transmitter == null) {
return false;
}
EnumColor color = transmitter.getColor();
if (color != null && color != stack.color) {
return false;
}
}
return true;
}
use of mekanism.api.text.EnumColor in project Mekanism by mekanism.
the class TileEntityTeleporter method onUpdateServer.
@Override
protected void onUpdateServer() {
super.onUpdateServer();
if (teleportBounds == null && frameDirection != null) {
resetBounds();
}
status = canTeleport();
if (MekanismUtils.canFunction(this) && status == 1 && teleDelay == 0) {
teleport();
}
if (teleDelay == 0 && teleportBounds != null && !didTeleport.isEmpty()) {
cleanTeleportCache();
}
boolean prevShouldRender = shouldRender;
shouldRender = status == 1 || status > 4;
EnumColor prevColor = color;
TeleporterFrequency freq = getFrequency(FrequencyType.TELEPORTER);
color = freq != null ? freq.getColor() : null;
if (shouldRender != prevShouldRender) {
// This also means the comparator output changed so notify the neighbors we have a change
WorldUtils.notifyLoadedNeighborsOfTileChange(level, getBlockPos());
sendUpdatePacket();
} else if (color != prevColor) {
sendUpdatePacket();
}
teleDelay = Math.max(0, teleDelay - 1);
energySlot.fillContainerOrConvert();
}
Aggregations