Skip to content

Commit

Permalink
Update implementation according to API
Browse files Browse the repository at this point in the history
  • Loading branch information
gabizou committed Dec 11, 2014
1 parent 5bb0ac5 commit aa807d6
Show file tree
Hide file tree
Showing 16 changed files with 582 additions and 72 deletions.
22 changes: 21 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
/bin/
#Folders to ignore
bin/
target/
build/
.externalToolBuilders/
.manifest
buildLocal.xml

#Files to ignore
# -Eclipse-
.settings
.project
.classpath

# -IntelliJ-
*.iml
*.ipr
*.iws
.idea/

#Specific files to the project
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2014 The Voxel Plugineering Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
170 changes: 170 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.voxelplugineering</groupId>
<artifactId>VoxelSniper-Bukkit</artifactId>
<version>7.0.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>VoxelSniper-Bukkit</name>
<description>Implementation of VoxelGunsmith for the Bukkit Platform</description>
<url>http://voxelmodpack.com/</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.number>UNKNOWN</project.build.number>
<project.build.version>${project.version}</project.build.version>
</properties>

<profiles>
<profile>
<id>jenkins</id>
<activation>
<property>
<name>env.BUILD_NUMBER</name>
</property>
</activation>
<properties>
<project.build.number>${env.BUILD_NUMBER}</project.build.number>
<project.build.version>${project.version}-jnks${project.build.number}</project.build.version>
</properties>
</profile>
</profiles>

<distributionManagement>
<snapshotRepository>
<id>tvpt-repo</id>
<name>TVPT Snapshot Repository</name>
<url>http://vault.voxelmodpack.com/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>tvpt-repo</id>
<name>TVPT Release Repository</name>
<url>http://vault.voxelmodpack.com/content/repositories/releases</url>
</repository>
</distributionManagement>

<dependencies>
<dependency>
<groupId>com.voxelplugineering</groupId>
<artifactId>VoxelGunsmith</artifactId>
<version>2.0.0-SNAPSHOT</version>
<scope>compile</scope>
<optional>false</optional>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.7.10-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.4</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>

<plugin>
<groupId>com.mycila.maven-license-plugin</groupId>
<artifactId>maven-license-plugin</artifactId>
<version>1.10.b1</version>
<executions>
<execution>
<phase>clean</phase>
<goals>
<goal>format</goal>
</goals>
</execution>
</executions>
<configuration>
<quiet>true</quiet>
<encoding>UTF-8</encoding>
<strictCheck>true</strictCheck>
<header>${basedir}/LICENSE</header>
<mapping>
<java>SLASHSTAR_STYLE</java>
</mapping>
<includes>
<include>src/main/java/com/voxelplugineering/voxelsniper/**</include>
</includes>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>com.google.guava:guava</include>
<include>com.voxelplugineering:VoxelGunsmith</include>
</includes>
<excludes>
<exclude>net.milkbowl.vault:VaultAPI</exclude>
</excludes>
</artifactSet>
<relocations>
<relocation>
<pattern>com.google.common</pattern>
<shadedPattern>com.voxelplugineering.libs.com.google.common</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 The Voxel Plugin Team
* Copyright (c) 2014 The Voxel Plugineering Team
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 The Voxel Plugin Team
* Copyright (c) 2014 The Voxel Plugineering Team
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -33,7 +33,7 @@
import com.voxelplugineering.voxelsniper.api.ISniperManager;
import com.voxelplugineering.voxelsniper.bukkit.BukkitSniper;

public class SniperManagerBukkit implements ISniperManager<Player>, IPermissionProxy
public class SniperManagerBukkit implements ISniperManager<Player>
{

private Map<Player, BukkitSniper> players = new WeakHashMap<Player, BukkitSniper>();
Expand All @@ -47,7 +47,7 @@ public void init()
@Override
public void stop()
{
players.clear();
this.players.clear();
}

@Override
Expand All @@ -60,11 +60,11 @@ public void restart()
@Override
public ISniper getSniper(Player player)
{
if(!players.containsKey(player))
if(!this.players.containsKey(player))
{
players.put(player, new BukkitSniper(player));
this.players.put(player, new BukkitSniper(player));
}
return players.get(player);
return this.players.get(player);
}

@Override
Expand All @@ -73,11 +73,4 @@ public Class<Player> getPlayerClass()
return Player.class;
}

@Override
public boolean hasPermission(ISniper sniper, String permission)
{
Player p = (Player) sniper.getPlayer();
return p.hasPermission(permission);
}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 The Voxel Plugin Team
* Copyright (c) 2014 The Voxel Plugineering Team
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -23,11 +23,14 @@
*/
package com.voxelplugineering.voxelsniper;

import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;

import com.voxelplugineering.voxelsniper.api.Gunsmith;
import com.voxelplugineering.voxelsniper.api.IBrushManager;
import com.voxelplugineering.voxelsniper.api.ISniper;
import com.voxelplugineering.voxelsniper.api.ISniperManager;
Expand All @@ -36,29 +39,41 @@
import com.voxelplugineering.voxelsniper.command.BukkitCommandRegistrar;
import com.voxelplugineering.voxelsniper.common.command.CommandHandler;
import com.voxelplugineering.voxelsniper.common.factory.CommonWorldFactory;
import com.voxelplugineering.voxelsniper.perms.VaultPermissionProxy;

public class VoxelSniperBukkit extends JavaPlugin implements IVoxelSniper
{
public static VoxelSniperBukkit voxelsniper;
ISniperManager<Player> sniperManager;
IBrushManager brushManager;

SniperManagerBukkit sniperManager;
BrushManagerBukkit brushManager;

@Override
public void onEnable()
{
voxelsniper = this;
Gunsmith.setPlugin(this);
CommonWorldFactory.setFactory(new BukkitWorldFactory(this.getServer()));
this.sniperManager = new SniperManagerBukkit();
this.sniperManager.init();
this.brushManager = new BrushManagerBukkit();
Gunsmith.setBrushManager(this.brushManager);
this.brushManager.init();

setupPermissions();
CommandHandler.create();
CommandHandler.COMMAND_HANDLER.setRegistrar(new BukkitCommandRegistrar());
Gunsmith.finish();

}


private void setupPermissions()
{
Plugin vault = Bukkit.getPluginManager().getPlugin("Vault");
if (vault != null) {
Gunsmith.setPermissionProxy(new VaultPermissionProxy());
}
}

@Override
public void onDisable()
{
Expand All @@ -75,19 +90,15 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
}

@Override
public ISniperManager<Player> getSniperManager()
public SniperManagerBukkit getSniperManager()
{
return this.sniperManager;
}

@Override
public IBrushManager getBrushManager()
public BrushManagerBukkit getBrushManager()
{
return this.brushManager;
}

public ISniperManager<Player> getSniperHandler()
{
return this.sniperManager;
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 The Voxel Plugin Team
* Copyright (c) 2014 The Voxel Plugineering Team
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -23,7 +23,14 @@
*/
package com.voxelplugineering.voxelsniper.bukkit;

public class BukkitBlock
import com.voxelplugineering.voxelsniper.common.CommonBlock;
import com.voxelplugineering.voxelsniper.common.CommonLocation;

public class BukkitBlock extends CommonBlock
{

public BukkitBlock(CommonLocation location, BukkitMaterial material)
{
super(location, material);
}
}
Loading

0 comments on commit aa807d6

Please sign in to comment.