Use correct class of Optional in older versions

This commit is contained in:
filoghost 2019-06-05 11:07:54 +02:00
parent ff4102599c
commit 484b4c8a9f

View File

@ -326,7 +326,7 @@ public class ProtocolLibHookImpl implements ProtocolLibHook {
WrappedDataWatcher dataWatcher = new WrappedDataWatcher();
if (NMSVersion.isGreaterEqualThan(NMSVersion.v1_9_R1)) {
Object itemStackObject = NMSVersion.isGreaterEqualThan(NMSVersion.v1_11_R1) ? itemLine.getNmsItem().getRawItemStack() : Optional.of(itemLine.getNmsItem().getRawItemStack());
Object itemStackObject = NMSVersion.isGreaterEqualThan(NMSVersion.v1_11_R1) ? itemLine.getNmsItem().getRawItemStack() : com.google.common.base.Optional.of(itemLine.getNmsItem().getRawItemStack());
dataWatcher.setObject(new WrappedDataWatcherObject(itemstackMetadataWatcherIndex, itemSerializer), itemStackObject);
dataWatcher.setObject(new WrappedDataWatcherObject(1, intSerializer), 300);
dataWatcher.setObject(new WrappedDataWatcherObject(0, byteSerializer), (byte) 0);