this access

This commit is contained in:
thatsIch 2015-01-01 21:17:00 +01:00
parent eed0c11d7f
commit 8920d949d2
28 changed files with 133 additions and 133 deletions

View file

@ -30,27 +30,27 @@ public enum AccessRestriction
private final int permissionBit;
private AccessRestriction(int v) {
permissionBit = v;
this.permissionBit = v;
}
public boolean hasPermission(AccessRestriction ar)
{
return (permissionBit & ar.permissionBit) == ar.permissionBit;
return ( this.permissionBit & ar.permissionBit) == ar.permissionBit;
}
public AccessRestriction restrictPermissions(AccessRestriction ar)
{
return getPermByBit( permissionBit & ar.permissionBit);
return this.getPermByBit( this.permissionBit & ar.permissionBit);
}
public AccessRestriction addPermissions(AccessRestriction ar)
{
return getPermByBit( permissionBit | ar.permissionBit);
return this.getPermByBit( this.permissionBit | ar.permissionBit);
}
public AccessRestriction removePermissions(AccessRestriction ar)
{
return getPermByBit( permissionBit & (~ar.permissionBit) );
return this.getPermByBit( this.permissionBit & (~ar.permissionBit) );
}
private AccessRestriction getPermByBit(int bit)

View file

@ -32,13 +32,13 @@ public enum FuzzyMode
final public float percentage;
private FuzzyMode(float p) {
percentage = p;
breakPoint = p / 100.0f;
this.percentage = p;
this.breakPoint = p / 100.0f;
}
public int calculateBreakPoint(int maxDamage)
{
return (int) ((percentage * maxDamage) / 100.0f);
return (int) (( this.percentage * maxDamage) / 100.0f);
}
}

View file

@ -34,11 +34,11 @@ public enum PowerMultiplier
public double multiply(double in)
{
return in * multiplier;
return in * this.multiplier;
}
public double divide(double in)
{
return in / multiplier;
return in / this.multiplier;
}
}

View file

@ -33,7 +33,7 @@ public enum PowerUnits
MK("gui.appliedenergistics2.units.mekanism"); // Mekanism - Joules
private PowerUnits(String un) {
unlocalizedName = un;
this.unlocalizedName = un;
}
/**
@ -59,7 +59,7 @@ public enum PowerUnits
*/
public double convertTo(PowerUnits target, double value)
{
return (value * conversionRatio) / target.conversionRatio;
return (value * this.conversionRatio ) / target.conversionRatio;
}
}

View file

@ -56,15 +56,15 @@ public enum SecurityPermissions
*/
SECURITY;
final private String unlocalizedName = "gui.appliedenergistics2.security." + name().toLowerCase();
final private String unlocalizedName = "gui.appliedenergistics2.security." + this.name().toLowerCase();
public String getUnlocalizedName()
{
return unlocalizedName + ".name";
return this.unlocalizedName + ".name";
}
public String getUnlocalizedTip()
{
return unlocalizedName + ".tip";
return this.unlocalizedName + ".tip";
}
}

View file

@ -57,13 +57,13 @@ public enum Settings
public EnumSet getPossibleValues()
{
return values;
return this.values;
}
private Settings(EnumSet set) {
if ( set == null || set.isEmpty() )
throw new RuntimeException( "Invalid configuration." );
values = set;
this.values = set;
}
}

View file

@ -44,8 +44,8 @@ public class LocatableEventAnnounce extends Event
final public LocatableEvent change;
public LocatableEventAnnounce(ILocatable o, LocatableEvent ev) {
target = o;
change = ev;
this.target = o;
this.change = ev;
}
}

View file

@ -33,7 +33,7 @@ public class TransitionResult
public final double energyUsage;
public TransitionResult(boolean _success, double power) {
success = _success;
energyUsage = power;
this.success = _success;
this.energyUsage = power;
}
}

View file

@ -35,7 +35,7 @@ public class MENetworkChannelChanged extends MENetworkEvent
public final IGridNode node;
public MENetworkChannelChanged(IGridNode n) {
node = n;
this.node = n;
}
}

View file

@ -31,7 +31,7 @@ public class MENetworkCraftingCpuChange extends MENetworkEvent
public final IGridNode node;
public MENetworkCraftingCpuChange(IGridNode n) {
node = n;
this.node = n;
}
}

View file

@ -33,8 +33,8 @@ public class MENetworkCraftingPatternChange extends MENetworkEvent
public final IGridNode node;
public MENetworkCraftingPatternChange(ICraftingProvider p, IGridNode n) {
provider = p;
node = n;
this.provider = p;
this.node = n;
}
}

View file

