geforkt von Mirrors/Paper
#1216: Add missing Raider API and 'no action ticks'
By: Parker Hawke <hawkeboyz2@hotmail.com>
Dieser Commit ist enthalten in:
Ursprung
3edbef0526
Commit
f0c9bae0f7
@ -100,4 +100,8 @@ public final class CraftRaid implements Raid {
|
||||
}
|
||||
}).collect(ImmutableList.toImmutableList());
|
||||
}
|
||||
|
||||
public net.minecraft.world.entity.raid.Raid getHandle() {
|
||||
return handle;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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());
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren