mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2025-02-16 12:21:20 +01:00
Started adding the portal block placing feature and also updated the
portal creation code to accept destinations
This commit is contained in:
parent
b0d593f27e
commit
39822badd8
@ -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
|
||||
|
@ -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
|
||||
|
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user