render cat/wolf collars, charged creeper and wither armor energy swirl (additive), fox/dolphin mouth items
This commit is contained in:
1 parent
fbea9dfe08
commit
c66ebaa942
11 files changed
+231
-20
No files matched your search
@@ -79,6 +79,18 @@ public class PPTest extends JavaPlugin {
|
||||
scenes.put("proj_stuck_close_t", new Scene("proj_stuck_close_t", this::projStuck, 18.5, 2.6, -3, 13.5, 1.6, 1));
|
||||
// Rendered 4 ticks after the shots: freshly stuck arrows still wobble (vanilla shakeTime -> pitch offset).
|
||||
scenes.put("proj_shake", new Scene("proj_shake", this::projStuck, -2.5, 2.4, -2.5, 2.5, 1.6, 1));
|
||||
// Conditional vanilla layers: collars (tamed only, dye-tinted), charged creeper / wither armor (additive
|
||||
// energy swirl), fox/dolphin mouth items.
|
||||
scenes.put("layers", new Scene("layers", this::layers, 4.8, 2.4, -5.5, 4.8, 0.6, 1.5));
|
||||
scenes.put("layers_side", new Scene("layers_side", this::layers, 12.5, 2.2, 5.5, 5, 0.5, 2.5));
|
||||
scenes.put("layers_close", new Scene("layers_close", this::layers, 5.5, 1.3, 0.3, 5.5, 0.4, 2.5));
|
||||
scenes.put("layers_pets", new Scene("layers_pets", this::layers, 4.5, 1.6, -3.2, 4.5, 0.3, 0));
|
||||
scenes.put("layers_dolphin", new Scene("layers_dolphin", this::layers, 10, 1.0, 1.0, 7.5, 0.4, 2.0));
|
||||
scenes.put("layers_cats", new Scene("layers_cats", this::layers, 1.7, 1.1, -1.6, 1.7, 0.3, 0));
|
||||
scenes.put("layers_cats_side", new Scene("layers_cats_side", this::layers, 1.7, 1.6, 1.4, 1.7, 0.2, 0));
|
||||
scenes.put("layers_top", new Scene("layers_top", this::layers, 5.5, 6, 2.0, 5.5, 0, 2.5));
|
||||
scenes.put("layers_wither", new Scene("layers_wither", this::withers, 3.5, 4, -9, 3.5, 2.2, 1));
|
||||
scenes.put("layers_wither_close", new Scene("layers_wither_close", this::withers, 6, 3.4, -3.5, 6, 2.6, 1));
|
||||
scenes.put("proj_stuck_sw", new Scene("proj_stuck_sw", this::projStuck, -3, 6, 10, 8, 1.5, 2));
|
||||
}
|
||||
|
||||
@@ -613,6 +625,46 @@ public class PPTest extends JavaPlugin {
|
||||
t.setBillboard(Display.Billboard.CENTER);
|
||||
}
|
||||
|
||||
// --- conditional layers ----------------------------------------------------------------------
|
||||
|
||||
private void layers(Location o) {
|
||||
tame(spawn(o, 0, 0, 0, 180, Cat.class), DyeColor.RED);
|
||||
tame(spawn(o, 1.2, 0, 0, 180, Cat.class), DyeColor.BLUE);
|
||||
spawn(o, 2.4, 0, 0, 180, Cat.class); // untamed: no collar
|
||||
Cat kitten = spawn(o, 3.4, 0, 0, 180, Cat.class);
|
||||
kitten.setBaby();
|
||||
tame(kitten, DyeColor.YELLOW);
|
||||
tame(spawn(o, 5, 0, 0, 180, Wolf.class), DyeColor.RED);
|
||||
tame(spawn(o, 6.4, 0, 0, 180, Wolf.class), DyeColor.LIME);
|
||||
spawn(o, 7.8, 0, 0, 180, Wolf.class); // untamed: wild texture, no collar
|
||||
Wolf pup = spawn(o, 9.0, 0, 0, 180, Wolf.class);
|
||||
pup.setBaby();
|
||||
tame(pup, DyeColor.MAGENTA);
|
||||
spawn(o, 0.5, 0, 2.5, 180, Creeper.class);
|
||||
spawn(o, 2.2, 0, 2.5, 180, Creeper.class).setPowered(true);
|
||||
hands(spawn(o, 4.2, 0, 2.5, 180, Fox.class), Material.EMERALD, null);
|
||||
Fox kit = spawn(o, 5.5, 0, 2.5, 180, Fox.class);
|
||||
kit.setBaby();
|
||||
hands(kit, Material.SWEET_BERRIES, null);
|
||||
hands(spawn(o, 7.5, 0, 2.5, 180, Dolphin.class), Material.COD, null);
|
||||
// Spawned mobs get a random body yaw: face them all to the camera (north).
|
||||
for (Entity e : w.getNearbyEntities(o.clone().add(5, 0, 1), 7, 3, 4))
|
||||
if (e instanceof LivingEntity le && !(e instanceof Player)) le.setBodyYaw(180);
|
||||
}
|
||||
|
||||
private void tame(Tameable t, DyeColor collar) {
|
||||
t.setTamed(true);
|
||||
if (t instanceof Cat c) c.setCollarColor(collar);
|
||||
if (t instanceof Wolf wo) wo.setCollarColor(collar);
|
||||
}
|
||||
|
||||
private void withers(Location o) {
|
||||
spawn(o, 1, 0, 1, 180, Wither.class); // full health: no armor
|
||||
Wither half = spawn(o, 6, 0, 1, 180, Wither.class);
|
||||
half.setHealth(half.getAttribute(org.bukkit.attribute.Attribute.MAX_HEALTH).getValue() / 2 - 1);
|
||||
for (Entity e : w.getNearbyEntities(o, 12, 8, 8)) if (e instanceof Wither wi) wi.setBodyYaw(180);
|
||||
}
|
||||
|
||||
// --- projectiles -----------------------------------------------------------------------------
|
||||
|
||||
/** Spawns a projectile at p moving along dir, rotated like vanilla Projectile#shoot (yaw atan2(x,z), pitch up). */
|
||||
|
||||
Reference in new issue
Block a user