Теперь это (почти) универсальная хрень. ServerMods таки мешают, хотя для клиента их просто удалить, для сервера - проблема серверовладельца, там авторизация из полезного только и та жопой сделана.

This commit is contained in:
ZLOFENIX 2013-06-29 19:48:48 +04:00
parent 1543766132
commit 0865baea01
10 changed files with 15 additions and 10 deletions

View file

@ -89,7 +89,6 @@ public class BlockProtocol extends BlockContainer {
* Called upon block activation (right click on the block.) * Called upon block activation (right click on the block.)
*/ */
@Override @Override
@SideOnly(Side.SERVER)
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{ {
if (FMLCommonHandler.instance().getEffectiveSide().isClient()) if (FMLCommonHandler.instance().getEffectiveSide().isClient())

View file

@ -84,7 +84,6 @@ public class BlockRadar extends BlockContainer {
} }
@Override @Override
@SideOnly(Side.SERVER)
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{ {
if (FMLCommonHandler.instance().getEffectiveSide().isClient()) if (FMLCommonHandler.instance().getEffectiveSide().isClient())

View file

@ -80,7 +80,6 @@ public class BlockReactor extends BlockContainer {
/** /**
* Called upon block activation (right click on the block.) * Called upon block activation (right click on the block.)
*/ */
@SideOnly(Side.SERVER)
@Override @Override
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{ {

View file

@ -1,5 +1,6 @@
package cr0s.WarpDrive; package cr0s.WarpDrive;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import dan200.computer.api.IPeripheral; import dan200.computer.api.IPeripheral;
@ -118,9 +119,10 @@ public class EntityJump extends Entity {
} }
} }
@SideOnly(Side.SERVER)
@Override @Override
public void onUpdate() { public void onUpdate() {
if (FMLCommonHandler.instance().getEffectiveSide().isClient())
return;
if (!on || worldObj.getBlockId(xCoord, yCoord, zCoord) != WarpDrive.WARP_CORE_BLOCKID) { if (!on || worldObj.getBlockId(xCoord, yCoord, zCoord) != WarpDrive.WARP_CORE_BLOCKID) {
unlockWorlds(); unlockWorlds();
worldObj.removeEntity(this); worldObj.removeEntity(this);

View file

@ -1,5 +1,6 @@
package cr0s.WarpDrive; package cr0s.WarpDrive;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block; import net.minecraft.block.Block;
@ -76,9 +77,10 @@ public final class EntitySphereGen extends Entity {
worldObj.removeEntity(this); worldObj.removeEntity(this);
} }
@SideOnly(Side.SERVER)
@Override @Override
public void onUpdate() { public void onUpdate() {
if (FMLCommonHandler.instance().getEffectiveSide().isClient())
return;
if (!on) if (!on)
{ {
System.out.println("[SGEN] onUpdate(): entity disabled."); System.out.println("[SGEN] onUpdate(): entity disabled.");

View file

@ -34,7 +34,6 @@ public class SpaceGenerator extends ChunkProviderGenerate implements IChunkProvi
} }
@Override @Override
//@SideOnly(Side.SERVER)
public Chunk provideChunk(int par1, int par2) { public Chunk provideChunk(int par1, int par2) {
this.rand.setSeed((long) par1 * 341873128712L + (long) par2 * 132897987541L); this.rand.setSeed((long) par1 * 341873128712L + (long) par2 * 132897987541L);
byte[] var3 = new byte[32768]; byte[] var3 = new byte[32768];

View file

@ -4,6 +4,7 @@
*/ */
package cr0s.WarpDrive; package cr0s.WarpDrive;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import dan200.computer.api.IComputerAccess; import dan200.computer.api.IComputerAccess;
@ -57,9 +58,10 @@ public class TileEntityProtocol extends TileEntity implements IPeripheral {
private TileEntity core; private TileEntity core;
@SideOnly(Side.SERVER)
@Override @Override
public void updateEntity() { public void updateEntity() {
if (FMLCommonHandler.instance().getEffectiveSide().isClient())
return;
if (++ticks >= BLOCK_UPDATE_INTERVAL){ if (++ticks >= BLOCK_UPDATE_INTERVAL){
findCoreBlock(); findCoreBlock();

View file

@ -1,5 +1,6 @@
package cr0s.WarpDrive; package cr0s.WarpDrive;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import dan200.computer.api.IComputerAccess; import dan200.computer.api.IComputerAccess;
@ -37,9 +38,10 @@ public class TileEntityRadar extends TileEntity implements IPeripheral, IEnergyS
return ((getCurrentEnergyValue() - needEnergy) > 0); return ((getCurrentEnergyValue() - needEnergy) > 0);
} }
@SideOnly(Side.SERVER)
@Override @Override
public void updateEntity() { public void updateEntity() {
if (FMLCommonHandler.instance().getEffectiveSide().isClient())
return;
try { try {
if (worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 2) { if (worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 2) {
if (cooldownTime++ > (20 * ((scanRadius / 1000) + 1))) { if (cooldownTime++ > (20 * ((scanRadius / 1000) + 1))) {

View file

@ -4,6 +4,7 @@
*/ */
package cr0s.WarpDrive; package cr0s.WarpDrive;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.Direction; import ic2.api.Direction;
@ -93,9 +94,10 @@ public class TileEntityReactor extends TileEntity implements IEnergySink {
public String coreState = ""; public String coreState = "";
public TileEntityProtocol controller; public TileEntityProtocol controller;
@SideOnly(Side.SERVER)
@Override @Override
public void updateEntity() { public void updateEntity() {
if (FMLCommonHandler.instance().getEffectiveSide().isClient())
return;
// Update warp core in cores registry // Update warp core in cores registry
if (++registryUpdateTicks > CORES_REGISTRY_UPDATE_INTERVAL_SECONDS * 20) { if (++registryUpdateTicks > CORES_REGISTRY_UPDATE_INTERVAL_SECONDS * 20) {
registryUpdateTicks = 0; registryUpdateTicks = 0;

View file

@ -117,7 +117,6 @@ public class WarpDrive {
registry = new WarpCoresRegistry(); registry = new WarpCoresRegistry();
} }
//@SideOnly(Side.SERVER)
private void registerSpaceDimension() { private void registerSpaceDimension() {
spaceBiome = (new BiomeSpace(23)).setColor(0).setDisableRain().setBiomeName("Space"); spaceBiome = (new BiomeSpace(23)).setColor(0).setDisableRain().setBiomeName("Space");
this.spaceProviderID = 14; this.spaceProviderID = 14;