Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public static Permission getRootPermission(Plugin plugin) {
}

public static UUID convertFromUUIDInts(int[] uuidData) {
return new UUID(uuidData[0] << 32 | uuidData[1], uuidData[2] << 32 | uuidData[3]);
return new UUID(((long) uuidData[0] << 32) | uuidData[1], ((long) uuidData[2] << 32) | uuidData[3]);
}

public static int[] convertToUUIDInts(UUID uuid) {
Expand Down
42 changes: 35 additions & 7 deletions src/main/java/com/goncalomb/bukkit/nbteditor/nbt/EntityNBT.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,12 @@ public class EntityNBT extends EntityNBTBase {
cCreeper.add("Ignited", new BooleanVariable("ignited"));

NBTUnboundVariableContainer cDolphin = new NBTUnboundVariableContainer("Dolphin", cMob);
cDolphin.add("CanFindTreasure", new BooleanVariable("CanFindTreasure"));
cDolphin.add("GotFish", new BooleanVariable("GotFish"));
cDolphin.add("Moistness", new IntegerVariable("Moistness"));
// TODO: add missing variables
cDolphin.add("TreasurePosX", new IntegerVariable("TreasurePosX"));
cDolphin.add("TreasurePosY", new IntegerVariable("TreasurePosY"));
cDolphin.add("TreasurePosZ", new IntegerVariable("TreasurePosZ"));

NBTUnboundVariableContainer cEnderDragon = new NBTUnboundVariableContainer("EnderDragon", cMob);
cEnderDragon.add("DragonPhase", new IntegerVariable("DragonPhase", 0, 10));
Expand Down Expand Up @@ -159,7 +162,12 @@ public class EntityNBT extends EntityNBTBase {

NBTUnboundVariableContainer cTurtle = new NBTUnboundVariableContainer("Turtle", cBreed);
cTurtle.add("HasEgg", new BooleanVariable("HasEgg"));
// TODO: add missing variables
cTurtle.add("HomePosX", new IntegerVariable("HomePosX"));
cTurtle.add("HomePosY", new IntegerVariable("HomePosY"));
cTurtle.add("HomePosZ", new IntegerVariable("HomePosZ"));
cTurtle.add("TravelPosX", new IntegerVariable("TravelPosX"));
cTurtle.add("TravelPosY", new IntegerVariable("TravelPosY"));
cTurtle.add("TravelPosZ", new IntegerVariable("TravelPosZ"));

NBTUnboundVariableContainer cVillagerGolem = new NBTUnboundVariableContainer("VillagerGolem", cMob);
cVillagerGolem.add("PlayerCreated", new BooleanVariable("PlayerCreated"));
Expand All @@ -180,6 +188,9 @@ public class EntityNBT extends EntityNBTBase {
NBTUnboundVariableContainer cZombiePigman = new NBTUnboundVariableContainer("ZombiePigman", cZombie);
cZombiePigman.add("Anger", new ShortVariable("Anger"));

NBTUnboundVariableContainer cZoglin = new NBTUnboundVariableContainer("Zoglin", cMob);
cZoglin.add("IsBaby", new BooleanVariable("IsBaby"));

NBTUnboundVariableContainer cPiglin = new NBTUnboundVariableContainer("Piglin", cMob);
cPiglin.add("IsBaby", new BooleanVariable("IsBaby"));
cPiglin.add("IsImmuneToZombification", new BooleanVariable("IsImmuneToZombification"));
Expand All @@ -195,8 +206,10 @@ public class EntityNBT extends EntityNBTBase {
cZombieVillager.add("ConversionTime", new IntegerVariable("ConversionTime", -1));

NBTUnboundVariableContainer cPhantom = new NBTUnboundVariableContainer("Phantom", cMob);
cPhantom.add("AX", new IntegerVariable("AX"));
cPhantom.add("AY", new IntegerVariable("AY"));
cPhantom.add("AZ", new IntegerVariable("AZ"));
cPhantom.add("Size", new IntegerVariable("Size"));
// TODO: add missing variables

// Breed SubTypes

Expand Down Expand Up @@ -247,6 +260,20 @@ public class EntityNBT extends EntityNBTBase {
cFox.add("Sitting", new BooleanVariable("Sitting"));
cFox.add("Crouching", new BooleanVariable("Crouching"));

NBTUnboundVariableContainer cBee = new NBTUnboundVariableContainer("Bee", cBreed);
cBee.add("AngerTime", new IntegerVariable("AngerTime"));
cBee.add("CannotEnterHiveTicks", new IntegerVariable("CannotEnterHiveTicks"));
cBee.add("CropsGrownSincePollination", new IntegerVariable("CropsGrownSincePollination"));
cBee.add("TicksSincePollination", new IntegerVariable("TicksSincePollination"));
cBee.add("HasNectar", new BooleanVariable("HasNectar"));
cBee.add("HasStung", new BooleanVariable("HasStung"));
// TODO: add FlowerPos / HivePos

NBTUnboundVariableContainer cHoglin = new NBTUnboundVariableContainer("Hoglin", cBreed);
cHoglin.add("IsImmuneToZombification", new BooleanVariable("IsImmuneToZombification"));
cHoglin.add("CannotBeHunted", new BooleanVariable("CannotBeHunted"));
cHoglin.add("TimeInOverworld", new IntegerVariable("TimeInOverworld"));

// Tameable SubTypes

NBTUnboundVariableContainer cOcelot = new NBTUnboundVariableContainer("Ocelot", cTameable);
Expand All @@ -256,7 +283,7 @@ public class EntityNBT extends EntityNBTBase {
cParrot.add("Variant", new IntegerVariable("Variant", 0, 4));

NBTUnboundVariableContainer cWolf = new NBTUnboundVariableContainer("Wolf", cTameable);
cWolf.add("Angry", new BooleanVariable("Angry"));
cWolf.add("AngerTime", new IntegerVariable("AngerTime"));
cWolf.add("CollarColor", new ByteVariable("CollarColor", (byte) 0, (byte) 15));

NBTUnboundVariableContainer cCat = new NBTUnboundVariableContainer("Cat", cTameable);
Expand Down Expand Up @@ -345,15 +372,16 @@ public class EntityNBT extends EntityNBTBase {
}

if (BukkitVersion.isVersion(15)) {
// TODO: add variables for 1.15 mobs
ENTITY_VARIABLES.put("minecraft:bee", cMob);
ENTITY_VARIABLES.put("minecraft:bee", cBee);
}

if (BukkitVersion.isVersion(16)) {
// TODO: add variables for 1.16 mobs
ENTITY_VARIABLES.put("minecraft:piglin", cPiglin);
ENTITY_VARIABLES.put("minecraft:piglin_brute", cMob);
ENTITY_VARIABLES.put("minecraft:zombified_piglin", cZombifiedPiglin);
ENTITY_VARIABLES.put("minecraft:zoglin", cZoglin);
ENTITY_VARIABLES.put("minecraft:hoglin", cHoglin);
ENTITY_VARIABLES.put("minecraft:strider", cPig);
}

// Projectile Entities
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class ItemNBT extends BaseNBT {
cItem.add("Lore", new RawJsonListVariable("display/Lore"));
cItem.add("Damage", new IntegerVariable("Damage"));
cItem.add("Unbreakable", new BooleanVariable("Unbreakable"));
cItem.add("CustomModelData", new IntegerVariable("CustomModelData"));
cItem.add("CanDestroy", new MaterialListVariable("CanDestroy"));
cItem.add("CanPlaceOn", new MaterialListVariable("CanPlaceOn"));
cItem.add("HideFlags", new IntegerVariable("HideFlags"));
Expand Down