This commit is contained in:
SeanOMik 2022-05-08 15:39:06 -04:00
parent 529a5463ba
commit a705cdfaf4
10 changed files with 60 additions and 60 deletions

View File

@ -518,17 +518,17 @@ public class EntityTamableFox extends EntityFox {
return super.r(entity); return super.r(entity);
} }
// When the fox dies, show a chat message. // When the fox dies, show a chat message, and remove the player's stored tamed foxed.
public void die(DamageSource damageSource) { public void die(DamageSource damageSource) {
if (!this.world.isClientSide && this.world.getGameRules().getBoolean(GameRules.SHOW_DEATH_MESSAGES) && this.getOwner() instanceof EntityPlayer) { if (!this.world.isClientSide && this.world.getGameRules().getBoolean(GameRules.SHOW_DEATH_MESSAGES) && this.getOwner() instanceof EntityPlayer) {
this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage()); this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage());
}
// Remove the amount of foxes the player has tamed if the limit is enabled. // Remove the amount of foxes the player has tamed if the limit is enabled.
if (Config.getMaxPlayerFoxTames() > 0) { if (Config.getMaxPlayerFoxTames() > 0) {
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin); SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
sqliteHelper.removePlayerFoxAmount(this.getOwner().getUniqueID(), 1); sqliteHelper.removePlayerFoxAmount(this.getOwner().getUniqueID(), 1);
} }
}
super.die(damageSource); super.die(damageSource);
} }

View File

@ -518,17 +518,17 @@ public class EntityTamableFox extends EntityFox {
return super.r(entity); return super.r(entity);
} }
// When the fox dies, show a chat message. // When the fox dies, show a chat message, and remove the player's stored tamed foxed.
public void die(DamageSource damageSource) { public void die(DamageSource damageSource) {
if (!this.world.isClientSide && this.world.getGameRules().getBoolean(GameRules.SHOW_DEATH_MESSAGES) && this.getOwner() instanceof EntityPlayer) { if (!this.world.isClientSide && this.world.getGameRules().getBoolean(GameRules.SHOW_DEATH_MESSAGES) && this.getOwner() instanceof EntityPlayer) {
this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage()); this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage());
}
// Remove the amount of foxes the player has tamed if the limit is enabled. // Remove the amount of foxes the player has tamed if the limit is enabled.
if (Config.getMaxPlayerFoxTames() > 0) { if (Config.getMaxPlayerFoxTames() > 0) {
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin); SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
sqliteHelper.removePlayerFoxAmount(this.getOwner().getUniqueID(), 1); sqliteHelper.removePlayerFoxAmount(this.getOwner().getUniqueID(), 1);
} }
}
super.die(damageSource); super.die(damageSource);
} }

View File

@ -520,17 +520,17 @@ public class EntityTamableFox extends EntityFox {
return super.r(entity); return super.r(entity);
} }
// When the fox dies, show a chat message. // When the fox dies, show a chat message, and remove the player's stored tamed foxed.
public void die(DamageSource damageSource) { public void die(DamageSource damageSource) {
if (!this.world.isClientSide && this.world.getGameRules().getBoolean(GameRules.SHOW_DEATH_MESSAGES) && this.getOwner() instanceof EntityPlayer) { if (!this.world.isClientSide && this.world.getGameRules().getBoolean(GameRules.SHOW_DEATH_MESSAGES) && this.getOwner() instanceof EntityPlayer) {
this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID()); this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID());
}
// Remove the amount of foxes the player has tamed if the limit is enabled. // Remove the amount of foxes the player has tamed if the limit is enabled.
if (Config.getMaxPlayerFoxTames() > 0) { if (Config.getMaxPlayerFoxTames() > 0) {
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin); SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
sqliteHelper.removePlayerFoxAmount(this.getOwner().getUniqueID(), 1); sqliteHelper.removePlayerFoxAmount(this.getOwner().getUniqueID(), 1);
} }
}
super.die(damageSource); super.die(damageSource);
} }

View File

