mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-25 20:25:19 +01:00
Add /npc boat, misc cleanup
This commit is contained in:
parent
26706f658d
commit
f2241cf104
33
main/pom.xml
33
main/pom.xml
@ -1,5 +1,7 @@
|
|||||||
<!-- Citizens build file -->
|
<!-- Citizens build file -->
|
||||||
<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">
|
<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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>net.citizensnpcs</groupId>
|
<groupId>net.citizensnpcs</groupId>
|
||||||
@ -13,7 +15,6 @@
|
|||||||
<placeholderapi.version>2.11.5</placeholderapi.version>
|
<placeholderapi.version>2.11.5</placeholderapi.version>
|
||||||
<citizensapi.version>${project.version}</citizensapi.version>
|
<citizensapi.version>${project.version}</citizensapi.version>
|
||||||
<worldguard.version>7.1.0-SNAPSHOT</worldguard.version>
|
<worldguard.version>7.1.0-SNAPSHOT</worldguard.version>
|
||||||
<powermock.version>1.4.12</powermock.version>
|
|
||||||
</properties>
|
</properties>
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
@ -29,7 +30,8 @@
|
|||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>placeholderapi</id>
|
<id>placeholderapi</id>
|
||||||
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
|
<url>
|
||||||
|
https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>sk89q-repo</id>
|
<id>sk89q-repo</id>
|
||||||
@ -52,18 +54,6 @@
|
|||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.powermock</groupId>
|
|
||||||
<artifactId>powermock-module-junit4</artifactId>
|
|
||||||
<version>${powermock.version}</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.powermock</groupId>
|
|
||||||
<artifactId>powermock-api-mockito</artifactId>
|
|
||||||
<version>${powermock.version}</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.sf.trove4j</groupId>
|
<groupId>net.sf.trove4j</groupId>
|
||||||
<artifactId>trove4j</artifactId>
|
<artifactId>trove4j</artifactId>
|
||||||
@ -121,7 +111,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.kyori</groupId>
|
<groupId>net.kyori</groupId>
|
||||||
<artifactId>adventure-text-minimessage</artifactId>
|
<artifactId>adventure-text-minimessage</artifactId>
|
||||||
<version>4.15.0</version>
|
<version>4.16.0</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -143,22 +133,15 @@
|
|||||||
</scm>
|
</scm>
|
||||||
<build>
|
<build>
|
||||||
<defaultGoal>clean package install javadoc:javadoc</defaultGoal>
|
<defaultGoal>clean package install javadoc:javadoc</defaultGoal>
|
||||||
<sourceDirectory>${basedir}/src/main/java</sourceDirectory>
|
<sourceDirectory>src/main/java</sourceDirectory>
|
||||||
<resources>
|
<resources>
|
||||||
<resource>
|
<resource>
|
||||||
<targetPath>.</targetPath>
|
<targetPath>.</targetPath>
|
||||||
<filtering>true</filtering>
|
<filtering>true</filtering>
|
||||||
<directory>${basedir}/src/main/resources</directory>
|
<directory>src/main/resources</directory>
|
||||||
<includes>
|
<includes>
|
||||||
<include>plugin.yml</include>
|
<include>plugin.yml</include>
|
||||||
<include>*.json</include>
|
<include>*.json</include>
|
||||||
</includes>
|
|
||||||
</resource>
|
|
||||||
<resource>
|
|
||||||
<targetPath>.</targetPath>
|
|
||||||
<filtering>true</filtering>
|
|
||||||
<directory>..</directory>
|
|
||||||
<includes>
|
|
||||||
<include>LICENSE</include>
|
<include>LICENSE</include>
|
||||||
</includes>
|
</includes>
|
||||||
</resource>
|
</resource>
|
||||||
|
@ -293,10 +293,10 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
|
|||||||
lib.loadLibrary(Library.builder().groupId("net{}sf{}trove4j").artifactId("trove4j").version("3.0.3")
|
lib.loadLibrary(Library.builder().groupId("net{}sf{}trove4j").artifactId("trove4j").version("3.0.3")
|
||||||
.relocate("gnu{}trove", "clib{}trove").build());
|
.relocate("gnu{}trove", "clib{}trove").build());
|
||||||
lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-text-minimessage")
|
lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-text-minimessage")
|
||||||
.version("4.15.0").relocate("net{}kyori", "clib{}net{}kyori").build());
|
.version("4.16.0").relocate("net{}kyori", "clib{}net{}kyori").build());
|
||||||
lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-api").version("4.15.0")
|
lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-api").version("4.16.0")
|
||||||
.relocate("net{}kyori", "clib{}net{}kyori").build());
|
.relocate("net{}kyori", "clib{}net{}kyori").build());
|
||||||
lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-key").version("4.15.0")
|
lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-key").version("4.16.0")
|
||||||
.relocate("net{}kyori", "clib{}net{}kyori").build());
|
.relocate("net{}kyori", "clib{}net{}kyori").build());
|
||||||
lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("examination-api").version("1.3.0")
|
lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("examination-api").version("1.3.0")
|
||||||
.relocate("net{}kyori", "clib{}net{}kyori").build());
|
.relocate("net{}kyori", "clib{}net{}kyori").build());
|
||||||
|
@ -474,7 +474,7 @@ public class EventListen implements Listener {
|
|||||||
if (npc.data().has(NPC.Metadata.HOLOGRAM_RENDERER)) {
|
if (npc.data().has(NPC.Metadata.HOLOGRAM_RENDERER)) {
|
||||||
HologramRenderer hr = npc.data().get(NPC.Metadata.HOLOGRAM_RENDERER);
|
HologramRenderer hr = npc.data().get(NPC.Metadata.HOLOGRAM_RENDERER);
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(),
|
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(),
|
||||||
() -> hr.onSeenByPlayer(event.getPlayer()), 2);
|
() -> hr.onSeenByPlayer(npc, event.getPlayer()), 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package net.citizensnpcs;
|
package net.citizensnpcs;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
|
||||||
|
|
||||||
import net.citizensnpcs.Settings.Setting;
|
import net.citizensnpcs.Settings.Setting;
|
||||||
import net.citizensnpcs.api.event.PlayerCreateNPCEvent;
|
import net.citizensnpcs.api.event.PlayerCreateNPCEvent;
|
||||||
import net.citizensnpcs.api.util.Messaging;
|
import net.citizensnpcs.api.util.Messaging;
|
||||||
@ -16,7 +16,7 @@ public class PaymentListener implements Listener {
|
|||||||
private final Economy provider;
|
private final Economy provider;
|
||||||
|
|
||||||
public PaymentListener(Economy provider) {
|
public PaymentListener(Economy provider) {
|
||||||
Preconditions.checkNotNull(provider, "provider cannot be null");
|
Objects.requireNonNull(provider, "provider cannot be null");
|
||||||
this.provider = provider;
|
this.provider = provider;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@ import org.bukkit.command.CommandSender;
|
|||||||
import org.bukkit.command.ConsoleCommandSender;
|
import org.bukkit.command.ConsoleCommandSender;
|
||||||
import org.bukkit.entity.Ageable;
|
import org.bukkit.entity.Ageable;
|
||||||
import org.bukkit.entity.ArmorStand;
|
import org.bukkit.entity.ArmorStand;
|
||||||
|
import org.bukkit.entity.Boat;
|
||||||
import org.bukkit.entity.Damageable;
|
import org.bukkit.entity.Damageable;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
@ -64,7 +65,7 @@ import net.citizensnpcs.api.CitizensAPI;
|
|||||||
import net.citizensnpcs.api.ai.speech.SpeechContext;
|
import net.citizensnpcs.api.ai.speech.SpeechContext;
|
||||||
import net.citizensnpcs.api.ai.tree.StatusMapper;
|
import net.citizensnpcs.api.ai.tree.StatusMapper;
|
||||||
import net.citizensnpcs.api.command.Arg;
|
import net.citizensnpcs.api.command.Arg;
|
||||||
import net.citizensnpcs.api.command.Arg.CompletionsProvider;
|
import net.citizensnpcs.api.command.Arg.CompletionsProvider.OptionalEnumCompletions;
|
||||||
import net.citizensnpcs.api.command.Command;
|
import net.citizensnpcs.api.command.Command;
|
||||||
import net.citizensnpcs.api.command.CommandContext;
|
import net.citizensnpcs.api.command.CommandContext;
|
||||||
import net.citizensnpcs.api.command.CommandMessages;
|
import net.citizensnpcs.api.command.CommandMessages;
|
||||||
@ -115,6 +116,7 @@ import net.citizensnpcs.trait.Age;
|
|||||||
import net.citizensnpcs.trait.Anchors;
|
import net.citizensnpcs.trait.Anchors;
|
||||||
import net.citizensnpcs.trait.ArmorStandTrait;
|
import net.citizensnpcs.trait.ArmorStandTrait;
|
||||||
import net.citizensnpcs.trait.AttributeTrait;
|
import net.citizensnpcs.trait.AttributeTrait;
|
||||||
|
import net.citizensnpcs.trait.BoatTrait;
|
||||||
import net.citizensnpcs.trait.BoundingBoxTrait;
|
import net.citizensnpcs.trait.BoundingBoxTrait;
|
||||||
import net.citizensnpcs.trait.ClickRedirectTrait;
|
import net.citizensnpcs.trait.ClickRedirectTrait;
|
||||||
import net.citizensnpcs.trait.CommandTrait;
|
import net.citizensnpcs.trait.CommandTrait;
|
||||||
@ -420,6 +422,26 @@ public class NPCCommands {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Command(
|
||||||
|
aliases = { "npc" },
|
||||||
|
usage = "boat --type [type]",
|
||||||
|
desc = "",
|
||||||
|
modifiers = { "boat" },
|
||||||
|
min = 1,
|
||||||
|
max = 1,
|
||||||
|
permission = "citizens.npc.boat")
|
||||||
|
public void boat(CommandContext args, CommandSender sender, NPC npc,
|
||||||
|
@Flag(value = "type", completionsProvider = OptionalBoatTypeCompletions.class) String stype)
|
||||||
|
throws CommandException {
|
||||||
|
if (stype != null) {
|
||||||
|
Boat.Type type = Boat.Type.valueOf(stype);
|
||||||
|
npc.getOrAddTrait(BoatTrait.class).setType(type);
|
||||||
|
Messaging.sendTr(sender, Messages.BOAT_TYPE_SET, type);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
throw new CommandUsageException();
|
||||||
|
}
|
||||||
|
|
||||||
@Command(
|
@Command(
|
||||||
aliases = { "npc" },
|
aliases = { "npc" },
|
||||||
usage = "breakblock --location [x,y,z] --radius [radius]",
|
usage = "breakblock --location [x,y,z] --radius [radius]",
|
||||||
@ -3514,7 +3536,7 @@ public class NPCCommands {
|
|||||||
|
|
||||||
@Command(
|
@Command(
|
||||||
aliases = { "npc" },
|
aliases = { "npc" },
|
||||||
usage = "wolf (-s(itting) a(ngry) t(amed) i(nfo)) --collar [hex rgb color|name] --variant [variant]",
|
usage = "wolf (-s(itting) a(ngry) t(amed) i(nterested)) --collar [hex rgb color|name] --variant [variant]",
|
||||||
desc = "",
|
desc = "",
|
||||||
modifiers = { "wolf" },
|
modifiers = { "wolf" },
|
||||||
min = 1,
|
min = 1,
|
||||||
@ -3539,6 +3561,9 @@ public class NPCCommands {
|
|||||||
if (args.hasFlag('t')) {
|
if (args.hasFlag('t')) {
|
||||||
trait.setTamed(!trait.isTamed());
|
trait.setTamed(!trait.isTamed());
|
||||||
}
|
}
|
||||||
|
if (args.hasFlag('i')) {
|
||||||
|
trait.setInterested(!trait.isInterested());
|
||||||
|
}
|
||||||
if (variant != null) {
|
if (variant != null) {
|
||||||
variant = variant.toUpperCase();
|
variant = variant.toUpperCase();
|
||||||
try {
|
try {
|
||||||
@ -3569,21 +3594,17 @@ public class NPCCommands {
|
|||||||
trait.isTamed(), trait.getCollarColor().name());
|
trait.isTamed(), trait.getCollarColor().name());
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
public static class OptionalAttributeCompletions extends OptionalEnumCompletions {
|
||||||
public static class OptionalAttributeCompletions implements CompletionsProvider {
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<String> getCompletions(CommandContext args, CommandSender sender, NPC npc) {
|
public String getEnumClassName() {
|
||||||
if (CLAZZ == null)
|
return "org.bukkit.attribute.Attribute";
|
||||||
return Collections.emptyList();
|
}
|
||||||
return Lists.transform(Arrays.asList(CLAZZ.getEnumConstants()), Enum::name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Class<? extends Enum<?>> CLAZZ;
|
public static class OptionalBoatTypeCompletions extends OptionalEnumCompletions {
|
||||||
static {
|
@Override
|
||||||
try {
|
public String getEnumClassName() {
|
||||||
CLAZZ = (Class<? extends Enum<?>>) Class.forName("org.bukkit.attribute.Attribute");
|
return "org.bukkit.entity.Boat.Type";
|
||||||
} catch (ClassNotFoundException e) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package net.citizensnpcs.npc;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
@ -17,7 +18,6 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
|||||||
import org.bukkit.metadata.FixedMetadataValue;
|
import org.bukkit.metadata.FixedMetadataValue;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
|
||||||
import com.google.common.base.Throwables;
|
import com.google.common.base.Throwables;
|
||||||
import com.google.common.collect.HashMultimap;
|
import com.google.common.collect.HashMultimap;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
@ -233,7 +233,7 @@ public class CitizensNPC extends AbstractNPC {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setEntityController(EntityController newController) {
|
public void setEntityController(EntityController newController) {
|
||||||
Preconditions.checkNotNull(newController);
|
Objects.requireNonNull(newController);
|
||||||
boolean wasSpawned = entityController == null ? false : isSpawned();
|
boolean wasSpawned = entityController == null ? false : isSpawned();
|
||||||
Location prev = null;
|
Location prev = null;
|
||||||
if (wasSpawned) {
|
if (wasSpawned) {
|
||||||
@ -293,8 +293,8 @@ public class CitizensNPC extends AbstractNPC {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean spawn(Location at, SpawnReason reason) {
|
public boolean spawn(Location at, SpawnReason reason) {
|
||||||
Preconditions.checkNotNull(at, "location cannot be null");
|
Objects.requireNonNull(at, "location cannot be null");
|
||||||
Preconditions.checkNotNull(reason, "reason cannot be null");
|
Objects.requireNonNull(reason, "reason cannot be null");
|
||||||
if (getEntity() != null) {
|
if (getEntity() != null) {
|
||||||
Messaging.debug("Tried to spawn", this, "while already spawned. SpawnReason." + reason);
|
Messaging.debug("Tried to spawn", this, "while already spawned. SpawnReason." + reason);
|
||||||
return false;
|
return false;
|
||||||
|
@ -6,6 +6,7 @@ import java.util.Comparator;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -15,7 +16,6 @@ import org.bukkit.entity.EntityType;
|
|||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
import gnu.trove.map.hash.TIntObjectHashMap;
|
import gnu.trove.map.hash.TIntObjectHashMap;
|
||||||
@ -65,8 +65,8 @@ public class CitizensNPCRegistry implements NPCRegistry {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NPC createNPC(EntityType type, UUID uuid, int id, String name) {
|
public NPC createNPC(EntityType type, UUID uuid, int id, String name) {
|
||||||
Preconditions.checkNotNull(name, "name cannot be null");
|
Objects.requireNonNull(name, "name cannot be null");
|
||||||
Preconditions.checkNotNull(type, "type cannot be null");
|
Objects.requireNonNull(type, "type cannot be null");
|
||||||
CitizensNPC npc = new CitizensNPC(uuid, id, name, EntityControllers.createForType(type), this);
|
CitizensNPC npc = new CitizensNPC(uuid, id, name, EntityControllers.createForType(type), this);
|
||||||
npc.getOrAddTrait(MobType.class).setType(type);
|
npc.getOrAddTrait(MobType.class).setType(type);
|
||||||
npcs.put(id, npc);
|
npcs.put(id, npc);
|
||||||
|
@ -3,8 +3,8 @@ package net.citizensnpcs.npc;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
@ -23,6 +23,7 @@ import net.citizensnpcs.trait.Age;
|
|||||||
import net.citizensnpcs.trait.Anchors;
|
import net.citizensnpcs.trait.Anchors;
|
||||||
import net.citizensnpcs.trait.ArmorStandTrait;
|
import net.citizensnpcs.trait.ArmorStandTrait;
|
||||||
import net.citizensnpcs.trait.AttributeTrait;
|
import net.citizensnpcs.trait.AttributeTrait;
|
||||||
|
import net.citizensnpcs.trait.BoatTrait;
|
||||||
import net.citizensnpcs.trait.BoundingBoxTrait;
|
import net.citizensnpcs.trait.BoundingBoxTrait;
|
||||||
import net.citizensnpcs.trait.ClickRedirectTrait;
|
import net.citizensnpcs.trait.ClickRedirectTrait;
|
||||||
import net.citizensnpcs.trait.CommandTrait;
|
import net.citizensnpcs.trait.CommandTrait;
|
||||||
@ -77,6 +78,7 @@ public class CitizensTraitFactory implements TraitFactory {
|
|||||||
registerTrait(TraitInfo.create(ArmorStandTrait.class));
|
registerTrait(TraitInfo.create(ArmorStandTrait.class));
|
||||||
registerTrait(TraitInfo.create(AttributeTrait.class));
|
registerTrait(TraitInfo.create(AttributeTrait.class));
|
||||||
registerTrait(TraitInfo.create(Anchors.class));
|
registerTrait(TraitInfo.create(Anchors.class));
|
||||||
|
registerTrait(TraitInfo.create(BoatTrait.class));
|
||||||
registerTrait(TraitInfo.create(BoundingBoxTrait.class));
|
registerTrait(TraitInfo.create(BoundingBoxTrait.class));
|
||||||
registerTrait(TraitInfo.create(ClickRedirectTrait.class));
|
registerTrait(TraitInfo.create(ClickRedirectTrait.class));
|
||||||
registerTrait(TraitInfo.create(CommandTrait.class).optInToStats());
|
registerTrait(TraitInfo.create(CommandTrait.class).optInToStats());
|
||||||
@ -151,7 +153,7 @@ public class CitizensTraitFactory implements TraitFactory {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deregisterTrait(TraitInfo info) {
|
public void deregisterTrait(TraitInfo info) {
|
||||||
Preconditions.checkNotNull(info, "info cannot be null");
|
Objects.requireNonNull(info, "info cannot be null");
|
||||||
registered.remove(info.getTraitName());
|
registered.remove(info.getTraitName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,7 +188,7 @@ public class CitizensTraitFactory implements TraitFactory {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerTrait(TraitInfo info) {
|
public void registerTrait(TraitInfo info) {
|
||||||
Preconditions.checkNotNull(info, "info cannot be null");
|
Objects.requireNonNull(info, "info cannot be null");
|
||||||
info.checkValid();
|
info.checkValid();
|
||||||
if (registered.containsKey(info.getTraitName()))
|
if (registered.containsKey(info.getTraitName()))
|
||||||
throw new IllegalArgumentException("Trait name " + info.getTraitName() + " already registered");
|
throw new IllegalArgumentException("Trait name " + info.getTraitName() + " already registered");
|
||||||
|
@ -7,12 +7,12 @@ import java.util.Deque;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
|
||||||
import com.google.common.base.Throwables;
|
import com.google.common.base.Throwables;
|
||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
import com.mojang.authlib.ProfileLookupCallback;
|
import com.mojang.authlib.ProfileLookupCallback;
|
||||||
@ -49,7 +49,7 @@ class ProfileFetchThread implements Runnable {
|
|||||||
* @see ProfileFetcher#fetch
|
* @see ProfileFetcher#fetch
|
||||||
*/
|
*/
|
||||||
void fetch(String name, @Nullable ProfileFetchHandler handler) {
|
void fetch(String name, @Nullable ProfileFetchHandler handler) {
|
||||||
Preconditions.checkNotNull(name);
|
Objects.requireNonNull(name);
|
||||||
|
|
||||||
name = name.toLowerCase();
|
name = name.toLowerCase();
|
||||||
ProfileRequest request;
|
ProfileRequest request;
|
||||||
@ -76,7 +76,7 @@ class ProfileFetchThread implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void fetchForced(String name, ProfileFetchHandler handler) {
|
public void fetchForced(String name, ProfileFetchHandler handler) {
|
||||||
Preconditions.checkNotNull(name);
|
Objects.requireNonNull(name);
|
||||||
|
|
||||||
name = name.toLowerCase();
|
name = name.toLowerCase();
|
||||||
ProfileRequest request;
|
ProfileRequest request;
|
||||||
@ -116,7 +116,7 @@ class ProfileFetchThread implements Runnable {
|
|||||||
* The profile requests.
|
* The profile requests.
|
||||||
*/
|
*/
|
||||||
private void fetchRequests(Collection<ProfileRequest> requests) {
|
private void fetchRequests(Collection<ProfileRequest> requests) {
|
||||||
Preconditions.checkNotNull(requests);
|
Objects.requireNonNull(requests);
|
||||||
|
|
||||||
String[] playerNames = new String[requests.size()];
|
String[] playerNames = new String[requests.size()];
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
package net.citizensnpcs.npc.profile;
|
package net.citizensnpcs.npc.profile;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.scheduler.BukkitTask;
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
|
||||||
|
|
||||||
import net.citizensnpcs.api.CitizensAPI;
|
import net.citizensnpcs.api.CitizensAPI;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -27,7 +27,7 @@ public class ProfileFetcher {
|
|||||||
* Optional handler to handle the result. Handler always invoked from the main thread.
|
* Optional handler to handle the result. Handler always invoked from the main thread.
|
||||||
*/
|
*/
|
||||||
public static void fetch(String name, @Nullable ProfileFetchHandler handler) {
|
public static void fetch(String name, @Nullable ProfileFetchHandler handler) {
|
||||||
Preconditions.checkNotNull(name);
|
Objects.requireNonNull(name);
|
||||||
|
|
||||||
if (PROFILE_THREAD == null) {
|
if (PROFILE_THREAD == null) {
|
||||||
initThread();
|
initThread();
|
||||||
@ -36,7 +36,7 @@ public class ProfileFetcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void fetchForced(String name, ProfileFetchHandler handler) {
|
public static void fetchForced(String name, ProfileFetchHandler handler) {
|
||||||
Preconditions.checkNotNull(name);
|
Objects.requireNonNull(name);
|
||||||
|
|
||||||
if (PROFILE_THREAD == null) {
|
if (PROFILE_THREAD == null) {
|
||||||
initThread();
|
initThread();
|
||||||
|
@ -2,12 +2,12 @@ package net.citizensnpcs.npc.profile;
|
|||||||
|
|
||||||
import java.util.ArrayDeque;
|
import java.util.ArrayDeque;
|
||||||
import java.util.Deque;
|
import java.util.Deque;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
|
||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
|
|
||||||
import net.citizensnpcs.api.CitizensAPI;
|
import net.citizensnpcs.api.CitizensAPI;
|
||||||
@ -35,7 +35,7 @@ public class ProfileRequest {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public ProfileRequest(String playerName, ProfileFetchHandler handler) {
|
public ProfileRequest(String playerName, ProfileFetchHandler handler) {
|
||||||
Preconditions.checkNotNull(playerName);
|
Objects.requireNonNull(playerName);
|
||||||
|
|
||||||
this.playerName = playerName;
|
this.playerName = playerName;
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ public class ProfileRequest {
|
|||||||
* The result handler.
|
* The result handler.
|
||||||
*/
|
*/
|
||||||
public void addHandler(ProfileFetchHandler handler) {
|
public void addHandler(ProfileFetchHandler handler) {
|
||||||
Preconditions.checkNotNull(handler);
|
Objects.requireNonNull(handler);
|
||||||
|
|
||||||
if (result != ProfileFetchResult.PENDING) {
|
if (result != ProfileFetchResult.PENDING) {
|
||||||
handler.onResult(this);
|
handler.onResult(this);
|
||||||
|
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.WeakHashMap;
|
import java.util.WeakHashMap;
|
||||||
|
|
||||||
@ -13,7 +14,6 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.scheduler.BukkitTask;
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
|
||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
|
|
||||||
import net.citizensnpcs.Settings.Setting;
|
import net.citizensnpcs.Settings.Setting;
|
||||||
@ -73,7 +73,7 @@ public class Skin {
|
|||||||
* @return True if skin was applied, false if the data is being retrieved.
|
* @return True if skin was applied, false if the data is being retrieved.
|
||||||
*/
|
*/
|
||||||
public boolean apply(SkinnableEntity entity) {
|
public boolean apply(SkinnableEntity entity) {
|
||||||
Preconditions.checkNotNull(entity);
|
Objects.requireNonNull(entity);
|
||||||
|
|
||||||
NPC npc = entity.getNPC();
|
NPC npc = entity.getNPC();
|
||||||
SkinTrait skinTrait = npc.getOrAddTrait(SkinTrait.class);
|
SkinTrait skinTrait = npc.getOrAddTrait(SkinTrait.class);
|
||||||
@ -121,7 +121,7 @@ public class Skin {
|
|||||||
* The skinnable entity.
|
* The skinnable entity.
|
||||||
*/
|
*/
|
||||||
public void applyAndRespawn(SkinnableEntity entity) {
|
public void applyAndRespawn(SkinnableEntity entity) {
|
||||||
Preconditions.checkNotNull(entity);
|
Objects.requireNonNull(entity);
|
||||||
|
|
||||||
if (!apply(entity))
|
if (!apply(entity))
|
||||||
return;
|
return;
|
||||||
@ -319,7 +319,7 @@ public class Skin {
|
|||||||
* if the skin should be checked via the cache
|
* if the skin should be checked via the cache
|
||||||
*/
|
*/
|
||||||
public static Skin get(SkinnableEntity entity, boolean forceUpdate) {
|
public static Skin get(SkinnableEntity entity, boolean forceUpdate) {
|
||||||
Preconditions.checkNotNull(entity);
|
Objects.requireNonNull(entity);
|
||||||
|
|
||||||
String skinName = entity.getSkinName().toLowerCase();
|
String skinName = entity.getSkinName().toLowerCase();
|
||||||
return get(skinName, forceUpdate);
|
return get(skinName, forceUpdate);
|
||||||
@ -336,7 +336,7 @@ public class Skin {
|
|||||||
* The name of the skin.
|
* The name of the skin.
|
||||||
*/
|
*/
|
||||||
public static Skin get(String skinName, boolean forceUpdate) {
|
public static Skin get(String skinName, boolean forceUpdate) {
|
||||||
Preconditions.checkNotNull(skinName);
|
Objects.requireNonNull(skinName);
|
||||||
|
|
||||||
skinName = skinName.toLowerCase();
|
skinName = skinName.toLowerCase();
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ package net.citizensnpcs.npc.skin;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -13,8 +14,6 @@ import org.bukkit.event.player.PlayerQuitEvent;
|
|||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
import org.bukkit.scheduler.BukkitTask;
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
|
||||||
|
|
||||||
import net.citizensnpcs.Settings.Setting;
|
import net.citizensnpcs.Settings.Setting;
|
||||||
import net.citizensnpcs.api.CitizensAPI;
|
import net.citizensnpcs.api.CitizensAPI;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
@ -40,7 +39,7 @@ public class SkinPacketTracker {
|
|||||||
* The skinnable entity the instance belongs to.
|
* The skinnable entity the instance belongs to.
|
||||||
*/
|
*/
|
||||||
public SkinPacketTracker(SkinnableEntity entity) {
|
public SkinPacketTracker(SkinnableEntity entity) {
|
||||||
Preconditions.checkNotNull(entity);
|
Objects.requireNonNull(entity);
|
||||||
|
|
||||||
this.entity = entity;
|
this.entity = entity;
|
||||||
skin = Skin.get(entity);
|
skin = Skin.get(entity);
|
||||||
@ -171,7 +170,7 @@ public class SkinPacketTracker {
|
|||||||
* The player.
|
* The player.
|
||||||
*/
|
*/
|
||||||
public void updateViewer(Player player) {
|
public void updateViewer(Player player) {
|
||||||
Preconditions.checkNotNull(player);
|
Objects.requireNonNull(player);
|
||||||
|
|
||||||
if (isRemoved || player.hasMetadata("NPC"))
|
if (isRemoved || player.hasMetadata("NPC"))
|
||||||
return;
|
return;
|
||||||
|
@ -7,6 +7,7 @@ import java.util.HashMap;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Queue;
|
import java.util.Queue;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@ -20,7 +21,6 @@ import org.bukkit.entity.Entity;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
|
||||||
import com.google.common.base.Predicates;
|
import com.google.common.base.Predicates;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
@ -153,7 +153,7 @@ public class SkinUpdateTracker {
|
|||||||
* The despawned NPC.
|
* The despawned NPC.
|
||||||
*/
|
*/
|
||||||
public void onNPCDespawn(NPC npc) {
|
public void onNPCDespawn(NPC npc) {
|
||||||
Preconditions.checkNotNull(npc);
|
Objects.requireNonNull(npc);
|
||||||
playerTrackers.remove(npc.getUniqueId());
|
playerTrackers.remove(npc.getUniqueId());
|
||||||
SkinnableEntity skinnable = getSkinnable(npc);
|
SkinnableEntity skinnable = getSkinnable(npc);
|
||||||
if (skinnable == null)
|
if (skinnable == null)
|
||||||
@ -173,7 +173,7 @@ public class SkinUpdateTracker {
|
|||||||
* The navigating NPC.
|
* The navigating NPC.
|
||||||
*/
|
*/
|
||||||
public void onNPCNavigationBegin(NPC npc) {
|
public void onNPCNavigationBegin(NPC npc) {
|
||||||
Preconditions.checkNotNull(npc);
|
Objects.requireNonNull(npc);
|
||||||
SkinnableEntity skinnable = getSkinnable(npc);
|
SkinnableEntity skinnable = getSkinnable(npc);
|
||||||
if (skinnable == null)
|
if (skinnable == null)
|
||||||
return;
|
return;
|
||||||
@ -188,7 +188,7 @@ public class SkinUpdateTracker {
|
|||||||
* The finished NPC.
|
* The finished NPC.
|
||||||
*/
|
*/
|
||||||
public void onNPCNavigationComplete(NPC npc) {
|
public void onNPCNavigationComplete(NPC npc) {
|
||||||
Preconditions.checkNotNull(npc);
|
Objects.requireNonNull(npc);
|
||||||
SkinnableEntity skinnable = getSkinnable(npc);
|
SkinnableEntity skinnable = getSkinnable(npc);
|
||||||
if (skinnable == null)
|
if (skinnable == null)
|
||||||
return;
|
return;
|
||||||
@ -203,7 +203,7 @@ public class SkinUpdateTracker {
|
|||||||
* The spawned NPC.
|
* The spawned NPC.
|
||||||
*/
|
*/
|
||||||
public void onNPCSpawn(NPC npc) {
|
public void onNPCSpawn(NPC npc) {
|
||||||
Preconditions.checkNotNull(npc);
|
Objects.requireNonNull(npc);
|
||||||
SkinnableEntity skinnable = getSkinnable(npc);
|
SkinnableEntity skinnable = getSkinnable(npc);
|
||||||
if (skinnable == null)
|
if (skinnable == null)
|
||||||
return;
|
return;
|
||||||
@ -219,7 +219,7 @@ public class SkinUpdateTracker {
|
|||||||
* The player that moved.
|
* The player that moved.
|
||||||
*/
|
*/
|
||||||
public void onPlayerMove(Player player) {
|
public void onPlayerMove(Player player) {
|
||||||
Preconditions.checkNotNull(player);
|
Objects.requireNonNull(player);
|
||||||
PlayerTracker updateTracker = playerTrackers.get(player.getUniqueId());
|
PlayerTracker updateTracker = playerTrackers.get(player.getUniqueId());
|
||||||
if (updateTracker == null || !updateTracker.shouldUpdate(player))
|
if (updateTracker == null || !updateTracker.shouldUpdate(player))
|
||||||
return;
|
return;
|
||||||
@ -238,7 +238,7 @@ public class SkinUpdateTracker {
|
|||||||
* The ID of the player.
|
* The ID of the player.
|
||||||
*/
|
*/
|
||||||
public void removePlayer(UUID playerId) {
|
public void removePlayer(UUID playerId) {
|
||||||
Preconditions.checkNotNull(playerId);
|
Objects.requireNonNull(playerId);
|
||||||
playerTrackers.remove(playerId);
|
playerTrackers.remove(playerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,14 +6,13 @@ import java.util.HashSet;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
|
||||||
|
|
||||||
import net.citizensnpcs.api.CitizensAPI;
|
import net.citizensnpcs.api.CitizensAPI;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
|
|
||||||
@ -39,7 +38,7 @@ public class TabListRemover {
|
|||||||
* The player.
|
* The player.
|
||||||
*/
|
*/
|
||||||
public void cancelPackets(Player player) {
|
public void cancelPackets(Player player) {
|
||||||
Preconditions.checkNotNull(player);
|
Objects.requireNonNull(player);
|
||||||
|
|
||||||
PlayerEntry entry = pending.remove(player.getUniqueId());
|
PlayerEntry entry = pending.remove(player.getUniqueId());
|
||||||
if (entry == null)
|
if (entry == null)
|
||||||
@ -59,8 +58,8 @@ public class TabListRemover {
|
|||||||
* The skinnable entity.
|
* The skinnable entity.
|
||||||
*/
|
*/
|
||||||
public void cancelPackets(Player player, SkinnableEntity skinnable) {
|
public void cancelPackets(Player player, SkinnableEntity skinnable) {
|
||||||
Preconditions.checkNotNull(player);
|
Objects.requireNonNull(player);
|
||||||
Preconditions.checkNotNull(skinnable);
|
Objects.requireNonNull(skinnable);
|
||||||
|
|
||||||
PlayerEntry entry = pending.get(player.getUniqueId());
|
PlayerEntry entry = pending.get(player.getUniqueId());
|
||||||
if (entry == null)
|
if (entry == null)
|
||||||
@ -92,8 +91,8 @@ public class TabListRemover {
|
|||||||
* The entity to remove.
|
* The entity to remove.
|
||||||
*/
|
*/
|
||||||
public void sendPacket(Player player, SkinnableEntity entity) {
|
public void sendPacket(Player player, SkinnableEntity entity) {
|
||||||
Preconditions.checkNotNull(player);
|
Objects.requireNonNull(player);
|
||||||
Preconditions.checkNotNull(entity);
|
Objects.requireNonNull(entity);
|
||||||
|
|
||||||
PlayerEntry entry = getEntry(player);
|
PlayerEntry entry = getEntry(player);
|
||||||
|
|
||||||
|
35
main/src/main/java/net/citizensnpcs/trait/BoatTrait.java
Normal file
35
main/src/main/java/net/citizensnpcs/trait/BoatTrait.java
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
package net.citizensnpcs.trait;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Boat;
|
||||||
|
|
||||||
|
import net.citizensnpcs.api.persistence.Persist;
|
||||||
|
import net.citizensnpcs.api.trait.Trait;
|
||||||
|
import net.citizensnpcs.api.trait.TraitName;
|
||||||
|
|
||||||
|
@TraitName("boattrait")
|
||||||
|
public class BoatTrait extends Trait {
|
||||||
|
@Persist
|
||||||
|
private Boat.Type type;
|
||||||
|
|
||||||
|
public BoatTrait() {
|
||||||
|
super("boattrait");
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boat.Type getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSpawn() {
|
||||||
|
if (npc.getEntity() instanceof Boat) {
|
||||||
|
if (type != null) {
|
||||||
|
((Boat) npc.getEntity()).setBoatType(type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(Boat.Type type) {
|
||||||
|
this.type = type;
|
||||||
|
onSpawn();
|
||||||
|
}
|
||||||
|
}
|
@ -51,7 +51,6 @@ import net.citizensnpcs.util.Util;
|
|||||||
* Manages a set of <em>holograms</em> attached to the NPC. Holograms are lines of text or items that follow the NPC at
|
* Manages a set of <em>holograms</em> attached to the NPC. Holograms are lines of text or items that follow the NPC at
|
||||||
* some offset (typically vertically offset).
|
* some offset (typically vertically offset).
|
||||||
*/
|
*/
|
||||||
// TODO: cleanup: make HologramRenderer static, possibly make it singleton-friendly?
|
|
||||||
@TraitName("hologramtrait")
|
@TraitName("hologramtrait")
|
||||||
public class HologramTrait extends Trait {
|
public class HologramTrait extends Trait {
|
||||||
private Location currentLoc;
|
private Location currentLoc;
|
||||||
@ -132,10 +131,6 @@ public class HologramTrait extends Trait {
|
|||||||
return new ArmorstandVehicleRenderer();
|
return new ArmorstandVehicleRenderer();
|
||||||
}
|
}
|
||||||
|
|
||||||
private double getEntityBbHeight() {
|
|
||||||
return NMS.getBoundingBoxHeight(npc.getEntity());
|
|
||||||
}
|
|
||||||
|
|
||||||
private double getHeight(int lineNumber) {
|
private double getHeight(int lineNumber) {
|
||||||
double base = lastNameplateVisible ? 0 : -getLineHeight();
|
double base = lastNameplateVisible ? 0 : -getLineHeight();
|
||||||
for (int i = 0; i <= lineNumber; i++) {
|
for (int i = 0; i <= lineNumber; i++) {
|
||||||
@ -261,7 +256,7 @@ public class HologramTrait extends Trait {
|
|||||||
boolean updatePosition = Setting.HOLOGRAM_ALWAYS_UPDATE_POSITION.asBoolean() || currentLoc == null
|
boolean updatePosition = Setting.HOLOGRAM_ALWAYS_UPDATE_POSITION.asBoolean() || currentLoc == null
|
||||||
|| currentLoc.getWorld() != npcLoc.getWorld() || currentLoc.distance(npcLoc) >= 0.001
|
|| currentLoc.getWorld() != npcLoc.getWorld() || currentLoc.distance(npcLoc) >= 0.001
|
||||||
|| lastNameplateVisible != nameplateVisible
|
|| lastNameplateVisible != nameplateVisible
|
||||||
|| Math.abs(lastEntityBbHeight - getEntityBbHeight()) >= 0.05;
|
|| Math.abs(lastEntityBbHeight - NMS.getBoundingBoxHeight(npc.getEntity())) >= 0.05;
|
||||||
boolean updateName = false;
|
boolean updateName = false;
|
||||||
|
|
||||||
if (t++ >= Setting.HOLOGRAM_UPDATE_RATE.asTicks() + Util.getFastRandom().nextInt(3) /* add some jitter */) {
|
if (t++ >= Setting.HOLOGRAM_UPDATE_RATE.asTicks() + Util.getFastRandom().nextInt(3) /* add some jitter */) {
|
||||||
@ -272,7 +267,7 @@ public class HologramTrait extends Trait {
|
|||||||
|
|
||||||
if (updatePosition) {
|
if (updatePosition) {
|
||||||
currentLoc = npcLoc.clone();
|
currentLoc = npcLoc.clone();
|
||||||
lastEntityBbHeight = getEntityBbHeight();
|
lastEntityBbHeight = NMS.getBoundingBoxHeight(npc.getEntity());
|
||||||
}
|
}
|
||||||
if (nameLine != null) {
|
if (nameLine != null) {
|
||||||
if (updatePosition || nameLine.renderer.getEntities().size() == 0) {
|
if (updatePosition || nameLine.renderer.getEntities().size() == 0) {
|
||||||
@ -378,9 +373,8 @@ public class HologramTrait extends Trait {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void render0(NPC npc, Vector3d offset) {
|
protected void render0(NPC npc, Vector3d offset) {
|
||||||
hologram.getEntity().teleport(
|
hologram.getEntity().teleport(npc.getStoredLocation().clone().add(offset.x,
|
||||||
npc.getStoredLocation().clone().add(offset.x, offset.y + getEntityBbHeight(), offset.z),
|
offset.y + NMS.getBoundingBoxHeight(npc.getEntity()), offset.z), TeleportCause.PLUGIN);
|
||||||
TeleportCause.PLUGIN);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -443,23 +437,81 @@ public class HologramTrait extends Trait {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API for rendering holograms. Assumptions are documented in Javadoc but the API is early and subject to change.
|
||||||
|
* Feedback is welcomed.
|
||||||
|
*/
|
||||||
public static interface HologramRenderer {
|
public static interface HologramRenderer {
|
||||||
|
/**
|
||||||
|
* Destroy/teardown any rendered holograms.
|
||||||
|
*/
|
||||||
void destroy();
|
void destroy();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Any associated hologram entities. Used in {@link #getEntities()}.
|
||||||
|
*/
|
||||||
Collection<Entity> getEntities();
|
Collection<Entity> getEntities();
|
||||||
|
|
||||||
String getPerPlayerText(NPC npc, Player viewer);
|
/**
|
||||||
|
* If {@NPC.Metadata.HOLOGRAM_RENDERER} is set on any entity and ProtocolLib is enabled, this method will be
|
||||||
|
* called to modify the name per-player. Note: this should be async-safe. This method is fragile and may be
|
||||||
|
* moved elsewhere.
|
||||||
|
*
|
||||||
|
* @param hologram
|
||||||
|
* the <em>hologram</em> NPC
|
||||||
|
* @param viewer
|
||||||
|
* the viewing Player
|
||||||
|
* @return the modified text per Player
|
||||||
|
*/
|
||||||
|
String getPerPlayerText(NPC hologram, Player viewer);
|
||||||
|
|
||||||
default boolean isSneaking(NPC npc, Player player) {
|
/**
|
||||||
|
* If {@NPC.Metadata.HOLOGRAM_RENDERER} is set on any entity and ProtocolLib is enabled, returns whether the NPC
|
||||||
|
* should be considered sneaking or not to the viewing player. Presently called only when player first sees the
|
||||||
|
* NPC (i.e. not proactively).Note: this should be async-safe. This method is fragile and may be moved
|
||||||
|
* elsewhere.
|
||||||
|
*
|
||||||
|
* @param hologram
|
||||||
|
* the <em>hologram</em> NPC
|
||||||
|
* @param player
|
||||||
|
* the viewing Player
|
||||||
|
* @return whether the NPC is sneaking
|
||||||
|
*/
|
||||||
|
default boolean isSneaking(NPC hologram, Player player) {
|
||||||
return NMS.isSneaking(player);
|
return NMS.isSneaking(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
default void onSeenByPlayer(Player player) {
|
/**
|
||||||
|
* If {@NPC.Metadata.HOLOGRAM_RENDERER} is set on any entity, called when it is seen for the first time by a
|
||||||
|
* Player.
|
||||||
|
*
|
||||||
|
* @param hologram
|
||||||
|
* the <em>hologram</em> NPC
|
||||||
|
* @param player
|
||||||
|
* the viewing Player
|
||||||
|
*/
|
||||||
|
default void onSeenByPlayer(NPC hologram, Player player) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void render(NPC npc, Vector3d offset);
|
/**
|
||||||
|
* Render the hologram at a given offset. Any underlying hologram NPCs should be spawned at this point.
|
||||||
|
*
|
||||||
|
* @param parent
|
||||||
|
* the <em>parent</em> NPC.
|
||||||
|
* @param offset
|
||||||
|
* the offset, in blocks
|
||||||
|
*/
|
||||||
|
void render(NPC parent, Vector3d offset);
|
||||||
|
|
||||||
void updateText(NPC npc, String text);
|
/**
|
||||||
|
* Update the hologram text. Will be called first before {@link #render(NPC, Vector3d)}.
|
||||||
|
*
|
||||||
|
* @param parent
|
||||||
|
* the <em>parent</em> NPC
|
||||||
|
* @param text
|
||||||
|
* the new hologram text
|
||||||
|
*/
|
||||||
|
void updateText(NPC parent, String text);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class InteractionVehicleRenderer extends SingleEntityHologramRenderer {
|
public class InteractionVehicleRenderer extends SingleEntityHologramRenderer {
|
||||||
@ -472,7 +524,7 @@ public class HologramTrait extends Trait {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSeenByPlayer(Player player) {
|
public void onSeenByPlayer(NPC npc, Player player) {
|
||||||
if (lastOffset == null)
|
if (lastOffset == null)
|
||||||
return;
|
return;
|
||||||
NMS.linkTextInteraction(player, hologram.getEntity(), npc.getEntity(), lastOffset.y);
|
NMS.linkTextInteraction(player, hologram.getEntity(), npc.getEntity(), lastOffset.y);
|
||||||
@ -565,9 +617,8 @@ public class HologramTrait extends Trait {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void render0(NPC npc, Vector3d offset) {
|
protected void render0(NPC npc, Vector3d offset) {
|
||||||
hologram.getEntity().teleport(
|
hologram.getEntity().teleport(npc.getStoredLocation().clone().add(offset.x,
|
||||||
npc.getStoredLocation().clone().add(offset.x, offset.y + getEntityBbHeight(), offset.z),
|
offset.y + NMS.getBoundingBoxHeight(npc.getEntity()), offset.z), TeleportCause.PLUGIN);
|
||||||
TeleportCause.PLUGIN);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -576,6 +627,10 @@ public class HologramTrait extends Trait {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A helper class that models a hologram as a single entity that represents a single line in game.
|
||||||
|
*/
|
||||||
|
// TODO: make static (requires: view range/registry modelling)
|
||||||
public abstract class SingleEntityHologramRenderer implements HologramRenderer {
|
public abstract class SingleEntityHologramRenderer implements HologramRenderer {
|
||||||
protected NPC hologram;
|
protected NPC hologram;
|
||||||
protected String text;
|
protected String text;
|
||||||
@ -609,6 +664,9 @@ public class HologramTrait extends Trait {
|
|||||||
render0(npc, offset);
|
render0(npc, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hologram spawning is delegated to {@link #createNPC(Entity, String, Vector3d)}
|
||||||
|
*/
|
||||||
protected abstract void render0(NPC npc, Vector3d offset);
|
protected abstract void render0(NPC npc, Vector3d offset);
|
||||||
|
|
||||||
protected void spawnHologram(NPC npc, Vector3d offset) {
|
protected void spawnHologram(NPC npc, Vector3d offset) {
|
||||||
@ -625,7 +683,8 @@ public class HologramTrait extends Trait {
|
|||||||
} else if (npc.data().has(NPC.Metadata.TRACKING_RANGE)) {
|
} else if (npc.data().has(NPC.Metadata.TRACKING_RANGE)) {
|
||||||
hologram.data().set(NPC.Metadata.TRACKING_RANGE, npc.data().get(NPC.Metadata.TRACKING_RANGE));
|
hologram.data().set(NPC.Metadata.TRACKING_RANGE, npc.data().get(NPC.Metadata.TRACKING_RANGE));
|
||||||
}
|
}
|
||||||
hologram.spawn(npc.getEntity().getLocation().add(offset.x, offset.y, offset.z));
|
hologram.spawn(npc.getEntity().getLocation().add(offset.x,
|
||||||
|
offset.y + NMS.getBoundingBoxHeight(npc.getEntity()), offset.z));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -674,9 +733,8 @@ public class HologramTrait extends Trait {
|
|||||||
if (color != null) {
|
if (color != null) {
|
||||||
disp.setBackgroundColor(color);
|
disp.setBackgroundColor(color);
|
||||||
}
|
}
|
||||||
hologram.getEntity().teleport(
|
hologram.getEntity().teleport(npc.getStoredLocation().clone().add(offset.x,
|
||||||
npc.getStoredLocation().clone().add(offset.x, offset.y + getEntityBbHeight(), offset.z),
|
offset.y + NMS.getBoundingBoxHeight(npc.getEntity()), offset.z), TeleportCause.PLUGIN);
|
||||||
TeleportCause.PLUGIN);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBackgroundColor(Color color) {
|
public void setBackgroundColor(Color color) {
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
package net.citizensnpcs.trait;
|
package net.citizensnpcs.trait;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
import com.google.common.base.Charsets;
|
import com.google.common.base.Charsets;
|
||||||
import com.google.common.base.Preconditions;
|
|
||||||
import com.google.common.io.BaseEncoding;
|
import com.google.common.io.BaseEncoding;
|
||||||
|
|
||||||
import net.citizensnpcs.Settings.Setting;
|
import net.citizensnpcs.Settings.Setting;
|
||||||
@ -139,7 +140,7 @@ public class SkinTrait extends Trait {
|
|||||||
* @see net.citizensnpcs.npc.skin.Skin#get(SkinnableEntity, boolean)
|
* @see net.citizensnpcs.npc.skin.Skin#get(SkinnableEntity, boolean)
|
||||||
*/
|
*/
|
||||||
public void setSkinName(String name, boolean forceUpdate) {
|
public void setSkinName(String name, boolean forceUpdate) {
|
||||||
Preconditions.checkNotNull(name);
|
Objects.requireNonNull(name);
|
||||||
setSkinNameInternal(name);
|
setSkinNameInternal(name);
|
||||||
onSkinChange(forceUpdate);
|
onSkinChange(forceUpdate);
|
||||||
}
|
}
|
||||||
@ -160,9 +161,9 @@ public class SkinTrait extends Trait {
|
|||||||
* {@link #getTexture()}
|
* {@link #getTexture()}
|
||||||
*/
|
*/
|
||||||
public void setSkinPersistent(String skinName, String signature, String data) {
|
public void setSkinPersistent(String skinName, String signature, String data) {
|
||||||
Preconditions.checkNotNull(skinName);
|
Objects.requireNonNull(skinName);
|
||||||
Preconditions.checkNotNull(signature);
|
Objects.requireNonNull(signature);
|
||||||
Preconditions.checkNotNull(data);
|
Objects.requireNonNull(data);
|
||||||
|
|
||||||
setSkinNameInternal(skinName);
|
setSkinNameInternal(skinName);
|
||||||
String json = new String(BaseEncoding.base64().decode(data), Charsets.UTF_8);
|
String json = new String(BaseEncoding.base64().decode(data), Charsets.UTF_8);
|
||||||
|
@ -24,6 +24,8 @@ public class WolfModifiers extends Trait {
|
|||||||
@Persist("collarColor")
|
@Persist("collarColor")
|
||||||
private DyeColor collarColor = DyeColor.RED;
|
private DyeColor collarColor = DyeColor.RED;
|
||||||
@Persist
|
@Persist
|
||||||
|
private boolean interested;
|
||||||
|
@Persist
|
||||||
private boolean sitting;
|
private boolean sitting;
|
||||||
@Persist
|
@Persist
|
||||||
private boolean tamed;
|
private boolean tamed;
|
||||||
@ -46,6 +48,10 @@ public class WolfModifiers extends Trait {
|
|||||||
return angry;
|
return angry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isInterested() {
|
||||||
|
return interested;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isSitting() {
|
public boolean isSitting() {
|
||||||
return sitting;
|
return sitting;
|
||||||
}
|
}
|
||||||
@ -69,6 +75,11 @@ public class WolfModifiers extends Trait {
|
|||||||
updateModifiers();
|
updateModifiers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setInterested(boolean interested) {
|
||||||
|
this.interested = interested;
|
||||||
|
updateModifiers();
|
||||||
|
}
|
||||||
|
|
||||||
public void setSitting(boolean sitting) {
|
public void setSitting(boolean sitting) {
|
||||||
this.sitting = sitting;
|
this.sitting = sitting;
|
||||||
updateModifiers();
|
updateModifiers();
|
||||||
@ -104,8 +115,19 @@ public class WolfModifiers extends Trait {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
wolf.setTamed(tamed);
|
wolf.setTamed(tamed);
|
||||||
|
if (SUPPORT_SET_INTERESTED) {
|
||||||
|
wolf.setInterested(interested);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean SUPPORT_SET_INTERESTED = true;
|
||||||
private static final Map<String, Object> VARIANT_CACHE = Maps.newHashMap();
|
private static final Map<String, Object> VARIANT_CACHE = Maps.newHashMap();
|
||||||
|
static {
|
||||||
|
try {
|
||||||
|
Wolf.class.getMethod("setInterested", boolean.class);
|
||||||
|
} catch (Throwable e) {
|
||||||
|
SUPPORT_SET_INTERESTED = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@ public class Messages {
|
|||||||
public static final String BEE_NO_NECTAR = "citizens.commands.npc.bee.no-nectar";
|
public static final String BEE_NO_NECTAR = "citizens.commands.npc.bee.no-nectar";
|
||||||
public static final String BEE_NOT_STUNG = "citizens.commands.npc.bee.not-stung";
|
public static final String BEE_NOT_STUNG = "citizens.commands.npc.bee.not-stung";
|
||||||
public static final String BEE_STUNG = "citizens.commands.npc.bee.bee-stung";
|
public static final String BEE_STUNG = "citizens.commands.npc.bee.bee-stung";
|
||||||
|
public static final String BOAT_TYPE_SET = "citizens.commands.npc.boat.type-set";
|
||||||
public static final String BOUNDING_BOX_SET = "citizens.commands.npc.hitbox.set";
|
public static final String BOUNDING_BOX_SET = "citizens.commands.npc.hitbox.set";
|
||||||
public static final String CAMEL_POSE_SET = "citizens.commands.npc.camel.pose-set";
|
public static final String CAMEL_POSE_SET = "citizens.commands.npc.camel.pose-set";
|
||||||
public static final String CANNOT_TELEPORT_ACROSS_WORLDS = "citizens.commands.npc.tphere.multiworld-not-allowed";
|
public static final String CANNOT_TELEPORT_ACROSS_WORLDS = "citizens.commands.npc.tphere.multiworld-not-allowed";
|
||||||
|
47
main/src/main/resources/LICENSE
Normal file
47
main/src/main/resources/LICENSE
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
Citizens is licensed under the Open Software License 3.0
|
||||||
|
|
||||||
|
This Open Software License (the “License”) applies to any original work of authorship (the “Original Work”) whose owner (the “Licensor”) has placed the following licensing notice adjacent to the copyright notice for the Original Work:
|
||||||
|
|
||||||
|
Licensed under the Open Software License version 3.0
|
||||||
|
|
||||||
|
1) Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:
|
||||||
|
|
||||||
|
a) to reproduce the Original Work in copies, either alone or as part of a collective work;
|
||||||
|
|
||||||
|
b) to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works (“Derivative Works”) based upon the Original Work;
|
||||||
|
|
||||||
|
c) to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License;
|
||||||
|
|
||||||
|
d) to perform the Original Work publicly; and
|
||||||
|
|
||||||
|
e) to display the Original Work publicly.
|
||||||
|
|
||||||
|
2) Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.
|
||||||
|
|
||||||
|
3) Grant of Source Code License. The term “Source Code” means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.
|
||||||
|
|
||||||
|
4) Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor’s trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.
|
||||||
|
|
||||||
|
5) External Deployment. The term “External Deployment” means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).
|
||||||
|
|
||||||
|
6) Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an “Attribution Notice.” You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
|
||||||
|
|
||||||
|
7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an “AS IS” BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.
|
||||||
|
|
||||||
|
8) Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.
|
||||||
|
|
||||||
|
9) Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including “fair use” or “fair dealing”). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).
|
||||||
|
|
||||||
|
10) Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.
|
||||||
|
|
||||||
|
11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.
|
||||||
|
|
||||||
|
12) Attorneys’ Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys’ fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
|
||||||
|
|
||||||
|
13) Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
|
||||||
|
|
||||||
|
14) Definition of “You” in This License. “You” throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, “You” includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, “control” means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
15) Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
|
||||||
|
|
||||||
|
16) Modification of This License. This License is Copyright © 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the “Modified License”) and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the “Open Software License” or “OSL” and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice “Licensed under <insert your license name here>” or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.
|
@ -57,6 +57,8 @@
|
|||||||
"citizens.commands.npc.axolotl.playing-dead" : "[[{0}]] now playing dead.",
|
"citizens.commands.npc.axolotl.playing-dead" : "[[{0}]] now playing dead.",
|
||||||
"citizens.commands.npc.axolotl.playing-dead-stopped" : "[[{0}]] no longer playing dead.",
|
"citizens.commands.npc.axolotl.playing-dead-stopped" : "[[{0}]] no longer playing dead.",
|
||||||
"citizens.commands.npc.axolotl.variant-set" : "Variant set to [[{0}]].",
|
"citizens.commands.npc.axolotl.variant-set" : "Variant set to [[{0}]].",
|
||||||
|
"citizens.commands.npc.boat.type-set": "Boat type set to [[{0}]].",
|
||||||
|
"citizens.commands.npc.boat.description": "Sets boat modifiers",
|
||||||
"citizens.commands.npc.bee.anger-set" : "Anger set to [[{0}]].",
|
"citizens.commands.npc.bee.anger-set" : "Anger set to [[{0}]].",
|
||||||
"citizens.commands.npc.bee.bee-stung" : "[[{0}]] has now stung.",
|
"citizens.commands.npc.bee.bee-stung" : "[[{0}]] has now stung.",
|
||||||
"citizens.commands.npc.bee.description" : "Sets bee modifiers",
|
"citizens.commands.npc.bee.description" : "Sets bee modifiers",
|
||||||
|
Loading…
Reference in New Issue
Block a user