diff --git a/src/main/java/de/craftinc/replicator/Replicator.java b/src/main/java/de/craftinc/replicator/Replicator.java new file mode 100644 index 0000000..0f1d80b --- /dev/null +++ b/src/main/java/de/craftinc/replicator/Replicator.java @@ -0,0 +1,82 @@ +/* Craft Inc. Replicator + Copyright (C) 2013 Paul Schulze, Maximilian Häckel + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +package de.craftinc.replicator; + +import org.bukkit.Location; +import org.bukkit.block.BlockFace; +import org.bukkit.entity.Player; + +import java.util.ArrayList; + +/** + * Created with IntelliJ IDEA. + * User: starback + * Date: 18.03.13 + * Time: 16:26 + * To change this template use File | Settings | File Templates. + */ +public class Replicator { + + private ArrayList owners; + private ArrayList users; + + private Location spawn; + private Location pumpkin; + + public Replicator(String firstOwner, Location spawn, Location pumpkin) { + this.owners = new ArrayList(); + this.users = new ArrayList(); + this.owners.add(firstOwner); + this.spawn = spawn; + this.pumpkin = pumpkin; + } + + public void addUser(String user) { + this.users.add(user); + } + + public void addOwner(String owner) { + this.users.add(owner); + } + + public boolean rmUser(String user) { + if(this.users.remove(user)) return true; + else return false; + } + + public boolean rmOwner(String owner) { + if(this.owners.remove(owner)) return true; + else return false; + } + + private BlockFace getDirection() { + + if(this.pumpkin.getBlock().get) + + if(this.spawn.getBlock().getRelative(BlockFace.EAST).equals(this.pumpkin.getBlock())) return BlockFace.EAST; + else if(this.spawn.getBlock().getRelative(BlockFace.SOUTH).equals(this.pumpkin.getBlock())) return BlockFace.SOUTH; + else if(this.spawn.getBlock().getRelative(BlockFace.WEST).equals(this.pumpkin.getBlock())) return BlockFace.WEST; + else if(this.spawn.getBlock().getRelative(BlockFace.NORTH).equals(this.pumpkin.getBlock())) return BlockFace.NORTH; + else return null; + } + + private boolean isValid(){ + + return false; + } +}