Search in sources :

Example 1 with CustomGuardian

use of be.isach.ultracosmetics.v1_14_R1.customentities.CustomGuardian in project UltraCosmetics by iSach.

the class MorphElderGuardian method onEquip.

@Override
protected void onEquip() {
    super.onEquip();
    World world = ((CraftWorld) getPlayer().getWorld()).getHandle();
    customGuardian = new CustomGuardian(EntityTypes.ELDER_GUARDIAN, world);
    customEntities.add(customGuardian);
    customGuardian.check();
    Location location = getPlayer().getLocation();
    double x = location.getX();
    double y = location.getY();
    double z = location.getZ();
    customGuardian.setLocation(x, y, z, 0, 0);
    EntitySpawningManager.setBypass(true);
    world.addEntity(customGuardian);
    EntitySpawningManager.setBypass(false);
    getPlayer().setPassenger(customGuardian.getBukkitEntity());
    customGuardian.setInvisible(true);
}
Also used : CraftWorld(org.bukkit.craftbukkit.v1_15_R1.CraftWorld) World(net.minecraft.server.v1_15_R1.World) CraftWorld(org.bukkit.craftbukkit.v1_15_R1.CraftWorld) CustomGuardian(be.isach.ultracosmetics.v1_15_R1.customentities.CustomGuardian) Location(org.bukkit.Location)

Example 2 with CustomGuardian

use of be.isach.ultracosmetics.v1_14_R1.customentities.CustomGuardian in project UltraCosmetics by iSach.

the class MorphElderGuardian method onEquip.

@Override
protected void onEquip() {
    super.onEquip();
    World world = ((CraftWorld) getPlayer().getWorld()).getHandle();
    customGuardian = new CustomGuardian(world);
    customEntities.add(customGuardian);
    customGuardian.check();
    Location location = getPlayer().getLocation();
    double x = location.getX();
    double y = location.getY();
    double z = location.getZ();
    customGuardian.setLocation(x, y, z, 0, 0);
    EntitySpawningManager.setBypass(true);
    world.addEntity(customGuardian);
    EntitySpawningManager.setBypass(false);
    getPlayer().addPassenger(customGuardian.getBukkitEntity());
    customGuardian.setInvisible(true);
}
Also used : World(net.minecraft.server.v1_12_R1.World) CraftWorld(org.bukkit.craftbukkit.v1_12_R1.CraftWorld) CraftWorld(org.bukkit.craftbukkit.v1_12_R1.CraftWorld) CustomGuardian(be.isach.ultracosmetics.v1_12_R1.customentities.CustomGuardian) Location(org.bukkit.Location)

Example 3 with CustomGuardian

use of be.isach.ultracosmetics.v1_14_R1.customentities.CustomGuardian in project UltraCosmetics by iSach.

the class MorphElderGuardian method onEquip.

@Override
protected void onEquip() {
    super.onEquip();
    Level world = ((CraftWorld) getPlayer().getWorld()).getHandle();
    customGuardian = new CustomGuardian(EntityType.ELDER_GUARDIAN, world);
    CustomEntities.addCustomEntity(customGuardian);
    Location location = getPlayer().getLocation();
    double x = location.getX();
    double y = location.getY();
    double z = location.getZ();
    // the methods don't get properly re-obfuscated without casting like this
    ((Entity) customGuardian).moveTo(x, y, z, 0, 0);
    EntitySpawningManager.setBypass(true);
    ((LevelWriter) world).addFreshEntity(customGuardian);
    EntitySpawningManager.setBypass(false);
    getPlayer().addPassenger(customGuardian.getBukkitEntity());
    ((Entity) customGuardian).setInvisible(true);
}
Also used : CraftEntity(org.bukkit.craftbukkit.v1_19_R1.entity.CraftEntity) LivingEntity(org.bukkit.entity.LivingEntity) Entity(net.minecraft.world.entity.Entity) LevelWriter(net.minecraft.world.level.LevelWriter) Level(net.minecraft.world.level.Level) CraftWorld(org.bukkit.craftbukkit.v1_19_R1.CraftWorld) CustomGuardian(be.isach.ultracosmetics.v1_19_R1.customentities.CustomGuardian) Location(org.bukkit.Location)

