Non static access of static members

This commit is contained in:
yueh 2015-08-06 18:59:31 +02:00 committed by thatsIch
parent b0bb793a0e
commit 6488119318
5 changed files with 23 additions and 21 deletions

View file

@ -19,16 +19,17 @@
package appeng.parts; package appeng.parts;
import io.netty.buffer.ByteBuf;
import java.io.IOException; import java.io.IOException;
import io.netty.buffer.ByteBuf;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos; import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import appeng.api.implementations.IPowerChannelState; import appeng.api.implementations.IPowerChannelState;
import appeng.api.networking.GridFlags; import appeng.api.networking.GridFlags;
import appeng.api.networking.events.MENetworkChannelsChanged; import appeng.api.networking.events.MENetworkChannelsChanged;
@ -69,7 +70,7 @@ public abstract class PartBasicState extends AEBasePart implements IPowerChannel
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
public void renderLights( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer ) public void renderLights( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
{ {
this.setColors( renderer, ( this.clientFlags & ( this.POWERED_FLAG | this.CHANNEL_FLAG ) ) == ( this.POWERED_FLAG | this.CHANNEL_FLAG ), ( this.clientFlags & this.POWERED_FLAG ) == this.POWERED_FLAG ); this.setColors( renderer, ( this.clientFlags & ( POWERED_FLAG | CHANNEL_FLAG ) ) == ( POWERED_FLAG | CHANNEL_FLAG ), ( this.clientFlags & POWERED_FLAG ) == POWERED_FLAG );
rh.renderFace( pos, CableBusTextures.PartMonitorSidesStatusLights.getIcon(), EnumFacing.EAST, renderer ); rh.renderFace( pos, CableBusTextures.PartMonitorSidesStatusLights.getIcon(), EnumFacing.EAST, renderer );
rh.renderFace( pos, CableBusTextures.PartMonitorSidesStatusLights.getIcon(), EnumFacing.WEST, renderer ); rh.renderFace( pos, CableBusTextures.PartMonitorSidesStatusLights.getIcon(), EnumFacing.WEST, renderer );
rh.renderFace( pos, CableBusTextures.PartMonitorSidesStatusLights.getIcon(), EnumFacing.UP, renderer ); rh.renderFace( pos, CableBusTextures.PartMonitorSidesStatusLights.getIcon(), EnumFacing.UP, renderer );
@ -108,12 +109,12 @@ public abstract class PartBasicState extends AEBasePart implements IPowerChannel
{ {
if( this.proxy.getEnergy().isNetworkPowered() ) if( this.proxy.getEnergy().isNetworkPowered() )
{ {
this.clientFlags |= this.POWERED_FLAG; this.clientFlags |= POWERED_FLAG;
} }
if( this.proxy.getNode().meetsChannelRequirements() ) if( this.proxy.getNode().meetsChannelRequirements() )
{ {
this.clientFlags |= this.CHANNEL_FLAG; this.clientFlags |= CHANNEL_FLAG;
} }
this.clientFlags = this.populateFlags( this.clientFlags ); this.clientFlags = this.populateFlags( this.clientFlags );
@ -152,12 +153,12 @@ public abstract class PartBasicState extends AEBasePart implements IPowerChannel
@Override @Override
public boolean isPowered() public boolean isPowered()
{ {
return ( this.clientFlags & this.POWERED_FLAG ) == this.POWERED_FLAG; return ( this.clientFlags & POWERED_FLAG ) == POWERED_FLAG;
} }
@Override @Override
public boolean isActive() public boolean isActive()
{ {
return ( this.clientFlags & this.CHANNEL_FLAG ) == this.CHANNEL_FLAG; return ( this.clientFlags & CHANNEL_FLAG ) == CHANNEL_FLAG;
} }
} }

View file

@ -76,6 +76,7 @@ import appeng.core.sync.GuiBridge;
import appeng.helpers.IPriorityHost; import appeng.helpers.IPriorityHost;
import appeng.me.GridAccessException; import appeng.me.GridAccessException;
import appeng.me.storage.MEInventoryHandler; import appeng.me.storage.MEInventoryHandler;
import appeng.parts.PartBasicState;
import appeng.tile.inventory.AppEngInternalAEInventory; import appeng.tile.inventory.AppEngInternalAEInventory;
import appeng.tile.inventory.InvOperation; import appeng.tile.inventory.InvOperation;
import appeng.util.Platform; import appeng.util.Platform;
@ -311,7 +312,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
maxY = 16; maxY = 16;
} }
boolean isActive = ( this.clientFlags & ( this.POWERED_FLAG | this.CHANNEL_FLAG ) ) == ( this.POWERED_FLAG | this.CHANNEL_FLAG ); boolean isActive = ( this.clientFlags & ( PartBasicState.POWERED_FLAG | PartBasicState.CHANNEL_FLAG ) ) == ( PartBasicState.POWERED_FLAG | PartBasicState.CHANNEL_FLAG );
rh.setTexture( CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockFormPlaneOn.getIcon() : renderer.getIcon( is ), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon() ); rh.setTexture( CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockFormPlaneOn.getIcon() : renderer.getIcon( is ), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon() );

View file

@ -153,7 +153,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
{ {
if( Platform.isClient() ) if( Platform.isClient() )
{ {
return ( this.clientFlags & this.FLAG_ON ) == this.FLAG_ON; return ( this.clientFlags & FLAG_ON ) == FLAG_ON;
} }
if( !this.proxy.isActive() ) if( !this.proxy.isActive() )
@ -188,7 +188,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
@Override @Override
protected int populateFlags( int cf ) protected int populateFlags( int cf )
{ {
return cf | ( this.prevState ? this.FLAG_ON : 0 ); return cf | ( this.prevState ? FLAG_ON : 0 );
} }
@Override @Override

View file

@ -72,14 +72,14 @@ public class PartToggleBus extends PartBasicState
@Override @Override
public void setColors( ModelGenerator renderer, boolean hasChan, boolean hasPower ) public void setColors( ModelGenerator renderer, boolean hasChan, boolean hasPower )
{ {
this.hasRedstone = ( this.clientFlags & this.REDSTONE_FLAG ) == this.REDSTONE_FLAG; this.hasRedstone = ( this.clientFlags & REDSTONE_FLAG ) == REDSTONE_FLAG;
super.setColors( renderer, hasChan && this.hasRedstone, hasPower && this.hasRedstone ); super.setColors( renderer, hasChan && this.hasRedstone, hasPower && this.hasRedstone );
} }
@Override @Override
protected int populateFlags( int cf ) protected int populateFlags( int cf )
{ {
return cf | ( this.getIntention() ? this.REDSTONE_FLAG : 0 ); return cf | ( this.getIntention() ? REDSTONE_FLAG : 0 );
} }
protected boolean getIntention() protected boolean getIntention()

View file

@ -136,27 +136,27 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock
{ {
if( this.cluster.min.equals( this.getLocation() ) ) if( this.cluster.min.equals( this.getLocation() ) )
{ {
this.displayBits = this.DISPLAY_END_MIN; this.displayBits = DISPLAY_END_MIN;
} }
else if( this.cluster.max.equals( this.getLocation() ) ) else if( this.cluster.max.equals( this.getLocation() ) )
{ {
this.displayBits = this.DISPLAY_END_MAX; this.displayBits = DISPLAY_END_MAX;
} }
else else
{ {
this.displayBits = this.DISPLAY_MIDDLE; this.displayBits = DISPLAY_MIDDLE;
} }
switch( this.cluster.currentAxis ) switch( this.cluster.currentAxis )
{ {
case X: case X:
this.displayBits |= this.DISPLAY_X; this.displayBits |= DISPLAY_X;
break; break;
case Y: case Y:
this.displayBits |= this.DISPLAY_Y; this.displayBits |= DISPLAY_Y;
break; break;
case Z: case Z:
this.displayBits |= this.DISPLAY_Z; this.displayBits |= DISPLAY_Z;
break; break;
default: default:
this.displayBits = 0; this.displayBits = 0;
@ -167,12 +167,12 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock
{ {
if( this.gridProxy.getEnergy().isNetworkPowered() ) if( this.gridProxy.getEnergy().isNetworkPowered() )
{ {
this.displayBits |= this.DISPLAY_POWERED_ENABLED; this.displayBits |= DISPLAY_POWERED_ENABLED;
} }
if( this.cluster.isValid && this.gridProxy.isActive() ) if( this.cluster.isValid && this.gridProxy.isActive() )
{ {
this.displayBits |= this.DISPLAY_ENABLED; this.displayBits |= DISPLAY_ENABLED;
} }
} }
catch( GridAccessException e ) catch( GridAccessException e )
@ -208,7 +208,7 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock
public int getLightValue() public int getLightValue()
{ {
if( ( this.displayBits & this.DISPLAY_POWERED_ENABLED ) == this.DISPLAY_POWERED_ENABLED ) if( ( this.displayBits & DISPLAY_POWERED_ENABLED ) == DISPLAY_POWERED_ENABLED )
{ {
return 8; return 8;
} }