mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
hh
This commit is contained in:
parent
ff4b231be2
commit
9c4c081e3e
@ -68,7 +68,7 @@ public class ItemWiring extends Item {
|
|||||||
player.addChatMessage(new ChatComponentText("Wire end"));
|
player.addChatMessage(new ChatComponentText("Wire end"));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
player.addChatMessage(new ChatComponentText("Wire error"));
|
player.addChatMessage(new ChatComponentText("Wire error - " + TileEntityPylonBase.errorMessage));
|
||||||
}
|
}
|
||||||
|
|
||||||
stack.stackTagCompound = null;
|
stack.stackTagCompound = null;
|
||||||
|
|||||||
@ -18,14 +18,19 @@ import net.minecraft.world.WorldServer;
|
|||||||
public abstract class TileEntityPylonBase extends TileEntityCableBaseNT {
|
public abstract class TileEntityPylonBase extends TileEntityCableBaseNT {
|
||||||
|
|
||||||
public List<int[]> connected = new ArrayList<int[]>();
|
public List<int[]> connected = new ArrayList<int[]>();
|
||||||
|
public static String errorMessage = "";
|
||||||
|
|
||||||
public static boolean canConnect(TileEntityPylonBase first, TileEntityPylonBase second) {
|
public static boolean canConnect(TileEntityPylonBase first, TileEntityPylonBase second) {
|
||||||
|
|
||||||
if(first.getConnectionType() != second.getConnectionType())
|
if(first.getConnectionType() != second.getConnectionType()) {
|
||||||
|
errorMessage = "pylons are not the same type";
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if(first == second)
|
if(first == second) {
|
||||||
|
errorMessage = "cannot connect to the same pylon";
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
double len = Math.min(first.getMaxWireLength(), second.getMaxWireLength());
|
double len = Math.min(first.getMaxWireLength(), second.getMaxWireLength());
|
||||||
|
|
||||||
@ -38,6 +43,7 @@ public abstract class TileEntityPylonBase extends TileEntityCableBaseNT {
|
|||||||
(secondPos.zCoord) - (firstPos.zCoord)
|
(secondPos.zCoord) - (firstPos.zCoord)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
errorMessage = "pylon too far away";
|
||||||
return len >= delta.lengthVector();
|
return len >= delta.lengthVector();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user