A few fixes, dynamic distance calculating as called by ILogisticalTransporter. Off to bed, more work tomorrow!

This commit is contained in:
Aidan Brady 2013-12-22 01:21:40 -05:00
parent 0f7e8eec31
commit ced44e97fc
10 changed files with 30 additions and 17 deletions

View file

@ -83,6 +83,7 @@ public class RenderTickHandler implements ITickHandler
ItemStack stack = player.getCurrentItemOrArmor(3);
ScaledResolution scaledresolution = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
int x = scaledresolution.getScaledWidth();
int y = scaledresolution.getScaledHeight();
@ -124,10 +125,10 @@ public class RenderTickHandler implements ITickHandler
float random = (rand.nextFloat()-0.5F)*0.1F;
Pos3D vLeft = new Pos3D();
vLeft.zPos -= 0.54;
vLeft.xPos -= 0.43;
vLeft.rotateYaw(p.renderYawOffset);
vLeft.yPos -= 0.55;
vLeft.zPos -= 0.54;
vLeft.rotateYaw(p.renderYawOffset);
Pos3D vRight = new Pos3D();
vRight.xPos += 0.43;

View file

@ -177,7 +177,6 @@ public class CommonProxy
Mekanism.allowBackCrafting = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "Allow crafting multiparts back to block transmitters", false).getBoolean(false);
Mekanism.voiceServerEnabled = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "VoiceServerEnabled", true).getBoolean(true);
Mekanism.forceBuildcraft = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ForceBuildcraftPower", false).getBoolean(false);
Mekanism.overrideUERatios = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "OverrideUERatios", true).getBoolean(true);
Mekanism.obsidianTNTDelay = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ObsidianTNTDelay", 100).getInt();
Mekanism.obsidianTNTBlastRadius = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ObsidianTNTBlastRadius", 12).getInt();
Mekanism.UPDATE_DELAY = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ClientUpdateDelay", 10).getInt();

View file

@ -29,4 +29,6 @@ public interface ILogisticalTransporter
public boolean canEmitTo(TileEntity tileEntity, ForgeDirection side);
public boolean canReceiveFrom(TileEntity tileEntity, ForgeDirection side);
public int getPriority();
}

View file

@ -259,7 +259,6 @@ public class Mekanism
public static boolean allowBackCrafting = false;
public static boolean voiceServerEnabled = true;
public static boolean forceBuildcraft = false;
public static boolean overrideUERatios = true;
public static int obsidianTNTBlastRadius = 12;
public static int osmiumGenerationAmount = 12;
public static int copperGenerationAmount = 16;

View file

@ -788,4 +788,10 @@ public class PartLogisticalTransporter extends PartSidedPipe implements ILogisti
return getConnectionType(side) == ConnectionType.NORMAL;
}
@Override
public int getPriority()
{
return 1;
}
}

View file

@ -27,4 +27,10 @@ public class PartRestrictiveTransporter extends PartLogisticalTransporter
{
return transporterIcons.getSideIcon(1);
}
@Override
public int getPriority()
{
return 1000;
}
}

View file

@ -59,7 +59,9 @@ public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart,
{
public static IndexedCuboid6[] smallSides = new IndexedCuboid6[7];
public static IndexedCuboid6[] largeSides = new IndexedCuboid6[7];
public int delayTicks;
public ForgeDirection testingSide = null;
public byte currentAcceptorConnections = 0x00;
@ -67,6 +69,7 @@ public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart,
public boolean sendDesc = false;
public boolean redstonePowered = false;
public ConnectionType[] connectionTypes = {ConnectionType.NORMAL, ConnectionType.NORMAL, ConnectionType.NORMAL, ConnectionType.NORMAL, ConnectionType.NORMAL, ConnectionType.NORMAL};
static

View file

@ -602,4 +602,10 @@ public class TileEntityLogisticalTransporter extends TileEntity implements ITile
return true;
}
@Override
public int getPriority()
{
return 1;
}
}

View file

@ -48,13 +48,7 @@ public final class TransporterPathfinder
currentPath.add(pointer);
if(pointer.getMetadata(worldObj) == 4)
{
dist += 1000;
}
else {
dist++;
}
dist += ((ILogisticalTransporter)pointer.getTileEntity(worldObj)).getPriority();
boolean found = false;
@ -427,10 +421,7 @@ public final class TransporterPathfinder
TileEntity tile = neighbor.getTileEntity(worldObj);
double tentativeG = gScore.get(currentNode) + currentNode.distanceTo(neighbor);
if(neighbor.getMetadata(worldObj) == 4)
{
tentativeG += 999;
}
tentativeG += ((ILogisticalTransporter)tile).getPriority();
if(closedSet.contains(neighbor))
{

View file

@ -1091,7 +1091,7 @@ public final class MekanismUtils
Vec3 headVec = getHeadVec(player);
Vec3 lookVec = player.getLook(1);
Vec3 endVec = headVec.addVector(lookVec.xCoord * reach, lookVec.yCoord * reach, lookVec.zCoord * reach);
Vec3 endVec = headVec.addVector(lookVec.xCoord*reach, lookVec.yCoord*reach, lookVec.zCoord*reach);
return world.rayTraceBlocks_do_do(headVec, endVec, true, false);
}
@ -1102,7 +1102,7 @@ public final class MekanismUtils
if(!player.worldObj.isRemote)
{
vec.yCoord+=player.getEyeHeight();
vec.yCoord += player.getEyeHeight();
if(player instanceof EntityPlayerMP && player.isSneaking())
{