Started adding the portal block placing feature and also updated the

portal creation code to accept destinations
This commit is contained in:
sekwah41 2013-12-13 21:32:21 +00:00
parent b0d593f27e
commit 39822badd8
3 changed files with 11 additions and 4 deletions

View File

@ -11,6 +11,9 @@ UseOnlyServerMadeAxe: false
# Preferably an item and not a block but it shouldnt matter
AxeItemId: IRON_AXE
# Will be implemented so you can give yourself the portal block and build manually with it so its easier to make portals with the portal block.
CanBuildPortalBlock: true
# This stops all water flowing inside a portal area(can be disabled if something like world edit is handelling the water flow or you dont want it active)
# you want to
StopWaterFlow: true

View File

@ -135,10 +135,10 @@ public class AdvancedPortalsCommand implements CommandExecutor {
if(!hasTriggerBlock || triggerBlockId == null){
Portal.create(pos1, pos2, "portalname");
Portal.create(pos1, pos2, "portalname", destination);
}
else{
Portal.create(pos1, pos2, "portalname", triggerBlockId);
Portal.create(pos1, pos2, "portalname", destination, triggerBlockId);
}
// add code to save the portal to the portal config and reload the portals

View File

@ -47,7 +47,7 @@ public class Portal {
}
@SuppressWarnings("deprecation")
public static void create(Location pos1, Location pos2 , String name, Material triggerBlockId) {
public static void create(Location pos1, Location pos2 , String name, String destination , Material triggerBlockId) {
ConfigAccessor config = new ConfigAccessor(plugin, "Portals.yml");
config.getConfig().set(name + ".world", pos1.getWorld().getName());
@ -55,6 +55,8 @@ public class Portal {
config.getConfig().set(name + ".triggerblock", triggerBlockId.toString());
config.getConfig().set(name + ".destination", destination);
config.getConfig().set(name + ".pos1.X", pos1.getX());
config.getConfig().set(name + ".pos1.Y", pos1.getY());
config.getConfig().set(name + ".pos1.Z", pos1.getZ());
@ -68,12 +70,14 @@ public class Portal {
loadPortals();
}
public static void create(Location pos1, Location pos2, String name) { // add stuff for destination names or coordinates
public static void create(Location pos1, Location pos2, String name, String destination) { // add stuff for destination names or coordinates
ConfigAccessor config = new ConfigAccessor(plugin, "Portals.yml");
config.getConfig().set(name + ".world", pos1.getWorld().getName());
config.getConfig().set(name + ".hastriggerblock", false);
config.getConfig().set(name + ".destination", destination);
config.getConfig().set(name + ".pos1.X", pos1.getX());
config.getConfig().set(name + ".pos1.Y", pos1.getY());
config.getConfig().set(name + ".pos1.Z", pos1.getZ());