Update to Minecraft 1.18-pre5

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-11-22 09:00:00 +11:00
parent a852b81a69
commit 43702a9e10
700 changed files with 10286 additions and 10098 deletions

View File

@@ -30,7 +30,7 @@ public class CraftAttributeInstance implements AttributeInstance {
@Override
public void setBaseValue(double d) {
handle.setValue(d);
handle.setBaseValue(d);
}
@Override
@@ -46,7 +46,7 @@ public class CraftAttributeInstance implements AttributeInstance {
@Override
public void addModifier(AttributeModifier modifier) {
Preconditions.checkArgument(modifier != null, "modifier");
handle.addModifier(convert(modifier));
handle.addPermanentModifier(convert(modifier));
}
@Override
@@ -62,7 +62,7 @@ public class CraftAttributeInstance implements AttributeInstance {
@Override
public double getDefaultValue() {
return handle.getAttribute().getDefault();
return handle.getAttribute().getDefaultValue();
}
public static net.minecraft.world.entity.ai.attributes.AttributeModifier convert(AttributeModifier bukkit) {
@@ -70,6 +70,6 @@ public class CraftAttributeInstance implements AttributeInstance {
}
public static AttributeModifier convert(net.minecraft.world.entity.ai.attributes.AttributeModifier nms) {
return new AttributeModifier(nms.getUniqueId(), nms.getName(), nms.getAmount(), AttributeModifier.Operation.values()[nms.getOperation().ordinal()]);
return new AttributeModifier(nms.getId(), nms.getName(), nms.getAmount(), AttributeModifier.Operation.values()[nms.getOperation().ordinal()]);
}
}

View File

@@ -21,7 +21,7 @@ public class CraftAttributeMap implements Attributable {
@Override
public AttributeInstance getAttribute(Attribute attribute) {
Preconditions.checkArgument(attribute != null, "attribute");
net.minecraft.world.entity.ai.attributes.AttributeModifiable nms = handle.a(toMinecraft(attribute));
net.minecraft.world.entity.ai.attributes.AttributeModifiable nms = handle.getInstance(toMinecraft(attribute));
return (nms == null) ? null : new CraftAttributeInstance(nms, attribute);
}