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