Search in sources :

Example 1 with IIconTransformation

use of logisticspipes.proxy.object3d.interfaces.IIconTransformation in project LogisticsPipes by RS485.

the class LogisticsNewSolidBlockWorldRenderer method renderWorldBlock.

public void renderWorldBlock(IBlockAccess world, LogisticsSolidTileEntity blockTile, RenderBlocks renderer, int x, int y, int z) {
    Tessellator tess = Tessellator.instance;
    SimpleServiceLocator.cclProxy.getRenderState().reset();
    SimpleServiceLocator.cclProxy.getRenderState().setUseNormals(true);
    SimpleServiceLocator.cclProxy.getRenderState().setAlphaOverride(0xff);
    BlockRotation rotation = BlockRotation.ZERO;
    int brightness = 0;
    IIconTransformation icon;
    if (blockTile != null) {
        BlockRotation.getRotation(blockTile.getRotation());
        brightness = new DoubleCoordinates(blockTile).getBlock(world).getMixedBrightnessForBlock(world, blockTile.xCoord, blockTile.yCoord, blockTile.zCoord);
        icon = SimpleServiceLocator.cclProxy.createIconTransformer(LogisticsSolidBlock.getNewIcon(world, blockTile.xCoord, blockTile.yCoord, blockTile.zCoord));
    } else {
        brightness = LogisticsPipes.LogisticsSolidBlock.getMixedBrightnessForBlock(world, x, y, z);
        icon = SimpleServiceLocator.cclProxy.createIconTransformer(LogisticsSolidBlock.getNewIcon(world, x, y, z));
    }
    tess.setColorOpaque_F(1F, 1F, 1F);
    tess.setBrightness(brightness);
    //Draw
    LogisticsNewSolidBlockWorldRenderer.block.get(rotation).render(new LPTranslation(x, y, z), icon);
    if (blockTile != null) {
        DoubleCoordinates pos = new DoubleCoordinates(blockTile);
        for (CoverSides side : CoverSides.values()) {
            boolean render = true;
            DoubleCoordinates newPos = CoordinateUtils.sum(pos, side.getDir(rotation));
            TileEntity sideTile = newPos.getTileEntity(blockTile.getWorldObj());
            if (sideTile instanceof LogisticsTileGenericPipe) {
                LogisticsTileGenericPipe tilePipe = (LogisticsTileGenericPipe) sideTile;
                if (tilePipe.renderState.pipeConnectionMatrix.isConnected(side.getDir(rotation).getOpposite())) {
                    render = false;
                }
            }
            if (render) {
                LogisticsNewSolidBlockWorldRenderer.texturePlate_Outer.get(side).get(rotation).render(new LPTranslation(x, y, z), icon);
                LogisticsNewSolidBlockWorldRenderer.texturePlate_Inner.get(side).get(rotation).render(new LPTranslation(x, y, z), icon);
            }
        }
    }
}
Also used : LPTranslation(logisticspipes.proxy.object3d.operation.LPTranslation) LogisticsSolidTileEntity(logisticspipes.blocks.LogisticsSolidTileEntity) TileEntity(net.minecraft.tileentity.TileEntity) Tessellator(net.minecraft.client.renderer.Tessellator) LogisticsTileGenericPipe(logisticspipes.pipes.basic.LogisticsTileGenericPipe) IIconTransformation(logisticspipes.proxy.object3d.interfaces.IIconTransformation) DoubleCoordinates(network.rs485.logisticspipes.world.DoubleCoordinates)

Example 2 with IIconTransformation

use of logisticspipes.proxy.object3d.interfaces.IIconTransformation in project LogisticsPipes by RS485.

the class LogisticsNewPipeItemRenderer method renderBlockItem.

private void renderBlockItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) {
    //don't break other mods' guis when holding a pipe
    GL11.glPushAttrib(GL11.GL_COLOR_BUFFER_BIT);
    //force transparency
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glTranslatef(translateX, translateY, translateZ);
    Block block = LogisticsPipes.LogisticsPipeBlock;
    Tessellator tess = Tessellator.instance;
    BlockRotation rotation = BlockRotation.ZERO;
    tess.startDrawingQuads();
    IIconTransformation icon = SimpleServiceLocator.cclProxy.createIconTransformer(Textures.LOGISTICS_REQUEST_TABLE_NEW);
    //Draw
    LogisticsNewSolidBlockWorldRenderer.block.get(rotation).render(new I3DOperation[] { icon });
    for (CoverSides side : CoverSides.values()) {
        LogisticsNewSolidBlockWorldRenderer.texturePlate_Outer.get(side).get(rotation).render(new I3DOperation[] { icon });
    }
    tess.draw();
    block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
    // nicely leave the rendering how it was
    GL11.glPopAttrib();
}
Also used : Tessellator(net.minecraft.client.renderer.Tessellator) CoverSides(logisticspipes.renderer.newpipe.LogisticsNewSolidBlockWorldRenderer.CoverSides) Block(net.minecraft.block.Block) IIconTransformation(logisticspipes.proxy.object3d.interfaces.IIconTransformation) BlockRotation(logisticspipes.renderer.newpipe.LogisticsNewSolidBlockWorldRenderer.BlockRotation)

Example 3 with IIconTransformation

use of logisticspipes.proxy.object3d.interfaces.IIconTransformation in project LogisticsPipes by RS485.

the class ProxyManager method load.

