Code cleanup
This commit is contained in:
parent
484eecf299
commit
e0cbb632f7
7 changed files with 17 additions and 15 deletions
|
@ -528,7 +528,7 @@ public class Commons {
|
||||||
final List<EntityPlayer> onlinePlayers = MinecraftServer.getServer().getConfigurationManager().playerEntityList;
|
final List<EntityPlayer> onlinePlayers = MinecraftServer.getServer().getConfigurationManager().playerEntityList;
|
||||||
for (final EntityPlayer onlinePlayer : onlinePlayers) {
|
for (final EntityPlayer onlinePlayer : onlinePlayers) {
|
||||||
if (onlinePlayer.getCommandSenderName().equalsIgnoreCase(playerNameOrSelector) && onlinePlayer instanceof EntityPlayerMP) {
|
if (onlinePlayer.getCommandSenderName().equalsIgnoreCase(playerNameOrSelector) && onlinePlayer instanceof EntityPlayerMP) {
|
||||||
return new EntityPlayerMP[]{ (EntityPlayerMP)onlinePlayer };
|
return new EntityPlayerMP[] { (EntityPlayerMP)onlinePlayer };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -518,9 +518,9 @@ public class TileEntityLaser extends TileEntityAbstractLaser implements IBeamFre
|
||||||
beamFrequency = parBeamFrequency;
|
beamFrequency = parBeamFrequency;
|
||||||
}
|
}
|
||||||
final Vector3 vRGB = IBeamFrequency.getBeamColor(beamFrequency);
|
final Vector3 vRGB = IBeamFrequency.getBeamColor(beamFrequency);
|
||||||
r = (float)vRGB.x;
|
r = (float) vRGB.x;
|
||||||
g = (float)vRGB.y;
|
g = (float) vRGB.y;
|
||||||
b = (float)vRGB.z;
|
b = (float) vRGB.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void playSoundCorrespondsEnergy(int energy) {
|
private void playSoundCorrespondsEnergy(int energy) {
|
||||||
|
@ -634,13 +634,13 @@ public class TileEntityLaser extends TileEntityAbstractLaser implements IBeamFre
|
||||||
return emitBeam(arguments);
|
return emitBeam(arguments);
|
||||||
|
|
||||||
case "position":
|
case "position":
|
||||||
return new Integer[]{ xCoord, yCoord, zCoord };
|
return new Integer[] { xCoord, yCoord, zCoord };
|
||||||
|
|
||||||
case "beamFrequency":
|
case "beamFrequency":
|
||||||
if (arguments.length == 1) {
|
if (arguments.length == 1) {
|
||||||
setBeamFrequency(Commons.toInt(arguments[0]));
|
setBeamFrequency(Commons.toInt(arguments[0]));
|
||||||
}
|
}
|
||||||
return new Integer[]{ beamFrequency };
|
return new Integer[] { beamFrequency };
|
||||||
|
|
||||||
case "getScanResult":
|
case "getScanResult":
|
||||||
return getScanResult();
|
return getScanResult();
|
||||||
|
|
|
@ -18,7 +18,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.network.NetworkManager;
|
import net.minecraft.network.NetworkManager;
|
||||||
import net.minecraft.network.Packet;
|
import net.minecraft.network.Packet;
|
||||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||||
import net.minecraft.util.StatCollector;
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.Optional;
|
import cpw.mods.fml.common.Optional;
|
||||||
|
|
||||||
|
@ -28,15 +27,15 @@ public class TileEntityAbstractForceField extends TileEntityAbstractEnergy imple
|
||||||
protected byte tier = -1;
|
protected byte tier = -1;
|
||||||
protected int beamFrequency = -1;
|
protected int beamFrequency = -1;
|
||||||
public boolean isEnabled = true;
|
public boolean isEnabled = true;
|
||||||
|
protected boolean isConnected = false;
|
||||||
|
|
||||||
// computed properties
|
// computed properties
|
||||||
protected Vector3 vRGB;
|
protected Vector3 vRGB;
|
||||||
protected boolean isConnected = false;
|
|
||||||
|
|
||||||
public TileEntityAbstractForceField() {
|
public TileEntityAbstractForceField() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
addMethods(new String[]{
|
addMethods(new String[] {
|
||||||
"enable",
|
"enable",
|
||||||
"beamFrequency"
|
"beamFrequency"
|
||||||
});
|
});
|
||||||
|
@ -186,7 +185,7 @@ public class TileEntityAbstractForceField extends TileEntityAbstractEnergy imple
|
||||||
if (arguments.length == 1) {
|
if (arguments.length == 1) {
|
||||||
setBeamFrequency(Commons.toInt(arguments[0]));
|
setBeamFrequency(Commons.toInt(arguments[0]));
|
||||||
}
|
}
|
||||||
return new Integer[]{ beamFrequency };
|
return new Integer[] { beamFrequency };
|
||||||
}
|
}
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
exception.printStackTrace();
|
exception.printStackTrace();
|
||||||
|
|
|
@ -16,6 +16,7 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
public class TileEntityForceField extends TileEntityAbstractBase {
|
public class TileEntityForceField extends TileEntityAbstractBase {
|
||||||
|
|
||||||
private VectorI vProjector;
|
private VectorI vProjector;
|
||||||
|
|
||||||
// cache parameters used for rendering, force projector check for others
|
// cache parameters used for rendering, force projector check for others
|
||||||
|
@ -154,7 +155,7 @@ public class TileEntityForceField extends TileEntityAbstractBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ForceFieldSetup getForceFieldSetup() {
|
public ForceFieldSetup getForceFieldSetup() {
|
||||||
TileEntityForceFieldProjector tileEntityForceFieldProjector = getProjector();
|
final TileEntityForceFieldProjector tileEntityForceFieldProjector = getProjector();
|
||||||
if (tileEntityForceFieldProjector == null) {
|
if (tileEntityForceFieldProjector == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -214,7 +214,8 @@ public class Dictionary {
|
||||||
+ "Tags shall be separated by at least one space, comma or tabulation.\n" + "Invalid tags will be ignored silently. Tags and block names are case sensitive.\n"
|
+ "Tags shall be separated by at least one space, comma or tabulation.\n" + "Invalid tags will be ignored silently. Tags and block names are case sensitive.\n"
|
||||||
+ "In case of conflicts, the latest tag overwrite the previous ones.\n" + "- Anchor: ship can't move with this entity aboard (default: none).\n"
|
+ "In case of conflicts, the latest tag overwrite the previous ones.\n" + "- Anchor: ship can't move with this entity aboard (default: none).\n"
|
||||||
+ "- NoMass: this entity doesn't count when calculating ship volume/mass (default: Galacticraft air bubble).\n"
|
+ "- NoMass: this entity doesn't count when calculating ship volume/mass (default: Galacticraft air bubble).\n"
|
||||||
+ "- LeftBehind: this entity won't move with your ship (default: Galacticraft air bubble).\n"
|
+ "- LeftBehind: this entity won't move with your ship nor transporter (default: Galacticraft air bubble).\n"
|
||||||
|
// + "- NoTransport: this entity is ignored by the transporter (default: -none-).\n"
|
||||||
+ "- NonLivingTarget: this non-living entity can be targeted/removed by weapons (default: ItemFrame, Painting).\n"
|
+ "- NonLivingTarget: this non-living entity can be targeted/removed by weapons (default: ItemFrame, Painting).\n"
|
||||||
+ "- LivingWithoutAir: this living entity doesn't need air to live (default: vanilla zombies and skeletons).");
|
+ "- LivingWithoutAir: this living entity doesn't need air to live (default: vanilla zombies and skeletons).");
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,6 @@ public class CameraRegistryItem {
|
||||||
&& position.chunkPosX == tileEntity.xCoord
|
&& position.chunkPosX == tileEntity.xCoord
|
||||||
&& position.chunkPosY == tileEntity.yCoord
|
&& position.chunkPosY == tileEntity.yCoord
|
||||||
&& position.chunkPosZ == tileEntity.zCoord
|
&& position.chunkPosZ == tileEntity.zCoord
|
||||||
&& videoChannel == ((IVideoChannel)tileEntity).getVideoChannel();
|
&& videoChannel == ((IVideoChannel) tileEntity).getVideoChannel();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -29,6 +29,7 @@ import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class ForceFieldSetup extends GlobalPosition {
|
public class ForceFieldSetup extends GlobalPosition {
|
||||||
|
|
||||||
private static final float FORCEFIELD_BASE_SCAN_SPEED_BLOCKS_PER_SECOND = 100;
|
private static final float FORCEFIELD_BASE_SCAN_SPEED_BLOCKS_PER_SECOND = 100;
|
||||||
private static final float FORCEFIELD_BASE_PLACE_SPEED_BLOCKS_PER_SECOND = 20;
|
private static final float FORCEFIELD_BASE_PLACE_SPEED_BLOCKS_PER_SECOND = 20;
|
||||||
private static final float FORCEFIELD_MAX_SCAN_SPEED_BLOCKS_PER_SECOND = 10000;
|
private static final float FORCEFIELD_MAX_SCAN_SPEED_BLOCKS_PER_SECOND = 10000;
|
||||||
|
|
Loading…
Reference in a new issue