@ -512,17 +512,17 @@ public class EntityTamableFox extends EntityFox {
return super.r(entity); return super.r(entity);
} }
// When the fox dies, show a chat message. // When the fox dies, show a chat message, and remove the player's stored tamed foxed.
public void die(DamageSource damageSource) { public void die(DamageSource damageSource) {
if (!this.world.isClientSide && this.world.getGameRules().getBoolean(GameRules.SHOW_DEATH_MESSAGES) && this.getOwner() instanceof EntityPlayer) { if (!this.world.isClientSide && this.world.getGameRules().getBoolean(GameRules.SHOW_DEATH_MESSAGES) && this.getOwner() instanceof EntityPlayer) {
this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID()); this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID());
}
// Remove the amount of foxes the player has tamed if the limit is enabled. // Remove the amount of foxes the player has tamed if the limit is enabled.
if (Config.getMaxPlayerFoxTames() > 0) { if (Config.getMaxPlayerFoxTames() > 0) {
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin); SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
sqliteHelper.removePlayerFoxAmount(this.getOwner().getUniqueID(), 1); sqliteHelper.removePlayerFoxAmount(this.getOwner().getUniqueID(), 1);
} }
}
super.die(damageSource); super.die(damageSource);
} }

View File

@ -512,17 +512,17 @@ public class EntityTamableFox extends EntityFox {
return super.r(entity); return super.r(entity);
} }
// When the fox dies, show a chat message. // When the fox dies, show a chat message, and remove the player's stored tamed foxed.
public void die(DamageSource damageSource) { public void die(DamageSource damageSource) {
if (!this.world.isClientSide && this.world.getGameRules().getBoolean(GameRules.SHOW_DEATH_MESSAGES) && this.getOwner() instanceof EntityPlayer) { if (!this.world.isClientSide && this.world.getGameRules().getBoolean(GameRules.SHOW_DEATH_MESSAGES) && this.getOwner() instanceof EntityPlayer) {
this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID()); this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID());
}
// Remove the amount of foxes the player has tamed if the limit is enabled. // Remove the amount of foxes the player has tamed if the limit is enabled.
if (Config.getMaxPlayerFoxTames() > 0) { if (Config.getMaxPlayerFoxTames() > 0) {
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin); SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
sqliteHelper.removePlayerFoxAmount(this.getOwner().getUniqueID(), 1); sqliteHelper.removePlayerFoxAmount(this.getOwner().getUniqueID(), 1);
} }
}
super.die(damageSource); super.die(damageSource);
} }

View File

@ -543,18 +543,18 @@ public class EntityTamableFox extends Fox {
return super.isAlliedTo(entity); return super.isAlliedTo(entity);
} }
// When the fox dies, show a chat message. // When the fox dies, show a chat message, and remove the player's stored tamed foxed.
@Override @Override
public void die(DamageSource damageSource) { public void die(DamageSource damageSource) {
if (!this.getCommandSenderWorld().isClientSide && this.getCommandSenderWorld().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) { if (!this.getCommandSenderWorld().isClientSide && this.getCommandSenderWorld().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) {
this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID()); this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID());
}
// Remove the amount of foxes the player has tamed if the limit is enabled. // Remove the amount of foxes the player has tamed if the limit is enabled.
if (Config.getMaxPlayerFoxTames() > 0) { if (Config.getMaxPlayerFoxTames() > 0) {
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin); SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
sqliteHelper.removePlayerFoxAmount(this.getOwner().getUUID(), 1); sqliteHelper.removePlayerFoxAmount(this.getOwner().getUUID(), 1);
} }
}
super.die(damageSource); super.die(damageSource);
} }

View File