public static void load() {
    SimpleServiceLocator.setBuildCraftProxy(ProxyManager.getWrappedProxy("BuildCraft|Transport+BuildCraft|Silicon+BuildCraft|Robotics", IBCProxy.class, BuildCraftProxy.class, new IBCProxy() {

        @Override
        public void resetItemRotation() {
        }

        @Override
        public boolean isIPipeTile(TileEntity tile) {
            return false;
        }

        @Override
        public void registerPipeInformationProvider() {
        }

        @Override
        public void initProxy() {
        }

        @Override
        public boolean checkForPipeConnection(TileEntity with, ForgeDirection side, LogisticsTileGenericPipe pipe) {
            return true;
        }

        @Override
        public IConnectionOverrideResult checkConnectionOverride(TileEntity with, ForgeDirection side, LogisticsTileGenericPipe pipe) {
            return new IConnectionOverrideResult() {

                @Override
                public boolean forceConnect() {
                    return false;
                }

                @Override
                public boolean forceDisconnect() {
                    return false;
                }
            };
        }

        @Override
        public boolean canPipeConnect(TileEntity pipe, TileEntity tile, ForgeDirection direction) {
            return false;
        }

        @Override
        public boolean isActive() {
            return false;
        }

        @Override
        public boolean isInstalled() {
            return false;
        }

        @Override
        public Object getLPPipeType() {
            return null;
        }

        @Override
        public void registerTrigger() {
        }

        @Override
        public CraftingParts getRecipeParts() {
            return null;
        }

        @Override
        public void addCraftingRecipes(CraftingParts parts) {
        }

        @Override
        public Class<? extends ICraftingRecipeProvider> getAssemblyTableProviderClass() {
            return null;
        }

        @Override
        public void notifyOfChange(LogisticsTileGenericPipe logisticsTileGenericPipe, TileEntity tile, ForgeDirection o) {
        }

        @Override
        public IBCTilePart getBCTilePart(LogisticsTileGenericPipe logisticsTileGenericPipe) {
            return new IBCTilePart() {

                @Override
                public boolean hasBlockingPluggable(ForgeDirection side) {
                    return false;
                }

                @Override
                public void writeToNBT_LP(NBTTagCompound nbt) {
                }

                @Override
                public void readFromNBT_LP(NBTTagCompound nbt) {
                }

                @Override
                public boolean isSolidOnSide(ForgeDirection side) {
                    return false;
                }

                @Override
                public void invalidate_LP() {
                }

                @Override
                public void validate_LP() {
                }

                @Override
                public void updateEntity_LP() {
                }

                @Override
                public void scheduleNeighborChange() {
                }

                @Override
                public boolean hasGate(ForgeDirection orientation) {
                    return false;
                }

                @Override
                public IBCRenderState getBCRenderState() {
                    return new IBCRenderState() {

                        @Override
                        public boolean needsRenderUpdate() {
                            return false;
                        }

                        @Override
                        public boolean isDirty() {
                            return false;
                        }

                        @Override
                        public void writeData_LP(LPDataOutput output) {
                            output.writeBoolean(false);
                        }

                        @Override
                        public void readData_LP(LPDataInput input) {
                        }

                        @Override
                        public void clean() {
                        }
                    };
                }

                @Override
                public IBCPipePart getBCPipePart() {
                    return new IBCPipePart() {

                        @Override
                        public boolean canConnectRedstone() {
                            return false;
                        }

                        @Override
                        public int isPoweringTo(int l) {
                            return 0;
                        }

                        @Override
                        public int isIndirectlyPoweringTo(int l) {
                            return 0;
                        }

                        @Override
                        public Object getClientGui(InventoryPlayer inventory, int side) {
                            return null;
                        }

                        @Override
                        public Container getGateContainer(InventoryPlayer inventory, int side) {
                            return null;
                        }

                        @Override
                        public void addItemDrops(ArrayList<ItemStack> result) {
                        }

                        @Override
                        public Object getOriginal() {
                            return null;
                        }
                    };
                }

                @Override
                public IBCPluggableState getBCPlugableState() {
                    return new IBCPluggableState() {

                        @Override
                        public void writeData(LPDataOutput output) {
                        }

                        @Override
                        public void readData(LPDataInput input) {
                        }

                        @Override
                        public boolean isDirty(boolean clean) {
                            return false;
                        }
                    };
                }

                @Override
                public boolean hasEnabledFacade(ForgeDirection dir) {
                    return false;
                }

                @Override
                public IBCPipePluggable getBCPipePluggable(ForgeDirection sideHit) {
                    return new IBCPipePluggable() {

                        @Override
                        public ItemStack[] getDropItems(LogisticsTileGenericPipe container) {
                            return new ItemStack[] {};
                        }

                        @Override
                        public boolean isBlocking() {
                            return false;
                        }

                        @Override
                        public Object getOriginal() {
                            return null;
                        }

                        @Override
                        @SideOnly(Side.CLIENT)
                        public void renderPluggable(RenderBlocks renderblocks, ForgeDirection dir, int renderPass, int x, int y, int z) {
                        }

                        @Override
                        public boolean isAcceptingItems(LPTravelingItemServer arrivingItem) {
                            return false;
                        }

                        @Override
                        public LPTravelingItemServer handleItem(LPTravelingItemServer arrivingItem) {
                            return arrivingItem;
                        }
                    };
                }

                @Override
                public void readOldRedStone(NBTTagCompound nbt) {
                }

                @Override
                public void afterStateUpdated() {
                }

                @Override
                public Object getOriginal() {
                    return null;
                }

                @Override
                public boolean hasPipePluggable(ForgeDirection dir) {
                    return false;
                }

                @Override
                public void setWorldObj_LP(World world) {
                }
            };
        }

        @Override
        public IBCClickResult handleBCClickOnPipe(World world, int x, int y, int z, EntityPlayer player, int side, float xOffset, float yOffset, float zOffset, CoreUnroutedPipe pipe) {
            return new IBCClickResult() {

                @Override
                public boolean handled() {
                    return false;
                }

                @Override
                public boolean blocked() {
                    return false;
                }
            };
        }

        @Override
        public void callBCNeighborBlockChange(World world, int x, int y, int z, Block block) {
        }

        @Override
        public void callBCRemovePipe(World world, int x, int y, int z) {
        }

        @Override
        public void logWarning(String format) {
        }

        @Override
        public IBCRenderTESR getBCRenderTESR() {
            return new IBCRenderTESR() {

                @Override
                public void renderWires(LogisticsTileGenericPipe pipe, double x, double y, double z) {
                }

                @Override
                public void dynamicRenderPluggables(LogisticsTileGenericPipe pipe, double x, double y, double z) {
                }
            };
        }

        @Override
        public boolean isTileGenericPipe(TileEntity tile) {
            return false;
        }

        @Override
        public void cleanup() {
        }
    }, IBCTilePart.class, IBCPipePart.class, IBCPipePluggable.class, IBCPluggableState.class, IBCRenderState.class, IBCRenderTESR.class));
    SimpleServiceLocator.setForestryProxy(ProxyManager.getWrappedProxy("Forestry", IForestryProxy.class, ForestryProxy.class, new IForestryProxy() {

        @Override
        public boolean isBee(ItemStack item) {
            return false;
        }

        @Override
        public boolean isBee(ItemIdentifier item) {
            return false;
        }

        @Override
        public boolean isAnalysedBee(ItemStack item) {
            return false;
        }

        @Override
        public boolean isAnalysedBee(ItemIdentifier item) {
            return false;
        }

        @Override
        public boolean isTileAnalyser(TileEntity tile) {
            return false;
        }

        @Override
        public boolean isKnownAlleleId(String uid, World world) {
            return false;
        }

        @Override
        public String getAlleleName(String uid) {
            return "";
        }

        @Override
        public String getFirstAlleleId(ItemStack bee) {
            return "";
        }

        @Override
        public String getSecondAlleleId(ItemStack bee) {
            return "";
        }

        @Override
        public boolean isDrone(ItemStack bee) {
            return false;
        }

        @Override
        public boolean isFlyer(ItemStack bee) {
            return false;
        }

        @Override
        public boolean isPrincess(ItemStack bee) {
            return false;
        }

        @Override
        public boolean isQueen(ItemStack bee) {
            return false;
        }

        @Override
        public boolean isPurebred(ItemStack bee) {
            return false;
        }

        @Override
        public boolean isNocturnal(ItemStack bee) {
            return false;
        }

        @Override
        public boolean isPureNocturnal(ItemStack bee) {
            return false;
        }

        @Override
        public boolean isPureFlyer(ItemStack bee) {
            return false;
        }

        @Override
        public boolean isCave(ItemStack bee) {
            return false;
        }

        @Override
        public boolean isPureCave(ItemStack bee) {
            return false;
        }

        @Override
        public String getForestryTranslation(String input) {
            return input.substring(input.lastIndexOf(".") + 1).toLowerCase(Locale.US).replace("_", " ");
        }

        @Override
        @SideOnly(Side.CLIENT)
        public IIcon getIconIndexForAlleleId(String id, int phase) {
            return null;
        }

        @Override
        @SideOnly(Side.CLIENT)
        public int getColorForAlleleId(String id, int phase) {
            return 16777215;
        }

        @Override
        @SideOnly(Side.CLIENT)
        public int getRenderPassesForAlleleId(String id) {
            return 0;
        }

        @Override
        public void addCraftingRecipes(CraftingParts parts) {
        }

        @Override
        public String getNextAlleleId(String uid, World world) {
            return "";
        }

        @Override
        public String getPrevAlleleId(String uid, World world) {
            return "";
        }

        @Override
        @SideOnly(Side.CLIENT)
        public IIcon getIconFromTextureManager(String name) {
            return null;
        }

        @Override
        public void syncTracker(World world, EntityPlayer player) {
        }
    }));
    SimpleServiceLocator.setElectricItemProxy(ProxyManager.getWrappedProxy("IC2", IIC2Proxy.class, IC2Proxy.class, new IIC2Proxy() {

        @Override
        public boolean isElectricItem(ItemStack stack) {
            return false;
        }

        @Override
        public boolean isSimilarElectricItem(ItemStack stack, ItemStack template) {
            return false;
        }

        @Override
        public boolean isFullyCharged(ItemStack stack) {
            return false;
        }

        @Override
        public boolean isFullyDischarged(ItemStack stack) {
            return false;
        }

        @Override
        public boolean isPartiallyCharged(ItemStack stack) {
            return false;
        }

        @Override
        public void addCraftingRecipes(CraftingParts parts) {
        }

        @Override
        public boolean hasIC2() {
            return false;
        }

        @Override
        public void registerToEneryNet(TileEntity tile) {
        }

        @Override
        public void unregisterToEneryNet(TileEntity tile) {
        }

        @Override
        public boolean acceptsEnergyFrom(TileEntity tile1, TileEntity tile2, ForgeDirection opposite) {
            return false;
        }

        @Override
        public boolean isEnergySink(TileEntity tile) {
            return false;
        }

        @Override
        public double demandedEnergyUnits(TileEntity tile) {
            return 0;
        }

        @Override
        public double injectEnergyUnits(TileEntity tile, ForgeDirection opposite, double d) {
            return d;
        }
    }));
    SimpleServiceLocator.setCCProxy(ProxyManager.getWrappedProxy(LPConstants.computerCraftModID, ICCProxy.class, CCProxy.class, new ICCProxy() {

        @Override
        public boolean isTurtle(TileEntity tile) {
            return false;
        }

        @Override
        public boolean isComputer(TileEntity tile) {
            return false;
        }

        @Override
        public boolean isCC() {
            return false;
        }

        @Override
        public boolean isLuaThread(Thread thread) {
            return false;
        }

        @Override
        public void queueEvent(String event, Object[] arguments, LogisticsTileGenericPipe logisticsTileGenericPipe) {
        }

        @Override
        public void setTurtleConnect(boolean flag, LogisticsTileGenericPipe logisticsTileGenericPipe) {
        }

        @Override
        public boolean getTurtleConnect(LogisticsTileGenericPipe logisticsTileGenericPipe) {
            return false;
        }

        @Override
        public int getLastCCID(LogisticsTileGenericPipe logisticsTileGenericPipe) {
            return 0;
        }

        @Override
        public void handleMesssage(int computerId, Object message, LogisticsTileGenericPipe tile, int sourceId) {
        }

        @Override
        public void addCraftingRecipes(CraftingParts parts) {
        }

        @Override
        public Object getAnswer(Object object) {
            return object;
        }
    }));
    SimpleServiceLocator.setThaumCraftProxy(ProxyManager.getWrappedProxy("Thaumcraft", IThaumCraftProxy.class, ThaumCraftProxy.class, new IThaumCraftProxy() {

        @Override
        public boolean isScannedObject(ItemStack stack, String playerName) {
            return false;
        }

        @Override
        public List<String> getListOfTagsForStack(ItemStack stack) {
            return null;
        }

        @Override
        @SideOnly(Side.CLIENT)
        public void renderAspectsDown(ItemStack item, int x, int y, GuiScreen gui) {
        }

        @Override
        @SideOnly(Side.CLIENT)
        public void renderAspectsInGrid(List<String> eTags, int x, int y, int legnth, int width, GuiScreen gui) {
        }

        @Override
        public void addCraftingRecipes(CraftingParts parts) {
        }
    }));
    SimpleServiceLocator.setThermalExpansionProxy(ProxyManager.getWrappedProxy("ThermalExpansion", IThermalExpansionProxy.class, ThermalExpansionProxy.class, new IThermalExpansionProxy() {

        @Override
        public boolean isTesseract(TileEntity tile) {
            return false;
        }

        @Override
        public boolean isTE() {
            return false;
        }

        @Override
        public List<TileEntity> getConnectedTesseracts(TileEntity tile) {
            return new ArrayList<>(0);
        }

        @Override
        public CraftingParts getRecipeParts() {
            return null;
        }
    }));
    SimpleServiceLocator.setBetterStorageProxy(ProxyManager.getWrappedProxy("betterstorage", IBetterStorageProxy.class, BetterStorageProxy.class, new IBetterStorageProxy() {

        @Override
        public boolean isBetterStorageCrate(TileEntity tile) {
            return false;
        }

        @Override
        public ICrateStorageProxy getCrateStorageProxy(TileEntity tile) {
            return new ICrateStorageProxy() {

                @Override
                public Iterable<ItemStack> getContents() {
                    return null;
                }

                @Override
                public int getUniqueItems() {
                    return 0;
                }

                @Override
                public int getItemCount(ItemStack stack) {
                    return 0;
                }

                @Override
                public ItemStack extractItems(ItemStack stack, int count) {
                    return null;
                }

                @Override
                public int getSpaceForItem(ItemStack stack) {
                    return 0;
                }

                @Override
                public ItemStack insertItems(ItemStack stack) {
                    return stack;
                }
            };
        }
    }, ICrateStorageProxy.class));
    SimpleServiceLocator.setNEIProxy(ProxyManager.getWrappedProxy("NotEnoughItems", INEIProxy.class, NEIProxy.class, new INEIProxy() {

        @Override
        public List<String> getInfoForPosition(World world, EntityPlayer player, MovingObjectPosition objectMouseOver) {
            return new ArrayList<>(0);
        }

        @Override
        @SideOnly(Side.CLIENT)
        public boolean renderItemToolTip(int posX, int posY, List<String> msg, EnumChatFormatting rarityColor, ItemStack stack) {
            return false;
        }

        @Override
        @SideOnly(Side.CLIENT)
        public List<String> getItemToolTip(ItemStack stack, EntityPlayer thePlayer, boolean advancedItemTooltips, GuiContainer screen) {
            return stack.getTooltip(thePlayer, advancedItemTooltips);
        }

        @Override
        public ItemStack getItemForPosition(World world, EntityPlayer player, MovingObjectPosition objectMouseOver) {
            return null;
        }
    }));
    SimpleServiceLocator.setFactorizationProxy(ProxyManager.getWrappedProxy("factorization", IFactorizationProxy.class, FactorizationProxy.class, tile -> false));
    SimpleServiceLocator.setEnderIOProxy(ProxyManager.getWrappedProxy("EnderIO", IEnderIOProxy.class, EnderIOProxy.class, new IEnderIOProxy() {

        @Override
        public boolean isSendAndReceive(TileEntity tile) {
            return false;
        }

        @Override
        public boolean isHyperCube(TileEntity tile) {
            return false;
        }

        @Override
        public boolean isTransceiver(TileEntity tile) {
            return false;
        }

        @Override
        public List<TileEntity> getConnectedHyperCubes(TileEntity tile) {
            return new ArrayList<>(0);
        }

        @Override
        public List<TileEntity> getConnectedTransceivers(TileEntity tile) {
            return null;
        }

        @Override
        public boolean isEnderIO() {
            return false;
        }

        @Override
        public boolean isItemConduit(TileEntity tile, ForgeDirection dir) {
            return false;
        }

        @Override
        public boolean isFluidConduit(TileEntity tile, ForgeDirection dir) {
            return false;
        }

        @Override
        public boolean isBundledPipe(TileEntity tile) {
            return false;
        }
    }));
    SimpleServiceLocator.setIronChestProxy(ProxyManager.getWrappedProxy("IronChest", IIronChestProxy.class, IronChestProxy.class, new IIronChestProxy() {

        @Override
        public boolean isIronChest(TileEntity tile) {
            return false;
        }

        @Override
        @SideOnly(Side.CLIENT)
        public boolean isChestGui(GuiScreen gui) {
            return false;
        }
    }));
    SimpleServiceLocator.setEnderStorageProxy(ProxyManager.getWrappedProxy("EnderStorage", IEnderStorageProxy.class, EnderStorageProxy.class, new IEnderStorageProxy() {

        @Override
        public boolean isEnderChestBlock(Block block) {
            return false;
        }

        @Override
        public void openEnderChest(World world, int x, int y, int z, EntityPlayer player) {
        }
    }));
    SimpleServiceLocator.setOpenComputersProxy(ProxyManager.getWrappedProxy(LPConstants.openComputersModID, IOpenComputersProxy.class, OpenComputersProxy.class, new IOpenComputersProxy() {

        @Override
        public void initLogisticsTileGenericPipe(LogisticsTileGenericPipe tile) {
        }

        @Override
        public void initLogisticsSolidTileEntity(LogisticsSolidTileEntity tile) {
        }

        @Override
        public void handleWriteToNBT(IOCTile tile, NBTTagCompound nbt) {
        }

        @Override
        public void handleReadFromNBT(IOCTile tile, NBTTagCompound nbt) {
        }

        @Override
        public void handleInvalidate(IOCTile tile) {
        }

        @Override
        public void handleChunkUnload(IOCTile tile) {
        }

        @Override
        public void addToNetwork(TileEntity tile) {
        }
    }));
    SimpleServiceLocator.setToolWrenchProxy(ProxyManager.getWrappedProxy("!IToolWrench", IToolWrenchProxy.class, ToolWrenchProxy.class, new IToolWrenchProxy() {

        @Override
        public void wrenchUsed(EntityPlayer entityplayer, int x, int y, int z) {
        }

        @Override
        public boolean isWrenchEquipped(EntityPlayer entityplayer) {
            return false;
        }

        @Override
        public boolean canWrench(EntityPlayer entityplayer, int x, int y, int z) {
            return false;
        }

        @Override
        public boolean isWrench(Item item) {
            return false;
        }
    }));
    SimpleServiceLocator.setExtraCellsProxy(ProxyManager.getWrappedProxy("extracells", IExtraCellsProxy.class, ExtraCellsProxy.class, fluid -> true));
    SimpleServiceLocator.setCoFHPowerProxy(ProxyManager.getWrappedProxy("CoFHAPI|energy", ICoFHPowerProxy.class, CoFHPowerProxy.class, new ICoFHPowerProxy() {

        @Override
        public boolean isEnergyReceiver(TileEntity tile) {
            return false;
        }

        @Override
        public ICoFHEnergyReceiver getEnergyReceiver(TileEntity tile) {
            return new ICoFHEnergyReceiver() {

                @Override
                public int getMaxEnergyStored(ForgeDirection opposite) {
                    return 0;
                }

                @Override
                public int getEnergyStored(ForgeDirection opposite) {
                    return 0;
                }

                @Override
                public boolean canConnectEnergy(ForgeDirection opposite) {
                    return false;
                }

                @Override
                public int receiveEnergy(ForgeDirection opposite, int i, boolean b) {
                    return 0;
                }
            };
        }

        @Override
        public void addCraftingRecipes(CraftingParts parts) {
        }

        @Override
        public ICoFHEnergyStorage getEnergyStorage(int i) {
            return new ICoFHEnergyStorage() {

                @Override
                public int extractEnergy(int space, boolean b) {
                    return 0;
                }

                @Override
                public int receiveEnergy(int maxReceive, boolean simulate) {
                    return 0;
                }

                @Override
                public int getEnergyStored() {
                    return 0;
                }

                @Override
                public int getMaxEnergyStored() {
                    return 0;
                }

                @Override
                public void readFromNBT(NBTTagCompound nbt) {
                }

                @Override
                public void writeToNBT(NBTTagCompound nbt) {
                }
            };
        }

        @Override
        public boolean isAvailable() {
            return false;
        }
    }, ICoFHEnergyReceiver.class, ICoFHEnergyStorage.class));
    SimpleServiceLocator.setThermalDynamicsProxy(ProxyManager.getWrappedProxy("ThermalDynamics", ITDProxy.class, ThermalDynamicsProxy.class, new ITDProxy() {

        @Override
        public ITDPart getTDPart(final LogisticsTileGenericPipe pipe) {
            return new ITDPart() {

                @Override
                public TileEntity getInternalDuctForSide(ForgeDirection opposite) {
                    return pipe;
                }

                @Override
                public void setWorldObj_LP(World world) {
                }

                @Override
                public void invalidate() {
                }

                @Override
                public void onChunkUnload() {
                }

                @Override
                public void scheduleNeighborChange() {
                }

                @Override
                public void connectionsChanged() {
                }
            };
        }

        @Override
        public boolean isActive() {
            return false;
        }

        @Override
        public void registerPipeInformationProvider() {
        }

        @Override
        public boolean isItemDuct(TileEntity tile) {
            return false;
        }

        @Override
        @SideOnly(Side.CLIENT)
        public void renderPipeConnections(LogisticsTileGenericPipe pipeTile, RenderBlocks renderer) {
        }

        @Override
        public void registerTextures(IIconRegister iconRegister) {
        }

        @Override
        public boolean isBlockedSide(TileEntity with, ForgeDirection opposite) {
            return false;
        }
    }, ITDPart.class));
    SimpleServiceLocator.setBinnieProxy(ProxyManager.getWrappedProxy("Genetics", IBinnieProxy.class, BinnieProxy.class, tile -> false));
    final IBounds dummyBounds = new IBounds() {

        @Override
        public IVec3 min() {
            return new IVec3() {

                @Override
                public double x() {
                    return 0;
                }

                @Override
                public double y() {
                    return 0;
                }

                @Override
                public double z() {
                    return 0;
                }

                @Override
                public Object getOriginal() {
                    return null;
                }
            };
        }

        @Override
        public IVec3 max() {
            return new IVec3() {

                @Override
                public double x() {
                    return 0;
                }

                @Override
                public double y() {
                    return 0;
                }

                @Override
                public double z() {
                    return 0;
                }

                @Override
                public Object getOriginal() {
                    return null;
                }
            };
        }

        @Override
        public AxisAlignedBB toAABB() {
            return null;
        }
    };
    final IModel3D dummy3DModel = new IModel3D() {

        @Override
        public IModel3D backfacedCopy() {
            return this;
        }

        @Override
        public void render(I3DOperation... i3dOperations) {
        }

        @Override
        public void computeNormals() {
        }

        @Override
        public void computeStandardLighting() {
        }

        @Override
        public IBounds bounds() {
            return dummyBounds;
        }

        @Override
        public IModel3D apply(I3DOperation translation) {
            return this;
        }

        @Override
        public IModel3D copy() {
            return this;
        }

        @Override
        public IModel3D twoFacedCopy() {
            return this;
        }

        @Override
        public Object getOriginal() {
            return this;
        }

        @Override
        public IBounds getBoundsInside(AxisAlignedBB boundingBox) {
            return dummyBounds;
        }
    };
    ICCLProxy dummyCCLProxy = new ICCLProxy() {

        @Override
        public IIconTransformation createIconTransformer(IIcon registerIcon) {
            return new IIconTransformation() {

                @Override
                public Object getOriginal() {
                    return null;
                }

                @Override
                public void update(IIcon registerIcon) {
                }
            };
        }

        @Override
        public IRenderState getRenderState() {
            return new IRenderState() {

                @Override
                public void reset() {
                }

                @Override
                public void setUseNormals(boolean b) {
                }

                @Override
                public void setAlphaOverride(int i) {
                }

                @Override
                public void draw() {
                }

                @Override
                public void setBrightness(int brightness) {
                }

                @Override
                public void startDrawing() {
                }
            };
        }

        @Override
        public Map<String, IModel3D> parseObjModels(InputStream resourceAsStream, int i, LPScale scale) {
            return new HashMap<>();
        }

        @Override
        public Object getRotation(int i, int j) {
            return null;
        }

        @Override
        public Object getScale(double d, double e, double f) {
            return null;
        }

        @Override
        public Object getScale(double d) {
            return null;
        }

        @Override
        public ITranslation getTranslation(double d, double e, double f) {
            return new ITranslation() {

                @Override
                public ITranslation inverse() {
                    return this;
                }

                @Override
                public Object getOriginal() {
                    return null;
                }
            };
        }

        @Override
        public ITranslation getTranslation(IVec3 min) {
            return new ITranslation() {

                @Override
                public ITranslation inverse() {
                    return this;
                }

                @Override
                public Object getOriginal() {
                    return null;
                }
            };
        }

        @Override
        public Object getUVScale(double i, double d) {
            return null;
        }

        @Override
        public Object getUVTranslation(float i, float f) {
            return null;
        }

        @Override
        public Object getUVTransformationList(I3DOperation[] uvTranslation) {
            return null;
        }

        @Override
        public IModel3D wrapModel(Object model) {
            return dummy3DModel;
        }

        @Override
        public boolean isActivated() {
            return false;
        }

        @Override
        public Object getRotation(double d, int i, int j, int k) {
            return null;
        }

        @Override
        public IModel3D combine(Collection<IModel3D> list) {
            return dummy3DModel;
        }

        @Override
        public Object getColourMultiplier(int i) {
            return null;
        }
    };
    Class<?>[] cclSubWrapper = new Class<?>[] { IIconTransformation.class, IRenderState.class, IModel3D.class, ITranslation.class, IVec3.class, IBounds.class };
    SimpleServiceLocator.setCCLProxy(ProxyManager.getWrappedProxy("!CCLRender", ICCLProxy.class, CCLProxy.class, dummyCCLProxy, cclSubWrapper));
    if (!SimpleServiceLocator.cclProxy.isActivated()) {
        SimpleServiceLocator.setCCLProxy(ProxyManager.getWrappedProxy("!CoFHCCLRender", ICCLProxy.class, CoFHCCLProxy.class, dummyCCLProxy, cclSubWrapper));
    }
}
Also used : IVec3(logisticspipes.proxy.object3d.interfaces.IVec3) ICrateStorageProxy(logisticspipes.proxy.bs.ICrateStorageProxy) IRenderState(logisticspipes.proxy.object3d.interfaces.IRenderState) Block(net.minecraft.block.Block) IC2Proxy(logisticspipes.proxy.ic2.IC2Proxy) ITDPart(logisticspipes.proxy.td.subproxies.ITDPart) Map(java.util.Map) CoreUnroutedPipe(logisticspipes.pipes.basic.CoreUnroutedPipe) INEIProxy(logisticspipes.proxy.interfaces.INEIProxy) GuiContainer(net.minecraft.client.gui.inventory.GuiContainer) IBinnieProxy(logisticspipes.proxy.interfaces.IBinnieProxy) SideOnly(cpw.mods.fml.relauncher.SideOnly) CoFHCCLProxy(logisticspipes.proxy.cofhccl.CoFHCCLProxy) ICCLProxy(logisticspipes.proxy.interfaces.ICCLProxy) IBCTilePart(logisticspipes.proxy.buildcraft.subproxies.IBCTilePart) ForgeDirection(net.minecraftforge.common.util.ForgeDirection) IThermalExpansionProxy(logisticspipes.proxy.interfaces.IThermalExpansionProxy) CCLProxy(logisticspipes.proxy.ccl.CCLProxy) ITranslation(logisticspipes.proxy.object3d.interfaces.ITranslation) IOCTile(logisticspipes.proxy.opencomputers.IOCTile) BuildCraftProxy(logisticspipes.proxy.buildcraft.BuildCraftProxy) ICCProxy(logisticspipes.proxy.interfaces.ICCProxy) Container(net.minecraft.inventory.Container) ICraftingRecipeProvider(logisticspipes.proxy.interfaces.ICraftingRecipeProvider) ThaumCraftProxy(logisticspipes.proxy.thaumcraft.ThaumCraftProxy) IIC2Proxy(logisticspipes.proxy.interfaces.IIC2Proxy) BinnieProxy(logisticspipes.proxy.binnie.BinnieProxy) OpenComputersProxy(logisticspipes.proxy.opencomputers.OpenComputersProxy) ThermalDynamicsProxy(logisticspipes.proxy.td.ThermalDynamicsProxy) LogisticsWrapperHandler(logisticspipes.asm.wrapper.LogisticsWrapperHandler) EnderStorageProxy(logisticspipes.proxy.enderchest.EnderStorageProxy) ArrayList(java.util.ArrayList) ItemStack(net.minecraft.item.ItemStack) ExtraCellsProxy(logisticspipes.proxy.ec.ExtraCellsProxy) ITDProxy(logisticspipes.proxy.interfaces.ITDProxy) IToolWrenchProxy(logisticspipes.proxy.interfaces.IToolWrenchProxy) MovingObjectPosition(net.minecraft.util.MovingObjectPosition) RenderBlocks(net.minecraft.client.renderer.RenderBlocks) IBounds(logisticspipes.proxy.object3d.interfaces.IBounds) IBCPluggableState(logisticspipes.proxy.buildcraft.subproxies.IBCPluggableState) IExtraCellsProxy(logisticspipes.proxy.interfaces.IExtraCellsProxy) IIronChestProxy(logisticspipes.proxy.interfaces.IIronChestProxy) NEIProxy(logisticspipes.proxy.nei.NEIProxy) World(net.minecraft.world.World) IBCProxy(logisticspipes.proxy.interfaces.IBCProxy) ToolWrenchProxy(logisticspipes.proxy.toolWrench.ToolWrenchProxy) ICoFHEnergyStorage(logisticspipes.proxy.cofh.subproxies.ICoFHEnergyStorage) IIcon(net.minecraft.util.IIcon) CCProxy(logisticspipes.proxy.cc.CCProxy) TileEntity(net.minecraft.tileentity.TileEntity) LPScale(logisticspipes.proxy.object3d.operation.LPScale) Item(net.minecraft.item.Item) IIconTransformation(logisticspipes.proxy.object3d.interfaces.IIconTransformation) LogisticsSolidTileEntity(logisticspipes.blocks.LogisticsSolidTileEntity) IBCClickResult(logisticspipes.proxy.buildcraft.subproxies.IBCClickResult) IronChestProxy(logisticspipes.proxy.ic.IronChestProxy) IOpenComputersProxy(logisticspipes.proxy.interfaces.IOpenComputersProxy) BetterStorageProxy(logisticspipes.proxy.bs.BetterStorageProxy) Locale(java.util.Locale) IBCRenderState(logisticspipes.proxy.buildcraft.subproxies.IBCRenderState) I3DOperation(logisticspipes.proxy.object3d.interfaces.I3DOperation) EnumChatFormatting(net.minecraft.util.EnumChatFormatting) IIconRegister(net.minecraft.client.renderer.texture.IIconRegister) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) CoFHPowerProxy(logisticspipes.proxy.cofh.CoFHPowerProxy) Side(cpw.mods.fml.relauncher.Side) IForestryProxy(logisticspipes.proxy.interfaces.IForestryProxy) FactorizationProxy(logisticspipes.proxy.factorization.FactorizationProxy) Collection(java.util.Collection) ItemIdentifier(logisticspipes.utils.item.ItemIdentifier) IBCRenderTESR(logisticspipes.proxy.buildcraft.subproxies.IBCRenderTESR) IEnderStorageProxy(logisticspipes.proxy.interfaces.IEnderStorageProxy) AxisAlignedBB(net.minecraft.util.AxisAlignedBB) IConnectionOverrideResult(logisticspipes.proxy.buildcraft.subproxies.IConnectionOverrideResult) LPDataOutput(network.rs485.logisticspipes.util.LPDataOutput) List(java.util.List) ICoFHEnergyReceiver(logisticspipes.proxy.cofh.subproxies.ICoFHEnergyReceiver) EntityPlayer(net.minecraft.entity.player.EntityPlayer) CraftingParts(logisticspipes.recipes.CraftingParts) ThermalExpansionProxy(logisticspipes.proxy.te.ThermalExpansionProxy) IModel3D(logisticspipes.proxy.object3d.interfaces.IModel3D) IBetterStorageProxy(logisticspipes.proxy.interfaces.IBetterStorageProxy) LogisticsTileGenericPipe(logisticspipes.pipes.basic.LogisticsTileGenericPipe) HashMap(java.util.HashMap) ICoFHPowerProxy(logisticspipes.proxy.interfaces.ICoFHPowerProxy) IThaumCraftProxy(logisticspipes.proxy.interfaces.IThaumCraftProxy) LPTravelingItemServer(logisticspipes.transport.LPTravelingItem.LPTravelingItemServer) ForestryProxy(logisticspipes.proxy.forestry.ForestryProxy) LPConstants(logisticspipes.LPConstants) IBCPipePluggable(logisticspipes.proxy.buildcraft.subproxies.IBCPipePluggable) LPDataInput(network.rs485.logisticspipes.util.LPDataInput) IEnderIOProxy(logisticspipes.proxy.interfaces.IEnderIOProxy) InventoryPlayer(net.minecraft.entity.player.InventoryPlayer) EnderIOProxy(logisticspipes.proxy.enderio.EnderIOProxy) IFactorizationProxy(logisticspipes.proxy.interfaces.IFactorizationProxy) GuiScreen(net.minecraft.client.gui.GuiScreen) IBCPipePart(logisticspipes.proxy.buildcraft.subproxies.IBCPipePart) InputStream(java.io.InputStream) IConnectionOverrideResult(logisticspipes.proxy.buildcraft.subproxies.IConnectionOverrideResult) ICrateStorageProxy(logisticspipes.proxy.bs.ICrateStorageProxy) EnderStorageProxy(logisticspipes.proxy.enderchest.EnderStorageProxy) IEnderStorageProxy(logisticspipes.proxy.interfaces.IEnderStorageProxy) IFactorizationProxy(logisticspipes.proxy.interfaces.IFactorizationProxy) IEnderIOProxy(logisticspipes.proxy.interfaces.IEnderIOProxy) IBCPipePart(logisticspipes.proxy.buildcraft.subproxies.IBCPipePart) IForestryProxy(logisticspipes.proxy.interfaces.IForestryProxy) ForestryProxy(logisticspipes.proxy.forestry.ForestryProxy) HashMap(java.util.HashMap) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) ArrayList(java.util.ArrayList) LogisticsSolidTileEntity(logisticspipes.blocks.LogisticsSolidTileEntity) World(net.minecraft.world.World) IC2Proxy(logisticspipes.proxy.ic2.IC2Proxy) IIC2Proxy(logisticspipes.proxy.interfaces.IIC2Proxy) IBCRenderTESR(logisticspipes.proxy.buildcraft.subproxies.IBCRenderTESR) Item(net.minecraft.item.Item) ITDProxy(logisticspipes.proxy.interfaces.ITDProxy) FactorizationProxy(logisticspipes.proxy.factorization.FactorizationProxy) IFactorizationProxy(logisticspipes.proxy.interfaces.IFactorizationProxy) EnumChatFormatting(net.minecraft.util.EnumChatFormatting) BetterStorageProxy(logisticspipes.proxy.bs.BetterStorageProxy) IBetterStorageProxy(logisticspipes.proxy.interfaces.IBetterStorageProxy) ThermalDynamicsProxy(logisticspipes.proxy.td.ThermalDynamicsProxy) LogisticsTileGenericPipe(logisticspipes.pipes.basic.LogisticsTileGenericPipe) IIconTransformation(logisticspipes.proxy.object3d.interfaces.IIconTransformation) ArrayList(java.util.ArrayList) List(java.util.List) ICoFHEnergyReceiver(logisticspipes.proxy.cofh.subproxies.ICoFHEnergyReceiver) CoFHCCLProxy(logisticspipes.proxy.cofhccl.CoFHCCLProxy) ICCLProxy(logisticspipes.proxy.interfaces.ICCLProxy) CCLProxy(logisticspipes.proxy.ccl.CCLProxy) OpenComputersProxy(logisticspipes.proxy.opencomputers.OpenComputersProxy) IOpenComputersProxy(logisticspipes.proxy.interfaces.IOpenComputersProxy) IVec3(logisticspipes.proxy.object3d.interfaces.IVec3) ICCLProxy(logisticspipes.proxy.interfaces.ICCLProxy) ThaumCraftProxy(logisticspipes.proxy.thaumcraft.ThaumCraftProxy) IThaumCraftProxy(logisticspipes.proxy.interfaces.IThaumCraftProxy) IForestryProxy(logisticspipes.proxy.interfaces.IForestryProxy) LPDataOutput(network.rs485.logisticspipes.util.LPDataOutput) IIronChestProxy(logisticspipes.proxy.interfaces.IIronChestProxy) IBCRenderState(logisticspipes.proxy.buildcraft.subproxies.IBCRenderState) MovingObjectPosition(net.minecraft.util.MovingObjectPosition) EntityPlayer(net.minecraft.entity.player.EntityPlayer) Block(net.minecraft.block.Block) Collection(java.util.Collection) LPScale(logisticspipes.proxy.object3d.operation.LPScale) ItemStack(net.minecraft.item.ItemStack) INEIProxy(logisticspipes.proxy.interfaces.INEIProxy) IOpenComputersProxy(logisticspipes.proxy.interfaces.IOpenComputersProxy) AxisAlignedBB(net.minecraft.util.AxisAlignedBB) IEnderStorageProxy(logisticspipes.proxy.interfaces.IEnderStorageProxy) IModel3D(logisticspipes.proxy.object3d.interfaces.IModel3D) IExtraCellsProxy(logisticspipes.proxy.interfaces.IExtraCellsProxy) ExtraCellsProxy(logisticspipes.proxy.ec.ExtraCellsProxy) IExtraCellsProxy(logisticspipes.proxy.interfaces.IExtraCellsProxy) INEIProxy(logisticspipes.proxy.interfaces.INEIProxy) NEIProxy(logisticspipes.proxy.nei.NEIProxy) IIcon(net.minecraft.util.IIcon) IBCProxy(logisticspipes.proxy.interfaces.IBCProxy) IBounds(logisticspipes.proxy.object3d.interfaces.IBounds) IBinnieProxy(logisticspipes.proxy.interfaces.IBinnieProxy) BinnieProxy(logisticspipes.proxy.binnie.BinnieProxy) IIconRegister(net.minecraft.client.renderer.texture.IIconRegister) IBinnieProxy(logisticspipes.proxy.interfaces.IBinnieProxy) CoFHCCLProxy(logisticspipes.proxy.cofhccl.CoFHCCLProxy) IBCTilePart(logisticspipes.proxy.buildcraft.subproxies.IBCTilePart) IToolWrenchProxy(logisticspipes.proxy.interfaces.IToolWrenchProxy) I3DOperation(logisticspipes.proxy.object3d.interfaces.I3DOperation) IIronChestProxy(logisticspipes.proxy.interfaces.IIronChestProxy) IronChestProxy(logisticspipes.proxy.ic.IronChestProxy) TileEntity(net.minecraft.tileentity.TileEntity) LogisticsSolidTileEntity(logisticspipes.blocks.LogisticsSolidTileEntity) CoFHPowerProxy(logisticspipes.proxy.cofh.CoFHPowerProxy) ICoFHPowerProxy(logisticspipes.proxy.interfaces.ICoFHPowerProxy) RenderBlocks(net.minecraft.client.renderer.RenderBlocks) ItemIdentifier(logisticspipes.utils.item.ItemIdentifier) IIC2Proxy(logisticspipes.proxy.interfaces.IIC2Proxy) IThermalExpansionProxy(logisticspipes.proxy.interfaces.IThermalExpansionProxy) ForgeDirection(net.minecraftforge.common.util.ForgeDirection) IToolWrenchProxy(logisticspipes.proxy.interfaces.IToolWrenchProxy) ToolWrenchProxy(logisticspipes.proxy.toolWrench.ToolWrenchProxy) ICCProxy(logisticspipes.proxy.interfaces.ICCProxy) CCProxy(logisticspipes.proxy.cc.CCProxy) ICoFHEnergyStorage(logisticspipes.proxy.cofh.subproxies.ICoFHEnergyStorage) BuildCraftProxy(logisticspipes.proxy.buildcraft.BuildCraftProxy) LPTravelingItemServer(logisticspipes.transport.LPTravelingItem.LPTravelingItemServer) CoreUnroutedPipe(logisticspipes.pipes.basic.CoreUnroutedPipe) IBetterStorageProxy(logisticspipes.proxy.interfaces.IBetterStorageProxy) IOCTile(logisticspipes.proxy.opencomputers.IOCTile) InputStream(java.io.InputStream) CraftingParts(logisticspipes.recipes.CraftingParts) ICCProxy(logisticspipes.proxy.interfaces.ICCProxy) IThermalExpansionProxy(logisticspipes.proxy.interfaces.IThermalExpansionProxy) ThermalExpansionProxy(logisticspipes.proxy.te.ThermalExpansionProxy) IEnderIOProxy(logisticspipes.proxy.interfaces.IEnderIOProxy) EnderIOProxy(logisticspipes.proxy.enderio.EnderIOProxy) ITDPart(logisticspipes.proxy.td.subproxies.ITDPart) InventoryPlayer(net.minecraft.entity.player.InventoryPlayer) ITranslation(logisticspipes.proxy.object3d.interfaces.ITranslation) LPDataInput(network.rs485.logisticspipes.util.LPDataInput) IBCClickResult(logisticspipes.proxy.buildcraft.subproxies.IBCClickResult) IRenderState(logisticspipes.proxy.object3d.interfaces.IRenderState) IBCPipePluggable(logisticspipes.proxy.buildcraft.subproxies.IBCPipePluggable) ICoFHPowerProxy(logisticspipes.proxy.interfaces.ICoFHPowerProxy) IBCPluggableState(logisticspipes.proxy.buildcraft.subproxies.IBCPluggableState) GuiScreen(net.minecraft.client.gui.GuiScreen) GuiContainer(net.minecraft.client.gui.inventory.GuiContainer) IThaumCraftProxy(logisticspipes.proxy.interfaces.IThaumCraftProxy)

