Skip to content

Commit

Permalink
Merge branch '1.20.2-server-renderer' into 1.20.2
Browse files Browse the repository at this point in the history
  • Loading branch information
MATRIX-feather committed Jan 14, 2024
2 parents 1a8c7ac + 9fe4251 commit fea8c65
Show file tree
Hide file tree
Showing 42 changed files with 117 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
public abstract class AbstractValues
{
private int currentIndex = 0;
protected <X> SingleValue<X> getSingle(X val)
protected <X> SingleValue<X> getSingle(String name, X val)
{
if (val == null)
throw new IllegalArgumentException("May not pass a null value to getIndex()");

var sv = SingleValue.of(currentIndex, val);
var sv = SingleValue.of(name, currentIndex, val);

currentIndex++;
return sv;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

public class AllayValues extends MobValues
{
public final SingleValue<Boolean> DANCING = getSingle(false);
public final SingleValue<Boolean> CAN_DUPLICATE = getSingle(false);
public final SingleValue<Boolean> DANCING = getSingle("allay_dancing", false);
public final SingleValue<Boolean> CAN_DUPLICATE = getSingle("allay_can_dupe", false);

public AllayValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

public class ArmorStandValues extends LivingEntityValues
{
public final SingleValue<Byte> DATA_FLAGS = getSingle((byte)0);
public final SingleValue<Rotations> HEAD_ROTATION = getSingle(new Rotations(0, 0, 0));
public final SingleValue<Rotations> BODY_ROTATION = getSingle(new Rotations(0, 0, 0));
public final SingleValue<Rotations> LEFT_ARM_ROTATION = getSingle(new Rotations(-10, 0, -10));
public final SingleValue<Rotations> RIGHT_ARM_ROTATION = getSingle(new Rotations(-15, 0, 10));
public final SingleValue<Rotations> LEFT_LEG_ROTATION = getSingle(new Rotations(-1, 0, -1));
public final SingleValue<Rotations> RIGHT_LEG_ROTATION = getSingle(new Rotations(1, 0, 1));
public final SingleValue<Byte> DATA_FLAGS = getSingle("armor_stand_flags", (byte)0);
public final SingleValue<Rotations> HEAD_ROTATION = getSingle("armor_stand_headRot", new Rotations(0, 0, 0));
public final SingleValue<Rotations> BODY_ROTATION = getSingle("armor_stand_bodyRot", new Rotations(0, 0, 0));
public final SingleValue<Rotations> LEFT_ARM_ROTATION = getSingle("armor_stand_leftArmRot", new Rotations(-10, 0, -10));
public final SingleValue<Rotations> RIGHT_ARM_ROTATION = getSingle("armor_stand_rightArmRot", new Rotations(-15, 0, 10));
public final SingleValue<Rotations> LEFT_LEG_ROTATION = getSingle("armor_stand_leftLegRot", new Rotations(-1, 0, -1));
public final SingleValue<Rotations> RIGHT_LEG_ROTATION = getSingle("armor_stand_rightLeg", new Rotations(1, 0, 1));

public ArmorStandValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

public class AxolotlValues extends AnimalValues
{
public final SingleValue<Integer> COLOR = getSingle(0).withRandom(0, 1, 2, 3, 4);
public final SingleValue<Boolean> PLAYING_DEAD = getSingle(false);
public final SingleValue<Boolean> SPAWNED_FROM_BUCKET = getSingle(false);
public final SingleValue<Integer> COLOR = getSingle("axolotl_color", 0).withRandom(0, 1, 2, 3, 4);
public final SingleValue<Boolean> PLAYING_DEAD = getSingle("axolotl_playing_dead", false);
public final SingleValue<Boolean> SPAWNED_FROM_BUCKET = getSingle("axolotl_spawned_from_bucket", false);

public AxolotlValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

public class CatValues extends TameableAnimalValues
{
public final SingleValue<CatVariant> CAT_VARIANT = getSingle(BuiltInRegistries.CAT_VARIANT.getOrThrow(CatVariant.TABBY));
public final SingleValue<Boolean> IS_LYING = getSingle(false);
public final SingleValue<Boolean> RELAXED = getSingle(false);
public final SingleValue<Integer> COLLAR_COLOR = getSingle(14);
public final SingleValue<CatVariant> CAT_VARIANT = getSingle("cat_variant", BuiltInRegistries.CAT_VARIANT.getOrThrow(CatVariant.TABBY));
public final SingleValue<Boolean> IS_LYING = getSingle("cat_is_lying", false);
public final SingleValue<Boolean> RELAXED = getSingle("cat_relaxed", false);
public final SingleValue<Integer> COLLAR_COLOR = getSingle("cat_collar_color", 14);

public CatValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

public class CreeperValues extends MonsterValues
{
public final SingleValue<Integer> STATE = getSingle(0);
public final SingleValue<Boolean> IS_CHARGED_CREEPER = getSingle(false);
public final SingleValue<Boolean> IGNITED = getSingle(false);
public final SingleValue<Integer> STATE = getSingle("creeper_state", 0);
public final SingleValue<Boolean> IS_CHARGED_CREEPER = getSingle("creeper_is_charged", false);
public final SingleValue<Boolean> IGNITED = getSingle("creeper_ignited", false);

public CreeperValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

public class FoxValues extends AnimalValues
{
public final SingleValue<Integer> FOX_VARIANT = getSingle(0).withRandom(0, 1);
public final SingleValue<Byte> FLAGS = getSingle((byte)0);
public final SingleValue<UUID> TRUSTED_ID_0 = getSingle(UUID.randomUUID());
public final SingleValue<UUID> TRUSTED_ID_1 = getSingle(UUID.randomUUID());
public final SingleValue<Integer> FOX_VARIANT = getSingle("fox_variant", 0).withRandom(0, 1);
public final SingleValue<Byte> FLAGS = getSingle("fox_flags", (byte)0);
public final SingleValue<UUID> TRUSTED_ID_0 = getSingle("fox_trusted_0", UUID.randomUUID());
public final SingleValue<UUID> TRUSTED_ID_1 = getSingle("fox_trusted_1", UUID.randomUUID());

public FoxValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

public class FrogValues extends AnimalValues
{
public final SingleValue<FrogVariant> FROG_VARIANT = getSingle(FrogVariant.TEMPERATE).withRandom(FrogVariant.TEMPERATE, FrogVariant.COLD, FrogVariant.WARM);
public final SingleValue<FrogVariant> FROG_VARIANT = getSingle("frog_variant", FrogVariant.TEMPERATE).withRandom(FrogVariant.TEMPERATE, FrogVariant.COLD, FrogVariant.WARM);

public FrogValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public class GhastValues extends MobValues
{
public final SingleValue<Boolean> CHARGING = getSingle(false);
public final SingleValue<Boolean> CHARGING = getSingle("ghast_charging", false);

public GhastValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

public class GoatValues extends AnimalValues
{
public final SingleValue<Boolean> IS_SCREAMING = getSingle(false);
public final SingleValue<Boolean> HAS_LEFT_HORN = getSingle(true);
public final SingleValue<Boolean> HAS_RIGHT_HORN = getSingle(true);
public final SingleValue<Boolean> IS_SCREAMING = getSingle("goat_is_screaming", false);
public final SingleValue<Boolean> HAS_LEFT_HORN = getSingle("goat_has_left_horn", true);
public final SingleValue<Boolean> HAS_RIGHT_HORN = getSingle("goat_has_right_horn", true);

public GoatValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

public class GuardianValues extends MonsterValues
{
public final SingleValue<Boolean> RETRACING_SPIKES = getSingle(false);
public final SingleValue<Integer> TARGET_ENTITY_ID = getSingle(-1);
public final SingleValue<Boolean> RETRACING_SPIKES = getSingle("guardian_retracing_spikes", false);
public final SingleValue<Integer> TARGET_ENTITY_ID = getSingle("guardian_target_entity", -1);

public GuardianValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

public class HorseValues extends AbstractHorseValues
{
public final SingleValue<Integer> HORSE_VARIANT = getSingle(0);
public final SingleValue<Integer> HORSE_VARIANT = getSingle("horse_variant", 0);

public HorseValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

public class LlamaValues extends ChestedHorseValues
{
public final SingleValue<Integer> SLOTS = getSingle(0);
public final SingleValue<Integer> CARPET_COLOR = getSingle(-1);
public final SingleValue<Integer> VARIANT = getSingle(0);
public final SingleValue<Integer> SLOTS = getSingle("llama_slots", 0);
public final SingleValue<Integer> CARPET_COLOR = getSingle("llama_carpet_color", -1);
public final SingleValue<Integer> VARIANT = getSingle("llama_variant", 0);

public LlamaValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

public class MobValues extends LivingEntityValues
{
public final SingleValue MOB_FLAGS = getSingle((byte)0);
public final SingleValue MOB_FLAGS = getSingle("mob_flags", (byte)0);

public MobValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

public class MooshroomValues extends AnimalValues
{
public final SingleValue<String> VARIANT = getSingle(RED).withRandom(RED, RED, RED, BROWN);
public final SingleValue<String> VARIANT = getSingle("mooshroom_variant", RED).withRandom(RED, RED, RED, BROWN);
public static final String RED = "red";
public static final String BROWN = "brown";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

public class PandaValues extends AnimalValues
{
public final SingleValue<Integer> BREED_TIMER = getSingle(0);
public final SingleValue<Integer> SNEEZE_TIMER = getSingle(0);
public final SingleValue<Integer> EAT_TIMER = getSingle(0);
public final SingleValue<Byte> MAIN_GENE = getSingle((byte)0);
public final SingleValue<Byte> HIDDEN_GENE = getSingle((byte)0);
public final SingleValue<Byte> FLAGS = getSingle((byte)0);
public final SingleValue<Integer> BREED_TIMER = getSingle("panda_breed_timer", 0);
public final SingleValue<Integer> SNEEZE_TIMER = getSingle("panda_sneeze_timer", 0);
public final SingleValue<Integer> EAT_TIMER = getSingle("panda_eat_timer", 0);
public final SingleValue<Byte> MAIN_GENE = getSingle("panda_main_gene", (byte)0);
public final SingleValue<Byte> HIDDEN_GENE = getSingle("panda_hidden_gene", (byte)0);
public final SingleValue<Byte> FLAGS = getSingle("panda_flags", (byte)0);

public PandaValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

public class ParrotValues extends TameableAnimalValues
{
public final SingleValue<Integer> PARROT_VARIANT = getSingle(0).withRandom(0, 1, 2, 3, 4);
public final SingleValue<Integer> PARROT_VARIANT = getSingle("parrot_variant", 0).withRandom(0, 1, 2, 3, 4);

public ParrotValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public class PhantomValues extends MobValues
{
public final SingleValue<Integer> SIZE = getSingle(0);
public final SingleValue<Integer> SIZE = getSingle("phantom_size", 0);

public PhantomValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

public class PiglinValues extends BasePiglinValues
{
public final SingleValue<Boolean> IS_BABY = getSingle(false);
public final SingleValue<Boolean> CHARGING_CROSSBOW = getSingle(false);
public final SingleValue<Boolean> DANCING = getSingle(false);
public final SingleValue<Boolean> IS_BABY = getSingle("piglin_is_baby", false);
public final SingleValue<Boolean> CHARGING_CROSSBOW = getSingle("piglin_charging_crossbow", false);
public final SingleValue<Boolean> DANCING = getSingle("piglin_dancing", false);

public PiglinValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

public class PlayerValues extends LivingEntityValues
{
public final SingleValue<Float> ABSORPTION_AMOUNT = getSingle(0f);
public final SingleValue<Integer> SCORE = getSingle(0);
public final SingleValue<Byte> SKIN_FLAGS = getSingle((byte)0); //127
public final SingleValue<Byte> MAINHAND = getSingle((byte)1);
public final SingleValue<CompoundTag> LEFT_SHOULDER_PARROT_COMPOUND = getSingle(new CompoundTag());
public final SingleValue<CompoundTag> RIGHT_SHOULDER_PARROT_COMPOUND = getSingle(new CompoundTag());
public final SingleValue<Float> ABSORPTION_AMOUNT = getSingle("player_absorption_amount", 0f);
public final SingleValue<Integer> SCORE = getSingle("player_score", 0);
public final SingleValue<Byte> SKIN_FLAGS = getSingle("player_skin_flags", (byte)0); //127
public final SingleValue<Byte> MAINHAND = getSingle("player_mainhand", (byte)1);
public final SingleValue<CompoundTag> LEFT_SHOULDER_PARROT_COMPOUND = getSingle("player_lSPC", new CompoundTag());
public final SingleValue<CompoundTag> RIGHT_SHOULDER_PARROT_COMPOUND = getSingle("player_rSPC", new CompoundTag());

public PlayerValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

public class RabbitValues extends AnimalValues
{
public final SingleValue<Integer> RABBIT_TYPE = getSingle(0);
public final SingleValue<Integer> RABBIT_TYPE = getSingle("rabbit_type", 0);

public RabbitValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

public class SheepValues extends AnimalValues
{
public final SingleValue<Byte> WOOL_TYPE = getSingle((byte)0);
public final SingleValue<Byte> WOOL_TYPE = getSingle("sheep_wool_type", (byte)0);

public SheepValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,16 @@ public WrappedDataWatcher.Serializer getSerializer()
return serializer;
}

public SingleValue(Class<T> type, int index, @NotNull T defaultValue)
private final String name;

public String name()
{
return name;
}

public SingleValue(String name, Class<T> type, int index, @NotNull T defaultValue)
{
this.name = name;
this.type = type;
this.index = index;
this.defaultValue = defaultValue;
Expand Down Expand Up @@ -86,14 +94,14 @@ public boolean equals(Object obj)
@Override
public String toString()
{
return "SingleValue[type='%s', index='%s']".formatted(type, index);
return "SingleValue[name='%s', type='%s', index='%s']".formatted(name, type, index);
}

public static <TVal> SingleValue<TVal> of(int index, @NotNull TVal val)
public static <TVal> SingleValue<TVal> of(String name, int index, @NotNull TVal val)
{
if (val == null)
throw new IllegalArgumentException("TVal may not be null");

return new SingleValue<>((Class<TVal>) val.getClass(), index, val);
return new SingleValue<>(name, (Class<TVal>) val.getClass(), index, val);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public class SlimeValues extends MobValues
{
public final SingleValue<Integer> SIZE = getSingle(1);
public final SingleValue<Integer> SIZE = getSingle("slimemagma_size", 1);

public SlimeValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

public class SnowGolemValues extends AbstractGolemValues
{
public final SingleValue<Byte> HAT_FLAGS = getSingle(HAS_PUMPKIN); //.withRandom(HAS_PUMPKIN, NO_PUMPKIN);
public final SingleValue<Byte> HAT_FLAGS = getSingle("snowman_has_pumpkin", HAS_PUMPKIN); //.withRandom(HAS_PUMPKIN, NO_PUMPKIN);

public static byte NO_PUMPKIN = 0;
public static byte HAS_PUMPKIN = 16;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

public class TropicalFishValues extends AbstractFishValues
{
public final SingleValue<Integer> FISH_VARIANT = getSingle(0);
public final SingleValue<Integer> FISH_VARIANT = getSingle("tropical_variant", 0);

public TropicalFishValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

public class VillagerValues extends AbstractVillagerValues
{
public final SingleValue<VillagerData> VILLAGER_DATA = getSingle(new VillagerData(VillagerType.PLAINS, VillagerProfession.NONE, 0));
public final SingleValue<VillagerData> VILLAGER_DATA = getSingle("villager_data", new VillagerData(VillagerType.PLAINS, VillagerProfession.NONE, 0));

public VillagerValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

public class WolfValues extends TameableAnimalValues
{
public final SingleValue<Boolean> BEGGING = getSingle(false);
public final SingleValue<Integer> COLLAR_COLOR = getSingle(14);
public final SingleValue<Integer> ANGER_TIME = getSingle(0);
public final SingleValue<Boolean> BEGGING = getSingle("wolf_begging", false);
public final SingleValue<Integer> COLLAR_COLOR = getSingle("wolf_collar_color", 14);
public final SingleValue<Integer> ANGER_TIME = getSingle("wolf_anger_time", 0);

public WolfValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public class ZoglinValues extends MonsterValues
{
public final SingleValue<Boolean> IS_BABY = getSingle(false);
public final SingleValue<Boolean> IS_BABY = getSingle("zoglin_is_baby", false);

public ZoglinValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

public class ZombieValues extends MonsterValues
{
public final SingleValue<Boolean> IS_BABY = getSingle(false);
public final SingleValue<Integer> ZOMBIE_TYPE = getSingle(0);
public final SingleValue<Boolean> CONVERTING_DROWNED = getSingle(false);
public final SingleValue<Boolean> IS_BABY = getSingle("zombie_is_baby", false);
public final SingleValue<Integer> ZOMBIE_TYPE = getSingle("zombie_type", 0);
public final SingleValue<Boolean> CONVERTING_DROWNED = getSingle("zombie_converting_drowned", false);

public ZombieValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

public class ZombieVillagerValues extends ZombieValues
{
public final SingleValue<Boolean> CONVERTING = getSingle(false);
public final SingleValue<VillagerData> VILLAGER_DATA = getSingle(new VillagerData(VillagerType.PLAINS, VillagerProfession.NONE, 1));
public final SingleValue<Boolean> CONVERTING = getSingle("zVillager_converting", false);
public final SingleValue<VillagerData> VILLAGER_DATA = getSingle("zVillager_data", new VillagerData(VillagerType.PLAINS, VillagerProfession.NONE, 1));

public ZombieVillagerValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

public class AbstractFishValues extends WaterAnimalValues
{
public final SingleValue<Boolean> FROM_BUCKET = getSingle(false);
public final SingleValue<Boolean> FROM_BUCKET = getSingle("ab_fish_from_bucket", false);

public AbstractFishValues()
{
Expand Down
Loading

0 comments on commit fea8c65

Please sign in to comment.