@ -540,18 +540,18 @@ public class EntityTamableFox extends Fox {
return super.isAlliedTo(entity); return super.isAlliedTo(entity);
} }
// When the fox dies, show a chat message. // When the fox dies, show a chat message, and remove the player's stored tamed foxed.
@Override @Override
public void die(DamageSource damageSource) { public void die(DamageSource damageSource) {
if (!this.getCommandSenderWorld().isClientSide && this.getCommandSenderWorld().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) { if (!this.getCommandSenderWorld().isClientSide && this.getCommandSenderWorld().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) {
this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID()); this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID());
}
// Remove the amount of foxes the player has tamed if the limit is enabled. // Remove the amount of foxes the player has tamed if the limit is enabled.
if (Config.getMaxPlayerFoxTames() > 0) { if (Config.getMaxPlayerFoxTames() > 0) {
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin); SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
sqliteHelper.removePlayerFoxAmount(this.getOwner().getUUID(), 1); sqliteHelper.removePlayerFoxAmount(this.getOwner().getUUID(), 1);
} }
}
super.die(damageSource); super.die(damageSource);
} }

View File

@ -562,18 +562,18 @@ public class EntityTamableFox extends Fox {
return super.isAlliedTo(entity); return super.isAlliedTo(entity);
} }
// When the fox dies, show a chat message. // When the fox dies, show a chat message, and remove the player's stored tamed foxed.
@Override @Override
public void die(DamageSource damageSource) { public void die(DamageSource damageSource) {
if (!this.getCommandSenderWorld().isClientSide && this.getCommandSenderWorld().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) { if (!this.getCommandSenderWorld().isClientSide && this.getCommandSenderWorld().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) {
this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID()); this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID());
}
// Remove the amount of foxes the player has tamed if the limit is enabled. // Remove the amount of foxes the player has tamed if the limit is enabled.
if (Config.getMaxPlayerFoxTames() > 0) { if (Config.getMaxPlayerFoxTames() > 0) {
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin); SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
sqliteHelper.removePlayerFoxAmount(this.getOwner().getUUID(), 1); sqliteHelper.removePlayerFoxAmount(this.getOwner().getUUID(), 1);
} }
}
super.die(damageSource); super.die(damageSource);
} }

View File

@ -562,18 +562,18 @@ public class EntityTamableFox extends Fox {
return super.isAlliedTo(entity); return super.isAlliedTo(entity);
} }
// When the fox dies, show a chat message. // When the fox dies, show a chat message, and remove the player's stored tamed foxed.
@Override @Override
public void die(DamageSource damageSource) { public void die(DamageSource damageSource) {
if (!this.getCommandSenderWorld().isClientSide && this.getCommandSenderWorld().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) { if (!this.getCommandSenderWorld().isClientSide && this.getCommandSenderWorld().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) {
this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID()); this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID());
}
// Remove the amount of foxes the player has tamed if the limit is enabled. // Remove the amount of foxes the player has tamed if the limit is enabled.
if (Config.getMaxPlayerFoxTames() > 0) { if (Config.getMaxPlayerFoxTames() > 0) {
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin); SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
sqliteHelper.removePlayerFoxAmount(this.getOwner().getUUID(), 1); sqliteHelper.removePlayerFoxAmount(this.getOwner().getUUID(), 1);
} }
}
super.die(damageSource); super.die(damageSource);
} }

View File

@ -560,18 +560,18 @@ public class EntityTamableFox extends Fox {
return super.isAlliedTo(entity); return super.isAlliedTo(entity);
} }
// When the fox dies, show a chat message. // When the fox dies, show a chat message, and remove the player's stored tamed foxed.
@Override @Override
public void die(DamageSource damageSource) { public void die(DamageSource damageSource) {
if (!this.getCommandSenderWorld().isClientSide && this.getCommandSenderWorld().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) { if (!this.getCommandSenderWorld().isClientSide && this.getCommandSenderWorld().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) {
this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID()); this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID());
}
// Remove the amount of foxes the player has tamed if the limit is enabled. // Remove the amount of foxes the player has tamed if the limit is enabled.
if (Config.getMaxPlayerFoxTames() > 0) { if (Config.getMaxPlayerFoxTames() > 0) {
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin); SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
sqliteHelper.removePlayerFoxAmount(this.getOwner().getUUID(), 1); sqliteHelper.removePlayerFoxAmount(this.getOwner().getUUID(), 1);
} }
}
super.die(damageSource); super.die(damageSource);
} }