Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
ad310ddb9c | |||
3db630f60e | |||
7a03f49fb1 |
@ -388,6 +388,14 @@ portalInfoServer=Server: %server%
|
|||||||
|
|
||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
|
#### \[Version 0.9.1.2] EpicKnarvik97 fork
|
||||||
|
|
||||||
|
- Allows a sneaking player to see information about a silent stargate with no sign
|
||||||
|
|
||||||
|
#### \[Version 0.9.1.1] EpicKnarvik97 fork
|
||||||
|
|
||||||
|
- Makes sure to translate the `&` character to fix a bug causing portal signs to not be colored on some servers
|
||||||
|
|
||||||
#### \[Version 0.9.1.0] EpicKnarvik97 fork
|
#### \[Version 0.9.1.0] EpicKnarvik97 fork
|
||||||
|
|
||||||
- Rewrites config loading as a part of the changes required to implement config commands
|
- Rewrites config loading as a part of the changes required to implement config commands
|
||||||
|
2
pom.xml
2
pom.xml
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<groupId>net.knarcraft</groupId>
|
<groupId>net.knarcraft</groupId>
|
||||||
<artifactId>Stargate</artifactId>
|
<artifactId>Stargate</artifactId>
|
||||||
<version>0.9.1.0</version>
|
<version>0.9.1.2</version>
|
||||||
|
|
||||||
<licenses>
|
<licenses>
|
||||||
<license>
|
<license>
|
||||||
|
@ -317,7 +317,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Display portal information as a portal without a sign does not display any
|
//Display portal information as a portal without a sign does not display any
|
||||||
if (portal.getOptions().hasNoSign() && !portal.getOptions().isSilent()) {
|
if (portal.getOptions().hasNoSign() && (!portal.getOptions().isSilent() || player.isSneaking())) {
|
||||||
MessageSender sender = Stargate.getMessageSender();
|
MessageSender sender = Stargate.getMessageSender();
|
||||||
sender.sendSuccessMessage(player, ChatColor.GOLD + Stargate.getString("portalInfoTitle"));
|
sender.sendSuccessMessage(player, ChatColor.GOLD + Stargate.getString("portalInfoTitle"));
|
||||||
sender.sendSuccessMessage(player, Stargate.replaceVars(Stargate.getString("portalInfoName"),
|
sender.sendSuccessMessage(player, Stargate.replaceVars(Stargate.getString("portalInfoName"),
|
||||||
|
@ -81,8 +81,7 @@ public class PortalSignDrawer {
|
|||||||
private void drawSign(Sign sign) {
|
private void drawSign(Sign sign) {
|
||||||
//Clear sign
|
//Clear sign
|
||||||
clearSign(sign);
|
clearSign(sign);
|
||||||
setLine(sign, 0, highlightColor + "-" + mainColor +
|
setLine(sign, 0, highlightColor + "-" + mainColor + fixColor(portal.getName()) + highlightColor + "-");
|
||||||
portal.getName() + highlightColor + "-");
|
|
||||||
|
|
||||||
if (!portal.getPortalActivator().isActive()) {
|
if (!portal.getPortalActivator().isActive()) {
|
||||||
//Default sign text
|
//Default sign text
|
||||||
@ -123,7 +122,7 @@ public class PortalSignDrawer {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
clearSign(sign);
|
clearSign(sign);
|
||||||
sign.setLine(0, portal.getName());
|
sign.setLine(0, fixColor(portal.getName()));
|
||||||
sign.update();
|
sign.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -173,10 +172,10 @@ public class PortalSignDrawer {
|
|||||||
boolean green = PermissionHelper.isFree(portal.getActivePlayer(), portal, destination);
|
boolean green = PermissionHelper.isFree(portal.getActivePlayer(), portal, destination);
|
||||||
ChatColor nameColor = (green ? freeColor : highlightColor);
|
ChatColor nameColor = (green ? freeColor : highlightColor);
|
||||||
setLine(sign, signLineIndex, nameColor + ">" + (green ? freeColor : mainColor) +
|
setLine(sign, signLineIndex, nameColor + ">" + (green ? freeColor : mainColor) +
|
||||||
portal.getDestinationName() + nameColor + "<");
|
fixColor(portal.getDestinationName()) + nameColor + "<");
|
||||||
} else {
|
} else {
|
||||||
setLine(sign, signLineIndex, highlightColor + ">" + mainColor + portal.getDestinationName() +
|
setLine(sign, signLineIndex, highlightColor + ">" + mainColor +
|
||||||
highlightColor + "<");
|
fixColor(portal.getDestinationName()) + highlightColor + "<");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,9 +204,9 @@ public class PortalSignDrawer {
|
|||||||
if (freeGatesGreen) {
|
if (freeGatesGreen) {
|
||||||
Portal destination = PortalHandler.getByName(destinationName, portal.getNetwork());
|
Portal destination = PortalHandler.getByName(destinationName, portal.getNetwork());
|
||||||
boolean green = PermissionHelper.isFree(portal.getActivePlayer(), portal, destination);
|
boolean green = PermissionHelper.isFree(portal.getActivePlayer(), portal, destination);
|
||||||
setLine(sign, signLineIndex, (green ? freeColor : mainColor) + destinationName);
|
setLine(sign, signLineIndex, (green ? freeColor : mainColor) + fixColor(destinationName));
|
||||||
} else {
|
} else {
|
||||||
setLine(sign, signLineIndex, mainColor + destinationName);
|
setLine(sign, signLineIndex, mainColor + fixColor(destinationName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -218,8 +217,10 @@ public class PortalSignDrawer {
|
|||||||
*/
|
*/
|
||||||
private void drawBungeeSign(Sign sign) {
|
private void drawBungeeSign(Sign sign) {
|
||||||
setLine(sign, 1, Stargate.getString("bungeeSign"));
|
setLine(sign, 1, Stargate.getString("bungeeSign"));
|
||||||
setLine(sign, 2, highlightColor + ">" + mainColor + portal.getDestinationName() + highlightColor + "<");
|
setLine(sign, 2, highlightColor + ">" + mainColor + fixColor(portal.getDestinationName()) +
|
||||||
setLine(sign, 3, highlightColor + "[" + mainColor + portal.getNetwork() + highlightColor + "]");
|
highlightColor + "<");
|
||||||
|
setLine(sign, 3, highlightColor + "[" + mainColor + fixColor(portal.getNetwork()) +
|
||||||
|
highlightColor + "]");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -233,7 +234,8 @@ public class PortalSignDrawer {
|
|||||||
setLine(sign, 1, Stargate.getString("signRightClick"));
|
setLine(sign, 1, Stargate.getString("signRightClick"));
|
||||||
setLine(sign, 2, Stargate.getString("signToUse"));
|
setLine(sign, 2, Stargate.getString("signToUse"));
|
||||||
if (!portal.getOptions().isNoNetwork()) {
|
if (!portal.getOptions().isNoNetwork()) {
|
||||||
setLine(sign, 3, highlightColor + "(" + mainColor + portal.getNetwork() + highlightColor + ")");
|
setLine(sign, 3, highlightColor + "(" + mainColor + fixColor(portal.getNetwork()) +
|
||||||
|
highlightColor + ")");
|
||||||
} else {
|
} else {
|
||||||
setLine(sign, 3, "");
|
setLine(sign, 3, "");
|
||||||
}
|
}
|
||||||
@ -247,12 +249,13 @@ public class PortalSignDrawer {
|
|||||||
private void drawFixedSign(Sign sign) {
|
private void drawFixedSign(Sign sign) {
|
||||||
String destinationName = portal.getOptions().isRandom() ? Stargate.getString("signRandom") :
|
String destinationName = portal.getOptions().isRandom() ? Stargate.getString("signRandom") :
|
||||||
portal.getDestinationName();
|
portal.getDestinationName();
|
||||||
setLine(sign, 1, highlightColor + ">" + mainColor + destinationName + highlightColor + "<");
|
setLine(sign, 1, highlightColor + ">" + mainColor + fixColor(destinationName) + highlightColor + "<");
|
||||||
|
|
||||||
if (portal.getOptions().isNoNetwork()) {
|
if (portal.getOptions().isNoNetwork()) {
|
||||||
setLine(sign, 2, "");
|
setLine(sign, 2, "");
|
||||||
} else {
|
} else {
|
||||||
setLine(sign, 2, highlightColor + "(" + mainColor + portal.getNetwork() + highlightColor + ")");
|
setLine(sign, 2, highlightColor + "(" + mainColor + fixColor(portal.getNetwork()) +
|
||||||
|
highlightColor + ")");
|
||||||
}
|
}
|
||||||
Portal destination = PortalHandler.getByName(portal.getDestinationName(), portal.getNetwork());
|
Portal destination = PortalHandler.getByName(portal.getDestinationName(), portal.getNetwork());
|
||||||
if (destination == null && !portal.getOptions().isRandom()) {
|
if (destination == null && !portal.getOptions().isRandom()) {
|
||||||
@ -277,4 +280,14 @@ public class PortalSignDrawer {
|
|||||||
Stargate.logInfo(String.format("Gate layout on line %d does not exist [%s]", lineIndex, gateName));
|
Stargate.logInfo(String.format("Gate layout on line %d does not exist [%s]", lineIndex, gateName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fixes coloring of signs as the & character isn't translated on all servers
|
||||||
|
*
|
||||||
|
* @param text <p>The text to fix the coloring of</p>
|
||||||
|
* @return <p>The text with the coloring fixed</p>
|
||||||
|
*/
|
||||||
|
private String fixColor(String text) {
|
||||||
|
return ChatColor.translateAlternateColorCodes('&', text);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: Stargate
|
name: Stargate
|
||||||
main: net.knarcraft.stargate.Stargate
|
main: net.knarcraft.stargate.Stargate
|
||||||
version: 0.9.1.0
|
version: 0.9.1.2
|
||||||
description: Stargate mod for Bukkit Revived
|
description: Stargate mod for Bukkit Revived
|
||||||
author: EpicKnarvik97
|
author: EpicKnarvik97
|
||||||
authors: [ Drakia, PseudoKnight, EpicKnarvik97 ]
|
authors: [ Drakia, PseudoKnight, EpicKnarvik97 ]
|
||||||
|
Reference in New Issue
Block a user