Skip to content

Commit

Permalink
Add Bukkit ThrownExpBottle entity, Fixes #71
Browse files Browse the repository at this point in the history
  • Loading branch information
pisaiah committed Nov 16, 2020
1 parent 0c78668 commit 5009753
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import org.cardboardpowered.impl.entity.CardboardPanda;
import org.cardboardpowered.impl.entity.CardboardSilverfish;
import org.cardboardpowered.impl.entity.CardboardSnowman;
import org.cardboardpowered.impl.entity.CardboardThrownExpBottle;
import org.cardboardpowered.impl.entity.CardboardWaterMob;
import org.cardboardpowered.impl.entity.CatImpl;
import org.cardboardpowered.impl.entity.CaveSpiderImpl;
Expand Down Expand Up @@ -157,6 +158,7 @@
import net.minecraft.entity.projectile.PersistentProjectileEntity;
import net.minecraft.entity.projectile.TridentEntity;
import net.minecraft.entity.projectile.thrown.EggEntity;
import net.minecraft.entity.projectile.thrown.ExperienceBottleEntity;
import net.minecraft.entity.projectile.thrown.SnowballEntity;
import net.minecraft.entity.projectile.thrown.ThrownEntity;
import net.minecraft.entity.vehicle.AbstractMinecartEntity;
Expand Down Expand Up @@ -422,7 +424,8 @@ else if (entity instanceof ThrownEntity) {
else if (entity instanceof SnowballEntity) { return new SnowballImpl(server, (SnowballEntity) entity); }
//else if (entity instanceof PotionEntity) { return new CraftThrownPotion(server, (PotionEntity) entity); }
//else if (entity instanceof EnderPearlEntity) { return new CraftEnderPearl(server, (EnderPearlEntity) entity); }
//else if (entity instanceof ExperienceBottleEntity) { return new CraftThrownExpBottle(server, (ExperienceBottleEntity) entity); }
else if (entity instanceof ExperienceBottleEntity) { return new CardboardThrownExpBottle(server, (ExperienceBottleEntity) entity); }

}
else if (entity instanceof FallingBlockEntity) { return new FallingBlockImpl(server, (FallingBlockEntity) entity); }
else if (entity instanceof ExplosiveProjectileEntity) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package org.cardboardpowered.impl.entity;

import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.ThrownExpBottle;

import net.minecraft.entity.projectile.ProjectileEntity;
import net.minecraft.entity.projectile.thrown.ExperienceBottleEntity;

public class CardboardThrownExpBottle extends ThrowableProjectileImpl implements ThrownExpBottle {

public CardboardThrownExpBottle(CraftServer server, ProjectileEntity entity) {
super(server, entity);
}

@Override
public ExperienceBottleEntity getHandle() {
return (ExperienceBottleEntity) nms;
}

@Override
public String toString() {
return "EntityThrownExpBottle";
}

@Override
public EntityType getType() {
return EntityType.THROWN_EXP_BOTTLE;
}

}

0 comments on commit 5009753

Please sign in to comment.