@ -41,7 +41,7 @@ public class MENetworkEvent
*/
public void cancel()
{
canceled = true;
this.canceled = true;
}
/**
@ -51,7 +51,7 @@ public class MENetworkEvent
*/
public boolean isCanceled()
{
return canceled;
return this.canceled;
}
/**
@ -61,7 +61,7 @@ public class MENetworkEvent
*/
public int getVisitedObjects()
{
return visited;
return this.visited;
}
/**
@ -71,6 +71,6 @@ public class MENetworkEvent
*/
public void setVisitedObjects(int v)
{
visited = v;
this.visited = v;
}
}

View file

@ -38,7 +38,7 @@ public class MENetworkPowerIdleChange extends MENetworkEvent
public final IGridNode node;
public MENetworkPowerIdleChange(IGridNode nodeThatChanged) {
node = nodeThatChanged;
this.node = nodeThatChanged;
}
}

View file

@ -54,8 +54,8 @@ public class MENetworkPowerStorage extends MENetworkEvent
public final PowerEventType type;
public MENetworkPowerStorage(IAEPowerStorage t, PowerEventType y) {
storage = t;
type = y;
this.storage = t;
this.type = y;
}
}

View file

@ -39,7 +39,7 @@ public class MENetworkSpatialEvent extends MENetworkEvent
*/
public MENetworkSpatialEvent(IGridHost SpatialIO, double EnergyUsage)
{
host = SpatialIO;
spatialEnergyUsage = EnergyUsage;
this.host = SpatialIO;
this.spatialEnergyUsage = EnergyUsage;
}
}

View file

@ -41,8 +41,8 @@ public class MENetworkStorageEvent extends MENetworkEvent
public final StorageChannel channel;
public MENetworkStorageEvent(IMEMonitor o, StorageChannel chan) {
monitor = o;
channel = chan;
this.monitor = o;
this.channel = chan;
}
}

View file

@ -35,7 +35,7 @@ public class MachineSource extends BaseActionSource
}
public MachineSource(IActionHost v) {
via = v;
this.via = v;
}
}

View file

@ -38,8 +38,8 @@ public class PlayerSource extends BaseActionSource
}
public PlayerSource(EntityPlayer p, IActionHost v) {
player = p;
via = v;
this.player = p;
this.via = v;
}
}

View file

@ -68,10 +68,10 @@ public class TickingRequest
public final boolean canBeAlerted;
public TickingRequest(int min, int max, boolean sleep, boolean alertable) {
minTickRate = min;
maxTickRate = max;
isSleeping = sleep;
canBeAlerted = alertable;
this.minTickRate = min;
this.maxTickRate = max;
this.isSleeping = sleep;
this.canBeAlerted = alertable;
}
}

View file

@ -35,6 +35,6 @@ public enum CableRenderMode
private CableRenderMode(boolean hideFacades) {
this.transparentFacades = hideFacades;
opaqueFacades = !hideFacades;
this.opaqueFacades = !hideFacades;
}
}

View file

@ -47,19 +47,19 @@ public class SelectedPart
public final ForgeDirection side;
public SelectedPart() {
part = null;
facade = null;
side = ForgeDirection.UNKNOWN;
this.part = null;
this.facade = null;
this.side = ForgeDirection.UNKNOWN;
}
public SelectedPart(IPart part, ForgeDirection side) {
this.part = part;
facade = null;
this.facade = null;
this.side = side;
}
public SelectedPart(IFacadePart facade, ForgeDirection side) {
part = null;
this.part = null;
this.facade = facade;
this.side = side;
}

View file

@ -33,15 +33,15 @@ public class ResolverResult
final public NBTTagCompound compound;
public ResolverResult(String name, int damage) {
itemName = name;
damageValue = damage;
compound = null;
this.itemName = name;
this.damageValue = damage;
this.compound = null;
}
public ResolverResult(String name, int damage, NBTTagCompound data) {
itemName = name;
damageValue = damage;
compound = data;
this.itemName = name;
this.damageValue = damage;
this.compound = data;
}
}

View file

@ -35,8 +35,8 @@ public class ResolverResultSet
public final List<ItemStack> results;
public ResolverResultSet(String myName, ItemStack... set) {
results = Arrays.asList( set );
name = myName;
this.results = Arrays.asList( set );
this.name = myName;
}
}

View file

@ -51,23 +51,23 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
protected IMEInventoryHandler<StackType> getHandler()
{
return internalHandler;
return this.internalHandler;
}
protected Iterator<Entry<IMEMonitorHandlerReceiver<StackType>, Object>> getListeners()
{
return listeners.entrySet().iterator();
return this.listeners.entrySet().iterator();
}
protected void postChangesToListeners( Iterable<StackType> changes, BaseActionSource src)
{
notifyListenersOfChange( changes, src );
this.notifyListenersOfChange( changes, src );
}
protected void notifyListenersOfChange(Iterable<StackType> diff, BaseActionSource src)
{
hasChanged = true;// need to update the cache.
Iterator<Entry<IMEMonitorHandlerReceiver<StackType>, Object>> i = getListeners();
this.hasChanged = true;// need to update the cache.
Iterator<Entry<IMEMonitorHandlerReceiver<StackType>, Object>> i = this.getListeners();
while (i.hasNext())
{
Entry<IMEMonitorHandlerReceiver<StackType>, Object> o = i.next();
@ -89,108 +89,108 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
diff.decStackSize( leftOvers.getStackSize() );
if ( diff.getStackSize() != 0 )
postChangesToListeners( ImmutableList.of( diff ), src );
this.postChangesToListeners( ImmutableList.of( diff ), src );
return leftOvers;
}
public MEMonitorHandler(IMEInventoryHandler<StackType> t) {
internalHandler = t;
cachedList = (IItemList<StackType>) t.getChannel().createList();
this.internalHandler = t;
this.cachedList = (IItemList<StackType>) t.getChannel().createList();
}
public MEMonitorHandler(IMEInventoryHandler<StackType> t, StorageChannel chan) {
internalHandler = t;
cachedList = (IItemList<StackType>) chan.createList();
this.internalHandler = t;
this.cachedList = (IItemList<StackType>) chan.createList();
}
@Override
public void addListener(IMEMonitorHandlerReceiver<StackType> l, Object verificationToken)
{
listeners.put( l, verificationToken );
this.listeners.put( l, verificationToken );
}
@Override
public void removeListener(IMEMonitorHandlerReceiver<StackType> l)
{
listeners.remove( l );
this.listeners.remove( l );
}
@Override
public StackType injectItems(StackType input, Actionable mode, BaseActionSource src)
{
if ( mode == Actionable.SIMULATE )
return getHandler().injectItems( input, mode, src );
return monitorDifference(input.copy(), getHandler().injectItems(input, mode, src), false, src);
return this.getHandler().injectItems( input, mode, src );
return this.monitorDifference(input.copy(), this.getHandler().injectItems(input, mode, src), false, src);
}
@Override
public StackType extractItems(StackType request, Actionable mode, BaseActionSource src)
{
if ( mode == Actionable.SIMULATE )
return getHandler().extractItems( request, mode, src );
return monitorDifference(request.copy(), getHandler().extractItems(request, mode, src), true, src);
return this.getHandler().extractItems( request, mode, src );
return this.monitorDifference(request.copy(), this.getHandler().extractItems(request, mode, src), true, src);
}
@Override
public IItemList<StackType> getStorageList()
{
if ( hasChanged )
if ( this.hasChanged )
{
hasChanged = false;
cachedList.resetStatus();
return getAvailableItems( cachedList );
this.hasChanged = false;
this.cachedList.resetStatus();
return this.getAvailableItems( this.cachedList );
}
return cachedList;
return this.cachedList;
}
@Override
public IItemList<StackType> getAvailableItems(IItemList out)
{
return getHandler().getAvailableItems( out );
return this.getHandler().getAvailableItems( out );
}
@Override
public StorageChannel getChannel()
{
return getHandler().getChannel();
return this.getHandler().getChannel();
}
@Override
public AccessRestriction getAccess()
{
return getHandler().getAccess();
return this.getHandler().getAccess();
}
@Override
public boolean isPrioritized(StackType input)
{
return getHandler().isPrioritized( input );
return this.getHandler().isPrioritized( input );
}
@Override
public boolean canAccept(StackType input)
{
return getHandler().canAccept( input );
return this.getHandler().canAccept( input );
}
@Override
public int getPriority()
{
return getHandler().getPriority();
return this.getHandler().getPriority();
}
@Override
public int getSlot()
{
return getHandler().getSlot();
return this.getHandler().getSlot();
}
@Override
public boolean validForPass(int i)
{
return getHandler().validForPass( i );
return this.getHandler().validForPass( i );
}
}

View file

@ -44,7 +44,7 @@ public enum StorageChannel
public final Class<? extends IAEStack> type;
private StorageChannel( Class<? extends IAEStack> t ) {
type = t;
this.type = t;
}
public IItemList createList() {

View file

@ -89,9 +89,9 @@ public enum AEColor
AEColor(String unlocalizedName, int blackHex, int medHex, int whiteHex) {
this.unlocalizedName = unlocalizedName;
blackVariant = blackHex;
mediumVariant = medHex;
whiteVariant = whiteHex;
this.blackVariant = blackHex;
this.mediumVariant = medHex;
this.whiteVariant = whiteHex;
}
/**
@ -99,13 +99,13 @@ public enum AEColor
*/
public boolean matches(AEColor color)
{
return equals(Transparent) || color == Transparent || equals(color);
return this.equals(Transparent) || color == Transparent || this.equals(color);
}
@Override
public String toString()
{
return StatCollector.translateToLocal( unlocalizedName );
return StatCollector.translateToLocal( this.unlocalizedName );
}
}

View file

@ -37,20 +37,20 @@ public class DimensionalCoord extends WorldCoord
public DimensionalCoord(DimensionalCoord s) {
super( s.x, s.y, s.z );
w = s.w;
dimId = s.dimId;
this.w = s.w;
this.dimId = s.dimId;
}
public DimensionalCoord(TileEntity s) {
super( s );
w = s.getWorldObj();
dimId = w.provider.dimensionId;
this.w = s.getWorldObj();
this.dimId = this.w.provider.dimensionId;
}
public DimensionalCoord(World _w, int _x, int _y, int _z) {
super( _x, _y, _z );
w = _w;
dimId = _w.provider.dimensionId;
this.w = _w;
this.dimId = _w.provider.dimensionId;
}
@Override
@ -61,34 +61,34 @@ public class DimensionalCoord extends WorldCoord
public boolean isEqual(DimensionalCoord c)
{
return x == c.x && y == c.y && z == c.z && c.w == this.w;
return this.x == c.x && this.y == c.y && this.z == c.z && c.w == this.w;
}
@Override
public boolean equals(Object obj)
{
return obj instanceof DimensionalCoord && isEqual((DimensionalCoord) obj);
return obj instanceof DimensionalCoord && this.isEqual((DimensionalCoord) obj);
}
@Override
public int hashCode()
{
return super.hashCode() ^ dimId;
return super.hashCode() ^ this.dimId;
}
public boolean isInWorld(World world)
{
return w == world;
return this.w == world;
}
@Override
public String toString()
{
return dimId + "," + super.toString();
return this.dimId + "," + super.toString();
}
public World getWorld()
{
return w;
return this.w;
}
}

View file

@ -39,56 +39,56 @@ public class WorldCoord
public WorldCoord add(ForgeDirection direction, int length)
{
x += direction.offsetX * length;
y += direction.offsetY * length;
z += direction.offsetZ * length;
this.x += direction.offsetX * length;
this.y += direction.offsetY * length;
this.z += direction.offsetZ * length;
return this;
}
public WorldCoord subtract(ForgeDirection direction, int length)
{
x -= direction.offsetX * length;
y -= direction.offsetY * length;
z -= direction.offsetZ * length;
this.x -= direction.offsetX * length;
this.y -= direction.offsetY * length;
this.z -= direction.offsetZ * length;
return this;
}
public WorldCoord add(int _x, int _y, int _z)
{
x += _x;
y += _y;
z += _z;
this.x += _x;
this.y += _y;
this.z += _z;
return this;
}
public WorldCoord subtract(int _x, int _y, int _z)
{
x -= _x;
y -= _y;
z -= _z;
this.x -= _x;
this.y -= _y;
this.z -= _z;
return this;
}
public WorldCoord multiple(int _x, int _y, int _z)
{
x *= _x;
y *= _y;
z *= _z;
this.x *= _x;
this.y *= _y;
this.z *= _z;
return this;
}
public WorldCoord divide(int _x, int _y, int _z)
{
x /= _x;
y /= _y;
z /= _z;
this.x /= _x;
this.y /= _y;
this.z /= _z;
return this;
}
public WorldCoord(int _x, int _y, int _z) {
x = _x;
y = _y;
z = _z;
this.x = _x;
this.y = _y;
this.z = _z;
}
public WorldCoord(TileEntity s) {
@ -100,9 +100,9 @@ public class WorldCoord
*/
public ForgeDirection directionTo(WorldCoord loc)
{
int ox = x - loc.x;
int oy = y - loc.y;
int oz = z - loc.z;
int ox = this.x - loc.x;
int oy = this.y - loc.y;
int oz = this.z - loc.z;
int xlen = Math.abs( ox );
int ylen = Math.abs( oy );
@ -131,29 +131,29 @@ public class WorldCoord
public boolean isEqual(WorldCoord c)
{
return x == c.x && y == c.y && z == c.z;
return this.x == c.x && this.y == c.y && this.z == c.z;
}
public WorldCoord copy()
{
return new WorldCoord( x, y, z );
return new WorldCoord( this.x, this.y, this.z );
}
@Override
public boolean equals(Object obj)
{
return obj instanceof WorldCoord && isEqual((WorldCoord) obj);
return obj instanceof WorldCoord && this.isEqual((WorldCoord) obj);
}
@Override
public String toString()
{
return "" + x + "," + y + "," + z;
return "" + this.x + "," + this.y + "," + this.z;
}
@Override
public int hashCode()
{
return (y << 24) ^ x ^ z;
return ( this.y << 24) ^ this.x ^ this.z;
}
}