Working on client/server madness
This commit is contained in:
@@ -372,8 +372,8 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
||||
@Override
|
||||
public void enterDimDoor(World world, int x, int y, int z, Entity entity)
|
||||
{
|
||||
// We need to ignore particle entities
|
||||
if (world.isRemote || entity instanceof EntityFX)
|
||||
// FX entities dont exist on the server
|
||||
if (world.isRemote)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -7,10 +7,13 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import StevenDimDoors.mod_pocketDim.helpers.Compactor;
|
||||
import StevenDimDoors.mod_pocketDim.helpers.DeleteFolder;
|
||||
import StevenDimDoors.mod_pocketDim.saving.DDSaveHandler;
|
||||
@@ -276,7 +279,7 @@ public class PocketManager
|
||||
*/
|
||||
private static void loadInternal()
|
||||
{
|
||||
if (!DimensionManager.getWorld(OVERWORLD_DIMENSION_ID).isRemote &&
|
||||
if (FMLCommonHandler.instance().getSide().isServer()&&
|
||||
DimensionManager.getCurrentSaveRootDirectory() != null)
|
||||
{
|
||||
// Load and register blacklisted dimension IDs
|
||||
|
||||
@@ -61,6 +61,7 @@ public class itemRiftRemover extends Item
|
||||
if (tileEntity != null && tileEntity instanceof TileEntityRift)
|
||||
{
|
||||
((TileEntityRift) tileEntity).shouldClose = true;
|
||||
tileEntity.onInventoryChanged();
|
||||
}
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
@@ -76,7 +77,7 @@ public class itemRiftRemover extends Item
|
||||
@Override
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -170,9 +170,10 @@ public class TileEntityRift extends TileEntity
|
||||
{
|
||||
Point4D location = nearestRiftData.source();
|
||||
TileEntityRift rift = (TileEntityRift) worldObj.getBlockTileEntity(location.getX(), location.getY(), location.getZ());
|
||||
if (rift != null)
|
||||
if (rift != null&&rift.shouldClose!=true)
|
||||
{
|
||||
rift.shouldClose = true;
|
||||
rift.onInventoryChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -187,6 +188,7 @@ public class TileEntityRift extends TileEntity
|
||||
}
|
||||
}
|
||||
count2++;
|
||||
|
||||
}
|
||||
|
||||
public void calculateOldParticleOffset()
|
||||
@@ -200,18 +202,6 @@ public class TileEntityRift extends TileEntity
|
||||
this.zOffset = this.zCoord - location.getZ();
|
||||
this.distance = Math.abs(xOffset) + Math.abs(yOffset) + Math.abs(zOffset);
|
||||
this.isNearRift=true;
|
||||
|
||||
if (!worldObj.isRemote && distance > 1)
|
||||
{
|
||||
try
|
||||
{
|
||||
grow(distance);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -219,6 +209,7 @@ public class TileEntityRift extends TileEntity
|
||||
this.yOffset=0;
|
||||
this.xOffset=0;
|
||||
}
|
||||
this.onInventoryChanged();
|
||||
}
|
||||
|
||||
public void grow(int distance)
|
||||
|
||||
Reference in New Issue
Block a user