commit
1931f7988c
23 changed files with 250 additions and 201 deletions
|
@ -42,20 +42,14 @@ public class ConnectionHandler implements IConnectionHandler
|
|||
}
|
||||
|
||||
@Override
|
||||
public void connectionOpened(NetHandler netClientHandler, String server, int port, INetworkManager manager)
|
||||
{
|
||||
|
||||
}
|
||||
public void connectionOpened(NetHandler netClientHandler, String server, int port, INetworkManager manager) { }
|
||||
|
||||
@Override
|
||||
public void connectionOpened(NetHandler netClientHandler,MinecraftServer server, INetworkManager manager)
|
||||
{
|
||||
|
||||
}
|
||||
public void connectionOpened(NetHandler netClientHandler,MinecraftServer server, INetworkManager manager) { }
|
||||
|
||||
@Override
|
||||
public void connectionClosed(INetworkManager manager)
|
||||
{
|
||||
{
|
||||
if(PocketManager.isConnected)
|
||||
{
|
||||
PocketManager.unload();
|
||||
|
@ -63,14 +57,12 @@ public class ConnectionHandler implements IConnectionHandler
|
|||
}
|
||||
|
||||
@Override
|
||||
public void clientLoggedIn(NetHandler clientHandler, INetworkManager manager, Packet1Login login)
|
||||
{
|
||||
return;
|
||||
}
|
||||
public void clientLoggedIn(NetHandler clientHandler, INetworkManager manager, Packet1Login login) { }
|
||||
|
||||
@Override
|
||||
public void playerLoggedIn(Player player, NetHandler netHandler, INetworkManager manager)
|
||||
{
|
||||
|
||||
//Send information about all the registered dimensions and links to the client
|
||||
|
||||
}
|
||||
}
|
|
@ -4,6 +4,7 @@ import java.io.ByteArrayOutputStream;
|
|||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.watcher.ClientLinkData;
|
||||
import net.minecraft.network.INetworkManager;
|
||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
|
@ -40,16 +41,16 @@ public class ServerPacketHandler implements IPacketHandler
|
|||
}
|
||||
}
|
||||
|
||||
private static class LinkWatcher implements IUpdateWatcher<Point4D>
|
||||
private static class LinkWatcher implements IUpdateWatcher<ClientLinkData>
|
||||
{
|
||||
@Override
|
||||
public void onCreated(Point4D message)
|
||||
public void onCreated(ClientLinkData message)
|
||||
{
|
||||
sendLinkPacket(PacketConstants.CREATE_LINK_PACKET_ID, message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeleted(Point4D message)
|
||||
public void onDeleted(ClientLinkData message)
|
||||
{
|
||||
sendLinkPacket(PacketConstants.DELETE_LINK_PACKET_ID, message);
|
||||
}
|
||||
|
@ -77,7 +78,7 @@ public class ServerPacketHandler implements IPacketHandler
|
|||
}
|
||||
}
|
||||
|
||||
private static void sendLinkPacket(byte id, Point4D data)
|
||||
private static void sendLinkPacket(byte id, ClientLinkData message)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -85,7 +86,7 @@ public class ServerPacketHandler implements IPacketHandler
|
|||
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
|
||||
DataOutputStream writer = new DataOutputStream(buffer);
|
||||
writer.writeByte(id);
|
||||
Point4D.write(data, writer);
|
||||
message.write(writer);
|
||||
writer.close();
|
||||
packet.channel = PacketConstants.CHANNEL_NAME;
|
||||
packet.data = buffer.toByteArray();
|
||||
|
|
|
@ -33,6 +33,13 @@ public class CommandCreateDungeonRift extends DDCommandBase
|
|||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender sender) {
|
||||
return "Usage: /dd-rift <dungeon name>\r\n" +
|
||||
" /dd-rift list\r\n" +
|
||||
" /dd-rift random";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
|
||||
{
|
||||
|
@ -130,10 +137,4 @@ public class CommandCreateDungeonRift extends DDCommandBase
|
|||
}
|
||||
return bestMatch;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender icommandsender) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -21,6 +21,11 @@ public class CommandCreatePocket extends DDCommandBase
|
|||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender sender) {
|
||||
return "Usage: /dd-create";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
|
||||
{
|
||||
|
@ -46,10 +51,4 @@ public class CommandCreatePocket extends DDCommandBase
|
|||
}
|
||||
return DDCommandResult.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender icommandsender) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -28,6 +28,11 @@ public class CommandDeleteAllLinks extends DDCommandBase
|
|||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender sender) {
|
||||
return "Usage: /dd-deletelinks <targetDimensionID>";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
|
||||
{
|
||||
|
@ -66,10 +71,4 @@ public class CommandDeleteAllLinks extends DDCommandBase
|
|||
}
|
||||
return DDCommandResult.SUCCESS; //TEMPORARY HACK
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender icommandsender) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -28,6 +28,11 @@ public class CommandDeleteRifts extends DDCommandBase
|
|||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender sender) {
|
||||
return "Usage: /dd-??? <dimension ID>";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
|
||||
{
|
||||
|
@ -68,10 +73,4 @@ public class CommandDeleteRifts extends DDCommandBase
|
|||
}
|
||||
return DDCommandResult.SUCCESS; //TEMPORARY HACK
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender icommandsender) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -26,6 +26,13 @@ public class CommandExportDungeon extends DDCommandBase
|
|||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender sender) {
|
||||
return "Usage: /dd-export <dungeon type> <dungeon name> open <weight>\r\n" +
|
||||
" /dd-export <dungeon type> <dungeon name> closed <weight>\r\n" +
|
||||
" /dd-export <schematic name> override";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
|
||||
{
|
||||
|
@ -166,10 +173,4 @@ public class CommandExportDungeon extends DDCommandBase
|
|||
}
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender icommandsender) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -28,6 +28,11 @@ public class CommandResetDungeons extends DDCommandBase
|
|||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender sender) {
|
||||
return "/dd-resetdungeons";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
|
||||
{
|
||||
|
@ -89,10 +94,4 @@ public class CommandResetDungeons extends DDCommandBase
|
|||
sendChat(sender,("Reset complete. " + resetCount + " out of " + dungeonCount + " dungeons were reset."));
|
||||
return DDCommandResult.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender icommandsender) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -29,6 +29,11 @@ public class CommandTeleportPlayer extends DDCommandBase
|
|||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender sender) {
|
||||
return "Usage: /dd-tp <player name> <dimension id> <x> <y> <z>";
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO- Change to accept variety of input, like just coords, just dim ID, or two player names.
|
||||
*/
|
||||
|
@ -85,12 +90,6 @@ public class CommandTeleportPlayer extends DDCommandBase
|
|||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender icommandsender) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -72,12 +72,12 @@ public abstract class DDCommandBase extends CommandBase
|
|||
sendChat(player,(result.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void sendChat(EntityPlayer player, String message)
|
||||
{
|
||||
ChatMessageComponent cmp = new ChatMessageComponent();
|
||||
cmp.addText(message);
|
||||
player.sendChatToPlayer(cmp);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -356,13 +356,13 @@ public class DDTeleporter
|
|||
oldWorld.getChunkFromChunkCoords(entX, entZ).isModified = true;
|
||||
}
|
||||
// Memory concerns.
|
||||
// oldWorld.releaseEntitySkin(entity);
|
||||
oldWorld.onEntityRemoved(entity);
|
||||
|
||||
if (player == null) // Are we NOT working with a player?
|
||||
{
|
||||
NBTTagCompound entityNBT = new NBTTagCompound();
|
||||
entity.isDead = false;
|
||||
entity.writeToNBTOptional(entityNBT);
|
||||
entity.writeMountToNBT(entityNBT);
|
||||
entity.isDead = true;
|
||||
entity = EntityList.createEntityFromNBT(entityNBT, newWorld);
|
||||
|
||||
|
@ -469,7 +469,7 @@ public class DDTeleporter
|
|||
{
|
||||
if(PocketManager.isBlackListed(link.destination().getDimension()))
|
||||
{
|
||||
link=PocketManager.getDimensionData(link.source().getDimension()).createLink(link.source,LinkTypes.SAFE_EXIT,link.orientation);
|
||||
link=PocketManager.getDimensionData(link.source().getDimension()).createLink(link.link.point,LinkTypes.SAFE_EXIT,link.link.orientation);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -545,7 +545,7 @@ public class DDTeleporter
|
|||
// To avoid loops, don't generate a destination if the player is
|
||||
// already in a non-pocket dimension.
|
||||
|
||||
NewDimData current = PocketManager.getDimensionData(link.source.getDimension());
|
||||
NewDimData current = PocketManager.getDimensionData(link.link.point.getDimension());
|
||||
if (current.isPocketDimension())
|
||||
{
|
||||
Point4D source = link.source();
|
||||
|
@ -569,7 +569,7 @@ public class DDTeleporter
|
|||
{
|
||||
World startWorld = PocketManager.loadDimension(link.source().getDimension());
|
||||
World destWorld = PocketManager.loadDimension(link.destination().getDimension());
|
||||
TileEntity doorTE = startWorld.getBlockTileEntity(link.source().getX(), link.source().getY(), link.source.getZ());
|
||||
TileEntity doorTE = startWorld.getBlockTileEntity(link.source().getX(), link.source().getY(), link.link.point.getZ());
|
||||
if(doorTE instanceof TileEntityDimDoor)
|
||||
{
|
||||
if((TileEntityDimDoor.class.cast(doorTE).hasGennedPair))
|
||||
|
@ -599,7 +599,7 @@ public class DDTeleporter
|
|||
}
|
||||
private static boolean generateSafeExit(DimLink link, DDProperties properties)
|
||||
{
|
||||
NewDimData current = PocketManager.getDimensionData(link.source.getDimension());
|
||||
NewDimData current = PocketManager.getDimensionData(link.link.point.getDimension());
|
||||
return generateSafeExit(current.root(), link, properties);
|
||||
}
|
||||
|
||||
|
@ -608,7 +608,7 @@ public class DDTeleporter
|
|||
// A dungeon exit acts the same as a safe exit, but has the chance of
|
||||
// taking the user to any non-pocket dimension, excluding Limbo and The End.
|
||||
|
||||
NewDimData current = PocketManager.getDimensionData(link.source.getDimension());
|
||||
NewDimData current = PocketManager.getDimensionData(link.link.point.getDimension());
|
||||
ArrayList<NewDimData> roots = PocketManager.getRootDimensions();
|
||||
int shiftChance = START_ROOT_SHIFT_CHANCE + ROOT_SHIFT_CHANCE_PER_LEVEL * (current.packDepth() - 1);
|
||||
|
||||
|
|
|
@ -4,46 +4,56 @@ import java.util.LinkedList;
|
|||
import java.util.List;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.util.Point4D;
|
||||
import StevenDimDoors.mod_pocketDim.watcher.ClientLinkData;
|
||||
|
||||
public abstract class DimLink
|
||||
{
|
||||
protected Point4D source;
|
||||
protected ClientLinkData link;
|
||||
protected DimLink parent;
|
||||
protected LinkTail tail;
|
||||
protected int orientation;
|
||||
protected List<DimLink> children;
|
||||
|
||||
protected DimLink(Point4D source, DimLink parent, int orientation)
|
||||
protected DimLink(ClientLinkData link, DimLink parent)
|
||||
{
|
||||
|
||||
if (parent.source.getDimension() != source.getDimension())
|
||||
if (parent.link.point.getDimension() != link.point.getDimension())
|
||||
{
|
||||
// Ban having children in other dimensions to avoid serialization issues with cross-dimensional tails
|
||||
throw new IllegalArgumentException("source and parent.source must have the same dimension.");
|
||||
}
|
||||
this.orientation=orientation;
|
||||
this.parent = parent;
|
||||
this.source = source;
|
||||
this.link = link;
|
||||
this.tail = parent.tail;
|
||||
this.children = new LinkedList<DimLink>();
|
||||
parent.children.add(this);
|
||||
}
|
||||
|
||||
protected DimLink(Point4D source, int linkType, int orientation)
|
||||
protected DimLink(ClientLinkData link, int linkType)
|
||||
{
|
||||
if ((linkType < LinkTypes.ENUM_MIN || linkType > LinkTypes.ENUM_MAX) && linkType != LinkTypes.CLIENT_SIDE)
|
||||
{
|
||||
throw new IllegalArgumentException("The specified link type is invalid.");
|
||||
}
|
||||
this.orientation = orientation;
|
||||
|
||||
this.parent = null;
|
||||
this.source = source;
|
||||
this.link = link;
|
||||
this.tail = new LinkTail(linkType, null);
|
||||
this.children = new LinkedList<DimLink>();
|
||||
}
|
||||
|
||||
public Point4D source()
|
||||
{
|
||||
return source;
|
||||
return link.point;
|
||||
}
|
||||
|
||||
public int orientation()
|
||||
{
|
||||
return link.orientation;
|
||||
}
|
||||
|
||||
public ClientLinkData link()
|
||||
{
|
||||
return link;
|
||||
}
|
||||
|
||||
public Point4D destination()
|
||||
|
@ -52,7 +62,7 @@ public abstract class DimLink
|
|||
}
|
||||
public int getDestinationOrientation()
|
||||
{
|
||||
return PocketManager.getLink(source.getX(), source.getY(), source.getZ(), source.getDimension()).orientation();
|
||||
return PocketManager.getLink(link.point.getX(), link.point.getY(), link.point.getZ(), link.point.getDimension()).link().orientation;
|
||||
}
|
||||
public boolean hasDestination()
|
||||
{
|
||||
|
@ -78,13 +88,9 @@ public abstract class DimLink
|
|||
{
|
||||
return tail.getLinkType();
|
||||
}
|
||||
public int orientation()
|
||||
{
|
||||
return orientation;
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return source + " -> " + (hasDestination() ? destination() : "");
|
||||
return link.point + " -> " + (hasDestination() ? destination() : "");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import java.util.Map;
|
|||
import java.util.Random;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.watcher.ClientLinkData;
|
||||
import net.minecraft.world.World;
|
||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||
import StevenDimDoors.mod_pocketDim.Point3D;
|
||||
|
@ -21,12 +22,12 @@ public abstract class NewDimData
|
|||
{
|
||||
public InnerDimLink(Point4D source, DimLink parent,int orientation)
|
||||
{
|
||||
super(source, parent,orientation);
|
||||
super(new ClientLinkData(source, orientation), parent);
|
||||
}
|
||||
|
||||
public InnerDimLink(Point4D source, int linkType, int orientation)
|
||||
{
|
||||
super(source, linkType,orientation);
|
||||
super(new ClientLinkData(source, orientation), linkType);
|
||||
}
|
||||
|
||||
public void setDestination(int x, int y, int z, NewDimData dimension)
|
||||
|
@ -50,7 +51,7 @@ public abstract class NewDimData
|
|||
}
|
||||
|
||||
parent = null;
|
||||
source = null;
|
||||
link = null;
|
||||
tail = new LinkTail(0, null);
|
||||
}
|
||||
|
||||
|
@ -65,7 +66,7 @@ public abstract class NewDimData
|
|||
//Ignore this request silently
|
||||
return false;
|
||||
}
|
||||
if (nextParent.source.getDimension() != source.getDimension())
|
||||
if (nextParent.link.point.getDimension() != link.point.getDimension())
|
||||
{
|
||||
// Ban having children in other dimensions to avoid serialization issues with cross-dimensional tails
|
||||
throw new IllegalArgumentException("source and parent.source must have the same dimension.");
|
||||
|
@ -88,7 +89,7 @@ public abstract class NewDimData
|
|||
parent = nextParent;
|
||||
tail = nextParent.tail;
|
||||
nextParent.children.add(this);
|
||||
this.orientation=orientation;
|
||||
this.link.orientation=orientation;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -111,7 +112,7 @@ public abstract class NewDimData
|
|||
parent = null;
|
||||
tail = new LinkTail(linkType, null);
|
||||
//Set new orientation
|
||||
this.orientation=orientation;
|
||||
this.link.orientation=orientation;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -130,10 +131,10 @@ public abstract class NewDimData
|
|||
protected Point4D origin;
|
||||
protected int orientation;
|
||||
protected DungeonData dungeon;
|
||||
protected IUpdateWatcher<Point4D> linkWatcher;
|
||||
protected IUpdateWatcher<ClientLinkData> linkWatcher;
|
||||
|
||||
protected NewDimData(int id, NewDimData parent, boolean isPocket, boolean isDungeon,
|
||||
IUpdateWatcher<Point4D> linkWatcher)
|
||||
IUpdateWatcher<ClientLinkData> linkWatcher)
|
||||
{
|
||||
// The isPocket flag is redundant. It's meant as an integrity safeguard.
|
||||
if (isPocket && (parent == null))
|
||||
|
@ -267,7 +268,7 @@ public abstract class NewDimData
|
|||
//Link created!
|
||||
if(linkType!=LinkTypes.CLIENT_SIDE)
|
||||
{
|
||||
linkWatcher.onCreated(link.source);
|
||||
linkWatcher.onCreated(link.link);
|
||||
}
|
||||
return link;
|
||||
}
|
||||
|
@ -290,19 +291,19 @@ public abstract class NewDimData
|
|||
InnerDimLink link = linkMapping.get(source);
|
||||
if (link == null)
|
||||
{
|
||||
link = new InnerDimLink(source, parent, parent.orientation);
|
||||
link = new InnerDimLink(source, parent, parent.link.orientation);
|
||||
linkMapping.put(source, link);
|
||||
linkList.add(link);
|
||||
|
||||
//Link created!
|
||||
linkWatcher.onCreated(link.source);
|
||||
linkWatcher.onCreated(link.link);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (link.overwrite(parent, parent.orientation))
|
||||
if (link.overwrite(parent, parent.link.orientation))
|
||||
{
|
||||
//Link created!
|
||||
linkWatcher.onCreated(link.source);
|
||||
linkWatcher.onCreated(link.link);
|
||||
}
|
||||
}
|
||||
return link;
|
||||
|
@ -319,7 +320,7 @@ public abstract class NewDimData
|
|||
{
|
||||
linkList.remove(target);
|
||||
//Raise deletion event
|
||||
linkWatcher.onDeleted(target.source);
|
||||
linkWatcher.onDeleted(target.link);
|
||||
target.clear();
|
||||
}
|
||||
return (target != null);
|
||||
|
@ -334,9 +335,9 @@ public abstract class NewDimData
|
|||
linkList.remove(target);
|
||||
//Raise deletion event
|
||||
//TODO why is source null here?
|
||||
if(target.source!=null)
|
||||
if(target.link!=null)
|
||||
{
|
||||
linkWatcher.onDeleted(target.source);
|
||||
linkWatcher.onDeleted(target.link);
|
||||
}
|
||||
target.clear();
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ public class PocketManager
|
|||
// that any link destinations must be real dimensions controlled by PocketManager.
|
||||
|
||||
public InnerDimData(int id, InnerDimData parent, boolean isPocket, boolean isDungeon,
|
||||
IUpdateWatcher<Point4D> linkWatcher)
|
||||
IUpdateWatcher<ClientLinkData> linkWatcher)
|
||||
{
|
||||
super(id, parent, isPocket, isDungeon, linkWatcher);
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ public class PocketManager
|
|||
Point3D parentPoint = new Point3D(-1,-1,-1);
|
||||
if(link.parent!=null)
|
||||
{
|
||||
parentPoint=link.parent.source.toPoint3D();
|
||||
parentPoint=link.parent.link.point.toPoint3D();
|
||||
}
|
||||
|
||||
for(DimLink childLink : link.children)
|
||||
|
@ -127,7 +127,7 @@ public class PocketManager
|
|||
children.add(childLink.source().toPoint3D());
|
||||
}
|
||||
PackedLinkTail tail = new PackedLinkTail(link.tail.getDestination(),link.tail.getLinkType());
|
||||
Links.add(new PackedLinkData(link.source,parentPoint,tail,link.orientation,children));
|
||||
Links.add(new PackedLinkData(link.link.point,parentPoint,tail,link.link.orientation,children));
|
||||
|
||||
PackedLinkTail tempTail = new PackedLinkTail(link.tail.getDestination(),link.tail.getLinkType());
|
||||
if(Tails.contains(tempTail))
|
||||
|
@ -208,9 +208,11 @@ public class PocketManager
|
|||
private static volatile boolean isLoading = false;
|
||||
private static volatile boolean isLoaded = false;
|
||||
private static volatile boolean isSaving = false;
|
||||
/**
|
||||
* Set as true if we are a client that has connected to a dedicated server
|
||||
*/
|
||||
public static volatile boolean isConnected = false;
|
||||
|
||||
private static final UpdateWatcherProxy<Point4D> linkWatcher = new UpdateWatcherProxy<Point4D>();
|
||||
private static final UpdateWatcherProxy<ClientLinkData> linkWatcher = new UpdateWatcherProxy<ClientLinkData>();
|
||||
private static final UpdateWatcherProxy<ClientDimData> dimWatcher = new UpdateWatcherProxy<ClientDimData>();
|
||||
private static ArrayList<NewDimData> rootDimensions = null;
|
||||
|
||||
|
@ -572,6 +574,10 @@ public class PocketManager
|
|||
//Any pocket dimension must be listed with PocketManager to have a dimension ID
|
||||
//assigned, so it's safe to assume that any unknown dimensions don't belong to us.
|
||||
|
||||
if(PocketManager.dimensionData == null)
|
||||
{
|
||||
System.out.println("Something odd happend during shutdown");
|
||||
}
|
||||
NewDimData dimension = PocketManager.dimensionData.get(dimensionID);
|
||||
if (dimension == null)
|
||||
{
|
||||
|
@ -598,7 +604,7 @@ public class PocketManager
|
|||
{
|
||||
throw new IllegalStateException("Pocket dimensions have already been unloaded!");
|
||||
}
|
||||
|
||||
|
||||
save();
|
||||
unregisterPockets();
|
||||
dimensionData = null;
|
||||
|
@ -644,12 +650,12 @@ public class PocketManager
|
|||
return dimWatcher.unregisterReceiver(watcher);
|
||||
}
|
||||
|
||||
public static void registerLinkWatcher(IUpdateWatcher<Point4D> watcher)
|
||||
public static void registerLinkWatcher(IUpdateWatcher<ClientLinkData> watcher)
|
||||
{
|
||||
linkWatcher.registerReceiver(watcher);
|
||||
}
|
||||
|
||||
public static boolean unregisterLinkWatcher(IUpdateWatcher<Point4D> watcher)
|
||||
public static boolean unregisterLinkWatcher(IUpdateWatcher<ClientLinkData> watcher)
|
||||
{
|
||||
return linkWatcher.unregisterReceiver(watcher);
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@ public class Compactor
|
|||
for (DimLink link : dimension.links())
|
||||
{
|
||||
Point4D.write(link.source(), output);
|
||||
output.writeInt(link.orientation());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -27,9 +27,8 @@ public class ItemBlockDimWall extends ItemBlock
|
|||
return damageValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack)
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack)
|
||||
{
|
||||
return subNames[(par1ItemStack.getItemDamage())];
|
||||
return subNames[this.getDamage(par1ItemStack)];
|
||||
}
|
||||
}
|
|
@ -62,15 +62,14 @@ public class ItemRiftBlade extends ItemSword
|
|||
return material != Material.plants && material != Material.vine && material != Material.coral && material != Material.leaves && material != Material.pumpkin ? 1.0F : 1.5F;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked", "rawtypes"})
|
||||
public Multimap getItemAttributeModifiers()
|
||||
{
|
||||
{
|
||||
Multimap multimap = super.getItemAttributeModifiers();
|
||||
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon modifier", 7, 0));
|
||||
return multimap;
|
||||
}
|
||||
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon modifier", (double)7, 0));
|
||||
return multimap;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
|
|
@ -93,7 +93,7 @@ serverPacketHandlerSpec =
|
|||
@SidedPacketHandler(channels = {PacketConstants.CHANNEL_NAME}, packetHandler = ServerPacketHandler.class))
|
||||
public class mod_pocketDim
|
||||
{
|
||||
public static final String version = "1.6.2R2.1.1RC1";
|
||||
public static final String version = "$VERSION$";
|
||||
public static final String modid = "dimdoors";
|
||||
|
||||
//need to clean up
|
||||
|
|
|
@ -6,6 +6,7 @@ import net.minecraft.entity.DataWatcher;
|
|||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityFlying;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
@ -67,6 +68,12 @@ public class MobMonolith extends EntityFlying implements IMob
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void applyEntityAttributes()
|
||||
{
|
||||
super.applyEntityAttributes();
|
||||
this.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.maxHealth).setAttribute(20);
|
||||
}
|
||||
|
||||
public boolean canBePushed()
|
||||
{
|
||||
return false;
|
||||
|
@ -100,6 +107,7 @@ public class MobMonolith extends EntityFlying implements IMob
|
|||
{
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
super.onEntityUpdate();
|
||||
|
||||
if (this.isEntityAlive() && this.isEntityInsideOpaqueBlock())
|
||||
|
|
|
@ -32,6 +32,8 @@ public class ClientDimData
|
|||
|
||||
public static ClientDimData read(DataInputStream input) throws IOException
|
||||
{
|
||||
return new ClientDimData(input.readInt(), input.readInt());
|
||||
int id = input.readInt();
|
||||
int rootId = input.readInt();
|
||||
return new ClientDimData(id, rootId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,9 @@ public class ClientLinkData
|
|||
|
||||
public static ClientLinkData read(DataInputStream input) throws IOException
|
||||
{
|
||||
return new ClientLinkData(Point4D.read(input), input.readInt());
|
||||
Point4D point = Point4D.read(input);
|
||||
int orientation = input.readInt();
|
||||
return new ClientLinkData(point, orientation);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
183
build.xml
183
build.xml
|
@ -1,62 +1,93 @@
|
|||
|
||||
|
||||
<project name="DimensionalDoors" default="install" basedir=".">
|
||||
|
||||
<property environment="env" />
|
||||
|
||||
<property name="project.name" value="DimDoors" />
|
||||
<property name="src.dir" value="StevenDimDoors" />
|
||||
<property name="resources.dir" value="resources" />
|
||||
<property name="schematics.dir" value="schematics" />
|
||||
<property name="versionclass.dir" value="mod_pocketDim" />
|
||||
<property name="versionclass.file" value="mod_pocketDim.java"/>
|
||||
|
||||
<property name="minecraft.version" value="1.6.4" />
|
||||
<property name="forge.forgeversion" value="9.11.1" />
|
||||
<property name="forge.buildnum" value="953" />
|
||||
|
||||
<property name="build.dir" value="build" />
|
||||
<property name="classes.dir" value="${build.dir}/packaging" />
|
||||
<property name="src.dir" value="src" />
|
||||
<property name="forge.version" value="1.6.2-9.10.1.871" />
|
||||
<property name="resourcePack.dir" value="${classes.dir}" />
|
||||
<property name="schematicPack.dir" value="${classes.dir}/schematics/" />
|
||||
<property name="apiclasses.dir" value="${build.dir}/api-packaging" />
|
||||
<property name="forge.version" value="${minecraft.version}-${forge.forgeversion}.${forge.buildnum}" />
|
||||
<property name="forge.url" value="http://files.minecraftforge.net/minecraftforge/minecraftforge-src-${forge.version}.zip" />
|
||||
<property name="mcp.version" value="804" />
|
||||
<property name="forge.dir" value="${build.dir}/forge" />
|
||||
<property name="mcp.dir" value="${forge.dir}/mcp" />
|
||||
<property name="mcpsrc.dir" value="${mcp.dir}/src/minecraft" />
|
||||
<property name="resources.dir" value="resources" />
|
||||
<property name="mcpsrc.dir" value="${mcp.dir}/src/minecraft/StevenDimDoors" />
|
||||
|
||||
<property name="package.meta-inf" value="META-INF" />
|
||||
<property name="build.ver" value="1.6.2" />
|
||||
<property name="dist.dir" value="${build.dir}/dist" />
|
||||
|
||||
<property name="download.dir" value="downloads" />
|
||||
<property name="download.dir" value="${build.dir}/downloads" />
|
||||
|
||||
<property name="lib.dir" value="${mcp.dir}/lib" />
|
||||
|
||||
<property file="${forge.dir}/forgeversion.properties" />
|
||||
<condition property="forge.already.installed">
|
||||
<equals arg1="${forge.build.number}" arg2="871" />
|
||||
<equals arg1="${forge.build.number}" arg2="${forge.buildnum}" />
|
||||
</condition>
|
||||
|
||||
<property name="verclass.dir" value="${mcpsrc.dir}/StevenDimDoors/mod_pocketDim/" />
|
||||
<property name="verclass.name" value="mod_pocketDim.java"/>
|
||||
|
||||
|
||||
<mkdir dir="${download.dir}"/>
|
||||
<mkdir dir="${build.dir}" />
|
||||
|
||||
<target name="get-version" depends="setup-forge">
|
||||
<mkdir dir="${mcpsrc.dir}/StevenDimDoors" />
|
||||
<copy todir="${mcpsrc.dir}/StevenDimDoors" overwrite="true">
|
||||
<fileset dir="StevenDimDoors" />
|
||||
</copy>
|
||||
|
||||
|
||||
|
||||
<exec dir="${verclass.dir}" executable="sh" osfamily="unix" outputproperty="grep.out">
|
||||
<arg value="-c"/>
|
||||
<arg value="grep -o -P '[0-9.]+R[0-9.]+(RC[0-9]+)?(B[0-9]+)?' ${verclass.name}"/>
|
||||
</exec>
|
||||
<exec executable="python" osfamily="unix">
|
||||
<arg value="versionscript.py" />
|
||||
<arg value="${grep.out}" />
|
||||
</exec>
|
||||
<echo message="Grepped version: ${grep.out}"/>
|
||||
<copy todir="${classes.dir}" file="mcmod.info" overwrite="true"/>
|
||||
<target name="get-version" depends="setup-forge">
|
||||
<!-- Copy source -->
|
||||
<copy todir="${mcpsrc.dir}" overwrite="true">
|
||||
<fileset dir="${src.dir}"/>
|
||||
</copy>
|
||||
|
||||
<!-- Get the version from the mcmod.info -->
|
||||
<script language="javascript">
|
||||
importClass(java.io.File);
|
||||
importClass(java.nio.file.Files)
|
||||
importClass(java.io.FileReader);
|
||||
importClass(java.io.BufferedReader);
|
||||
importClass(java.io.FileWriter);
|
||||
importClass(java.io.BufferedWriter);
|
||||
|
||||
echo = project.createTask("echo");
|
||||
echo.setMessage("Parsing mcmod.info...");
|
||||
echo.perform();
|
||||
|
||||
var file = new File("./mcmod.info");
|
||||
|
||||
fr = new FileReader(file);
|
||||
br = new BufferedReader(fr);
|
||||
|
||||
// Read the file.
|
||||
// This assumes the file has no line
|
||||
var line;
|
||||
var json = "";
|
||||
while ((line = br.readLine()) != null) {
|
||||
json += line;
|
||||
}
|
||||
|
||||
var struct = JSON.parse(json);
|
||||
var version = struct["modlist"][0].version;
|
||||
|
||||
echo = project.createTask("echo");
|
||||
echo.setMessage("Parsed version: " + version);
|
||||
echo.perform();
|
||||
|
||||
project.setProperty("mod.version", version);
|
||||
</script>
|
||||
|
||||
<!-- Replace the version information in the mod class -->
|
||||
<replace file="${mcpsrc.dir}/${versionclass.dir}/${versionclass.file}">
|
||||
<replacefilter token="$VERSION$" value="${mod.version}"/>
|
||||
</replace>
|
||||
</target>
|
||||
|
||||
<available property="forge-exists" file="${download.dir}/minecraftforge-src-${forge.version}.zip" />
|
||||
<available property="already-compiled" file="${classes.dir}/deathrat" />
|
||||
<available property="already-compiled" file="${classes.dir}/${src.dir}" />
|
||||
<condition property="should-download-ant-contrib">
|
||||
<or>
|
||||
<available file="${download.dir}/ant-contrib/ant-contrib-1.0b3.jar"/>
|
||||
|
@ -65,14 +96,13 @@
|
|||
</condition>
|
||||
|
||||
<target name="install" depends="build">
|
||||
<copy todir="${classes.dir}/schematics" overwrite="true">
|
||||
<fileset dir="schematics" />
|
||||
</copy>
|
||||
<zip destfile="${dist.dir}/DimensionalDoors-${grep.out}-${build.number}.zip" basedir="${classes.dir}"/>
|
||||
<delete dir="${mcpsrc.dir}/${src.dir}" />
|
||||
<delete dir="${dist.dir}" />
|
||||
<jar destfile="${dist.dir}/${project.name}-${mod.version}-${build.number}.jar" basedir="${classes.dir}"/>
|
||||
<delete dir="${classes.dir}" />
|
||||
<delete dir="${mcp.dir}/reobf"/>
|
||||
<delete dir="${mcpsrc}/StevenDimDoors" />
|
||||
<delete dir="${mcpsrc}/Steven" />
|
||||
<delete dir="{$apiclasses.dir}" />
|
||||
<delete dir="${mcpsrc.dir}/${src.dir}" />
|
||||
</target>
|
||||
|
||||
<target name="build" depends="get-version" unless="already-compiled">
|
||||
|
@ -87,19 +117,36 @@
|
|||
|
||||
<!-- Reobf -->
|
||||
<exec dir="${mcp.dir}" executable="cmd" osfamily="windows">
|
||||
<arg line="/c reobfuscate_srg.bat"/>
|
||||
<arg line="/c reobfuscate.bat --srgnames"/>
|
||||
</exec>
|
||||
|
||||
<exec dir="${mcp.dir}" executable="sh" osfamily="unix">
|
||||
<arg value="reobfuscate_srg.sh" />
|
||||
<arg value="reobfuscate.sh" />
|
||||
</exec>
|
||||
|
||||
<copy todir="${classes.dir}">
|
||||
<fileset dir="${mcp.dir}/reobf/minecraft"/>
|
||||
</copy>
|
||||
<copy todir="${classes.dir}">
|
||||
<fileset dir="${resources.dir}"/>
|
||||
|
||||
<copy todir="${resourcePack.dir}">
|
||||
<fileset dir="${resources.dir}" />
|
||||
</copy>
|
||||
|
||||
<copy todir="${schematicPack.dir}">
|
||||
<fileset dir="${schematics.dir}" />
|
||||
</copy>
|
||||
|
||||
<copy todir="${classes.dir}">
|
||||
<fileset file="mcmod.info" />
|
||||
</copy>
|
||||
|
||||
<copy todir="${classes.dir}">
|
||||
<fileset file="${resources.dir}/pack.mcmeta" />
|
||||
</copy>
|
||||
|
||||
<delete file="${resourcePack.dir}/mcmod.info" />
|
||||
|
||||
<delete file="${resourcePack.dir}/pack.mcmeta" />
|
||||
</target>
|
||||
|
||||
<target name="build-number-there" if="env.BUILD_NUMBER" >
|
||||
|
@ -109,7 +156,7 @@
|
|||
|
||||
<target name="build-number-not-there" unless="env.BUILD_NUMBER" >
|
||||
<echo message="!! No build number set !!" />
|
||||
<property name="build.number" value="CUSTOM_BUILD" />
|
||||
<property name="build.number" value="0" />
|
||||
</target>
|
||||
|
||||
<target name="setup-forge" depends="download-forge,build-number-there,build-number-not-there" unless="forge.already.installed">
|
||||
|
@ -120,16 +167,10 @@
|
|||
<include name="minecraftforge-src-${forge.version}.zip"/>
|
||||
</fileset>
|
||||
</unzip>
|
||||
|
||||
|
||||
|
||||
<!-- Change executables' permitions -->
|
||||
|
||||
<chmod file="${forge.dir}/install.sh" perm="+x"/>
|
||||
|
||||
<!-- if your building on OSX these 2 should be executable -->
|
||||
|
||||
|
||||
|
||||
<!-- Install forge -->
|
||||
<delete dir="${mcp.dir}" failonerror="no"/>
|
||||
<exec dir="${forge.dir}" executable="cmd" osfamily="windows" inputstring="Yes\n">
|
||||
|
@ -138,38 +179,29 @@
|
|||
|
||||
<exec dir="${forge.dir}" executable="sh" osfamily="unix" inputstring="Yes\n">
|
||||
<arg value="install.sh" />
|
||||
|
||||
</exec>
|
||||
|
||||
|
||||
<chmod file="${mcp.dir}/updatemd5.sh" perm="+x"/>
|
||||
<chmod file="${mcp.dir}/recompile.sh" perm="+x"/>
|
||||
<chmod file="${mcp.dir}/reobfuscate_srg.sh" perm="+x"/>
|
||||
<chmod file="${mcp.dir}/reobfuscate.sh" perm="+x"/>
|
||||
<chmod file="${mcp.dir}/runtime/bin/astyle-osx" perm="+x" />
|
||||
<chmod file="${mcp.dir}/runtime/bin/jad-osx" perm="+x" />
|
||||
<!-- Copy libraries -->
|
||||
<!-- <copy todir="${mcp.dir}/lib" >
|
||||
<fileset dir="lib" >
|
||||
<patternset includes="*.jar" />
|
||||
</fileset>
|
||||
</copy> -->
|
||||
</target>
|
||||
|
||||
<target name="download-forge" depends="download-ant-contrib" unless="forge-exists">
|
||||
<taskdef resource="net/sf/antcontrib/antlib.xml">
|
||||
<classpath>
|
||||
<pathelement location="${download.dir}/ant-contrib/ant-contrib-1.0b3.jar"/>
|
||||
<fileset dir="${download.dir}/ant-contrib/lib">
|
||||
<include name="*.jar"/>
|
||||
</fileset>
|
||||
</classpath>
|
||||
</taskdef>
|
||||
<echo message="Downloading forge... " />
|
||||
<get src="${forge.url}" dest="${download.dir}/minecraftforge-src-${forge.version}.zip" />
|
||||
<target name="download-forge" depends="download-ant-contrib" unless="forge-exists">
|
||||
<taskdef resource="net/sf/antcontrib/antlib.xml">
|
||||
<classpath>
|
||||
<pathelement location="${download.dir}/ant-contrib/ant-contrib-1.0b3.jar"/>
|
||||
<fileset dir="${download.dir}/ant-contrib/lib">
|
||||
<include name="*.jar"/>
|
||||
</fileset>
|
||||
</classpath>
|
||||
</taskdef>
|
||||
<echo message="Downloading forge... " />
|
||||
<get src="http://files.minecraftforge.net/minecraftforge-src-${forge.version}.zip"
|
||||
dest="${download.dir}/minecraftforge-src-${forge.version}.zip" />
|
||||
</target>
|
||||
|
||||
|
||||
|
||||
<target name="download-ant-contrib" unless="should-download-ant-contrib">
|
||||
<echo message="Getting: ant-contrib"/>
|
||||
<mkdir dir="${download.dir}/tmp"/>
|
||||
|
@ -195,5 +227,4 @@
|
|||
</target>
|
||||
|
||||
|
||||
</project>
|
||||
|
||||
</project>
|
|
@ -1,9 +1,12 @@
|
|||
{
|
||||
"modinfoversion":2,
|
||||
"modlist":
|
||||
[
|
||||
{
|
||||
"modid": "DimDoors",
|
||||
"name": "Dimensional Doors",
|
||||
"description": "Bend and twist reality itself, creating pocket dimensions, rifts, and much more",
|
||||
"version": "1.5.2R1.4.1RC1",
|
||||
"version": "1.6.4R2.1.2RC1",
|
||||
"credits": "Created by StevenRS11, Coded by StevenRS11 and SenseiKiwi, Logo and Testing by Jaitsu",
|
||||
"logoFile": "/dimdoors_logo.png",
|
||||
"mcversion": "",
|
||||
|
@ -15,3 +18,4 @@
|
|||
"dependencies": [ "Forge"]
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in a new issue