More compile fixes

This commit is contained in:
Noah van der Aa 2023-12-06 19:21:23 +01:00
parent d79a08990a
commit 9734050cf0
5 changed files with 12 additions and 12 deletions

View file

@ -35,7 +35,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ +
+ @Override + @Override
+ public String translationKey() { + public String translationKey() {
+ return this.target.getDescriptionId(); + return this.handle.getDescriptionId();
+ } + }
// Paper end // Paper end

View file

@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private static final UUID SPEED_MODIFIER_BABY_UUID = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836"); private static final UUID SPEED_MODIFIER_BABY_UUID = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836");
private static final AttributeModifier SPEED_MODIFIER_BABY = new AttributeModifier(Zombie.SPEED_MODIFIER_BABY_UUID, "Baby speed boost", 0.5D, AttributeModifier.Operation.MULTIPLY_BASE); private static final AttributeModifier SPEED_MODIFIER_BABY = new AttributeModifier(Zombie.SPEED_MODIFIER_BABY_UUID, "Baby speed boost", 0.5D, AttributeModifier.Operation.MULTIPLY_BASE);
+ private final AttributeModifier babyModifier = new net.minecraft.world.entity.ai.attributes.AttributeModifier(SPEED_MODIFIER_BABY.getId(), SPEED_MODIFIER_BABY.getName(), this.level().paperConfig().entities.behavior.babyZombieMovementModifier, SPEED_MODIFIER_BABY.getOperation()); // Paper - Make baby speed configurable + private final AttributeModifier babyModifier = new net.minecraft.world.entity.ai.attributes.AttributeModifier(SPEED_MODIFIER_BABY.getId(), SPEED_MODIFIER_BABY.name, this.level().paperConfig().entities.behavior.babyZombieMovementModifier, SPEED_MODIFIER_BABY.getOperation()); // Paper - Make baby speed configurable
private static final EntityDataAccessor<Boolean> DATA_BABY_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.BOOLEAN); private static final EntityDataAccessor<Boolean> DATA_BABY_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.BOOLEAN);
private static final EntityDataAccessor<Integer> DATA_SPECIAL_TYPE_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.INT); private static final EntityDataAccessor<Integer> DATA_SPECIAL_TYPE_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.INT);
public static final EntityDataAccessor<Boolean> DATA_DROWNED_CONVERSION_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.BOOLEAN); public static final EntityDataAccessor<Boolean> DATA_DROWNED_CONVERSION_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.BOOLEAN);

View file

@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
command = event.getCommand(); command = event.getCommand();
String[] args = command.split(" "); String[] args = command.split(" ");
+ if (args.length == 0) return 0; // Paper - empty commands shall not be dispatched + if (args.length == 0) return; // Paper - empty commands shall not be dispatched
String cmd = args[0]; String cmd = args[0];
if (cmd.startsWith("minecraft:")) cmd = cmd.substring("minecraft:".length()); if (cmd.startsWith("minecraft:")) cmd = cmd.substring("minecraft:".length());

View file

@ -23,42 +23,42 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override @Override
@@ -0,0 +0,0 @@ public class CraftEnchantment extends Enchantment { @@ -0,0 +0,0 @@ public class CraftEnchantment extends Enchantment {
public String translationKey() { public String translationKey() {
return this.target.getDescriptionId(); return this.handle.getDescriptionId();
} }
+ +
+ @Override + @Override
+ public boolean isTradeable() { + public boolean isTradeable() {
+ return target.isTradeable(); + return handle.isTradeable();
+ } + }
+ +
+ @Override + @Override
+ public boolean isDiscoverable() { + public boolean isDiscoverable() {
+ return target.isDiscoverable(); + return handle.isDiscoverable();
+ } + }
+ +
+ @Override + @Override
+ public int getMinModifiedCost(int level) { + public int getMinModifiedCost(int level) {
+ return target.getMinCost(level); + return handle.getMinCost(level);
+ } + }
+ +
+ @Override + @Override
+ public int getMaxModifiedCost(int level) { + public int getMaxModifiedCost(int level) {
+ return target.getMaxCost(level); + return handle.getMaxCost(level);
+ } + }
+ +
+ @Override + @Override
+ public io.papermc.paper.enchantments.EnchantmentRarity getRarity() { + public io.papermc.paper.enchantments.EnchantmentRarity getRarity() {
+ return fromNMSRarity(target.getRarity()); + return fromNMSRarity(handle.getRarity());
+ } + }
+ +
+ @Override + @Override
+ public float getDamageIncrease(int level, org.bukkit.entity.EntityCategory entityCategory) { + public float getDamageIncrease(int level, org.bukkit.entity.EntityCategory entityCategory) {
+ return target.getDamageBonus(level, org.bukkit.craftbukkit.entity.CraftLivingEntity.fromBukkitEntityCategory(entityCategory)); + return handle.getDamageBonus(level, org.bukkit.craftbukkit.entity.CraftLivingEntity.fromBukkitEntityCategory(entityCategory));
+ } + }
+ +
+ @Override + @Override
+ public java.util.Set<org.bukkit.inventory.EquipmentSlot> getActiveSlots() { + public java.util.Set<org.bukkit.inventory.EquipmentSlot> getActiveSlots() {
+ return java.util.stream.Stream.of(target.slots).map(org.bukkit.craftbukkit.CraftEquipmentSlot::getSlot).collect(java.util.stream.Collectors.toSet()); + return java.util.stream.Stream.of(handle.slots).map(org.bukkit.craftbukkit.CraftEquipmentSlot::getSlot).collect(java.util.stream.Collectors.toSet());
+ } + }
+ +
+ public static io.papermc.paper.enchantments.EnchantmentRarity fromNMSRarity(net.minecraft.world.item.enchantment.Enchantment.Rarity nmsRarity) { + public static io.papermc.paper.enchantments.EnchantmentRarity fromNMSRarity(net.minecraft.world.item.enchantment.Enchantment.Rarity nmsRarity) {

View file

@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
set.add(blockposition); set.add(blockposition);
+ // Paper start - prevent headless pistons from forming + // Paper start - prevent headless pistons from forming
+ if (!io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowHeadlessPistons && iblockdata.getBlock() == Blocks.MOVING_PISTON) { + if (!io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowHeadlessPistons && iblockdata.getBlock() == Blocks.MOVING_PISTON) {
+ BlockEntity extension = this.level.getBlockEntity(blockposition); + net.minecraft.world.level.block.entity.BlockEntity extension = this.level.getBlockEntity(blockposition);
+ if (extension instanceof net.minecraft.world.level.block.piston.PistonMovingBlockEntity blockEntity && blockEntity.isSourcePiston()) { + if (extension instanceof net.minecraft.world.level.block.piston.PistonMovingBlockEntity blockEntity && blockEntity.isSourcePiston()) {
+ net.minecraft.core.Direction direction = iblockdata.getValue(net.minecraft.world.level.block.piston.PistonHeadBlock.FACING); + net.minecraft.core.Direction direction = iblockdata.getValue(net.minecraft.world.level.block.piston.PistonHeadBlock.FACING);
+ set.add(blockposition.relative(direction.getOpposite())); + set.add(blockposition.relative(direction.getOpposite()));