mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 02:25:57 +01:00
Revert previous change. Fix commandtrait charging for a cost of 0
This commit is contained in:
parent
8be9da5f04
commit
8672b4b997
@ -99,7 +99,7 @@ public class CommandTrait extends Trait {
|
||||
NPCShopAction action = null;
|
||||
if (player.hasPermission("citizens.npc.command.ignoreerrors.*"))
|
||||
return Transaction.success();
|
||||
if (cost > 0 && !player.hasPermission("citizens.npc.command.ignoreerrors.cost")) {
|
||||
if (cost != 0 && !player.hasPermission("citizens.npc.command.ignoreerrors.cost")) {
|
||||
action = new MoneyAction(cost);
|
||||
if (!action.take(player, null, 1).isPossible()) {
|
||||
sendErrorMessage(player, CommandTraitError.MISSING_MONEY, null, cost);
|
||||
@ -119,7 +119,8 @@ public class CommandTrait extends Trait {
|
||||
stack.getAmount());
|
||||
}
|
||||
}
|
||||
if (command.cost != -1 && !player.hasPermission("citizens.npc.command.ignoreerrors.cost")) {
|
||||
if (command.cost != -1 && command.cost != 0
|
||||
&& !player.hasPermission("citizens.npc.command.ignoreerrors.cost")) {
|
||||
action = new MoneyAction(command.cost);
|
||||
if (!action.take(player, null, 1).isPossible()) {
|
||||
sendErrorMessage(player, CommandTraitError.MISSING_MONEY, null, command.cost);
|
||||
|
@ -1135,9 +1135,6 @@ public class NMSImpl implements NMSBridge {
|
||||
return () -> {
|
||||
if (!entity.isValid())
|
||||
return;
|
||||
if (npc != null && npc.useMinecraftAI()) {
|
||||
player.movementTick();
|
||||
}
|
||||
player.playerTick();
|
||||
};
|
||||
}
|
||||
|
@ -1152,9 +1152,6 @@ public class NMSImpl implements NMSBridge {
|
||||
return () -> {
|
||||
if (!entity.isValid())
|
||||
return;
|
||||
if (npc != null && npc.useMinecraftAI()) {
|
||||
player.movementTick();
|
||||
}
|
||||
player.playerTick();
|
||||
};
|
||||
}
|
||||
|
@ -1176,9 +1176,6 @@ public class NMSImpl implements NMSBridge {
|
||||
return () -> {
|
||||
if (!entity.isValid())
|
||||
return;
|
||||
if (npc != null && npc.useMinecraftAI()) {
|
||||
player.movementTick();
|
||||
}
|
||||
player.playerTick();
|
||||
};
|
||||
}
|
||||
|
@ -1182,9 +1182,6 @@ public class NMSImpl implements NMSBridge {
|
||||
return () -> {
|
||||
if (!entity.isValid())
|
||||
return;
|
||||
if (npc != null && npc.useMinecraftAI()) {
|
||||
player.aiStep();
|
||||
}
|
||||
player.doTick();
|
||||
};
|
||||
}
|
||||
|
@ -1191,9 +1191,6 @@ public class NMSImpl implements NMSBridge {
|
||||
return () -> {
|
||||
if (!entity.isValid())
|
||||
return;
|
||||
if (npc != null && npc.useMinecraftAI()) {
|
||||
player.aiStep();
|
||||
}
|
||||
player.doTick();
|
||||
};
|
||||
}
|
||||
|
@ -1318,9 +1318,6 @@ public class NMSImpl implements NMSBridge {
|
||||
return () -> {
|
||||
if (!entity.isValid())
|
||||
return;
|
||||
if (npc != null && npc.useMinecraftAI()) {
|
||||
player.aiStep();
|
||||
}
|
||||
player.doTick();
|
||||
};
|
||||
}
|
||||
|
@ -1290,9 +1290,6 @@ public class NMSImpl implements NMSBridge {
|
||||
return () -> {
|
||||
if (!entity.isValid())
|
||||
return;
|
||||
if (npc != null && npc.useMinecraftAI()) {
|
||||
player.aiStep();
|
||||
}
|
||||
player.doTick();
|
||||
};
|
||||
}
|
||||
|
@ -909,9 +909,6 @@ public class NMSImpl implements NMSBridge {
|
||||
boolean removeFromPlayerList = ((NPCHolder) entity).getNPC().data().get("removefromplayerlist",
|
||||
Setting.REMOVE_PLAYERS_FROM_PLAYER_LIST.asBoolean());
|
||||
entity.l();
|
||||
if (npc != null && npc.useMinecraftAI()) {
|
||||
entity.m();
|
||||
}
|
||||
if (!removeFromPlayerList)
|
||||
return;
|
||||
if (!entity.dead) {
|
||||
|
Loading…
Reference in New Issue
Block a user