Skip to content

Commit 57bc18b

Browse files
committed
fixed problems with lava portals and portal block portals
1 parent 5d5f916 commit 57bc18b

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

Resources/plugin.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ commands:
1717
usage: /<command>
1818
permissions:
1919
advancedportals.*:
20-
description: Gives access to all portal commands
20+
description: Gives access to all commands
2121
children:
2222
advancedportals.createportal: true
2323
advancedportals.portal: true
2424
advancedportals.build: true
25+
advancedportals.desti.*: true
2526
advancedportals.createportal:
2627
description: Allows you to create portals
2728
default: op
@@ -31,3 +32,10 @@ permissions:
3132
advancedportals.build:
3233
description: Allows you to build in the portal regions
3334
default: op
35+
advancedportals.desti.*:
36+
description: Gives access to all desti commands
37+
children:
38+
advancedportals.desti.create: true
39+
advancedportals.desti.create:
40+
description: Allows users to create portal destinations
41+
default: op

src/com/sekwah/advancedportals/AdvancedPortalsCommand.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ private void portalEditMenu(CommandSender sender, ConfigAccessor portalConfig, S
540540

541541
Player player = (Player)sender;
542542

543-
plugin.nmsAccess.sendRawMessage("{\"text\":\"\u00A7aFunctions\u00A7e: \",\"extra\":[{\"text\":\"\u00A7eRemove\",\"hoverEvent\":{\"action\":show_text,\"value\":\"Remove the selected portal\"},\"clickEvent\":{\"action\":\"clickEvent\",\"value\":\"/portal gui remove " + portalName + "\"}}"
543+
plugin.nmsAccess.sendRawMessage("{\"text\":\"\u00A7aFunctions\u00A7e: \",\"extra\":[{\"text\":\"\u00A7eRemove\",\"hoverEvent\":{\"action\":\"show_text\",\"value\":\"Remove the selected portal\"},\"clickEvent\":{\"action\":\"clickEvent\",\"value\":\"/portal gui remove " + portalName + "\"}}"
544544
+ ",{\"text\":\" \"},{\"text\":\"\u00A7eShow\",\"hoverEvent\":{\"action\":\"show_text\",\"value\":\"Show the selected portal\"},\"clickEvent\":{\"action\":\"clickEvent\",\"value\":\"/portal show " + portalName + "\"}}"
545545
+ ",{\"text\":\" \"},{\"text\":\"\u00A7eRename\",\"hoverEvent\":{\"action\":\"show_text\",\"value\":\"Change the name of the portal\"},\"clickEvent\":{\"action\":\"suggest_command\",\"value\":\"/portal rename \"}}"
546546
+ ",{\"text\":\" \"},{\"text\":\"\u00A7eActivate\",\"hoverEvent\":{\"action\":\"show_text\",\"value\":\"Teleport to the set destination\n(same as entering the portal)\"},\"clickEvent\":{\"action\":\"clickEvent\",\"value\":\"/warp " + destination + "\"}}]}", player);

src/com/sekwah/advancedportals/DestinationCommand.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public DestinationCommand(AdvancedPortalsPlugin plugin) {
3535
public boolean onCommand(CommandSender sender, Command cmd, String command, String[] args) {
3636
if(args.length > 0){
3737
if(args[0].toLowerCase().equals("create")){
38-
if(sender.hasPermission("advancedportals.create")){
38+
if(sender.hasPermission("advancedportals.desti.create")){
3939
if(args.length > 1){
4040
ConfigAccessor config = new ConfigAccessor(plugin, "destinations.yml");
4141
String posX = config.getConfig().getString(args[1].toLowerCase() + ".pos.X");

src/com/sekwah/advancedportals/Listeners.java

+4-6
Original file line numberDiff line numberDiff line change
@@ -141,25 +141,23 @@ else if(PortalMessagesDisplay == 2 && warped){
141141
}
142142

143143
if(portal.trigger.equals(Material.PORTAL)){
144-
final Player finalplayer = event.getPlayer();
145144
if(player.getGameMode().equals(GameMode.CREATIVE)){
146145
player.setMetadata("hasWarped", new FixedMetadataValue(plugin, true));
147146
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
148147
public void run(){
149-
if(finalplayer != null && finalplayer.isOnline()){
150-
finalplayer.removeMetadata("hasWarped", plugin);
148+
if(player != null && player.isOnline()){
149+
player.removeMetadata("hasWarped", plugin);
151150
}
152151
}
153152
}, 10);
154153
}
155154
}
156155
else if(portal.trigger.equals(Material.LAVA)){
157-
final Player finalplayer = event.getPlayer();
158156
player.setMetadata("lavaWarped", new FixedMetadataValue(plugin, true));
159157
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
160158
public void run(){
161-
finalplayer.removeMetadata("lavaWarped", plugin);
162-
finalplayer.setFireTicks(-1);
159+
player.removeMetadata("lavaWarped", plugin);
160+
player.setFireTicks(0);
163161
}
164162
}, 10);
165163
}

0 commit comments

Comments
 (0)