Example 4 with CustomGuardian

use of be.isach.ultracosmetics.v1_14_R1.customentities.CustomGuardian in project UltraCosmetics by iSach.

the class MorphElderGuardian method onEquip.

@Override
protected void onEquip() {
    super.onEquip();
    World world = ((CraftWorld) getPlayer().getWorld()).getHandle();
    customGuardian = new CustomGuardian(world);
    customEntities.add(customGuardian);
    customGuardian.check();
    Location location = getPlayer().getLocation();
    double x = location.getX();
    double y = location.getY();
    double z = location.getZ();
    customGuardian.setLocation(x, y, z, 0, 0);
    EntitySpawningManager.setBypass(true);
    world.addEntity(customGuardian);
    EntitySpawningManager.setBypass(false);
    getPlayer().setPassenger(customGuardian.getBukkitEntity());
    customGuardian.setInvisible(true);
}
Also used : CraftWorld(org.bukkit.craftbukkit.v1_8_R3.CraftWorld) World(net.minecraft.server.v1_8_R3.World) CraftWorld(org.bukkit.craftbukkit.v1_8_R3.CraftWorld) CustomGuardian(be.isach.ultracosmetics.v1_8_R3.customentities.CustomGuardian) Location(org.bukkit.Location)

Example 5 with CustomGuardian

use of be.isach.ultracosmetics.v1_14_R1.customentities.CustomGuardian in project UltraCosmetics by iSach.

the class MorphElderGuardian method onEquip.

@Override
protected void onEquip() {
    super.onEquip();
    World world = ((CraftWorld) getPlayer().getWorld()).getHandle();
    customGuardian = new CustomGuardian(EntityTypes.ELDER_GUARDIAN, world);
    customEntities.add(customGuardian);
    customGuardian.check();
    Location location = getPlayer().getLocation();
    double x = location.getX();
    double y = location.getY();
    double z = location.getZ();
    customGuardian.setLocation(x, y, z, 0, 0);
    EntitySpawningManager.setBypass(true);
    world.addEntity(customGuardian);
    EntitySpawningManager.setBypass(false);
    getPlayer().setPassenger(customGuardian.getBukkitEntity());
    customGuardian.setInvisible(true);
}
Also used : World(net.minecraft.server.v1_14_R1.World) CraftWorld(org.bukkit.craftbukkit.v1_14_R1.CraftWorld) CraftWorld(org.bukkit.craftbukkit.v1_14_R1.CraftWorld) CustomGuardian(be.isach.ultracosmetics.v1_14_R1.customentities.CustomGuardian) Location(org.bukkit.Location)

Aggregations

Location (org.bukkit.Location)10 LivingEntity (org.bukkit.entity.LivingEntity)4 Entity (net.minecraft.world.entity.Entity)3 Level (net.minecraft.world.level.Level)3 LevelWriter (net.minecraft.world.level.LevelWriter)3 CustomGuardian (be.isach.ultracosmetics.v1_12_R1.customentities.CustomGuardian)1 CustomGuardian (be.isach.ultracosmetics.v1_13_R2.customentities.CustomGuardian)1 FireworkFactory (be.isach.ultracosmetics.v1_14_R1.FireworkFactory)1 CustomGuardian (be.isach.ultracosmetics.v1_14_R1.customentities.CustomGuardian)1 CustomGuardian (be.isach.ultracosmetics.v1_15_R1.customentities.CustomGuardian)1 CustomGuardian (be.isach.ultracosmetics.v1_16_R3.customentities.CustomGuardian)1 CustomGuardian (be.isach.ultracosmetics.v1_17_R1.customentities.CustomGuardian)1 CustomGuardian (be.isach.ultracosmetics.v1_18_R2.customentities.CustomGuardian)1 CustomGuardian (be.isach.ultracosmetics.v1_19_R1.customentities.CustomGuardian)1 CustomGuardian (be.isach.ultracosmetics.v1_8_R3.customentities.CustomGuardian)1 World (net.minecraft.server.v1_12_R1.World)1 World (net.minecraft.server.v1_13_R2.World)1 World (net.minecraft.server.v1_14_R1.World)1 World (net.minecraft.server.v1_15_R1.World)1 World (net.minecraft.server.v1_16_R3.World)1