API and other consistency fixes

This commit is contained in:
Ben Spiers committed 2016-01-25 04:35:25 +00:00
1 parent 8af7ec270a
commit 3126f144d2
32 files changed
+100 -170

No files matched your search

@@ -20,6 +20,7 @@ import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
@@ -139,16 +140,16 @@ public class RenderTickHandler
mRight.translate(rRight);
Pos3D v = playerPos.clone().translate(vLeft);
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);
spawnAndSetParticle(EnumParticleTypes.FLAME, world, v.xCoord, v.yCoord, v.zCoord, mLeft.xCoord, mLeft.yCoord, mLeft.zCoord);
spawnAndSetParticle(EnumParticleTypes.SMOKE_NORMAL, world, v.xCoord, v.yCoord, v.zCoord, mLeft.xCoord, mLeft.yCoord, mLeft.zCoord);
v = playerPos.clone().translate(vRight);
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);
spawnAndSetParticle(EnumParticleTypes.FLAME, world, v.xCoord, v.yCoord, v.zCoord, mRight.xCoord, mRight.yCoord, mRight.zCoord);
spawnAndSetParticle(EnumParticleTypes.SMOKE_NORMAL, world, v.xCoord, v.yCoord, v.zCoord, mRight.xCoord, mRight.yCoord, mRight.zCoord);
v = playerPos.clone().translate(vCenter);
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);
spawnAndSetParticle(EnumParticleTypes.FLAME, world, v.xCoord, v.yCoord, v.zCoord, mCenter.xCoord, mCenter.yCoord, mCenter.zCoord);
spawnAndSetParticle(EnumParticleTypes.SMOKE_NORMAL, world, v.xCoord, v.yCoord, v.zCoord, mCenter.xCoord, mCenter.yCoord, mCenter.zCoord);
}
}
@@ -197,7 +198,7 @@ public class RenderTickHandler
Pos3D mergedVec = playerPos.translate(flameVec);
spawnAndSetParticle("flame", world, mergedVec.xCoord, mergedVec.yCoord, mergedVec.zCoord, flameMotion.xCoord, flameMotion.yCoord, flameMotion.zCoord);
spawnAndSetParticle(EnumParticleTypes.FLAME, world, mergedVec.xCoord, mergedVec.yCoord, mergedVec.zCoord, flameMotion.xCoord, flameMotion.yCoord, flameMotion.zCoord);
}
}
}
@@ -206,15 +207,15 @@ public class RenderTickHandler
}
}
public void spawnAndSetParticle(String s, World world, double x, double y, double z, double velX, double velY, double velZ)
public void spawnAndSetParticle(EnumParticleTypes s, World world, double x, double y, double z, double velX, double velY, double velZ)
{
EntityFX fx = null;
if(s.equals("flame"))
if(s.equals(EnumParticleTypes.FLAME))
{
fx = new EntityJetpackFlameFX(world, x, y, z, velX, velY, velZ);
}
else if(s.equals("smoke"))
else if(s.equals(EnumParticleTypes.SMOKE_NORMAL))
{
fx = new EntityJetpackSmokeFX(world, x, y, z, velX, velY, velZ);
}
@@ -1,8 +1,8 @@
package mekanism.client.sound;
import mekanism.api.Pos3D;
import net.minecraft.client.audio.ISound.AttenuationType;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Vec3;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -18,7 +18,7 @@ public interface ISoundSource
public float getFrequency();
@SideOnly(Side.CLIENT)
public Pos3D getSoundPosition();
public Vec3 getSoundPosition();
@SideOnly(Side.CLIENT)
public boolean shouldRepeat();
@@ -148,7 +148,7 @@ public class Sound implements ISound
}
@Override
public float getFrequency()
public float getPitch()
{
return pitch;
}
@@ -72,6 +72,7 @@ import net.minecraft.nbt.NBTSizeTracker;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Vec3;
import net.minecraftforge.fml.common.network.ByteBufUtils;
import net.minecraftforge.fml.common.network.NetworkRegistry;
@@ -170,6 +171,10 @@ public class PacketHandler
{
output.writeByte((Byte)data);
}
else if(data instanceof EnumFacing)
{
output.writeInt(((EnumFacing)data).ordinal());
}
else if(data instanceof ItemStack)
{
writeStack(output, (ItemStack)data);
@@ -11,6 +11,7 @@ import mekanism.api.energy.IStrictEnergyStorage;
import mekanism.common.integration.IComputerIntegration;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
@InterfaceList({
@Interface(iface = "ic2.api.energy.tile.IEnergySink", modid = "IC2"),
@@ -18,11 +19,11 @@ import net.minecraft.item.ItemStack;
})
public interface IAdvancedBoundingBlock extends IBoundingBlock, ISidedInventory, IEnergySink, IStrictEnergyAcceptor, IStrictEnergyStorage, IEnergyHandler, IComputerIntegration, IFilterAccess
{
public int[] getBoundSlots(Coord4D location, int side);
public int[] getBoundSlots(Coord4D location, EnumFacing side);
public boolean canBoundInsert(Coord4D location, int i, ItemStack itemstack);
public boolean canBoundExtract(Coord4D location, int i, ItemStack itemstack, int j);
public boolean canBoundExtract(Coord4D location, int i, ItemStack itemstack, EnumFacing side);
public void onPower();
@@ -16,5 +16,5 @@ public interface ITileComponent
public void write(NBTTagCompound nbtTags);
public void write(ArrayList data);
public void write(ArrayList<Object> data);
}
@@ -22,5 +22,5 @@ public interface ITileNetwork
* @param data - list of data
* @return ArrayList
*/
public ArrayList getNetworkedData(ArrayList data);
public ArrayList getNetworkedData(ArrayList<Object> data);
}
@@ -354,22 +354,22 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IBlo
if(side == 4)
{
world.spawnParticle("smoke", (xRandom - iRandom), yRandom, (zRandom + jRandom), 0.0D, 0.0D, 0.0D);
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, (xRandom - iRandom), yRandom, (zRandom + jRandom), 0.0D, 0.0D, 0.0D);
world.spawnParticle("reddust", (xRandom - iRandom), yRandom, (zRandom + jRandom), 0.0D, 0.0D, 0.0D);
}
else if(side == 5)
{
world.spawnParticle("smoke", (xRandom + iRandom), yRandom, (zRandom + jRandom), 0.0D, 0.0D, 0.0D);
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, (xRandom + iRandom), yRandom, (zRandom + jRandom), 0.0D, 0.0D, 0.0D);
world.spawnParticle("reddust", (xRandom + iRandom), yRandom, (zRandom + jRandom), 0.0D, 0.0D, 0.0D);
}
else if(side == 2)
{
world.spawnParticle("smoke", (xRandom + jRandom), yRandom, (zRandom - iRandom), 0.0D, 0.0D, 0.0D);
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, (xRandom + jRandom), yRandom, (zRandom - iRandom), 0.0D, 0.0D, 0.0D);
world.spawnParticle("reddust", (xRandom + jRandom), yRandom, (zRandom - iRandom), 0.0D, 0.0D, 0.0D);
}
else if(side == 3)
{
world.spawnParticle("smoke", (xRandom + jRandom), yRandom, (zRandom + iRandom), 0.0D, 0.0D, 0.0D);
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, (xRandom + jRandom), yRandom, (zRandom + iRandom), 0.0D, 0.0D, 0.0D);
world.spawnParticle("reddust", (xRandom + jRandom), yRandom, (zRandom + iRandom), 0.0D, 0.0D, 0.0D);
}
}