Example 4 with IIconTransformation

use of logisticspipes.proxy.object3d.interfaces.IIconTransformation in project LogisticsPipes by RS485.

the class LogisticsNewPipeWorldRenderer method renderWorldBlock.

@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
    Tessellator tess = Tessellator.instance;
    TileEntity tile = world.getTileEntity(x, y, z);
    LogisticsTileGenericPipe pipeTile = (LogisticsTileGenericPipe) tile;
    PipeRenderState renderState = pipeTile.renderState;
    if (pipeTile.pipe instanceof PipeBlockRequestTable) {
        if (LogisticsPipeWorldRenderer.renderPass != 0) {
            return false;
        }
        IIconProvider icons = pipeTile.getPipeIcons();
        if (icons == null) {
            return false;
        }
        if (requestBlock == null || true) {
            requestBlock = new HashMap<>();
            for (BlockRotation rot : BlockRotation.values()) {
                requestBlock.put(rot, LogisticsNewSolidBlockWorldRenderer.block.get(rot).copy().apply(new LPScale(0.999)).apply(new LPTranslation(0.0005, 0.0005, 0.0005)));
            }
        }
        SimpleServiceLocator.cclProxy.getRenderState().reset();
        SimpleServiceLocator.cclProxy.getRenderState().setUseNormals(true);
        SimpleServiceLocator.cclProxy.getRenderState().setAlphaOverride(0xff);
        BlockRotation rotation = BlockRotation.getRotation(((PipeBlockRequestTable) pipeTile.pipe).getRotation());
        int brightness = new DoubleCoordinates(x, y, z).getBlock(world).getMixedBrightnessForBlock(world, x, y, z);
        tess.setColorOpaque_F(1F, 1F, 1F);
        tess.setBrightness(brightness);
        IIconTransformation icon = SimpleServiceLocator.cclProxy.createIconTransformer(Textures.LOGISTICS_REQUEST_TABLE_NEW);
        requestBlock.get(rotation).render(new LPTranslation(x, y, z), icon);
        for (CoverSides side : CoverSides.values()) {
            if (!pipeTile.renderState.pipeConnectionMatrix.isConnected(side.getDir(rotation))) {
                LogisticsNewSolidBlockWorldRenderer.texturePlate_Outer.get(side).get(rotation).render(new LPTranslation(x, y, z), icon);
                LogisticsNewSolidBlockWorldRenderer.texturePlate_Inner.get(side).get(rotation).render(new LPTranslation(x, y, z), icon);
            }
        }
        return true;
    }
    boolean hasRendered = false;
    tess.addTranslation(0.00002F, 0.00002F, 0.00002F);
    renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
    for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
        if (pipeTile.tilePart.hasPipePluggable(dir)) {
            IBCPipePluggable p = pipeTile.tilePart.getBCPipePluggable(dir);
            p.renderPluggable(renderer, dir, LogisticsPipeWorldRenderer.renderPass, x, y, z);
            hasRendered = true;
        }
    }
    tess.addTranslation(-0.00002F, -0.00002F, -0.00002F);
    boolean[] solidSides = new boolean[6];
    for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
        DoubleCoordinates pos = CoordinateUtils.add(new DoubleCoordinates((TileEntity) pipeTile), dir);
        Block blockSide = pos.getBlock(pipeTile.getWorldObj());
        if (blockSide != null && blockSide.isSideSolid(pipeTile.getWorldObj(), pos.getXInt(), pos.getYInt(), pos.getZInt(), dir.getOpposite()) && !renderState.pipeConnectionMatrix.isConnected(dir)) {
            solidSides[dir.ordinal()] = true;
        }
    }
    if (!Arrays.equals(solidSides, renderState.solidSidesCache)) {
        renderState.solidSidesCache = solidSides.clone();
        renderState.cachedRenderer = null;
    }
    if (hasRendered) {
        block.setBlockBounds(0, 0, 0, 0, 0, 0);
        renderer.setRenderBoundsFromBlock(block);
        renderer.renderStandardBlock(block, x, y, z);
        block.setBlockBounds(0, 0, 0, 1, 1, 1);
    }
    return hasRendered;
}
Also used : PipeRenderState(logisticspipes.renderer.state.PipeRenderState) Tessellator(net.minecraft.client.renderer.Tessellator) PipeBlockRequestTable(logisticspipes.pipes.PipeBlockRequestTable) IIconProvider(logisticspipes.renderer.IIconProvider) DoubleCoordinates(network.rs485.logisticspipes.world.DoubleCoordinates) TileEntity(net.minecraft.tileentity.TileEntity) LPTranslation(logisticspipes.proxy.object3d.operation.LPTranslation) CoverSides(logisticspipes.renderer.newpipe.LogisticsNewSolidBlockWorldRenderer.CoverSides) LogisticsTileGenericPipe(logisticspipes.pipes.basic.LogisticsTileGenericPipe) ForgeDirection(net.minecraftforge.common.util.ForgeDirection) IBCPipePluggable(logisticspipes.proxy.buildcraft.subproxies.IBCPipePluggable) IIconTransformation(logisticspipes.proxy.object3d.interfaces.IIconTransformation) Block(net.minecraft.block.Block) LPScale(logisticspipes.proxy.object3d.operation.LPScale) BlockRotation(logisticspipes.renderer.newpipe.LogisticsNewSolidBlockWorldRenderer.BlockRotation)

