Packet changes

This commit is contained in:
Auxilor
2021-07-15 12:09:43 +02:00
committed by Auxilor
parent beca53ca6a
commit 76e808b8b1
2 changed files with 6 additions and 1 deletions

View File

@@ -24,7 +24,7 @@ public class PacketAutoRecipe extends AbstractPacketAdapter {
@Override
public void onSend(@NotNull final PacketContainer packet,
@NotNull final Player player) {
if (!EcoPlugin.LOADED_ECO_PLUGINS.contains(packet.getMinecraftKeys().getValues().get(0).getFullKey().split(":")[0])) {
if (!EcoPlugin.getPluginNames().contains(packet.getMinecraftKeys().getValues().get(0).getFullKey().split(":")[0])) {
return;
}

View File

@@ -34,6 +34,11 @@ public class PacketOpenWindowMerchant extends AbstractPacketAdapter {
@NotNull final PacketEvent event) {
List<MerchantRecipe> recipes = new ArrayList<>();
/*
This awful, awful bit of code exists to fix a bug that existed in EcoEnchants
for too many versions.
*/
if (this.getPlugin().getConfigYml().getBool("villager-display-fix")) {
for (MerchantRecipe recipe : packet.getMerchantRecipeLists().read(0)) {
ItemStack result = recipe.getResult();