mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +00:00
More Client fixes
This commit is contained in:
1 parent
4384dbe376
commit
d4ca659ed0
24 files changed
+218
-233
No files matched your search
@@ -5,6 +5,8 @@ import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
/**
|
||||
@@ -357,11 +359,14 @@ public class CTM
|
||||
break;
|
||||
}
|
||||
|
||||
Block block1 = world.getBlock(x, y, z);
|
||||
Block block2 = world.getBlock(x2, y2, z2);
|
||||
IBlockState s1 = world.getBlockState(new BlockPos(x, y, z));
|
||||
IBlockState s2 = world.getBlockState(new BlockPos(x2, y2, z2));
|
||||
|
||||
int meta1 = world.getBlockMetadata(x, y, z);
|
||||
int meta2 = world.getBlockMetadata(x2, y2, z2);
|
||||
Block block1 = s1.getBlock();
|
||||
Block block2 = s2.getBlock();
|
||||
|
||||
int meta1 = block1.getMetaFromState(s1);
|
||||
int meta2 = block2.getMetaFromState(s2);
|
||||
|
||||
boolean validBlockMeta1 = false;
|
||||
boolean invalidBlockMeta2 = true;
|
||||
|
||||
@@ -22,16 +22,14 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GLAllocation;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.client.renderer.texture.ResourceLocation;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Timer;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
@@ -52,12 +50,12 @@ public class MekanismRenderer
|
||||
{
|
||||
private static RenderBlocks renderBlocks = new RenderBlocks();
|
||||
|
||||
public static IIcon[] colors = new IIcon[256];
|
||||
public static ResourceLocation[] colors = new ResourceLocation[256];
|
||||
|
||||
public static IIcon energyIcon;
|
||||
public static IIcon heatIcon;
|
||||
public static ResourceLocation energyIcon;
|
||||
public static ResourceLocation heatIcon;
|
||||
|
||||
public static Map<TransmissionType, IIcon> overlays = new HashMap<TransmissionType, IIcon>();
|
||||
public static Map<TransmissionType, ResourceLocation> overlays = new HashMap<TransmissionType, ResourceLocation>();
|
||||
|
||||
private static float lightmapLastX;
|
||||
private static float lightmapLastY;
|
||||
@@ -77,16 +75,16 @@ public class MekanismRenderer
|
||||
@SubscribeEvent
|
||||
public void onStitch(TextureStitchEvent.Pre event)
|
||||
{
|
||||
if(event.map.getTextureType() == 0)
|
||||
if(event.map.getGlTextureId()/*TODO Is this right?*/ == 0)
|
||||
{
|
||||
for(EnumColor color : EnumColor.values())
|
||||
{
|
||||
colors[color.ordinal()] = event.map.registerIcon("mekanism:overlay/overlay_" + color.unlocalizedName);
|
||||
colors[color.ordinal()] = event.map.registerSprite(new ResourceLocation("mekanism:overlay/overlay_" + color.unlocalizedName));
|
||||
}
|
||||
|
||||
for(TransmissionType type : TransmissionType.values())
|
||||
{
|
||||
overlays.put(type, event.map.registerIcon("mekanism:overlay/" + type.getTransmission() + "Overlay"));
|
||||
overlays.put(type, event.map.registerSprite(new ResourceLocation("mekanism:overlay/" + type.getTransmission() + "Overlay")));
|
||||
}
|
||||
|
||||
energyIcon = event.map.registerIcon("mekanism:LiquidEnergy");
|
||||
@@ -152,7 +150,7 @@ public class MekanismRenderer
|
||||
}
|
||||
}
|
||||
|
||||
public static void loadDynamicTextures(IIconRegister register, String name, IIcon[] textures, DefIcon... defaults)
|
||||
public static void loadDynamicTextures(ResourceLocationRegister register, String name, ResourceLocation[] textures, DefIcon... defaults)
|
||||
{
|
||||
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
@@ -204,11 +202,11 @@ public class MekanismRenderer
|
||||
|
||||
public static class DefIcon
|
||||
{
|
||||
public IIcon defIcon;
|
||||
public ResourceLocation defIcon;
|
||||
|
||||
public List<Integer> icons = new ArrayList<Integer>();
|
||||
|
||||
public DefIcon(IIcon icon, int... is)
|
||||
public DefIcon(ResourceLocation icon, int... is)
|
||||
{
|
||||
defIcon = icon;
|
||||
|
||||
@@ -218,12 +216,12 @@ public class MekanismRenderer
|
||||
}
|
||||
}
|
||||
|
||||
public static DefIcon getAll(IIcon icon)
|
||||
public static DefIcon getAll(ResourceLocation icon)
|
||||
{
|
||||
return new DefIcon(icon, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
|
||||
}
|
||||
|
||||
public static DefIcon getActivePair(IIcon icon, int... is)
|
||||
public static DefIcon getActivePair(ResourceLocation icon, int... is)
|
||||
{
|
||||
DefIcon ret = new DefIcon(icon, is);
|
||||
|
||||
@@ -245,7 +243,7 @@ public class MekanismRenderer
|
||||
public double maxY;
|
||||
public double maxZ;
|
||||
|
||||
public IIcon[] textures = new IIcon[6];
|
||||
public ResourceLocation[] textures = new ResourceLocation[6];
|
||||
|
||||
public boolean[] renderSides = new boolean[] {true, true, true, true, true, true, false};
|
||||
|
||||
@@ -271,17 +269,17 @@ public class MekanismRenderer
|
||||
return renderSides[side.ordinal()];
|
||||
}
|
||||
|
||||
public IIcon getBlockTextureFromSide(int i)
|
||||
public ResourceLocation getBlockTextureFromSide(int i)
|
||||
{
|
||||
return textures[i];
|
||||
}
|
||||
|
||||
public void setTexture(IIcon tex)
|
||||
public void setTexture(ResourceLocation tex)
|
||||
{
|
||||
Arrays.fill(textures, tex);
|
||||
}
|
||||
|
||||
public void setTextures(IIcon down, IIcon up, IIcon north, IIcon south, IIcon west, IIcon east)
|
||||
public void setTextures(ResourceLocation down, ResourceLocation up, ResourceLocation north, ResourceLocation south, ResourceLocation west, ResourceLocation east)
|
||||
{
|
||||
textures[0] = down;
|
||||
textures[1] = up;
|
||||
@@ -363,7 +361,7 @@ public class MekanismRenderer
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
public static IIcon getColorIcon(EnumColor color)
|
||||
public static ResourceLocation getColorIcon(EnumColor color)
|
||||
{
|
||||
return colors[color.ordinal()];
|
||||
}
|
||||
@@ -440,7 +438,7 @@ public class MekanismRenderer
|
||||
*/
|
||||
public static void renderItem(ItemStack item)
|
||||
{
|
||||
IIcon icon = item.getItem().getIconIndex(item);
|
||||
ResourceLocation icon = item.getItem().getIconIndex(item);
|
||||
TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager();
|
||||
|
||||
if(icon == null)
|
||||
@@ -689,6 +687,6 @@ public class MekanismRenderer
|
||||
|
||||
public static interface ICustomBlockIcon
|
||||
{
|
||||
public IIcon getIcon(ItemStack stack, int side);
|
||||
public ResourceLocation getIcon(ItemStack stack, int side);
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ public final class MinerVisualRenderer
|
||||
public static void render(TileEntityDigitalMiner miner)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(getX(miner.xCoord), getY(miner.yCoord), getZ(miner.zCoord));
|
||||
GL11.glTranslated(getX(miner.getPos().getX()), getY(miner.getPos().getY()), getZ(miner.getPos().getZ()));
|
||||
MekanismRenderer.blendOn();
|
||||
MekanismRenderer.glowOn();
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
@@ -60,7 +60,7 @@ public final class MinerVisualRenderer
|
||||
{
|
||||
if(x == -data.radius || x == data.radius || y == data.minY-data.yCoord || y == data.maxY-data.yCoord || z == -data.radius || z == data.radius)
|
||||
{
|
||||
models.add(createModel(new Coord4D(x, y, z, mc.theWorld.provider.dimensionId)));
|
||||
models.add(createModel(new Coord4D(x, y, z, mc.theWorld.provider.getDimensionId())));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -80,7 +80,7 @@ public final class MinerVisualRenderer
|
||||
{
|
||||
Model3D toReturn = new Model3D();
|
||||
|
||||
toReturn.setBlockBounds(rel.xCoord + 0.4, rel.yCoord + 0.4, rel.zCoord + 0.4, rel.xCoord + 0.6, rel.yCoord + 0.6, rel.zCoord + 0.6);
|
||||
toReturn.setBlockBounds(rel.getX() + 0.4, rel.getY() + 0.4, rel.getZ() + 0.4, rel.getX() + 0.6, rel.getY() + 0.6, rel.getZ() + 0.6);
|
||||
toReturn.baseBlock = Blocks.water;
|
||||
toReturn.setTexture(MekanismRenderer.getColorIcon(EnumColor.WHITE));
|
||||
|
||||
@@ -119,9 +119,9 @@ public final class MinerVisualRenderer
|
||||
|
||||
public MinerRenderData(TileEntityDigitalMiner miner)
|
||||
{
|
||||
this(miner.minY, miner.maxY, miner.radius, miner.yCoord);
|
||||
this(miner.minY, miner.maxY, miner.radius, miner.getPos().getY());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object data)
|
||||
{
|
||||
|
||||
@@ -41,18 +41,17 @@ public class ModelCustomArmor extends ModelBiped
|
||||
resetPart(bipedLeftLeg, 0, 0, 0);
|
||||
|
||||
bipedHeadwear.cubeList.clear();
|
||||
bipedEars.cubeList.clear();
|
||||
bipedCloak.cubeList.clear();
|
||||
}
|
||||
|
||||
public void init(Entity entity, float f, float f1, float f2, float f3, float f4, float size)
|
||||
{
|
||||
reset();
|
||||
|
||||
isSneak = entity.isSneaking();
|
||||
isRiding = entity.isRiding();
|
||||
|
||||
if(entity instanceof EntityLivingBase)
|
||||
{
|
||||
isSneak = ((EntityLivingBase)entity).isSneaking();
|
||||
isRiding = ((EntityLivingBase)entity).isRiding();
|
||||
isChild = ((EntityLivingBase)entity).isChild();
|
||||
}
|
||||
|
||||
@@ -246,10 +245,11 @@ public class ModelCustomArmor extends ModelBiped
|
||||
@Override
|
||||
public void render(Entity entity, float par2, float par3, float par4, float par5, float par6, float par7)
|
||||
{
|
||||
isSneak = entity.isSneaking();
|
||||
isRiding = entity.isRiding();
|
||||
|
||||
if(entity instanceof EntityLivingBase)
|
||||
{
|
||||
isSneak = ((EntityLivingBase)entity).isSneaking();
|
||||
isRiding = ((EntityLivingBase)entity).isRiding();
|
||||
isChild = ((EntityLivingBase)entity).isChild();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package mekanism.client.render;
|
||||
|
||||
/*
|
||||
import java.util.Map;
|
||||
|
||||
import mekanism.api.EnumColor;
|
||||
@@ -21,9 +22,11 @@ import codechicken.lib.render.TextureUtils.IIconSelfRegister;
|
||||
import codechicken.lib.render.uv.IconTransformation;
|
||||
import codechicken.lib.vec.Translation;
|
||||
import codechicken.lib.vec.Vector3;
|
||||
*/
|
||||
|
||||
public class RenderGlowPanel implements IIconSelfRegister
|
||||
public class RenderGlowPanel//TODO implements IIconSelfRegister
|
||||
{
|
||||
/*TODO
|
||||
public static RenderGlowPanel INSTANCE;
|
||||
|
||||
public static CCModel[] frameModels;
|
||||
@@ -100,4 +103,5 @@ public class RenderGlowPanel implements IIconSelfRegister
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package mekanism.client.render;
|
||||
|
||||
/*
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -57,10 +58,12 @@ import codechicken.lib.vec.Translation;
|
||||
import codechicken.lib.vec.Vector3;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
*/
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderPartTransmitter implements IIconSelfRegister
|
||||
//@SideOnly(Side.CLIENT)
|
||||
public class RenderPartTransmitter //TODO implements IIconSelfRegister
|
||||
{
|
||||
/*
|
||||
public static RenderPartTransmitter INSTANCE;
|
||||
|
||||
public static Map<String, CCModel> small_models;
|
||||
@@ -814,4 +817,5 @@ public class RenderPartTransmitter implements IIconSelfRegister
|
||||
cachedLiquids.clear();
|
||||
cachedOverlays.clear();
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -22,6 +22,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.TickEvent.Phase;
|
||||
@@ -29,6 +30,8 @@ import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import javafx.geometry.Pos;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderTickHandler
|
||||
{
|
||||
@@ -45,17 +48,13 @@ public class RenderTickHandler
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
World world = mc.thePlayer.worldObj;
|
||||
|
||||
FontRenderer font = mc.fontRenderer;
|
||||
FontRenderer font = mc.fontRendererObj;
|
||||
|
||||
MovingObjectPosition pos = player.rayTrace(40.0D, 1.0F);
|
||||
|
||||
if(pos != null)
|
||||
{
|
||||
int x = MathHelper.floor_double(pos.blockX);
|
||||
int y = MathHelper.floor_double(pos.blockY);
|
||||
int z = MathHelper.floor_double(pos.blockZ);
|
||||
|
||||
Coord4D obj = new Coord4D(x, y, z, world.provider.dimensionId);
|
||||
{
|
||||
Coord4D obj = new Coord4D(pos.getBlockPos(), world.provider.getDimensionId());
|
||||
|
||||
if(MekanismAPI.debug && mc.currentScreen == null && !mc.gameSettings.showDebugInfo)
|
||||
{
|
||||
@@ -81,7 +80,7 @@ public class RenderTickHandler
|
||||
{
|
||||
ItemStack stack = player.getEquipmentInSlot(3);
|
||||
|
||||
ScaledResolution scaledresolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||
ScaledResolution scaledresolution = new ScaledResolution(mc);
|
||||
|
||||
int x = scaledresolution.getScaledWidth();
|
||||
int y = scaledresolution.getScaledHeight();
|
||||
@@ -123,25 +122,13 @@ public class RenderTickHandler
|
||||
|
||||
float random = (rand.nextFloat() - 0.5F) * 0.1F;
|
||||
|
||||
Pos3D vLeft = new Pos3D();
|
||||
vLeft.xPos -= 0.43;
|
||||
vLeft.yPos -= 0.55;
|
||||
vLeft.zPos -= 0.54;
|
||||
vLeft.rotateYaw(p.renderYawOffset);
|
||||
Pos3D vLeft = new Pos3D(-0.43, -0.55, -0.54).rotateYaw(p.renderYawOffset);
|
||||
|
||||
Pos3D vRight = new Pos3D();
|
||||
vRight.xPos += 0.43;
|
||||
vRight.yPos -= 0.55;
|
||||
vRight.zPos -= 0.54;
|
||||
vRight.rotateYaw(p.renderYawOffset);
|
||||
Pos3D vRight = new Pos3D(0.43, -0.55, -0.54).rotateYaw(p.renderYawOffset);
|
||||
|
||||
Pos3D vCenter = new Pos3D();
|
||||
vCenter.xPos = (rand.nextFloat() - 0.5F) * 0.4F;
|
||||
vCenter.yPos -= 0.86;
|
||||
vCenter.zPos -= 0.30;
|
||||
vCenter.rotateYaw(p.renderYawOffset);
|
||||
Pos3D vCenter = new Pos3D((rand.nextFloat() - 0.5F) * 0.4F, -0.86, -0.30).rotateYaw(p.renderYawOffset);
|
||||
|
||||
Pos3D rLeft = vLeft.clone().scale(random);
|
||||
Pos3D rLeft = vLeft.scale(random);
|
||||
Pos3D rRight = vRight.clone().scale(random);
|
||||
|
||||
Pos3D mLeft = vLeft.clone().scale(0.2).translate(new Pos3D(p.motionX, p.motionY, p.motionZ));
|
||||
@@ -152,64 +139,65 @@ public class RenderTickHandler
|
||||
mRight.translate(rRight);
|
||||
|
||||
Pos3D v = playerPos.clone().translate(vLeft);
|
||||
spawnAndSetParticle("flame", world, v.xPos, v.yPos, v.zPos, mLeft.xPos, mLeft.yPos, mLeft.zPos);
|
||||
spawnAndSetParticle("smoke", world, v.xPos, v.yPos, v.zPos, mLeft.xPos, mLeft.yPos, mLeft.zPos);
|
||||
spawnAndSetParticle("flame", world, v.xCoord, v.yCoord, v.zCoord, mLeft.xCoord, mLeft.yCoord, mLeft.zCoord);
|
||||
spawnAndSetParticle("smoke", world, v.xCoord, v.yCoord, v.zCoord, mLeft.xCoord, mLeft.yCoord, mLeft.zCoord);
|
||||
|
||||
v = playerPos.clone().translate(vRight);
|
||||
spawnAndSetParticle("flame", world, v.xPos, v.yPos, v.zPos, mRight.xPos, mRight.yPos, mRight.zPos);
|
||||
spawnAndSetParticle("smoke", world, v.xPos, v.yPos, v.zPos, mRight.xPos, mRight.yPos, mRight.zPos);
|
||||
spawnAndSetParticle("flame", world, v.xCoord, v.yCoord, v.zCoord, mRight.xCoord, mRight.yCoord, mRight.zCoord);
|
||||
spawnAndSetParticle("smoke", world, v.xCoord, v.yCoord, v.zCoord, mRight.xCoord, mRight.yCoord, mRight.zCoord);
|
||||
|
||||
v = playerPos.clone().translate(vCenter);
|
||||
spawnAndSetParticle("flame", world, v.xPos, v.yPos, v.zPos, mCenter.xPos, mCenter.yPos, mCenter.zPos);
|
||||
spawnAndSetParticle("smoke", world, v.xPos, v.yPos, v.zPos, mCenter.xPos, mCenter.yPos, mCenter.zPos);
|
||||
spawnAndSetParticle("flame", world, v.xCoord, v.yCoord, v.zCoord, mCenter.xCoord, mCenter.yCoord, mCenter.zCoord);
|
||||
spawnAndSetParticle("smoke", world, v.xCoord, v.yCoord, v.zCoord, mCenter.xCoord, mCenter.yCoord, mCenter.zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
if(world.getWorldTime() % 4 == 0)
|
||||
{
|
||||
for(EntityPlayer p : (List<EntityPlayer>)world.playerEntities)
|
||||
for(EntityPlayer p : world.playerEntities)
|
||||
{
|
||||
if(!Mekanism.flamethrowerActive.contains(p.getCommandSenderName()) && !p.isSwingInProgress && p.getCurrentEquippedItem() != null && p.getCurrentEquippedItem().getItem() instanceof ItemFlamethrower)
|
||||
if(!Mekanism.flamethrowerActive.contains(p.getName()) && !p.isSwingInProgress && p.getCurrentEquippedItem() != null && p.getCurrentEquippedItem().getItem() instanceof ItemFlamethrower)
|
||||
{
|
||||
if(((ItemFlamethrower)p.getCurrentEquippedItem().getItem()).getGas(p.getCurrentEquippedItem()) != null)
|
||||
{
|
||||
Pos3D playerPos = new Pos3D(p);
|
||||
Pos3D flameVec = new Pos3D();
|
||||
Pos3D flameVec;
|
||||
|
||||
double flameXCoord = 0;
|
||||
double flameYCoord = 0;
|
||||
double flameZCoord = 0;
|
||||
|
||||
if(p.isSneaking())
|
||||
{
|
||||
flameVec.yPos -= 0.35F;
|
||||
flameVec.zPos -= 0.15F;
|
||||
flameYCoord -= 0.35F;
|
||||
flameZCoord -= 0.15F;
|
||||
}
|
||||
|
||||
Pos3D flameMotion = new Pos3D(p.motionX, p.onGround ? 0 : p.motionY, p.motionZ);
|
||||
|
||||
if(player == p && mc.gameSettings.thirdPersonView == 0)
|
||||
{
|
||||
flameVec = new Pos3D(0.8, 0.8, 0.8);
|
||||
|
||||
flameVec.multiply(new Pos3D(p.getLook(90)));
|
||||
flameVec.rotateYaw(15);
|
||||
flameVec = new Pos3D(0.8, 0.8, 0.8).multiply(new Pos3D(p.getLook(90))).rotateYaw(15);
|
||||
}
|
||||
else {
|
||||
flameVec.xPos -= 0.45F;
|
||||
flameXCoord -= 0.45F;
|
||||
|
||||
if(player == p)
|
||||
{
|
||||
flameVec.yPos -= 0.5F;
|
||||
flameYCoord -= 0.5F;
|
||||
}
|
||||
else {
|
||||
flameVec.yPos += 1F;
|
||||
flameYCoord += 1F;
|
||||
}
|
||||
|
||||
flameVec.zPos += 1.05F;
|
||||
flameZCoord += 1.05F;
|
||||
|
||||
flameVec.rotateYaw(p.renderYawOffset);
|
||||
flameVec = new Pos3D(flameXCoord, flameYCoord, flameZCoord).rotateYaw(p.renderYawOffset);
|
||||
}
|
||||
|
||||
Pos3D mergedVec = playerPos.clone().translate(flameVec);
|
||||
Pos3D mergedVec = playerPos.translate(flameVec);
|
||||
|
||||
spawnAndSetParticle("flame", world, mergedVec.xPos, mergedVec.yPos, mergedVec.zPos, flameMotion.xPos, flameMotion.yPos, flameMotion.zPos);
|
||||
spawnAndSetParticle("flame", world, mergedVec.xCoord, mergedVec.yCoord, mergedVec.zCoord, flameMotion.xCoord, flameMotion.yCoord, flameMotion.zCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ package mekanism.client.render.particle;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.EntityFlameFX;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.client.FMLClientHandler;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
@@ -27,11 +29,11 @@ public class EntityJetpackFlameFX extends EntityFlameFX
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_)
|
||||
public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float p_180434_4_, float p_180434_5_, float p_180434_6_, float p_180434_7_, float p_180434_8_)
|
||||
{
|
||||
if(particleAge > 0)
|
||||
{
|
||||
super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_);
|
||||
super.renderParticle(worldRendererIn, entityIn, partialTicks, p_180434_4_, p_180434_5_, p_180434_6_, p_180434_7_, p_180434_8_);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package mekanism.client.render.particle;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.EntitySmokeFX;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.client.FMLClientHandler;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
@@ -15,7 +17,7 @@ public class EntityJetpackSmokeFX extends EntitySmokeFX
|
||||
|
||||
public EntityJetpackSmokeFX(World world, double posX, double posY, double posZ, double velX, double velY, double velZ)
|
||||
{
|
||||
super(world, posX, posY, posZ, velX, velY, velZ);
|
||||
super(world, posX, posY, posZ, velX, velY, velZ, 1.0F);
|
||||
|
||||
noClip = false;
|
||||
}
|
||||
@@ -27,11 +29,11 @@ public class EntityJetpackSmokeFX extends EntitySmokeFX
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_)
|
||||
public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float p_180434_4_, float p_180434_5_, float p_180434_6_, float p_180434_7_, float p_180434_8_)
|
||||
{
|
||||
if(particleAge > 0)
|
||||
{
|
||||
super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_);
|
||||
super.renderParticle(worldRendererIn, entityIn, partialTicks, p_180434_4_, p_180434_5_, p_180434_6_, p_180434_7_, p_180434_8_);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,15 +6,12 @@ import mekanism.common.tile.TileEntityBin;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -23,87 +20,82 @@ import org.lwjgl.opengl.GL11;
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderBin extends TileEntitySpecialRenderer<TileEntityBin>
|
||||
{
|
||||
private final RenderBlocks renderBlocks = new RenderBlocks();
|
||||
private final RenderItem renderItem = (RenderItem)RenderManager.instance.getEntityClassRenderObject(EntityItem.class);
|
||||
private final RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntityBin tileEntity, double x, double y, double z, float partialTick, int destroyStage)
|
||||
{
|
||||
if(tileEntity instanceof TileEntityBin)
|
||||
String amount = "";
|
||||
ItemStack itemStack = tileEntity.itemType;
|
||||
|
||||
if(itemStack != null)
|
||||
{
|
||||
String amount = "";
|
||||
ItemStack itemStack = tileEntity.itemType;
|
||||
|
||||
if(itemStack != null)
|
||||
{
|
||||
amount = Integer.toString(tileEntity.clientAmount);
|
||||
}
|
||||
|
||||
Coord4D obj = Coord4D.get(tileEntity).offset(ForgeDirection.getOrientation(tileEntity.facing));
|
||||
|
||||
if(tileEntity.getWorldObj().getBlock(obj.xCoord, obj.yCoord, obj.zCoord).isSideSolid(tileEntity.getWorldObj(), obj.xCoord, obj.yCoord, obj.zCoord, ForgeDirection.getOrientation(tileEntity.facing).getOpposite()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
doLight(tileEntity.getWorldObj(), obj);
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240);
|
||||
|
||||
if(itemStack != null)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
|
||||
switch(ForgeDirection.getOrientation(tileEntity.facing))
|
||||
{
|
||||
case NORTH:
|
||||
GL11.glTranslated(x + 0.73, y + 0.83, z - 0.01);
|
||||
break;
|
||||
case SOUTH:
|
||||
GL11.glTranslated(x + 0.27, y + 0.83, z + 1.01);
|
||||
GL11.glRotatef(180, 0, 1, 0);
|
||||
break;
|
||||
case WEST:
|
||||
GL11.glTranslated(x - 0.01, y + 0.83, z + 0.27);
|
||||
GL11.glRotatef(90, 0, 1, 0);
|
||||
break;
|
||||
case EAST:
|
||||
GL11.glTranslated(x + 1.01, y + 0.83, z + 0.73);
|
||||
GL11.glRotatef(-90, 0, 1, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
float scale = 0.03125F;
|
||||
float scaler = 0.9F;
|
||||
|
||||
GL11.glScalef(scale*scaler, scale*scaler, 0);
|
||||
GL11.glRotatef(180, 0, 0, 1);
|
||||
|
||||
TextureManager renderEngine = Minecraft.getMinecraft().renderEngine;
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
|
||||
renderItem.renderItemAndEffectIntoGUI(func_147498_b()/*getFontRenderer()*/, renderEngine, itemStack, 0, 0);
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
if(amount != "")
|
||||
{
|
||||
renderText(amount, ForgeDirection.getOrientation(tileEntity.facing), 0.02F, x, y - 0.31F, z);
|
||||
}
|
||||
amount = Integer.toString(tileEntity.clientAmount);
|
||||
}
|
||||
}
|
||||
|
||||
private void doLight(World world, Coord4D obj)
|
||||
{
|
||||
if(world.getBlock(obj.xCoord, obj.yCoord, obj.zCoord).isOpaqueCube())
|
||||
Coord4D obj = Coord4D.get(tileEntity).offset(EnumFacing.getFront(tileEntity.facing));
|
||||
|
||||
if(tileEntity.getWorld().getBlockState(obj).getBlock().isSideSolid(tileEntity.getWorld(), obj, EnumFacing.getFront(tileEntity.facing).getOpposite()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int brightness = world.getLightBrightnessForSkyBlocks(obj.xCoord, obj.yCoord, obj.zCoord, 0);
|
||||
doLight(tileEntity.getWorld(), obj);
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240);
|
||||
|
||||
if(itemStack != null)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
|
||||
switch(EnumFacing.getFront(tileEntity.facing))
|
||||
{
|
||||
case NORTH:
|
||||
GL11.glTranslated(x + 0.73, y + 0.83, z - 0.01);
|
||||
break;
|
||||
case SOUTH:
|
||||
GL11.glTranslated(x + 0.27, y + 0.83, z + 1.01);
|
||||
GL11.glRotatef(180, 0, 1, 0);
|
||||
break;
|
||||
case WEST:
|
||||
GL11.glTranslated(x - 0.01, y + 0.83, z + 0.27);
|
||||
GL11.glRotatef(90, 0, 1, 0);
|
||||
break;
|
||||
case EAST:
|
||||
GL11.glTranslated(x + 1.01, y + 0.83, z + 0.73);
|
||||
GL11.glRotatef(-90, 0, 1, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
float scale = 0.03125F;
|
||||
float scaler = 0.9F;
|
||||
|
||||
GL11.glScalef(scale*scaler, scale*scaler, 0);
|
||||
GL11.glRotatef(180, 0, 0, 1);
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
|
||||
renderItem.renderItemAndEffectIntoGUI(itemStack, 0, 0);
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
if(!amount.equals(""))
|
||||
{
|
||||
renderText(amount, EnumFacing.getFront(tileEntity.facing), 0.02F, x, y - 0.31F, z);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void doLight(World world, Coord4D obj)
|
||||
{
|
||||
if(world.getBlockState(obj).getBlock().isOpaqueCube())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int brightness = world.getLightFromNeighborsFor(EnumSkyBlock.SKY, obj);
|
||||
int lightX = brightness % 65536;
|
||||
int lightY = brightness / 65536;
|
||||
float scale = 0.6F;
|
||||
@@ -112,7 +104,7 @@ public class RenderBin extends TileEntitySpecialRenderer<TileEntityBin>
|
||||
}
|
||||
|
||||
@SuppressWarnings("incomplete-switch")
|
||||
private void renderText(String text, ForgeDirection side, float maxScale, double x, double y, double z)
|
||||
private void renderText(String text, EnumFacing side, float maxScale, double x, double y, double z)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
|
||||
@@ -150,7 +142,7 @@ public class RenderBin extends TileEntitySpecialRenderer<TileEntityBin>
|
||||
GL11.glTranslatef(displayWidth / 2, 1F, displayHeight / 2);
|
||||
GL11.glRotatef(-90, 1, 0, 0);
|
||||
|
||||
FontRenderer fontRenderer = func_147498_b();//getFontRenderer();
|
||||
FontRenderer fontRenderer = getFontRenderer();
|
||||
|
||||
int requiredWidth = Math.max(fontRenderer.getStringWidth(text), 1);
|
||||
int lineHeight = fontRenderer.FONT_HEIGHT + 2;
|
||||
|
||||
@@ -47,6 +47,6 @@ public class RenderChemicalCrystallizer extends TileEntitySpecialRenderer<TileEn
|
||||
model.renderWithRotation(0.0625F, tileEntity.spin);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
MekanismRenderer.machineRenderer.renderAModelAt(tileEntity, x, y, z, partialTick);
|
||||
MekanismRenderer.machineRenderer.renderTileEntityAt(tileEntity, x, y, z, partialTick, destroyStage);
|
||||
}
|
||||
}
|
||||
@@ -14,8 +14,7 @@ import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -25,7 +24,7 @@ public class RenderChemicalInfuser extends TileEntitySpecialRenderer<TileEntityC
|
||||
|
||||
private static final double offset = 0.001;
|
||||
|
||||
private Map<ForgeDirection, HashMap<Gas, DisplayInteger>> cachedGasses = new HashMap<ForgeDirection, HashMap<Gas, DisplayInteger>>();
|
||||
private Map<EnumFacing, HashMap<Gas, DisplayInteger>> cachedGasses = new HashMap<EnumFacing, HashMap<Gas, DisplayInteger>>();
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntityChemicalInfuser tileEntity, double x, double y, double z, float partialTick, int destroyStage)
|
||||
@@ -39,7 +38,7 @@ public class RenderChemicalInfuser extends TileEntitySpecialRenderer<TileEntityC
|
||||
GL11.glTranslatef((float)x, (float)y, (float)z);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, (float)tileEntity.leftTank.getStored()/tileEntity.leftTank.getMaxGas());
|
||||
bindTexture(MekanismRenderer.getBlocksTexture());
|
||||
getListAndRender(ForgeDirection.getOrientation(tileEntity.facing), tileEntity.leftTank.getGas().getGas()).render();
|
||||
getListAndRender(EnumFacing.getFront(tileEntity.facing), tileEntity.leftTank.getGas().getGas()).render();
|
||||
GL11.glColor4f(1, 1, 1, 1);
|
||||
|
||||
pop();
|
||||
@@ -49,7 +48,7 @@ public class RenderChemicalInfuser extends TileEntitySpecialRenderer<TileEntityC
|
||||
{
|
||||
push();
|
||||
|
||||
switch(ForgeDirection.getOrientation(tileEntity.facing))
|
||||
switch(EnumFacing.getFront(tileEntity.facing))
|
||||
{
|
||||
case NORTH:
|
||||
GL11.glTranslatef(-0.4375F, 0, 0);
|
||||
@@ -68,7 +67,7 @@ public class RenderChemicalInfuser extends TileEntitySpecialRenderer<TileEntityC
|
||||
GL11.glTranslatef((float)x, (float)y, (float)z);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, (float)tileEntity.rightTank.getStored()/tileEntity.rightTank.getMaxGas());
|
||||
bindTexture(MekanismRenderer.getBlocksTexture());
|
||||
getListAndRender(ForgeDirection.getOrientation(tileEntity.facing), tileEntity.rightTank.getGas().getGas()).render();
|
||||
getListAndRender(EnumFacing.getFront(tileEntity.facing), tileEntity.rightTank.getGas().getGas()).render();
|
||||
GL11.glColor4f(1, 1, 1, 1);
|
||||
|
||||
pop();
|
||||
@@ -109,7 +108,7 @@ public class RenderChemicalInfuser extends TileEntitySpecialRenderer<TileEntityC
|
||||
}
|
||||
|
||||
@SuppressWarnings("incomplete-switch")
|
||||
private DisplayInteger getListAndRender(ForgeDirection side, Gas gas)
|
||||
private DisplayInteger getListAndRender(EnumFacing side, Gas gas)
|
||||
{
|
||||
if(gas == null || gas.getIcon() == null)
|
||||
{
|
||||
|
||||
@@ -14,8 +14,7 @@ import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -25,7 +24,7 @@ public class RenderChemicalOxidizer extends TileEntitySpecialRenderer<TileEntity
|
||||
|
||||
private static final double offset = 0.001;
|
||||
|
||||
private Map<ForgeDirection, HashMap<Gas, DisplayInteger>> cachedGasses = new HashMap<ForgeDirection, HashMap<Gas, DisplayInteger>>();
|
||||
private Map<EnumFacing, HashMap<Gas, DisplayInteger>> cachedGasses = new HashMap<EnumFacing, HashMap<Gas, DisplayInteger>>();
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntityChemicalOxidizer tileEntity, double x, double y, double z, float partialTick, int destroyStage)
|
||||
@@ -39,7 +38,7 @@ public class RenderChemicalOxidizer extends TileEntitySpecialRenderer<TileEntity
|
||||
GL11.glTranslatef((float)x, (float)y, (float)z);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, (float)tileEntity.gasTank.getStored()/tileEntity.gasTank.getMaxGas());
|
||||
bindTexture(MekanismRenderer.getBlocksTexture());
|
||||
getListAndRender(ForgeDirection.getOrientation(tileEntity.facing), tileEntity.gasTank.getGas().getGas()).render();
|
||||
getListAndRender(EnumFacing.getFront(tileEntity.facing), tileEntity.gasTank.getGas().getGas()).render();
|
||||
GL11.glColor4f(1, 1, 1, 1);
|
||||
|
||||
pop();
|
||||
@@ -80,7 +79,7 @@ public class RenderChemicalOxidizer extends TileEntitySpecialRenderer<TileEntity
|
||||
}
|
||||
|
||||
@SuppressWarnings("incomplete-switch")
|
||||
private DisplayInteger getListAndRender(ForgeDirection side, Gas gas)
|
||||
private DisplayInteger getListAndRender(EnumFacing side, Gas gas)
|
||||
{
|
||||
if(gas == null || gas.getIcon() == null)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,6 @@ package mekanism.client.render.tileentity;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.transmitters.TransmissionType;
|
||||
import mekanism.client.render.MekanismRenderer;
|
||||
@@ -17,13 +16,12 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import codechicken.lib.math.MathHelper;
|
||||
import net.minecraftforge.fml.client.FMLClientHandler;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -33,11 +31,11 @@ public class RenderConfigurableMachine<S extends TileEntity & ISideConfiguration
|
||||
{
|
||||
private Minecraft mc = FMLClientHandler.instance().getClient();
|
||||
|
||||
private HashMap<ForgeDirection, HashMap<TransmissionType, DisplayInteger>> cachedOverlays = new HashMap<ForgeDirection, HashMap<TransmissionType, DisplayInteger>>();
|
||||
private HashMap<EnumFacing, HashMap<TransmissionType, DisplayInteger>> cachedOverlays = new HashMap<EnumFacing, HashMap<TransmissionType, DisplayInteger>>();
|
||||
|
||||
public RenderConfigurableMachine()
|
||||
{
|
||||
field_147501_a = TileEntityRendererDispatcher.instance;
|
||||
rendererDispatcher = TileEntityRendererDispatcher.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -46,24 +44,20 @@ public class RenderConfigurableMachine<S extends TileEntity & ISideConfiguration
|
||||
GL11.glPushMatrix();
|
||||
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
World world = mc.thePlayer.worldObj;
|
||||
ItemStack itemStack = player.getCurrentEquippedItem();
|
||||
MovingObjectPosition pos = player.rayTrace(8.0D, 1.0F);
|
||||
|
||||
if(pos != null && itemStack != null && itemStack.getItem() instanceof ItemConfigurator && ((ItemConfigurator)itemStack.getItem()).getState(itemStack).isConfigurating())
|
||||
{
|
||||
int xPos = MathHelper.floor_double(pos.blockX);
|
||||
int yPos = MathHelper.floor_double(pos.blockY);
|
||||
int zPos = MathHelper.floor_double(pos.blockZ);
|
||||
BlockPos bp = pos.getBlockPos();
|
||||
|
||||
Coord4D obj = new Coord4D(xPos, yPos, zPos, configurable.getWorldObj().provider.dimensionId);
|
||||
TransmissionType type = ((ItemConfigurator)itemStack.getItem()).getState(itemStack).getTransmission();
|
||||
|
||||
if(configurable.getConfig().supports(type))
|
||||
{
|
||||
if(xPos == configurable.xCoord && yPos == configurable.yCoord && zPos == configurable.zCoord)
|
||||
if(bp.equals(configurable.getPos()))
|
||||
{
|
||||
EnumColor color = configurable.getConfig().getOutput(type, pos.sideHit, configurable.getOrientation()).color;
|
||||
EnumColor color = configurable.getConfig().getOutput(type, pos.sideHit.getIndex()/*TODO change to take EnumFacing*/, configurable.getOrientation()).color;
|
||||
|
||||
push();
|
||||
|
||||
@@ -72,7 +66,7 @@ public class RenderConfigurableMachine<S extends TileEntity & ISideConfiguration
|
||||
bindTexture(MekanismRenderer.getBlocksTexture());
|
||||
GL11.glTranslatef((float)x, (float)y, (float)z);
|
||||
|
||||
int display = getOverlayDisplay(world, ForgeDirection.getOrientation(pos.sideHit), type).display;
|
||||
int display = getOverlayDisplay(pos.sideHit, type).display;
|
||||
GL11.glCallList(display);
|
||||
|
||||
pop();
|
||||
@@ -101,7 +95,7 @@ public class RenderConfigurableMachine<S extends TileEntity & ISideConfiguration
|
||||
MekanismRenderer.blendOn();
|
||||
}
|
||||
|
||||
private DisplayInteger getOverlayDisplay(World world, ForgeDirection side, TransmissionType type)
|
||||
private DisplayInteger getOverlayDisplay(EnumFacing side, TransmissionType type)
|
||||
{
|
||||
if(cachedOverlays.containsKey(side) && cachedOverlays.get(side).containsKey(type))
|
||||
{
|
||||
|
||||
@@ -14,9 +14,8 @@ import mekanism.common.tile.TileEntityDynamicTank;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -47,12 +46,12 @@ public class RenderDynamicTank extends TileEntitySpecialRenderer<TileEntityDynam
|
||||
{
|
||||
push();
|
||||
|
||||
GL11.glTranslated(getX(data.location.xCoord), getY(data.location.yCoord), getZ(data.location.zCoord));
|
||||
GL11.glTranslated(getX(data.location.getX()), getY(data.location.getY()), getZ(data.location.getZ()));
|
||||
|
||||
MekanismRenderer.glowOn(tileEntity.structure.fluidStored.getFluid().getLuminosity());
|
||||
MekanismRenderer.colorFluid(tileEntity.structure.fluidStored.getFluid());
|
||||
|
||||
DisplayInteger[] displayList = getListAndRender(data, tileEntity.structure.fluidStored.getFluid(), tileEntity.getWorldObj());
|
||||
DisplayInteger[] displayList = getListAndRender(data, tileEntity.structure.fluidStored.getFluid(), tileEntity.getWorld());
|
||||
|
||||
if(tileEntity.structure.fluidStored.getFluid().isGaseous())
|
||||
{
|
||||
@@ -72,11 +71,11 @@ public class RenderDynamicTank extends TileEntitySpecialRenderer<TileEntityDynam
|
||||
{
|
||||
push();
|
||||
|
||||
GL11.glTranslated(getX(valveData.location.xCoord), getY(valveData.location.yCoord), getZ(valveData.location.zCoord));
|
||||
GL11.glTranslated(getX(valveData.location.getX()), getY(valveData.location.getY()), getZ(valveData.location.getZ()));
|
||||
|
||||
MekanismRenderer.glowOn(tileEntity.structure.fluidStored.getFluid().getLuminosity());
|
||||
|
||||
getValveDisplay(ValveRenderData.get(data, valveData), tileEntity.structure.fluidStored.getFluid(), tileEntity.getWorldObj()).render();
|
||||
getValveDisplay(ValveRenderData.get(data, valveData), tileEntity.structure.fluidStored.getFluid(), tileEntity.getWorld()).render();
|
||||
|
||||
MekanismRenderer.glowOff();
|
||||
MekanismRenderer.resetColor();
|
||||
@@ -112,7 +111,7 @@ public class RenderDynamicTank extends TileEntitySpecialRenderer<TileEntityDynam
|
||||
|
||||
Model3D toReturn = new Model3D();
|
||||
toReturn.baseBlock = Blocks.water;
|
||||
toReturn.setTexture(fluid.getIcon());
|
||||
toReturn.setTexture(fluid.getStill());
|
||||
|
||||
final int stages = getStages(data.height);
|
||||
DisplayInteger[] displays = new DisplayInteger[stages];
|
||||
@@ -131,7 +130,7 @@ public class RenderDynamicTank extends TileEntitySpecialRenderer<TileEntityDynam
|
||||
{
|
||||
displays[i] = DisplayInteger.createAndStart();
|
||||
|
||||
if(fluid.getIcon() != null)
|
||||
if(fluid.getStill() != null)
|
||||
{
|
||||
toReturn.minX = 0 + .01;
|
||||
toReturn.minY = 0 + .01;
|
||||
@@ -159,7 +158,7 @@ public class RenderDynamicTank extends TileEntitySpecialRenderer<TileEntityDynam
|
||||
|
||||
Model3D toReturn = new Model3D();
|
||||
toReturn.baseBlock = Blocks.water;
|
||||
toReturn.setTexture(fluid.getFlowingIcon());
|
||||
toReturn.setTexture(fluid.getFlowing());
|
||||
|
||||
DisplayInteger display = DisplayInteger.createAndStart();
|
||||
|
||||
@@ -259,7 +258,7 @@ public class RenderDynamicTank extends TileEntitySpecialRenderer<TileEntityDynam
|
||||
|
||||
private int getValveFluidHeight(ValveRenderData data)
|
||||
{
|
||||
return data.valveLocation.yCoord - data.location.yCoord;
|
||||
return data.valveLocation.getY() - data.location.getY();
|
||||
}
|
||||
|
||||
private int getStages(int height)
|
||||
@@ -311,7 +310,7 @@ public class RenderDynamicTank extends TileEntitySpecialRenderer<TileEntityDynam
|
||||
|
||||
public static class ValveRenderData extends RenderData
|
||||
{
|
||||
public ForgeDirection side;
|
||||
public EnumFacing side;
|
||||
public Coord4D valveLocation;
|
||||
|
||||
public static ValveRenderData get(RenderData renderData, ValveData valveData)
|
||||
|
||||
@@ -38,6 +38,6 @@ public class RenderMetallurgicInfuser extends TileEntitySpecialRenderer<TileEnti
|
||||
model.render(0.0625F);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
MekanismRenderer.machineRenderer.renderAModelAt(tileEntity, x, y, z, partialTick);
|
||||
MekanismRenderer.machineRenderer.renderTileEntityAt(tileEntity, x, y, z, partialTick, destroyStage);
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,6 @@ import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -120,7 +119,7 @@ public class RenderPortableTank extends TileEntitySpecialRenderer<TileEntityPort
|
||||
|
||||
Model3D toReturn = new Model3D();
|
||||
toReturn.baseBlock = Blocks.water;
|
||||
toReturn.setTexture(fluid.getFlowingIcon());
|
||||
toReturn.setTexture(fluid.getFlowing());
|
||||
|
||||
DisplayInteger[] displays = new DisplayInteger[stages];
|
||||
cachedValveFluids.put(fluid, displays);
|
||||
@@ -129,7 +128,7 @@ public class RenderPortableTank extends TileEntitySpecialRenderer<TileEntityPort
|
||||
{
|
||||
displays[i] = DisplayInteger.createAndStart();
|
||||
|
||||
if(fluid.getIcon() != null)
|
||||
if(fluid.getStill() != null)
|
||||
{
|
||||
toReturn.minX = 0.3125 + .01;
|
||||
toReturn.minY = 0.0625 + ((float)i/(float)stages)*0.875;
|
||||
@@ -157,7 +156,7 @@ public class RenderPortableTank extends TileEntitySpecialRenderer<TileEntityPort
|
||||
|
||||
Model3D toReturn = new Model3D();
|
||||
toReturn.baseBlock = Blocks.water;
|
||||
toReturn.setTexture(fluid.getIcon());
|
||||
toReturn.setTexture(fluid.getStill());
|
||||
|
||||
DisplayInteger[] displays = new DisplayInteger[stages];
|
||||
cachedCenterFluids.put(fluid, displays);
|
||||
@@ -166,7 +165,7 @@ public class RenderPortableTank extends TileEntitySpecialRenderer<TileEntityPort
|
||||
{
|
||||
displays[i] = DisplayInteger.createAndStart();
|
||||
|
||||
if(fluid.getIcon() != null)
|
||||
if(fluid.getStill() != null)
|
||||
{
|
||||
toReturn.minX = 0.125 + .01;
|
||||
toReturn.minY = 0.0625 + .01;
|
||||
|
||||
+1
-1
@@ -38,6 +38,6 @@ public class RenderPressurizedReactionChamber extends TileEntitySpecialRenderer<
|
||||
model.render(0.0625F);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
MekanismRenderer.machineRenderer.renderAModelAt(tileEntity, x, y, z, partialTick);
|
||||
MekanismRenderer.machineRenderer.renderTileEntityAt(tileEntity, x, y, z, partialTick, destroyStage);
|
||||
}
|
||||
}
|
||||
@@ -13,8 +13,7 @@ import mekanism.common.tile.TileEntitySolarEvaporationController;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -34,7 +33,7 @@ public class RenderSalinationController extends TileEntitySpecialRenderer<TileEn
|
||||
SalinationRenderData data = new SalinationRenderData();
|
||||
|
||||
data.height = tileEntity.height-2;
|
||||
data.side = ForgeDirection.getOrientation(tileEntity.facing);
|
||||
data.side = EnumFacing.getFront(tileEntity.facing);
|
||||
|
||||
bindTexture(MekanismRenderer.getBlocksTexture());
|
||||
|
||||
@@ -44,7 +43,7 @@ public class RenderSalinationController extends TileEntitySpecialRenderer<TileEn
|
||||
|
||||
push();
|
||||
|
||||
GL11.glTranslated(getX(renderLoc.xCoord), getY(renderLoc.yCoord), getZ(renderLoc.zCoord));
|
||||
GL11.glTranslated(getX(renderLoc.getX()), getY(renderLoc.getY()), getZ(renderLoc.getZ()));
|
||||
|
||||
MekanismRenderer.glowOn(tileEntity.inputTank.getFluid().getFluid().getLuminosity());
|
||||
|
||||
@@ -84,7 +83,7 @@ public class RenderSalinationController extends TileEntitySpecialRenderer<TileEn
|
||||
|
||||
Model3D toReturn = new Model3D();
|
||||
toReturn.baseBlock = Blocks.water;
|
||||
toReturn.setTexture(fluid.getIcon());
|
||||
toReturn.setTexture(fluid.getStill());
|
||||
|
||||
final int stages = getStages(data.height);
|
||||
DisplayInteger[] displays = new DisplayInteger[stages];
|
||||
@@ -105,7 +104,7 @@ public class RenderSalinationController extends TileEntitySpecialRenderer<TileEn
|
||||
{
|
||||
displays[i] = DisplayInteger.createAndStart();
|
||||
|
||||
if(fluid.getIcon() != null)
|
||||
if(fluid.getStill() != null)
|
||||
{
|
||||
switch(data.side)
|
||||
{
|
||||
@@ -181,7 +180,7 @@ public class RenderSalinationController extends TileEntitySpecialRenderer<TileEn
|
||||
public static class SalinationRenderData
|
||||
{
|
||||
public int height;
|
||||
public ForgeDirection side;
|
||||
public EnumFacing side;
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
|
||||
@@ -6,8 +6,6 @@ import mekanism.common.tile.TileEntitySolarNeutronActivator;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.IModel;
|
||||
import net.minecraftforge.client.model.obj.OBJLoader;
|
||||
|
||||
|
||||
@@ -11,9 +11,10 @@ import mekanism.client.render.MekanismRenderer.Model3D;
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.tile.TileEntityTeleporter;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -33,10 +34,12 @@ public class RenderTeleporter extends TileEntitySpecialRenderer<TileEntityTelepo
|
||||
bindTexture(MekanismRenderer.getBlocksTexture());
|
||||
GL11.glTranslatef((float)x, (float)y, (float)z);
|
||||
|
||||
Coord4D obj = Coord4D.get(tileEntity).offset(ForgeDirection.WEST);
|
||||
Coord4D obj = Coord4D.get(tileEntity).offset(EnumFacing.WEST);
|
||||
int type = 0;
|
||||
|
||||
if(obj.getBlock(tileEntity.getWorldObj()) == MekanismBlocks.BasicBlock && obj.getBlockState(tileEntity.getWorldObj()) == 7)
|
||||
IBlockState s = obj.getBlockState(tileEntity.getWorld());
|
||||
|
||||
if(s.getBlock() == MekanismBlocks.BasicBlock && s.getBlock().getMetaFromState(s) == 7)
|
||||
{
|
||||
type = 1;
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ public class Sound implements ISound
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getPositionedSoundLocation()
|
||||
public ResourceLocation getSoundLocation()
|
||||
{
|
||||
return sound;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class SoundHandler
|
||||
|
||||
public static boolean soundPlaying(EntityPlayer player, Channel channel)
|
||||
{
|
||||
String name = player.getCommandSenderName();
|
||||
String name = player.getName();
|
||||
Map<String, IResettableSound> map = getMap(name);
|
||||
IResettableSound sound = map.get(channel.getName());
|
||||
|
||||
@@ -72,7 +72,7 @@ public class SoundHandler
|
||||
|
||||
public static void addSound(EntityPlayer player, Channel channel, boolean replace)
|
||||
{
|
||||
String name = player.getCommandSenderName();
|
||||
String name = player.getName();
|
||||
Map<String, IResettableSound> map = getMap(name);
|
||||
IResettableSound sound = map.get(channel.getName());
|
||||
|
||||
@@ -85,7 +85,7 @@ public class SoundHandler
|
||||
|
||||
public static boolean playSound(EntityPlayer player, Channel channel)
|
||||
{
|
||||
String name = player.getCommandSenderName();
|
||||
String name = player.getName();
|
||||
Map<String, IResettableSound> map = getMap(name);
|
||||
IResettableSound sound = map.get(channel.getName());
|
||||
|
||||
@@ -147,7 +147,7 @@ public class SoundHandler
|
||||
|
||||
public static void playSound(String sound)
|
||||
{
|
||||
playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation(sound), 1.0F));
|
||||
playSound(PositionedSoundRecord.create(new ResourceLocation(sound), 1.0F));
|
||||
}
|
||||
|
||||
public static void playSound(ISound sound)
|
||||
|
||||
@@ -24,12 +24,12 @@ public class TileSound extends Sound implements IResettableSound
|
||||
|
||||
public TileSound(IHasSound source, ISoundSource values)
|
||||
{
|
||||
this(source, values.getSoundLocation(), values.getVolume(), values.getPitch(), values.shouldRepeat(), values.getRepeatDelay(), values.getSoundPosition().xPos, values.getSoundPosition().yPos, values.getSoundPosition().zPos);
|
||||
this(source, values.getSoundLocation(), values.getVolume(), values.getPitch(), values.shouldRepeat(), values.getRepeatDelay(), values.getSoundPosition().xCoord, values.getSoundPosition().yCoord, values.getSoundPosition().zCoord);
|
||||
}
|
||||
|
||||
public TileSound(IHasSound source, ISoundSource values, ResourceLocation location)
|
||||
{
|
||||
this(source, location, values.getVolume(), values.getPitch(), values.shouldRepeat(), values.getRepeatDelay(), values.getSoundPosition().xPos, values.getSoundPosition().yPos, values.getSoundPosition().zPos);
|
||||
this(source, location, values.getVolume(), values.getPitch(), values.shouldRepeat(), values.getRepeatDelay(), values.getSoundPosition().xCoord, values.getSoundPosition().yCoord, values.getSoundPosition().zCoord);
|
||||
}
|
||||
|
||||
public TileSound(IHasSound source, String sound, float volume, float pitch, boolean repeat, int repeatDelay, double x, double y, double z)
|
||||
|
||||
Reference in new issue
Block a user