Example 5 with IIconTransformation

use of logisticspipes.proxy.object3d.interfaces.IIconTransformation in project LogisticsPipes by RS485.

the class LogisticsNewRenderPipe method fillObjectsToRenderList.

private void fillObjectsToRenderList(List<RenderEntry> objectsToRender, LogisticsTileGenericPipe pipeTile, PipeRenderState renderState) {
    List<Edge> edgesToRender = new ArrayList<>(Arrays.asList(Edge.values()));
    Map<Corner, Integer> connectionAtCorner = new HashMap<>();
    List<PipeMount> mountCanidates = new ArrayList<>(Arrays.asList(PipeMount.values()));
    int connectionCount = 0;
    for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
        if (renderState.pipeConnectionMatrix.isConnected(dir) || pipeTile.pipe.hasSpecialPipeEndAt(dir)) {
            connectionCount++;
            if (renderState.pipeConnectionMatrix.isBCConnected(dir) || renderState.pipeConnectionMatrix.isTDConnected(dir)) {
                I3DOperation[] texture = new I3DOperation[] { LogisticsNewRenderPipe.basicPipeTexture };
                if (renderState.textureMatrix.isRouted()) {
                    if (renderState.textureMatrix.isRoutedInDir(dir)) {
                        if (renderState.textureMatrix.isSubPowerInDir(dir)) {
                            texture = new I3DOperation[] { new LPUVTransformationList(new LPUVTranslation(0, +23F / 100), LogisticsNewRenderPipe.statusBCTexture) };
                        } else {
                            texture = new I3DOperation[] { LogisticsNewRenderPipe.statusBCTexture };
                        }
                    } else {
                        texture = new I3DOperation[] { new LPUVTransformationList(new LPUVTranslation(0, -23F / 100), LogisticsNewRenderPipe.statusBCTexture) };
                    }
                }
                for (IModel3D model : LogisticsNewRenderPipe.sideBC.get(dir)) {
                    objectsToRender.add(new RenderEntry(model, texture));
                }
            } else if (!pipeTile.pipe.hasSpecialPipeEndAt(dir)) {
                I3DOperation[] texture = new I3DOperation[] { LogisticsNewRenderPipe.basicPipeTexture };
                if (renderState.textureMatrix.isRouted()) {
                    if (renderState.textureMatrix.isRoutedInDir(dir)) {
                        if (renderState.textureMatrix.isSubPowerInDir(dir)) {
                            texture = new I3DOperation[] { new LPUVTransformationList(new LPUVTranslation(-2.5F / 10, 0), LogisticsNewRenderPipe.statusTexture) };
                        } else {
                            texture = new I3DOperation[] { LogisticsNewRenderPipe.statusTexture };
                        }
                    } else {
                        if (renderState.textureMatrix.isHasPowerUpgrade()) {
                            if (renderState.textureMatrix.getPointedOrientation() == dir) {
                                texture = new I3DOperation[] { new LPUVTransformationList(new LPUVTranslation(+2.5F / 10, 0), LogisticsNewRenderPipe.statusTexture) };
                            } else {
                                texture = new I3DOperation[] { new LPUVTransformationList(new LPUVTranslation(-2.5F / 10, 37F / 100), LogisticsNewRenderPipe.statusTexture) };
                            }
                        } else {
                            if (renderState.textureMatrix.getPointedOrientation() == dir) {
                                texture = new I3DOperation[] { new LPUVTransformationList(new LPUVTranslation(+2.5F / 10, 37F / 100), LogisticsNewRenderPipe.statusTexture) };
                            } else {
                                texture = new I3DOperation[] { new LPUVTransformationList(new LPUVTranslation(0, 37F / 100), LogisticsNewRenderPipe.statusTexture) };
                            }
                        }
                    }
                }
                for (IModel3D model : LogisticsNewRenderPipe.sideNormal.get(dir)) {
                    DoubleCoordinates coords = CoordinateUtils.add(new DoubleCoordinates((TileEntity) pipeTile), dir);
                    Block block = coords.getBlock(pipeTile.getWorld());
                    double[] bounds = { block.getBlockBoundsMinY(), block.getBlockBoundsMinZ(), block.getBlockBoundsMinX(), block.getBlockBoundsMaxY(), block.getBlockBoundsMaxZ(), block.getBlockBoundsMaxX() };
                    if (SimpleServiceLocator.enderIOProxy.isItemConduit(coords.getTileEntity(pipeTile.getWorld()), dir.getOpposite()) || SimpleServiceLocator.enderIOProxy.isFluidConduit(coords.getTileEntity(pipeTile.getWorld()), dir.getOpposite())) {
                        bounds = new double[] { 0.0249D, 0.0249D, 0.0249D, 0.9751D, 0.9751D, 0.9751D };
                    }
                    double bound = bounds[dir.ordinal() / 2 + (dir.ordinal() % 2 == 0 ? 3 : 0)];
                    ScaleObject key = new ScaleObject(model, bound);
                    IModel3D model2 = LogisticsNewRenderPipe.scaleMap.get(key);
                    if (model2 == null) {
                        model2 = model.copy();
                        IVec3 min = model2.bounds().min();
                        model2.apply(new LPTranslation(min).inverse());
                        double toAdd = 1;
                        if (dir.ordinal() % 2 == 1) {
                            toAdd = 1 + (bound / LPConstants.PIPE_MIN_POS);
                            model2.apply(new LPScale(dir.offsetX != 0 ? toAdd : 1, dir.offsetY != 0 ? toAdd : 1, dir.offsetZ != 0 ? toAdd : 1));
                        } else {
                            bound = 1 - bound;
                            toAdd = 1 + (bound / LPConstants.PIPE_MIN_POS);
                            model2.apply(new LPScale(dir.offsetX != 0 ? toAdd : 1, dir.offsetY != 0 ? toAdd : 1, dir.offsetZ != 0 ? toAdd : 1));
                            model2.apply(new LPTranslation(dir.offsetX * bound, dir.offsetY * bound, dir.offsetZ * bound));
                        }
                        model2.apply(new LPTranslation(min));
                        LogisticsNewRenderPipe.scaleMap.put(key, model2);
                    }
                    objectsToRender.add(new RenderEntry(model2, texture));
                }
            }
            for (Edge edge : Edge.values()) {
                if (edge.part1 == dir || edge.part2 == dir) {
                    edgesToRender.remove(edge);
                    for (PipeMount mount : PipeMount.values()) {
                        if ((mount.dir == edge.part1 && mount.side == edge.part2) || (mount.dir == edge.part2 && mount.side == edge.part1)) {
                            mountCanidates.remove(mount);
                        }
                    }
                }
            }
            for (Corner corner : Corner.values()) {
                if (corner.ew.dir == dir || corner.ns.dir == dir || corner.ud.dir == dir) {
                    if (!connectionAtCorner.containsKey(corner)) {
                        connectionAtCorner.put(corner, 1);
                    } else {
                        connectionAtCorner.put(corner, connectionAtCorner.get(corner) + 1);
                    }
                }
            }
        }
    }
    for (Corner corner : Corner.values()) {
        IIconTransformation cornerTexture = LogisticsNewRenderPipe.basicPipeTexture;
        if (!renderState.textureMatrix.isHasPower() && renderState.textureMatrix.isRouted()) {
            cornerTexture = LogisticsNewRenderPipe.inactiveTexture;
        } else if (!renderState.textureMatrix.isRouted() && connectionCount > 2) {
            cornerTexture = LogisticsNewRenderPipe.inactiveTexture;
        }
        int count = connectionAtCorner.containsKey(corner) ? connectionAtCorner.get(corner) : 0;
        if (count == 0) {
            for (IModel3D model : LogisticsNewRenderPipe.corners_M.get(corner)) {
                objectsToRender.add(new RenderEntry(model, new I3DOperation[] { cornerTexture }));
            }
        } else if (count == 1) {
            for (PipeTurnCorner turn : PipeTurnCorner.values()) {
                if (turn.corner != corner) {
                    continue;
                }
                if (renderState.pipeConnectionMatrix.isConnected(turn.getPointer()) || pipeTile.pipe.hasSpecialPipeEndAt(turn.getPointer())) {
                    objectsToRender.add(new RenderEntry(LogisticsNewRenderPipe.spacers.get(turn), new I3DOperation[] { cornerTexture }));
                    break;
                }
            }
        } else if (count == 2) {
            for (PipeTurnCorner turn : PipeTurnCorner.values()) {
                if (turn.corner != corner) {
                    continue;
                }
                if (!renderState.pipeConnectionMatrix.isConnected(turn.getPointer()) || pipeTile.pipe.hasSpecialPipeEndAt(turn.getPointer())) {
                    objectsToRender.add(new RenderEntry(LogisticsNewRenderPipe.corners_I.get(turn), new I3DOperation[] { cornerTexture }));
                    break;
                }
            }
        } else if (count == 3) {
            for (IModel3D model : LogisticsNewRenderPipe.corners_I3.get(corner)) {
                objectsToRender.add(new RenderEntry(model, new I3DOperation[] { cornerTexture }));
            }
        }
    }
    objectsToRender.addAll(edgesToRender.stream().map(edge -> new RenderEntry(LogisticsNewRenderPipe.edges.get(edge), new I3DOperation[] { LogisticsNewRenderPipe.basicPipeTexture })).collect(Collectors.toList()));
    for (int i = 0; i < 6; i += 2) {
        ForgeDirection dir = ForgeDirection.getOrientation(i);
        List<ForgeDirection> list = new ArrayList<>(Arrays.asList(ForgeDirection.VALID_DIRECTIONS));
        list.remove(dir);
        list.remove(dir.getOpposite());
        if (renderState.pipeConnectionMatrix.isConnected(dir) && renderState.pipeConnectionMatrix.isConnected(dir.getOpposite())) {
            boolean found = false;
            for (ForgeDirection dir2 : list) {
                if (renderState.pipeConnectionMatrix.isConnected(dir2)) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                switch(dir) {
                    case DOWN:
                        objectsToRender.add(new RenderEntry(LogisticsNewRenderPipe.supports.get(PipeSupport.EAST_SIDE), new I3DOperation[] { LogisticsNewRenderPipe.basicPipeTexture }));
                        objectsToRender.add(new RenderEntry(LogisticsNewRenderPipe.supports.get(PipeSupport.WEST_SIDE), new I3DOperation[] { LogisticsNewRenderPipe.basicPipeTexture }));
                        objectsToRender.add(new RenderEntry(LogisticsNewRenderPipe.supports.get(PipeSupport.NORTH_SIDE), new I3DOperation[] { LogisticsNewRenderPipe.basicPipeTexture }));
                        objectsToRender.add(new RenderEntry(LogisticsNewRenderPipe.supports.get(PipeSupport.SOUTH_SIDE), new I3DOperation[] { LogisticsNewRenderPipe.basicPipeTexture }));
                        break;
                    case NORTH:
                        objectsToRender.add(new RenderEntry(LogisticsNewRenderPipe.supports.get(PipeSupport.EAST_UP), new I3DOperation[] { LogisticsNewRenderPipe.basicPipeTexture }));
                        objectsToRender.add(new RenderEntry(LogisticsNewRenderPipe.supports.get(PipeSupport.WEST_UP), new I3DOperation[] { LogisticsNewRenderPipe.basicPipeTexture }));
                        objectsToRender.add(new RenderEntry(LogisticsNewRenderPipe.supports.get(PipeSupport.UP_SIDE), new I3DOperation[] { LogisticsNewRenderPipe.basicPipeTexture }));
                        objectsToRender.add(new RenderEntry(LogisticsNewRenderPipe.supports.get(PipeSupport.DOWN_SIDE), new I3DOperation[] { LogisticsNewRenderPipe.basicPipeTexture }));
                        break;
                    case WEST:
                        objectsToRender.add(new RenderEntry(LogisticsNewRenderPipe.supports.get(PipeSupport.UP_UP), new I3DOperation[] { LogisticsNewRenderPipe.basicPipeTexture }));
                        objectsToRender.add(new RenderEntry(LogisticsNewRenderPipe.supports.get(PipeSupport.DOWN_UP), new I3DOperation[] { LogisticsNewRenderPipe.basicPipeTexture }));
                        objectsToRender.add(new RenderEntry(LogisticsNewRenderPipe.supports.get(PipeSupport.NORTH_UP), new I3DOperation[] { LogisticsNewRenderPipe.basicPipeTexture }));
                        objectsToRender.add(new RenderEntry(LogisticsNewRenderPipe.supports.get(PipeSupport.SOUTH_UP), new I3DOperation[] { LogisticsNewRenderPipe.basicPipeTexture }));
                        break;
                    default:
                        break;
                }
            }
        }
    }
    boolean[] solidSides = new boolean[6];
    for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
        DoubleCoordinates pos = CoordinateUtils.add(new DoubleCoordinates((TileEntity) pipeTile), dir);
        Block blockSide = pos.getBlock(pipeTile.getWorldObj());
        if (blockSide == null || !blockSide.isSideSolid(pipeTile.getWorldObj(), pos.getXInt(), pos.getYInt(), pos.getZInt(), dir.getOpposite()) || renderState.pipeConnectionMatrix.isConnected(dir)) {
            Iterator<PipeMount> iter = mountCanidates.iterator();
            while (iter.hasNext()) {
                PipeMount mount = iter.next();
                if (mount.dir == dir) {
                    iter.remove();
                }
            }
        } else {
            solidSides[dir.ordinal()] = true;
        }
    }
    if (!mountCanidates.isEmpty()) {
        if (solidSides[ForgeDirection.DOWN.ordinal()]) {
            findOponentOnSameSide(mountCanidates, ForgeDirection.DOWN);
        } else if (solidSides[ForgeDirection.UP.ordinal()]) {
            findOponentOnSameSide(mountCanidates, ForgeDirection.UP);
        } else {
            removeFromSide(mountCanidates, ForgeDirection.DOWN);
            removeFromSide(mountCanidates, ForgeDirection.UP);
            if (mountCanidates.size() > 2) {
                removeIfHasOponentSide(mountCanidates);
            }
            if (mountCanidates.size() > 2) {
                removeIfHasConnectedSide(mountCanidates);
            }
            if (mountCanidates.size() > 2) {
                findOponentOnSameSide(mountCanidates, mountCanidates.get(0).dir);
            }
        }
        if (LPConstants.DEBUG && mountCanidates.size() > 2) {
            new RuntimeException("Trying to render " + mountCanidates.size() + " Mounts").printStackTrace();
        }
        objectsToRender.addAll(mountCanidates.stream().map(mount -> new RenderEntry(LogisticsNewRenderPipe.mounts.get(mount), new I3DOperation[] { LogisticsNewRenderPipe.basicPipeTexture })).collect(Collectors.toList()));
    }
    for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
        if (!renderState.pipeConnectionMatrix.isConnected(dir)) {
            for (IModel3D model : LogisticsNewRenderPipe.texturePlate_Outer.get(dir)) {
                IIconTransformation icon = Textures.LPnewPipeIconProvider.getIcon(renderState.textureMatrix.getTextureIndex());
                if (icon != null) {
                    objectsToRender.add(new RenderEntry(model, new I3DOperation[] { icon }));
                }
            }
        }
    }
    if (renderState.textureMatrix.isFluid()) {
        for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
            if (!renderState.pipeConnectionMatrix.isConnected(dir)) {
                objectsToRender.addAll(LogisticsNewRenderPipe.texturePlate_Inner.get(dir).stream().map(model -> new RenderEntry(model, new I3DOperation[] { LogisticsNewRenderPipe.glassCenterTexture })).collect(Collectors.toList()));
            } else {
                if (!renderState.textureMatrix.isRoutedInDir(dir)) {
                    objectsToRender.addAll(LogisticsNewRenderPipe.sideTexturePlate.get(dir).getValue1().stream().map(model -> new RenderEntry(model, new I3DOperation[] { LogisticsNewRenderPipe.basicPipeTexture })).collect(Collectors.toList()));
                }
            }
        }
    }
}
Also used : IModel3D(logisticspipes.proxy.object3d.interfaces.IModel3D) I3DOperation(logisticspipes.proxy.object3d.interfaces.I3DOperation) TileEntity(net.minecraft.tileentity.TileEntity) ForgeDirection(net.minecraftforge.common.util.ForgeDirection) IIconTransformation(logisticspipes.proxy.object3d.interfaces.IIconTransformation) IVec3(logisticspipes.proxy.object3d.interfaces.IVec3) DoubleCoordinates(network.rs485.logisticspipes.world.DoubleCoordinates) Block(net.minecraft.block.Block)

