Directory restructure (maven recommended layout) for Unit-Tests
This commit is contained in:
parent
de57c93844
commit
dbce96a5ac
31 changed files with 13 additions and 31 deletions
13
pom.xml
13
pom.xml
|
@ -98,11 +98,12 @@
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<sourceDirectory>${basedir}/src</sourceDirectory>
|
<sourceDirectory>${basedir}/src/main/java</sourceDirectory>
|
||||||
<finalName>${project.artifactId}</finalName>
|
<finalName>${project.artifactId}</finalName>
|
||||||
|
|
||||||
|
<!--
|
||||||
<resources>
|
<resources>
|
||||||
<!-- <resource>
|
<!- - <resource>
|
||||||
<targetPath>.</targetPath>
|
<targetPath>.</targetPath>
|
||||||
<filtering>true</filtering>
|
<filtering>true</filtering>
|
||||||
<directory>${basedir}/</directory>
|
<directory>${basedir}/</directory>
|
||||||
|
@ -111,20 +112,20 @@
|
||||||
<include>config.yml</include>
|
<include>config.yml</include>
|
||||||
<include>META-INF/descriptions.jos</include>
|
<include>META-INF/descriptions.jos</include>
|
||||||
</includes>
|
</includes>
|
||||||
</resource>-->
|
</resource>- ->
|
||||||
<resource>
|
<resource>
|
||||||
<targetPath>lang/</targetPath>
|
<targetPath>lang/</targetPath>
|
||||||
<directory>${basedir}/lang/</directory>
|
<directory>${basedir}/lang/</directory>
|
||||||
</resource>
|
</resource>
|
||||||
<!-- <resource>
|
<!- - <resource>
|
||||||
<targetPath>META-INF/</targetPath>
|
<targetPath>META-INF/</targetPath>
|
||||||
<filtering>true</filtering>
|
<filtering>true</filtering>
|
||||||
<directory>${project.build.directory}/generated-sources/annotations/META-INF/</directory>
|
<directory>${project.build.directory}/generated-sources/annotations/META-INF/</directory>
|
||||||
<includes>
|
<includes>
|
||||||
<include>descriptions.jos</include>
|
<include>descriptions.jos</include>
|
||||||
</includes>
|
</includes>
|
||||||
</resource> -->
|
</resource> - ->
|
||||||
</resources>
|
</resources> -->
|
||||||
|
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package de.jaschastarke.minecraft.limitedcreative;
|
package de.jaschastarke.minecraft.limitedcreative;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
@ -49,9 +50,9 @@ public class FeatureSwitchGameMode extends CoreModule<LimitedCreative> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Commands extends AbstractCommandList implements IMethodCommandContainer, IHasName {
|
public class Commands extends AbstractCommandList implements IMethodCommandContainer, IHasName {
|
||||||
private List<ICommand> commands = MethodCommand.getMethodCommandsFor(this);
|
private MethodCommand[] commands = MethodCommand.getMethodCommandsFor(this);
|
||||||
public List<ICommand> getCommandList() {
|
public List<ICommand> getCommandList() {
|
||||||
return commands;
|
return Arrays.asList((ICommand[]) commands);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
|
@ -34,10 +34,6 @@ public class LimitedCreative extends Core {
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public String L(String msg, Object... objects) {
|
|
||||||
return getLang().trans(msg, objects);
|
|
||||||
}
|
|
||||||
public i18n getLocale() {
|
public i18n getLocale() {
|
||||||
return getLang();
|
return getLang();
|
||||||
}
|
}
|
|
@ -3,7 +3,6 @@ package de.jaschastarke.minecraft.limitedcreative.inventories;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.material.MaterialData;
|
import org.bukkit.material.MaterialData;
|
||||||
|
@ -16,7 +15,6 @@ import de.jaschastarke.bukkit.lib.items.Utils;
|
||||||
import de.jaschastarke.configuration.IConfigurationSubGroup;
|
import de.jaschastarke.configuration.IConfigurationSubGroup;
|
||||||
import de.jaschastarke.configuration.annotations.IsConfigurationNode;
|
import de.jaschastarke.configuration.annotations.IsConfigurationNode;
|
||||||
import de.jaschastarke.maven.ArchiveDocComments;
|
import de.jaschastarke.maven.ArchiveDocComments;
|
||||||
import de.jaschastarke.minecraft.limitedcreative.LimitedCreative;
|
|
||||||
import de.jaschastarke.minecraft.limitedcreative.ModInventories;
|
import de.jaschastarke.minecraft.limitedcreative.ModInventories;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -78,7 +76,7 @@ public class ArmoryConfig extends Configuration implements IConfigurationSubGrou
|
||||||
}
|
}
|
||||||
|
|
||||||
if (md != null)
|
if (md != null)
|
||||||
armor.put(entry.getKey(), md.toItemStack());
|
armor.put(entry.getKey(), md.toItemStack(1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -111,12 +109,10 @@ public class ArmoryConfig extends Configuration implements IConfigurationSubGrou
|
||||||
return config.get("feet", "CHAINMAIL_BOOTS");
|
return config.get("feet", "CHAINMAIL_BOOTS");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public String L(String msg, Object... objects) {
|
public String L(String msg, Object... objects) {
|
||||||
return ((LimitedCreative) Bukkit.getPluginManager().getPlugin("LimitedCreative")).getLocale().trans(msg, objects);
|
return mod.getPlugin().getLocale().trans(msg, objects);
|
||||||
}
|
}
|
||||||
@Deprecated
|
|
||||||
public ModuleLogger getLog() {
|
public ModuleLogger getLog() {
|
||||||
return ((LimitedCreative) Bukkit.getPluginManager().getPlugin("LimitedCreative")).getModule(ModInventories.class).getLog();
|
return mod.getLog();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -18,11 +18,9 @@
|
||||||
package de.jaschastarke.minecraft.limitedcreative.inventories;
|
package de.jaschastarke.minecraft.limitedcreative.inventories;
|
||||||
|
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.event.Event;
|
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.player.PlayerGameModeChangeEvent;
|
import org.bukkit.event.player.PlayerGameModeChangeEvent;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
|
||||||
import org.bukkit.event.player.PlayerRespawnEvent;
|
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||||
|
|
||||||
import de.jaschastarke.minecraft.limitedcreative.Hooks;
|
import de.jaschastarke.minecraft.limitedcreative.Hooks;
|
||||||
|
@ -34,16 +32,6 @@ public class PlayerListener implements Listener {
|
||||||
this.mod = mod;
|
this.mod = mod;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The isCancelled in PlayerInteractEvent doesn't check useItemInHand, even this decides (when clicking on
|
|
||||||
* entity with e.g. a bucket)
|
|
||||||
* @param event
|
|
||||||
* @return The relevant "isCancelled"
|
|
||||||
*/
|
|
||||||
public static boolean isCancelled(PlayerInteractEvent event) {
|
|
||||||
return event.useInteractedBlock() == Event.Result.DENY && event.useItemInHand() == Event.Result.DENY;
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerGameModeChange(PlayerGameModeChangeEvent event) {
|
public void onPlayerGameModeChange(PlayerGameModeChangeEvent event) {
|
||||||
boolean isLoggedIn = Hooks.IsLoggedIn.test(event.getPlayer());
|
boolean isLoggedIn = Hooks.IsLoggedIn.test(event.getPlayer());
|
Loading…
Reference in a new issue