diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftRaid.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftRaid.java index a672790c13..22b39abf59 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftRaid.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftRaid.java @@ -100,4 +100,8 @@ public final class CraftRaid implements Raid { } }).collect(ImmutableList.toImmutableList()); } + + public net.minecraft.world.entity.raid.Raid getHandle() { + return handle; + } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index e88342e714..3e1e4659f7 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -334,6 +334,17 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { getHandle().invulnerableTime = ticks; } + @Override + public int getNoActionTicks() { + return getHandle().getNoActionTime(); + } + + @Override + public void setNoActionTicks(int ticks) { + Preconditions.checkArgument(ticks >= 0, "ticks must be >= 0"); + getHandle().setNoActionTime(ticks); + } + @Override public EntityLiving getHandle() { return (EntityLiving) entity; diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftRaider.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftRaider.java index 8c442386bb..6d76f75dc7 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftRaider.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftRaider.java @@ -2,8 +2,10 @@ package org.bukkit.craftbukkit.entity; import com.google.common.base.Preconditions; import net.minecraft.world.entity.raid.EntityRaider; +import org.bukkit.Raid; import org.bukkit.Sound; import org.bukkit.block.Block; +import org.bukkit.craftbukkit.CraftRaid; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftSound; import org.bukkit.craftbukkit.block.CraftBlock; @@ -25,6 +27,27 @@ public abstract class CraftRaider extends CraftMonster implements Raider { return "CraftRaider"; } + @Override + public void setRaid(Raid raid) { + getHandle().setCurrentRaid(raid != null ? ((CraftRaid) raid).getHandle() : null); + } + + @Override + public Raid getRaid() { + return getHandle().getCurrentRaid() == null ? null : new CraftRaid(getHandle().getCurrentRaid()); + } + + @Override + public void setWave(int wave) { + Preconditions.checkArgument(wave >= 0, "wave must be >= 0"); + getHandle().setWave(wave); + } + + @Override + public int getWave() { + return getHandle().getWave(); + } + @Override public Block getPatrolTarget() { return getHandle().getPatrolTarget() == null ? null : CraftBlock.at(getHandle().level(), getHandle().getPatrolTarget()); @@ -60,6 +83,27 @@ public abstract class CraftRaider extends CraftMonster implements Raider { getHandle().setCanJoinRaid(join); } + @Override + public boolean isCelebrating() { + return getHandle().isCelebrating(); + } + + @Override + public void setCelebrating(boolean celebrating) { + getHandle().setCelebrating(true); + } + + @Override + public int getTicksOutsideRaid() { + return getHandle().getTicksOutsideRaid(); + } + + @Override + public void setTicksOutsideRaid(int ticks) { + Preconditions.checkArgument(ticks >= 0, "ticks must be >= 0"); + getHandle().setTicksOutsideRaid(ticks); + } + @Override public Sound getCelebrationSound() { return CraftSound.getBukkit(getHandle().getCelebrateSound());