Aggregations

IIconTransformation (logisticspipes.proxy.object3d.interfaces.IIconTransformation)7 Block (net.minecraft.block.Block)6 TileEntity (net.minecraft.tileentity.TileEntity)5 LogisticsTileGenericPipe (logisticspipes.pipes.basic.LogisticsTileGenericPipe)4 Tessellator (net.minecraft.client.renderer.Tessellator)4 ForgeDirection (net.minecraftforge.common.util.ForgeDirection)4 DoubleCoordinates (network.rs485.logisticspipes.world.DoubleCoordinates)4 I3DOperation (logisticspipes.proxy.object3d.interfaces.I3DOperation)3 IModel3D (logisticspipes.proxy.object3d.interfaces.IModel3D)3 IVec3 (logisticspipes.proxy.object3d.interfaces.IVec3)3 LPConstants (logisticspipes.LPConstants)2 LogisticsSolidTileEntity (logisticspipes.blocks.LogisticsSolidTileEntity)2 PipeBlockRequestTable (logisticspipes.pipes.PipeBlockRequestTable)2 CoreUnroutedPipe (logisticspipes.pipes.basic.CoreUnroutedPipe)2 IBCPipePluggable (logisticspipes.proxy.buildcraft.subproxies.IBCPipePluggable)2 IBounds (logisticspipes.proxy.object3d.interfaces.IBounds)2 LPScale (logisticspipes.proxy.object3d.operation.LPScale)2 PipeRenderState (logisticspipes.renderer.state.PipeRenderState)2 IIconRegister (net.minecraft.client.renderer.texture.IIconRegister)2 World (net.minecraft.world.World)2