mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-27 16:42:57 +00:00
API Changes:
-Implemented interfaces for all jobs & roles. ScriptPlayer: -Added getData() function, which returns player data objects. IPlayerData: New class that holds all player data for modification. -Holds dialog, bank, quest, transport, faction, item giver, and mail data. -Also holds companion data, with functions has/set/getCompanion, and a getCompanionID function to differentiate companions.
This commit is contained in:
1 parent
587f63396f
commit
63a1525ee2
66 files changed
+1418
-207
No files matched your search
@@ -3,8 +3,9 @@ package noppes.npcs.scripted.roles;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.JobBard;
|
||||
import noppes.npcs.scripted.constants.JobType;
|
||||
import noppes.npcs.scripted.interfaces.jobs.IJobBard;
|
||||
|
||||
public class ScriptJobBard extends ScriptJobInterface{
|
||||
public class ScriptJobBard extends ScriptJobInterface implements IJobBard {
|
||||
private JobBard job;
|
||||
public ScriptJobBard(EntityNPCInterface npc){
|
||||
super(npc);
|
||||
|
||||
@@ -3,8 +3,9 @@ package noppes.npcs.scripted.roles;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.JobConversation;
|
||||
import noppes.npcs.scripted.constants.JobType;
|
||||
import noppes.npcs.scripted.interfaces.jobs.IJobConversation;
|
||||
|
||||
public class ScriptJobConversation extends ScriptJobInterface{
|
||||
public class ScriptJobConversation extends ScriptJobInterface implements IJobConversation {
|
||||
private JobConversation job;
|
||||
public ScriptJobConversation(EntityNPCInterface npc){
|
||||
super(npc);
|
||||
|
||||
@@ -4,8 +4,9 @@ import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.JobFollower;
|
||||
import noppes.npcs.scripted.constants.JobType;
|
||||
import noppes.npcs.scripted.interfaces.entity.ICustomNpc;
|
||||
import noppes.npcs.scripted.interfaces.jobs.IJobFollower;
|
||||
|
||||
public class ScriptJobFollower extends ScriptJobInterface{
|
||||
public class ScriptJobFollower extends ScriptJobInterface implements IJobFollower {
|
||||
private JobFollower job;
|
||||
public ScriptJobFollower(EntityNPCInterface npc){
|
||||
super(npc);
|
||||
@@ -20,7 +21,7 @@ public class ScriptJobFollower extends ScriptJobInterface{
|
||||
job.name = name;
|
||||
}
|
||||
|
||||
public ICustomNpc getFollowingNpc(){
|
||||
public ICustomNpc getFollowingNpc() {
|
||||
if(!isFollowing())
|
||||
return null;
|
||||
return job.following.script.dummyNpc;
|
||||
|
||||
@@ -3,8 +3,9 @@ package noppes.npcs.scripted.roles;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.JobGuard;
|
||||
import noppes.npcs.scripted.constants.JobType;
|
||||
import noppes.npcs.scripted.interfaces.jobs.IJobGuard;
|
||||
|
||||
public class ScriptJobGuard extends ScriptJobInterface{
|
||||
public class ScriptJobGuard extends ScriptJobInterface implements IJobGuard {
|
||||
private JobGuard job;
|
||||
public ScriptJobGuard(EntityNPCInterface npc){
|
||||
super(npc);
|
||||
|
||||
@@ -4,8 +4,9 @@ import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.JobHealer;
|
||||
import noppes.npcs.scripted.constants.JobType;
|
||||
import noppes.npcs.scripted.interfaces.entity.IEntityLivingBase;
|
||||
import noppes.npcs.scripted.interfaces.jobs.IJobHealer;
|
||||
|
||||
public class ScriptJobHealer extends ScriptJobInterface{
|
||||
public class ScriptJobHealer extends ScriptJobInterface implements IJobHealer {
|
||||
private JobHealer job;
|
||||
public ScriptJobHealer(EntityNPCInterface npc){
|
||||
super(npc);
|
||||
|
||||
@@ -1,13 +1,24 @@
|
||||
package noppes.npcs.scripted.roles;
|
||||
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.JobInterface;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.constants.JobType;
|
||||
import noppes.npcs.scripted.interfaces.entity.ICustomNpc;
|
||||
import noppes.npcs.scripted.interfaces.jobs.IJob;
|
||||
|
||||
public class ScriptJobInterface {
|
||||
protected EntityNPCInterface npc;
|
||||
public class ScriptJobInterface implements IJob {
|
||||
public final EntityNPCInterface npc;
|
||||
public final JobInterface jobInterface;
|
||||
|
||||
public ScriptJobInterface(JobInterface jobInterface) {
|
||||
this.npc = null;
|
||||
this.jobInterface = jobInterface;
|
||||
}
|
||||
|
||||
public ScriptJobInterface(EntityNPCInterface npc){
|
||||
this.npc = npc;
|
||||
this.jobInterface = npc.jobInterface;
|
||||
}
|
||||
/**
|
||||
* @see noppes.npcs.scripted.constants.JobType
|
||||
@@ -16,4 +27,13 @@ public class ScriptJobInterface {
|
||||
public int getType(){
|
||||
return JobType.UNKNOWN;
|
||||
}
|
||||
|
||||
public JobInterface getJobInterface() {
|
||||
return jobInterface;
|
||||
}
|
||||
|
||||
public ICustomNpc getNpc() {
|
||||
return (ICustomNpc) NpcAPI.Instance().getIEntity(npc);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,11 +1,29 @@
|
||||
package noppes.npcs.scripted.roles;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import noppes.npcs.controllers.data.Availability;
|
||||
import noppes.npcs.controllers.data.PlayerItemGiverData;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.JobItemGiver;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.constants.JobType;
|
||||
import noppes.npcs.scripted.interfaces.entity.IPlayer;
|
||||
import noppes.npcs.scripted.interfaces.handler.data.IAvailability;
|
||||
import noppes.npcs.scripted.interfaces.item.IItemStack;
|
||||
import noppes.npcs.scripted.interfaces.jobs.IJobItemGiver;
|
||||
|
||||
public class ScriptJobItemGiver extends ScriptJobInterface{
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class ScriptJobItemGiver extends ScriptJobInterface implements IJobItemGiver {
|
||||
private JobItemGiver job;
|
||||
|
||||
public ScriptJobItemGiver(JobItemGiver job) {
|
||||
super(job);
|
||||
this.job = job;
|
||||
}
|
||||
|
||||
public ScriptJobItemGiver(EntityNPCInterface npc){
|
||||
super(npc);
|
||||
this.job = (JobItemGiver) npc.jobInterface;
|
||||
@@ -15,5 +33,81 @@ public class ScriptJobItemGiver extends ScriptJobInterface{
|
||||
public int getType(){
|
||||
return JobType.ITEMGIVER;
|
||||
}
|
||||
|
||||
|
||||
public void setCooldown(int cooldown) {
|
||||
if (cooldown < 0)
|
||||
cooldown = 0;
|
||||
|
||||
job.cooldown = cooldown;
|
||||
}
|
||||
|
||||
public void setCooldownType(int type) {
|
||||
if (type < 0) {
|
||||
type = 0;
|
||||
} else if (type > 2) {
|
||||
type = 2;
|
||||
}
|
||||
job.cooldownType = type;
|
||||
}
|
||||
|
||||
public int getCooldownType() {
|
||||
return job.cooldownType;
|
||||
}
|
||||
|
||||
public void setGivingMethod(int method) {
|
||||
if (method < 0) {
|
||||
method = 0;
|
||||
} else if (method > 4) {
|
||||
method = 4;
|
||||
}
|
||||
job.givingMethod = method;
|
||||
}
|
||||
|
||||
public int getGivingMethod() {
|
||||
return job.givingMethod;
|
||||
}
|
||||
|
||||
public void setLines(String[] lines) {
|
||||
job.lines = new ArrayList<>(Arrays.asList(lines));
|
||||
}
|
||||
|
||||
public String[] getLines() {
|
||||
return job.lines.toArray(new String[0]);
|
||||
}
|
||||
|
||||
public void setAvailability(IAvailability availability) {
|
||||
job.availability = (Availability) availability;
|
||||
}
|
||||
|
||||
public IAvailability getAvailability() {
|
||||
return job.availability;
|
||||
}
|
||||
|
||||
public void setItem(int slot, IItemStack item) {
|
||||
if (slot < 0) {
|
||||
slot = 0;
|
||||
} else if (slot > 8) {
|
||||
slot = 8;
|
||||
}
|
||||
|
||||
job.inventory.items.put(slot, item.getMCItemStack());
|
||||
}
|
||||
|
||||
public IItemStack[] getItems() {
|
||||
ArrayList<IItemStack> items = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < job.inventory.getSizeInventory(); i++) {
|
||||
items.add(NpcAPI.Instance().getIItemStack(job.inventory.getStackInSlot(i)));
|
||||
}
|
||||
|
||||
return items.toArray(new IItemStack[0]);
|
||||
}
|
||||
|
||||
public boolean giveItems(IPlayer player) {
|
||||
return job.giveItems((EntityPlayer) player.getMCEntity());
|
||||
}
|
||||
|
||||
public boolean canPlayerInteract(IPlayer player) {
|
||||
return job.canPlayerInteract((PlayerItemGiverData) player.getData().getItemGiverData());
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,9 @@ package noppes.npcs.scripted.roles;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.JobPuppet;
|
||||
import noppes.npcs.scripted.constants.JobType;
|
||||
import noppes.npcs.scripted.interfaces.jobs.IJobPuppet;
|
||||
|
||||
public class ScriptJobPuppet extends ScriptJobInterface{
|
||||
public class ScriptJobPuppet extends ScriptJobInterface implements IJobPuppet {
|
||||
private JobPuppet job;
|
||||
public ScriptJobPuppet(EntityNPCInterface npc){
|
||||
super(npc);
|
||||
@@ -100,7 +101,7 @@ public class ScriptJobPuppet extends ScriptJobInterface{
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @param type Body part (0:head, 1:body, 2:leftarm, 3:rightarm, 4:leftleg, 5:rightleg)
|
||||
* @param part Body part (0:head, 1:body, 2:leftarm, 3:rightarm, 4:leftleg, 5:rightleg)
|
||||
* @param rotation Rotation the of the body part
|
||||
*/
|
||||
public void setRotationY(int part, int rotation){
|
||||
|
||||
@@ -8,8 +8,9 @@ import noppes.npcs.roles.JobSpawner;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.constants.JobType;
|
||||
import noppes.npcs.scripted.interfaces.entity.IEntityLivingBase;
|
||||
import noppes.npcs.scripted.interfaces.jobs.IJobSpawner;
|
||||
|
||||
public class ScriptJobSpawner extends ScriptJobInterface{
|
||||
public class ScriptJobSpawner extends ScriptJobInterface implements IJobSpawner {
|
||||
private JobSpawner job;
|
||||
public ScriptJobSpawner(EntityNPCInterface npc){
|
||||
super(npc);
|
||||
|
||||
@@ -2,8 +2,9 @@ package noppes.npcs.scripted.roles;
|
||||
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.scripted.constants.RoleType;
|
||||
import noppes.npcs.scripted.interfaces.roles.IRoleBank;
|
||||
|
||||
public class ScriptRoleBank extends ScriptRoleInterface{
|
||||
public class ScriptRoleBank extends ScriptRoleInterface implements IRoleBank {
|
||||
|
||||
public ScriptRoleBank(EntityNPCInterface npc) {
|
||||
super(npc);
|
||||
|
||||
@@ -6,18 +6,15 @@ import noppes.npcs.roles.RoleFollower;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.constants.RoleType;
|
||||
import noppes.npcs.scripted.interfaces.entity.IPlayer;
|
||||
import noppes.npcs.scripted.interfaces.roles.IRoleFollower;
|
||||
|
||||
public class ScriptRoleFollower extends ScriptRoleInterface{
|
||||
public class ScriptRoleFollower extends ScriptRoleInterface implements IRoleFollower {
|
||||
private RoleFollower role;
|
||||
public ScriptRoleFollower(EntityNPCInterface npc) {
|
||||
super(npc);
|
||||
role = (RoleFollower) npc.roleInterface;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @param player Player who is set as the owner. If null given everything resets
|
||||
*/
|
||||
|
||||
public void setOwner(IPlayer player){
|
||||
if(player == null || player.getMCEntity() == null){
|
||||
role.setOwner(null);
|
||||
@@ -26,22 +23,14 @@ public class ScriptRoleFollower extends ScriptRoleInterface{
|
||||
EntityPlayer mcplayer = (EntityPlayer) player.getMCEntity();
|
||||
role.setOwner(mcplayer);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @return Returns the followers owner. Returns null if he has no owner or the owner is offline
|
||||
*/
|
||||
|
||||
public IPlayer getOwner(){
|
||||
if(role.owner == null)
|
||||
return null;
|
||||
|
||||
return (IPlayer) NpcAPI.Instance().getIEntity(role.owner);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @return Returns whether or not the follower has an owner
|
||||
*/
|
||||
|
||||
public boolean hasOwner(){
|
||||
return role.owner != null;
|
||||
}
|
||||
@@ -53,51 +42,27 @@ public class ScriptRoleFollower extends ScriptRoleInterface{
|
||||
public void setIsFollowing(boolean following) {
|
||||
if (role.owner != null && role.getDaysLeft() > 0) role.isFollowing = following;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @return Returns days left
|
||||
*/
|
||||
|
||||
public int getDaysLeft(){
|
||||
return role.getDaysLeft();
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @param days The days you want to add to the days remaining
|
||||
*/
|
||||
|
||||
public void addDaysLeft(int days){
|
||||
role.addDays(days);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @return Returns whether or not the follower is set to infinite days
|
||||
*/
|
||||
|
||||
public boolean getInfiniteDays(){
|
||||
return role.infiniteDays;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @param infinite Sets whether the days hired are infinite
|
||||
*/
|
||||
|
||||
public void setInfiniteDays(boolean infinite){
|
||||
role.infiniteDays = infinite;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @return Return whether the gui is disabled
|
||||
*/
|
||||
|
||||
public boolean getGuiDisabled(){
|
||||
return role.disableGui;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @param disabled Set the gui to be disabled or not
|
||||
*/
|
||||
|
||||
public void setGuiDisabled(boolean disabled){
|
||||
role.disableGui = disabled;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
package noppes.npcs.scripted.roles;
|
||||
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.RoleInterface;
|
||||
import noppes.npcs.scripted.constants.RoleType;
|
||||
import noppes.npcs.scripted.interfaces.roles.IRole;
|
||||
|
||||
public class ScriptRoleInterface {
|
||||
protected EntityNPCInterface npc;
|
||||
public class ScriptRoleInterface implements IRole {
|
||||
public final EntityNPCInterface npc;
|
||||
public final RoleInterface role;
|
||||
|
||||
public ScriptRoleInterface(EntityNPCInterface npc){
|
||||
this.npc = npc;
|
||||
this.role = npc.roleInterface;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,8 +2,9 @@ package noppes.npcs.scripted.roles;
|
||||
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.scripted.constants.RoleType;
|
||||
import noppes.npcs.scripted.interfaces.roles.IRoleMailman;
|
||||
|
||||
public class ScriptRoleMailman extends ScriptRoleInterface{
|
||||
public class ScriptRoleMailman extends ScriptRoleInterface implements IRoleMailman {
|
||||
|
||||
public ScriptRoleMailman(EntityNPCInterface npc) {
|
||||
super(npc);
|
||||
|
||||
@@ -8,20 +8,15 @@ import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.interfaces.item.IItemStack;
|
||||
import noppes.npcs.scripted.constants.RoleType;
|
||||
import noppes.npcs.scripted.interfaces.entity.IPlayer;
|
||||
import noppes.npcs.scripted.interfaces.roles.IRoleTrader;
|
||||
|
||||
public class ScriptRoleTrader extends ScriptRoleInterface{
|
||||
public class ScriptRoleTrader extends ScriptRoleInterface implements IRoleTrader {
|
||||
private RoleTrader role;
|
||||
public ScriptRoleTrader(EntityNPCInterface npc) {
|
||||
super(npc);
|
||||
role = (RoleTrader) npc.roleInterface;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param slot Slot number 0-17
|
||||
* @param currency Currency item
|
||||
* @param currency2 Currency item number two
|
||||
* @param sold Item to be sold by this npc
|
||||
*/
|
||||
|
||||
public void setSellOption(int slot, IItemStack currency, IItemStack currency2, IItemStack sold){
|
||||
if(sold == null || slot >= 18 || slot < 0)
|
||||
return;
|
||||
@@ -40,29 +35,16 @@ public class ScriptRoleTrader extends ScriptRoleInterface{
|
||||
role.inventorySold.items.put(slot, sold.getMCItemStack());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param slot Slot number 0-17
|
||||
* @param currency Currency item
|
||||
* @param sold Item to be sold by this npc
|
||||
*/
|
||||
public void setSellOption(int slot, IItemStack currency, IItemStack sold){
|
||||
setSellOption(slot, currency, null, sold);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param slot
|
||||
* @return The item being sold in this slot.
|
||||
*/
|
||||
|
||||
public IItemStack getSellOption(int slot) {
|
||||
if (slot >= 18 || slot < 0) return null;
|
||||
if (role.inventorySold.items.get(slot) == null) return null;
|
||||
return NpcAPI.Instance().getIItemStack(role.inventoryCurrency.items.get(slot));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param slot
|
||||
* @return a ScriptItemStack array of size 2 which contains the currency of this trade
|
||||
*/
|
||||
|
||||
public IItemStack[] getCurrency(int slot) {
|
||||
if (slot >= 18 || slot < 0) return null;
|
||||
IItemStack[] currency = new IItemStack[2];
|
||||
@@ -75,127 +57,72 @@ public class ScriptRoleTrader extends ScriptRoleInterface{
|
||||
return currency;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param slot Slot number 0-17
|
||||
*/
|
||||
|
||||
public void removeSellOption(int slot){
|
||||
if(slot >= 18 || slot < 0) return;
|
||||
role.inventoryCurrency.items.remove(slot);
|
||||
role.inventoryCurrency.items.remove(slot + 18);
|
||||
role.inventorySold.items.remove(slot);
|
||||
}
|
||||
/**
|
||||
* @param name The trader Linked Market name
|
||||
*/
|
||||
|
||||
public void setMarket(String name){
|
||||
role.marketName = name;
|
||||
Market.load(role, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Get the currently set Linked Market name
|
||||
*/
|
||||
|
||||
public String getMarket(){
|
||||
return role.marketName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param slot
|
||||
* @return the number of times an item has been sold on that slot
|
||||
*/
|
||||
|
||||
public int getPurchaseNum(int slot) {
|
||||
if(slot >= 18 || slot < 0) return -1;
|
||||
return role.purchases[slot];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param slot
|
||||
* @param player
|
||||
* @return the number of times this player has purchased from this trader
|
||||
*/
|
||||
|
||||
public int getPurchaseNum(int slot, IPlayer player) {
|
||||
if(slot >= 18 || slot < 0) return -1;
|
||||
return role.getArrayByName(player.getDisplayName(), role.playerPurchases)[slot];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the purchase count of all slots to 0
|
||||
*/
|
||||
|
||||
public void resetPurchaseNum() {
|
||||
for (int i = 0; i < role.purchases.length; ++i) role.purchases[i] = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* sets the purchase num for that slot to 0
|
||||
* @param slot
|
||||
*/
|
||||
|
||||
public void resetPurchaseNum(int slot) {
|
||||
if(slot >= 18 || slot < 0) return;
|
||||
role.purchases[slot] = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* sets the purchase num for that slot and player to 0
|
||||
* @param slot
|
||||
* @param player
|
||||
*/
|
||||
|
||||
public void resetPurchaseNum(int slot, IPlayer player) {
|
||||
if(slot >= 18 || slot < 0) return;
|
||||
role.getArrayByName(player.getDisplayName(), role.playerPurchases)[slot] = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param slot
|
||||
* @return if this slot is enabled
|
||||
*/
|
||||
|
||||
public boolean isSlotEnabled(int slot) {
|
||||
if(slot >= 18 || slot < 0) return false;
|
||||
return role.disableSlot[slot] > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param slot
|
||||
* @param player
|
||||
* @return if this slot is enabled for this player
|
||||
*/
|
||||
|
||||
public boolean isSlotEnabled(int slot, IPlayer player) {
|
||||
if(slot >= 18 || slot < 0) return false;
|
||||
return role.isSlotEnabled(slot, (EntityPlayer)player.getMCEntity());
|
||||
}
|
||||
|
||||
/**
|
||||
* prevent an item from being sold on that slot
|
||||
* @param slot
|
||||
*/
|
||||
|
||||
public void disableSlot(int slot) {
|
||||
if(slot >= 18 || slot < 0) return;
|
||||
role.disableSlot[slot] = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* disables the slot for this player
|
||||
* @param slot
|
||||
* @param player
|
||||
*/
|
||||
|
||||
public void disableSlot(int slot, IPlayer player) {
|
||||
if(slot >= 18 || slot < 0) return;
|
||||
role.getArrayByName(player.getDisplayName(), role.playerDisableSlot)[slot] = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* allow an item to be sold on that slot
|
||||
* @param slot
|
||||
*/
|
||||
|
||||
public void enableSlot(int slot) {
|
||||
if(slot >= 18 || slot < 0) return;
|
||||
role.disableSlot[slot] = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* enables the slot for this player
|
||||
* @param slot
|
||||
* @param player
|
||||
*/
|
||||
|
||||
public void enableSlot(int slot, IPlayer player) {
|
||||
if(slot >= 18 || slot < 0) return;
|
||||
role.getArrayByName(player.getDisplayName(), role.playerDisableSlot)[slot] = 0;
|
||||
|
||||
@@ -2,8 +2,9 @@ package noppes.npcs.scripted.roles;
|
||||
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.scripted.constants.RoleType;
|
||||
import noppes.npcs.scripted.interfaces.roles.IRoleTransporter;
|
||||
|
||||
public class ScriptRoleTransporter extends ScriptRoleInterface{
|
||||
public class ScriptRoleTransporter extends ScriptRoleInterface implements IRoleTransporter {
|
||||
|
||||
public ScriptRoleTransporter(EntityNPCInterface npc) {
|
||||
super(npc);
|
||||
|
||||
Reference in new issue
Block a user