Fix offset issue

This commit is contained in:
Camotoy 2020-12-26 13:24:50 -05:00
parent c1f5380ed1
commit 06f346b30b
No known key found for this signature in database
GPG Key ID: 7EEFB66FE798081F
1 changed files with 2 additions and 2 deletions

View File

@ -66,7 +66,7 @@ public abstract class ChestedHorseInventoryTranslator extends AbstractHorseInven
if (slot == this.equipSlot) {
return new BedrockContainerSlot(ContainerSlotType.HORSE_EQUIP, 0);
}
if (slot <= this.size) {
if (slot <= this.size - 1) { // Accommodate for the lack of one slot (saddle or armor)
return new BedrockContainerSlot(ContainerSlotType.CONTAINER, slot - 1);
}
return super.javaSlotToBedrockContainer(slot);
@ -77,7 +77,7 @@ public abstract class ChestedHorseInventoryTranslator extends AbstractHorseInven
if (slot == 0 && this.equipSlot == 0) {
return 0;
}
if (slot <= this.size) {
if (slot <= this.size - 1) {
return slot - 1;
}
return super.javaSlotToBedrock(slot);