Fixed PacketOpenWindowMerchant
This commit is contained in:
@@ -168,14 +168,6 @@
|
||||
<artifactId>worldguard-bukkit</artifactId>
|
||||
<version>7.0.4-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
<!--
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.destroystokyo.paper</groupId>
|
||||
<artifactId>paper-api</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
-->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.TechFortress</groupId>
|
||||
|
||||
@@ -27,6 +27,9 @@ public final class PacketOpenWindowMerchant extends AbstractPacketAdapter {
|
||||
|
||||
recipes = recipes.stream().peek(merchantRecipe -> {
|
||||
try {
|
||||
if(!EnchantmentTarget.ALL.getMaterials().contains(merchantRecipe.getResult().getType()))
|
||||
return;
|
||||
|
||||
// Enables removing final modifier
|
||||
Field modifiersField = Field.class.getDeclaredField("modifiers");
|
||||
modifiersField.setAccessible(true);
|
||||
@@ -36,8 +39,6 @@ public final class PacketOpenWindowMerchant extends AbstractPacketAdapter {
|
||||
fResult.setAccessible(true);
|
||||
ItemStack result = EnchantDisplay.displayEnchantments(merchantRecipe.getResult());
|
||||
result = EnchantDisplay.addV(result);
|
||||
if(!EnchantmentTarget.ALL.getMaterials().contains(result.getType()))
|
||||
return;
|
||||
fResult.set(merchantRecipe, result);
|
||||
|
||||
// Get NMS MerchantRecipe from CraftMerchantRecipe
|
||||
|
||||
Reference in New Issue
Block a user