Removed some unused render code and converted two more classes to scala
This commit is contained in:
parent
b938a58216
commit
aff1d3c789
|
@ -1,6 +0,0 @@
|
|||
package resonantinduction.core.prefab.part;
|
||||
|
||||
public interface IHighlight
|
||||
{
|
||||
public int getHighlightType();
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
package resonantinduction.core.prefab.part
|
||||
|
||||
abstract trait IHighlight
|
||||
{
|
||||
def getHighlightType: Int
|
||||
}
|
|
@ -1,60 +0,0 @@
|
|||
package resonantinduction.core.render;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.IIcon;
|
||||
import universalelectricity.core.transform.vector.Vector3;
|
||||
|
||||
/**
|
||||
* Used to store info on a block mainly used for rendering
|
||||
*/
|
||||
public class BlockRenderInfo
|
||||
{
|
||||
/**
|
||||
* Block lower corner size
|
||||
*/
|
||||
public Vector3 min = new Vector3(0, 0, 0);
|
||||
/**
|
||||
* Block higher corner size
|
||||
*/
|
||||
public Vector3 max = new Vector3(1, 1, 1);
|
||||
/**
|
||||
* Block to pull info from
|
||||
*/
|
||||
public Block baseBlock = Blocks.sand;
|
||||
/**
|
||||
* Override render texture
|
||||
*/
|
||||
public IIcon texture = null;
|
||||
/**
|
||||
* meta data to use for block the block
|
||||
*/
|
||||
public int meta = 0;
|
||||
|
||||
/**
|
||||
* Gets the block texture from side and meta
|
||||
*/
|
||||
public IIcon getBlockIconFromSideAndMetadata(int side, int meta)
|
||||
{
|
||||
return this.getIconSafe(baseBlock.getIcon(side, meta));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the icon and does some safty checks
|
||||
*/
|
||||
public IIcon getIconSafe(IIcon par1Icon)
|
||||
{
|
||||
IIcon icon = par1Icon;
|
||||
if (this.texture != null)
|
||||
{
|
||||
icon = texture;
|
||||
}
|
||||
if (par1Icon == null)
|
||||
{
|
||||
icon = ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno");
|
||||
}
|
||||
return icon;
|
||||
}
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
package resonantinduction.core.render;
|
||||
|
||||
import codechicken.lib.vec.Matrix4;
|
||||
import codechicken.lib.vec.Transformation;
|
||||
import codechicken.lib.vec.VariableTransformation;
|
||||
|
||||
public class InvertX extends VariableTransformation
|
||||
{
|
||||
public InvertX()
|
||||
{
|
||||
super(new Matrix4(1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Transformation inverse()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply(codechicken.lib.vec.Vector3 vec)
|
||||
{
|
||||
vec.x = -vec.x;
|
||||
}
|
||||
}
|
14
src/main/scala/resonantinduction/core/render/InvertX.scala
Normal file
14
src/main/scala/resonantinduction/core/render/InvertX.scala
Normal file
|
@ -0,0 +1,14 @@
|
|||
package resonantinduction.core.render
|
||||
|
||||
import codechicken.lib.vec.{Vector3, Matrix4, Transformation, VariableTransformation}
|
||||
|
||||
class InvertX extends VariableTransformation(new Matrix4(1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1))
|
||||
{
|
||||
override def inverse: Transformation = {
|
||||
return this
|
||||
}
|
||||
|
||||
override def apply(vec: Vector3) {
|
||||
vec.x = -vec.x
|
||||
}
|
||||
}
|
|
@ -1,65 +0,0 @@
|
|||
package resonantinduction.core.render;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import resonant.lib.render.RenderUtility;
|
||||
import resonantinduction.archaic.blocks.ItemImprint;
|
||||
import resonantinduction.archaic.blocks.TileFilterable;
|
||||
import universalelectricity.core.transform.vector.Vector3;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Briman0094
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public abstract class RenderImprintable extends TileEntitySpecialRenderer
|
||||
{
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float var8)
|
||||
{
|
||||
if (tileEntity != null)
|
||||
{
|
||||
if (tileEntity instanceof TileFilterable)
|
||||
{
|
||||
TileFilterable tileFilterable = (TileFilterable) tileEntity;
|
||||
|
||||
ItemStack filter = tileFilterable.getFilter();
|
||||
|
||||
if (filter != null)
|
||||
{
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
MovingObjectPosition objectPosition = player.rayTrace(8, 1);
|
||||
|
||||
if (objectPosition != null)
|
||||
{
|
||||
if (objectPosition.blockX == tileFilterable.xCoord && objectPosition.blockY == tileFilterable.yCoord && objectPosition.blockZ == tileFilterable.zCoord)
|
||||
{
|
||||
Set<ItemStack> filters = ItemImprint.getFilters(filter);
|
||||
|
||||
int i = 0;
|
||||
for (ItemStack filterStack : filters)
|
||||
{
|
||||
if (((TileFilterable) tileEntity).isInverted())
|
||||
{
|
||||
RenderUtility.renderFloatingText(filterStack.getTooltip(player, Minecraft.getMinecraft().gameSettings.advancedItemTooltips).get(0).toString(), new Vector3(x, y, z).add(0.5, i * 0.25f - 1f, z + 0.5f), 0xFF8888);
|
||||
}
|
||||
else
|
||||
{
|
||||
RenderUtility.renderFloatingText(filterStack.getTooltip(player, Minecraft.getMinecraft().gameSettings.advancedItemTooltips).get(0).toString(), new Vector3(x, y, z).add(0.5, i * 0.25f - 1f, z + 0.5f), 0x88FF88);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue