3.4.0
- Added support for 26.3
This commit is contained in:
1 parent
f753f46572
commit
ec3db2908d
43 files changed
+410
-300
No files matched your search
@@ -44,7 +44,7 @@ This method requires [NpcPlugin](https://www.spigotmc.org/resources/npc-plugin-1
|
||||
<dependency>
|
||||
<groupId>com.github.Eisi05</groupId>
|
||||
<artifactId>NpcApi</artifactId>
|
||||
<version>3.3.6</version>
|
||||
<version>3.4.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
```
|
||||
@@ -60,7 +60,7 @@ dependencyResolutionManagement {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly 'com.github.Eisi05:NpcApi:3.3.6'
|
||||
compileOnly 'com.github.Eisi05:NpcApi:3.4.0'
|
||||
}
|
||||
```
|
||||
|
||||
@@ -93,7 +93,7 @@ Add the repository and dependency to your `pom.xml`:
|
||||
<dependency>
|
||||
<groupId>com.github.Eisi05</groupId>
|
||||
<artifactId>NpcApi</artifactId>
|
||||
<version>3.3.6</version>
|
||||
<version>3.4.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
```
|
||||
@@ -110,7 +110,7 @@ dependencyResolutionManagement {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.github.Eisi05:NpcApi:3.3.6'
|
||||
implementation 'com.github.Eisi05:NpcApi:3.4.0'
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>de.eisi05</groupId>
|
||||
<artifactId>NpcApi</artifactId>
|
||||
<version>3.3.6</version>
|
||||
<version>3.4.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>NpcApi</name>
|
||||
|
||||
@@ -6,10 +6,7 @@ import de.eisi05.npc.api.NpcApi;
|
||||
import de.eisi05.npc.api.ai.Goal;
|
||||
import de.eisi05.npc.api.objects.NPC;
|
||||
import de.eisi05.npc.api.objects.NpcOption;
|
||||
import de.eisi05.npc.api.utils.LocationUtils;
|
||||
import de.eisi05.npc.api.utils.Reflections;
|
||||
import de.eisi05.npc.api.utils.RegistryPredicate;
|
||||
import de.eisi05.npc.api.utils.SerializableBiPredicate;
|
||||
import de.eisi05.npc.api.utils.*;
|
||||
import de.eisi05.npc.api.utils.serialize.NpcRegistry;
|
||||
import de.eisi05.npc.api.wrapper.enums.Pose;
|
||||
import de.eisi05.npc.api.wrapper.objects.WrappedEntityData;
|
||||
@@ -53,6 +50,17 @@ public class AttackEntityGoal extends Goal
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static final Attribute ATTACK__DAMAGE_ATTRIBUTE =
|
||||
Versions.isCurrentVersionSmallerThan(Versions.V1_21_2) ?
|
||||
Attribute.GENERIC_ATTACK_DAMAGE : Reflections.getStaticField(Attribute.class, "ATTACK_DAMAGE");
|
||||
private static final Attribute KNOCKBACK_RESISTANCE_ATTRIBUTE =
|
||||
Versions.isCurrentVersionSmallerThan(Versions.V1_21_2) ?
|
||||
Attribute.GENERIC_KNOCKBACK_RESISTANCE : Reflections.getStaticField(Attribute.class, "KNOCKBACK_RESISTANCE");
|
||||
private static final Attribute ATTACK_KNOCKBACK_ATTRIBUTE =
|
||||
Versions.isCurrentVersionSmallerThan(Versions.V1_21_2) ?
|
||||
Attribute.GENERIC_ATTACK_KNOCKBACK : Reflections.getStaticField(Attribute.class, "ATTACK_KNOCKBACK");
|
||||
|
||||
|
||||
private static final double WEAPONMECHANICS_ATTACK_RANGE = 25.0;
|
||||
private static final double BOW_ATTACK_RANGE = 15.0;
|
||||
private static final double MELEE_ATTACK_RANGE = 3.0;
|
||||
@@ -529,7 +537,7 @@ public class AttackEntityGoal extends Goal
|
||||
if(meta == null)
|
||||
return 5;
|
||||
|
||||
Collection<AttributeModifier> modifiers = meta.getAttributeModifiers(Attribute.GENERIC_ATTACK_SPEED);
|
||||
Collection<AttributeModifier> modifiers = meta.getAttributeModifiers(ATTACK__DAMAGE_ATTRIBUTE);
|
||||
if(modifiers == null)
|
||||
return 5;
|
||||
|
||||
@@ -763,7 +771,7 @@ public class AttackEntityGoal extends Goal
|
||||
if(meta == null)
|
||||
return 0.5;
|
||||
|
||||
Collection<AttributeModifier> modifiers = meta.getAttributeModifiers(Attribute.GENERIC_ATTACK_DAMAGE);
|
||||
Collection<AttributeModifier> modifiers = meta.getAttributeModifiers(ATTACK__DAMAGE_ATTRIBUTE);
|
||||
if(modifiers == null)
|
||||
return 0.5;
|
||||
|
||||
@@ -802,7 +810,7 @@ public class AttackEntityGoal extends Goal
|
||||
if(meta == null)
|
||||
return 0.5;
|
||||
|
||||
Collection<AttributeModifier> modifiers = meta.getAttributeModifiers(Attribute.GENERIC_ATTACK_KNOCKBACK);
|
||||
Collection<AttributeModifier> modifiers = meta.getAttributeModifiers(ATTACK_KNOCKBACK_ATTRIBUTE);
|
||||
if(modifiers == null)
|
||||
return 0.5;
|
||||
|
||||
@@ -821,10 +829,10 @@ public class AttackEntityGoal extends Goal
|
||||
*/
|
||||
private double getKnockbackResistance(@NotNull LivingEntity target)
|
||||
{
|
||||
if(target.getAttribute(Attribute.GENERIC_KNOCKBACK_RESISTANCE) == null)
|
||||
if(target.getAttribute(KNOCKBACK_RESISTANCE_ATTRIBUTE) == null)
|
||||
return 0;
|
||||
|
||||
return target.getAttribute(Attribute.GENERIC_KNOCKBACK_RESISTANCE).getValue();
|
||||
return target.getAttribute(KNOCKBACK_RESISTANCE_ATTRIBUTE).getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -297,7 +297,7 @@ public class Var
|
||||
return flags;
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.chat.ResolutionContext$Builder")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.chat.ResolutionContext$Builder")
|
||||
private static class ResolutionContextBuilder extends Wrapper
|
||||
{
|
||||
private ResolutionContextBuilder()
|
||||
@@ -305,7 +305,7 @@ public class Var
|
||||
super(createInstance(ResolutionContextBuilder.class));
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "withSource")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "withSource")
|
||||
public @NotNull ResolutionContextBuilder withSource(@Nullable WrappedCommandSourceStack sourceStack)
|
||||
{
|
||||
if(sourceStack == null)
|
||||
@@ -315,14 +315,14 @@ public class Var
|
||||
return this;
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "withEntityOverride")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "withEntityOverride")
|
||||
public @NotNull ResolutionContextBuilder withEntityOverride(@Nullable WrappedEntity<?> entityOverride)
|
||||
{
|
||||
invokeWrappedMethod(entityOverride == null ? null : entityOverride.getHandle());
|
||||
return this;
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "build")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "build")
|
||||
public @NotNull Object build()
|
||||
{
|
||||
return invokeWrappedMethod();
|
||||
|
||||
@@ -105,9 +105,13 @@ public enum Versions
|
||||
*/
|
||||
V26_1("v26_1"),
|
||||
/**
|
||||
* Minecraft 26.1 version.
|
||||
* Minecraft 26.2 version.
|
||||
*/
|
||||
V26_2("v26_2");
|
||||
V26_2("v26_2"),
|
||||
/**
|
||||
* Minecraft 26.3 version.
|
||||
*/
|
||||
V26_3("v26_3");
|
||||
|
||||
/**
|
||||
* Caches the determined current server version to avoid repeated lookups.
|
||||
@@ -145,6 +149,7 @@ public enum Versions
|
||||
{
|
||||
case String v when v.startsWith("26.1") -> V26_1;
|
||||
case String v when v.startsWith("26.2") -> V26_2;
|
||||
case String v when v.startsWith("26.3") -> V26_3;
|
||||
default -> null;
|
||||
};
|
||||
|
||||
|
||||
@@ -9,95 +9,95 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.ChatFormatting")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.ChatFormatting")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.EnumChatFormat")
|
||||
public enum ChatFormat implements Wrapper.EnumWrapper, Serializable
|
||||
{
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "BLACK")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "BLACK")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
BLACK(ChatColor.BLACK),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "DARK_BLUE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "DARK_BLUE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "b")
|
||||
DARK_BLUE(ChatColor.DARK_BLUE),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "DARK_GREEN")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "DARK_GREEN")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "c")
|
||||
DARK_GREEN(ChatColor.DARK_GREEN),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "DARK_AQUA")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "DARK_AQUA")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "d")
|
||||
DARK_AQUA(ChatColor.DARK_AQUA),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "DARK_RED")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "DARK_RED")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "e")
|
||||
DARK_RED(ChatColor.DARK_RED),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "DARK_PURPLE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "DARK_PURPLE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "f")
|
||||
DARK_PURPLE(ChatColor.DARK_PURPLE),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "GOLD")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "GOLD")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "g")
|
||||
GOLD(ChatColor.GOLD),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "GRAY")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "GRAY")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "h")
|
||||
GRAY(ChatColor.GRAY),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "DARK_GRAY")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "DARK_GRAY")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "i")
|
||||
DARK_GRAY(ChatColor.DARK_GRAY),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "BLUE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "BLUE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "j")
|
||||
BLUE(ChatColor.BLUE),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "GREEN")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "GREEN")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "k")
|
||||
GREEN(ChatColor.GREEN),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "AQUA")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "AQUA")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "l")
|
||||
AQUA(ChatColor.AQUA),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "RED")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "RED")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "m")
|
||||
RED(ChatColor.RED),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "LIGHT_PURPLE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "LIGHT_PURPLE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "n")
|
||||
LIGHT_PURPLE(ChatColor.LIGHT_PURPLE),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "YELLOW")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "YELLOW")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "o")
|
||||
YELLOW(ChatColor.YELLOW),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "WHITE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "WHITE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "p")
|
||||
WHITE(ChatColor.WHITE),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "OBFUSCATED")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "OBFUSCATED")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "q")
|
||||
OBFUSCATED(ChatColor.MAGIC),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "BOLD")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "BOLD")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "r")
|
||||
BOLD(ChatColor.BOLD),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "STRIKETHROUGH")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "STRIKETHROUGH")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "s")
|
||||
STRIKETHROUGH(ChatColor.STRIKETHROUGH),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "UNDERLINE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "UNDERLINE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "t")
|
||||
UNDERLINE(ChatColor.UNDERLINE),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "ITALIC")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "ITALIC")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "u")
|
||||
ITALIC(ChatColor.ITALIC),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "RESET")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "RESET")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "v")
|
||||
RESET(ChatColor.RESET);
|
||||
|
||||
|
||||
@@ -7,27 +7,27 @@ import de.eisi05.npc.api.wrapper.Wrapper;
|
||||
import de.eisi05.npc.api.wrapper.objects.WrappedConnection;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.ConnectionProtocol")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.ConnectionProtocol")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.EnumProtocol")
|
||||
public enum ConnectionProtocol implements Wrapper.EnumWrapper
|
||||
{
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "HANDSHAKE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "HANDSHAKE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
HANDSHAKE,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "PLAY")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "PLAY")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "b")
|
||||
PLAY,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "STATUS")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "STATUS")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "c")
|
||||
STATUS,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "LOGIN")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "LOGIN")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "d")
|
||||
LOGIN,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "CONFIGURATION")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "CONFIGURATION")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "e")
|
||||
CONFIGURATION;
|
||||
|
||||
|
||||
@@ -5,39 +5,39 @@ import de.eisi05.npc.api.wrapper.Mapping;
|
||||
import de.eisi05.npc.api.wrapper.Wrapper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.world.entity.EquipmentSlot")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.world.entity.EquipmentSlot")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.world.entity.EnumItemSlot")
|
||||
public enum EquipmentSlot implements Wrapper.EnumWrapper
|
||||
{
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "MAINHAND")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "MAINHAND")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
MAINHAND,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "OFFHAND")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "OFFHAND")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "b")
|
||||
OFFHAND,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "FEET")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "FEET")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "c")
|
||||
FEET,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "LEGS")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "LEGS")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "d")
|
||||
LEGS,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "CHEST")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "CHEST")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "e")
|
||||
CHEST,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "HEAD")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "HEAD")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "f")
|
||||
HEAD,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "BODY")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "BODY")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "g")
|
||||
BODY,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "SADDLE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "SADDLE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_6, to = Versions.V1_21_11), path = "h")
|
||||
SADDLE;
|
||||
|
||||
|
||||
@@ -5,15 +5,15 @@ import de.eisi05.npc.api.wrapper.Mapping;
|
||||
import de.eisi05.npc.api.wrapper.Wrapper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.world.InteractionHand")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.world.InteractionHand")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.world.EnumHand")
|
||||
public enum InteractionHand implements Wrapper.EnumWrapper
|
||||
{
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "MAIN_HAND")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "MAIN_HAND")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
MAIN_HAND,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "OFF_HAND")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "OFF_HAND")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "b")
|
||||
OFF_HAND;
|
||||
|
||||
|
||||
@@ -9,79 +9,79 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.world.entity.Pose")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.world.entity.Pose")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.world.entity.EntityPose")
|
||||
public enum Pose implements Wrapper.EnumWrapper
|
||||
{
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "STANDING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "STANDING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
STANDING(getBukkit("STANDING"), Material.ARMOR_STAND),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "FALL_FLYING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "FALL_FLYING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "b")
|
||||
FALL_FLYING(getBukkit("FALL_FLYING"), Material.FEATHER),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "SLEEPING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "SLEEPING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "c")
|
||||
SLEEPING(getBukkit("SLEEPING"), Material.RED_BED),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "SWIMMING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "SWIMMING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "d")
|
||||
SWIMMING(getBukkit("SWIMMING"), Material.WATER_BUCKET),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "SPIN_ATTACK")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "SPIN_ATTACK")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "e")
|
||||
SPIN_ATTACK(getBukkit("SPIN_ATTACK"), Material.TRIDENT),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "CROUCHING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "CROUCHING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "f")
|
||||
CROUCHING(getBukkit("SNEAKING"), Material.LEATHER_BOOTS),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "LONG_JUMPING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "LONG_JUMPING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "g")
|
||||
LONG_JUMPING(getBukkit("LONG_JUMPING"), null),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "DYING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "DYING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "h")
|
||||
DYING(getBukkit("DYING"), null),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "CROAKING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "CROAKING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "i")
|
||||
CROAKING(getBukkit("CROAKING"), null),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "USING_TONGUE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "USING_TONGUE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "j")
|
||||
USING_TONGUE(getBukkit("USING_TONGUE"), null),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "SITTING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "SITTING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "k")
|
||||
SITTING(getBukkit("SITTING"), Material.OAK_STAIRS),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "ROARING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "ROARING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "l")
|
||||
ROARING(getBukkit("ROARING"), null),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "SNIFFING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "SNIFFING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "m")
|
||||
SNIFFING(getBukkit("SNIFFING"), null),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "EMERGING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "EMERGING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "n")
|
||||
EMERGING(getBukkit("EMERGING"), null),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "DIGGING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "DIGGING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "o")
|
||||
DIGGING(getBukkit("DIGGING"), null),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "SLIDING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "SLIDING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "p")
|
||||
SLIDING(getBukkit("SLIDING"), null),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "SHOOTING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "SHOOTING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "q")
|
||||
SHOOTING(getBukkit("SHOOTING"), null),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "INHALING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "INHALING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "r")
|
||||
INHALING(getBukkit("INHALING"), null);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import de.eisi05.npc.api.wrapper.Wrapper;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.world.entity.ai.attributes.AttributeInstance")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.world.entity.ai.attributes.AttributeInstance")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.world.entity.ai.attributes.AttributeModifiable")
|
||||
public class WrappedAttributeInstance extends Wrapper
|
||||
{
|
||||
@@ -20,18 +20,18 @@ public class WrappedAttributeInstance extends Wrapper
|
||||
super(createInstance(WrappedAttributeInstance.class, holder, consumer));
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "setBaseValue")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "setBaseValue")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
public void setBaseValue(double value)
|
||||
{
|
||||
invokeWrappedMethod(value);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.world.entity.ai.attributes.Attributes")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.world.entity.ai.attributes.Attributes")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.world.entity.ai.attributes.GenericAttributes")
|
||||
public static class Attributes extends Wrapper
|
||||
{
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "SCALE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "SCALE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_11, to = Versions.V1_21_11), path = "A")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_6, to = Versions.V1_21_9), path = "z")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21, to = Versions.V1_21_5), path = "y")
|
||||
|
||||
@@ -5,7 +5,7 @@ import de.eisi05.npc.api.wrapper.Mapping;
|
||||
import de.eisi05.npc.api.wrapper.Wrapper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_2), path = "net.minecraft.server.level.ClientInformation")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_3), path = "net.minecraft.server.level.ClientInformation")
|
||||
public class WrappedClientInformation extends Wrapper
|
||||
{
|
||||
private WrappedClientInformation(Object handle)
|
||||
@@ -13,7 +13,7 @@ public class WrappedClientInformation extends Wrapper
|
||||
super(handle);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "createDefault")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "createDefault")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
public static @NotNull WrappedClientInformation createDefault()
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.commands.CommandSourceStack")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.commands.CommandSourceStack")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.commands.CommandListenerWrapper")
|
||||
public class WrappedCommandSourceStack extends Wrapper
|
||||
{
|
||||
@@ -23,13 +23,13 @@ public class WrappedCommandSourceStack extends Wrapper
|
||||
super(handle);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_2), path = "getBukkitSender")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_3), path = "getBukkitSender")
|
||||
public CommandSender getBukkitSender()
|
||||
{
|
||||
return invokeWrappedMethod();
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "getEntity")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "getEntity")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_11), path = "g")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_9), path = "f")
|
||||
public @NotNull WrappedEntity<?> getEntity()
|
||||
@@ -37,7 +37,7 @@ public class WrappedCommandSourceStack extends Wrapper
|
||||
return new WrappedEntity<>(invokeWrappedMethod());
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "withMaximumPermission")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "withMaximumPermission")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_11), path = "b")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_9), path = "a")
|
||||
public @NotNull WrappedCommandSourceStack withMaximumPermission()
|
||||
@@ -47,7 +47,7 @@ public class WrappedCommandSourceStack extends Wrapper
|
||||
return new WrappedCommandSourceStack(invokeWrappedMethod(WrappedPermissionSet.ALL.getHandle()));
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "withEntity")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "withEntity")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
public @NotNull WrappedCommandSourceStack withEntity(WrappedEntity<?> entity)
|
||||
{
|
||||
@@ -67,7 +67,7 @@ public class WrappedCommandSourceStack extends Wrapper
|
||||
}
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "withSuppressedOutput")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "withSuppressedOutput")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
public @NotNull WrappedCommandSourceStack withSuppressedOutput()
|
||||
{
|
||||
@@ -86,28 +86,28 @@ public class WrappedCommandSourceStack extends Wrapper
|
||||
return new Location(getWorld(), position.getX(), position.getY(), position.getZ(), rotation.getPitch(), rotation.getYaw());
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "withPosition")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "withPosition")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
public @NotNull WrappedCommandSourceStack withPosition(@NotNull Vector vector)
|
||||
{
|
||||
return new WrappedCommandSourceStack(invokeWrappedMethod(WrappedVec3D.fromVector(vector).getHandle()));
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "withRotation")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "withRotation")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
public @NotNull WrappedCommandSourceStack withRotation(float yaw, float pitch)
|
||||
{
|
||||
return new WrappedCommandSourceStack(invokeWrappedMethod(new WrappedVec2F(yaw, pitch).getHandle()));
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "withLevel")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "withLevel")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
public @NotNull WrappedCommandSourceStack withWorld(@NotNull World world)
|
||||
{
|
||||
return new WrappedCommandSourceStack(invokeWrappedMethod(Var.getNmsLevel(world)));
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "isSilent")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "isSilent")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_11), path = "y")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_2, to = Versions.V1_21_9), path = "x")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21), path = "y")
|
||||
@@ -116,7 +116,7 @@ public class WrappedCommandSourceStack extends Wrapper
|
||||
return invokeWrappedMethod();
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "getPosition")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "getPosition")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_11), path = "e")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_9), path = "d")
|
||||
public @NotNull Vector getPosition()
|
||||
@@ -124,7 +124,7 @@ public class WrappedCommandSourceStack extends Wrapper
|
||||
return WrappedVec3D.fromHandle(invokeWrappedMethod()).toVector();
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "getRotation")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "getRotation")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_11), path = "l")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_9), path = "k")
|
||||
public @NotNull WrappedVec2F getRotation()
|
||||
@@ -132,7 +132,7 @@ public class WrappedCommandSourceStack extends Wrapper
|
||||
return new WrappedVec2F(invokeWrappedMethod());
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "getLevel")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "getLevel")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_11), path = "f")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_9), path = "e")
|
||||
public @NotNull World getWorld()
|
||||
@@ -140,14 +140,14 @@ public class WrappedCommandSourceStack extends Wrapper
|
||||
return (World) Reflections.invokeMethod(invokeWrappedMethod(), "getWorld").get();
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_11, to = Versions.V26_2), path = "net.minecraft.server.permissions.PermissionSet")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_11, to = Versions.V26_3), path = "net.minecraft.server.permissions.PermissionSet")
|
||||
private static class WrappedPermissionSet extends Wrapper
|
||||
{
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "NO_PERMISSIONS")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "NO_PERMISSIONS")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_11, to = Versions.V1_21_11), path = "g")
|
||||
public static final WrappedPermissionSet NO = new WrappedPermissionSet(getStaticWrappedFieldValue("NO").orElse(null));
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "ALL_PERMISSIONS")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "ALL_PERMISSIONS")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_11, to = Versions.V1_21_11), path = "h")
|
||||
public static final WrappedPermissionSet ALL = new WrappedPermissionSet(getStaticWrappedFieldValue("ALL").orElse(null));
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.util.function.UnaryOperator;
|
||||
* A wrapper class for Minecraft's chat component system, providing a type-safe way to create and manipulate
|
||||
* chat messages with formatting, click events, hover events, and other rich text features.
|
||||
*/
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.chat.Component")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.chat.Component")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.chat.IChatBaseComponent")
|
||||
public class WrappedComponent extends Wrapper
|
||||
{
|
||||
@@ -56,7 +56,7 @@ public class WrappedComponent extends Wrapper
|
||||
* @param text The text to display (can be null for empty component)
|
||||
* @return A new WrappedComponent containing the specified text
|
||||
*/
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "literal")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "literal")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
public static @NotNull WrappedComponent create(@Nullable String text)
|
||||
{
|
||||
@@ -83,7 +83,7 @@ public class WrappedComponent extends Wrapper
|
||||
* @param format One or more ChatFormat values to apply (e.g., BOLD, ITALIC, UNDERLINE)
|
||||
* @return This component for method chaining
|
||||
*/
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "withStyle")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "withStyle")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
public @NotNull WrappedComponent setFormats(@NotNull ChatFormat... format)
|
||||
{
|
||||
@@ -119,7 +119,7 @@ public class WrappedComponent extends Wrapper
|
||||
* @param clickEvent The click event to add
|
||||
* @return This component for method chaining
|
||||
*/
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "withStyle")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "withStyle")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
public @NotNull WrappedComponent withClickEvent(@NotNull ClickEvent clickEvent)
|
||||
{
|
||||
@@ -133,7 +133,7 @@ public class WrappedComponent extends Wrapper
|
||||
* @param hoverEvent The hover event to add
|
||||
* @return This component for method chaining
|
||||
*/
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "withStyle")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "withStyle")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
public @NotNull WrappedComponent withHoverEvent(@NotNull HoverEvent hoverEvent)
|
||||
{
|
||||
@@ -147,7 +147,7 @@ public class WrappedComponent extends Wrapper
|
||||
* @param wrappedComponent The component to append
|
||||
* @return This component for method chaining
|
||||
*/
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "append")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "append")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "b")
|
||||
public @NotNull WrappedComponent append(WrappedComponent wrappedComponent)
|
||||
{
|
||||
@@ -160,7 +160,7 @@ public class WrappedComponent extends Wrapper
|
||||
*
|
||||
* @return A new WrappedComponent that is a copy of this one
|
||||
*/
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "copy")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "copy")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "f")
|
||||
public @NotNull WrappedComponent copy()
|
||||
{
|
||||
@@ -199,10 +199,10 @@ public class WrappedComponent extends Wrapper
|
||||
return new SerializedComponent(toLegacy(true));
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_2), path = "net.minecraft.network.chat.CommonComponents")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_3), path = "net.minecraft.network.chat.CommonComponents")
|
||||
private static class CommonComponents extends Wrapper
|
||||
{
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "EMPTY")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "EMPTY")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
private static final Object EMPTY = getStaticWrappedFieldValue("EMPTY").orElse(null);
|
||||
|
||||
@@ -212,7 +212,7 @@ public class WrappedComponent extends Wrapper
|
||||
}
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.chat.ClickEvent")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.chat.ClickEvent")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.chat.ChatClickable")
|
||||
public static class ClickEvent extends Wrapper
|
||||
{
|
||||
@@ -228,41 +228,41 @@ public class WrappedComponent extends Wrapper
|
||||
return action.function.apply(value);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.chat.ClickEvent$Action")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.chat.ClickEvent$Action")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.chat.ChatClickable$EnumClickAction")
|
||||
public enum ClickAction implements EnumWrapper
|
||||
{
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "OPEN_URL")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "OPEN_URL")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
OPEN_URL(o -> new OpenUrl((URI) o)),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "OPEN_FILE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "OPEN_FILE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "b")
|
||||
OPEN_FILE(o -> new OpenFile((String) o)),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "RUN_COMMAND")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "RUN_COMMAND")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "c")
|
||||
RUN_COMMAND(o -> new RunCommand((String) o)),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "SUGGEST_COMMAND")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "SUGGEST_COMMAND")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "d")
|
||||
SUGGEST_COMMAND(o -> new SuggestCommand((String) o)),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "SHOW_DIALOG")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "SHOW_DIALOG")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_6, to = Versions.V1_21_11), path = "e")
|
||||
SHOW_DIALOG(ShowDialog::new),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "CHANGE_PAGE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "CHANGE_PAGE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_6, to = Versions.V1_21_11), path = "f")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_5), path = "e")
|
||||
CHANGE_PAGE(o -> new ChangePage((int) o)),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "COPY_TO_CLIPBOARD")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "COPY_TO_CLIPBOARD")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_6, to = Versions.V1_21_11), path = "g")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_5), path = "f")
|
||||
COPY_TO_CLIPBOARD(o -> new CopyToClipboard((String) o)),
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "CUSTOM")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "CUSTOM")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_6, to = Versions.V1_21_11), path = "h")
|
||||
CUSTOM(o -> new Custom(((Object[]) o)[0], (Optional<?>) ((Object[]) o)[1]));
|
||||
|
||||
@@ -280,7 +280,7 @@ public class WrappedComponent extends Wrapper
|
||||
}
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.chat.ClickEvent$OpenUrl")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.chat.ClickEvent$OpenUrl")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_5, to = Versions.V1_21_11), path = "net.minecraft.network.chat.ChatClickable$OpenUrl")
|
||||
private static class OpenUrl extends WrappedComponent.ClickEvent
|
||||
{
|
||||
@@ -290,7 +290,7 @@ public class WrappedComponent extends Wrapper
|
||||
}
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.chat.ClickEvent$OpenFile")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.chat.ClickEvent$OpenFile")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_5, to = Versions.V1_21_11), path = "net.minecraft.network.chat.ChatClickable$OpenFile")
|
||||
private static class OpenFile extends WrappedComponent.ClickEvent
|
||||
{
|
||||
@@ -300,7 +300,7 @@ public class WrappedComponent extends Wrapper
|
||||
}
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.chat.ClickEvent$RunCommand")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.chat.ClickEvent$RunCommand")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_5, to = Versions.V1_21_11), path = "net.minecraft.network.chat.ChatClickable$RunCommand")
|
||||
private static class RunCommand extends WrappedComponent.ClickEvent
|
||||
{
|
||||
@@ -310,7 +310,7 @@ public class WrappedComponent extends Wrapper
|
||||
}
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.chat.ClickEvent$SuggestCommand")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.chat.ClickEvent$SuggestCommand")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_5, to = Versions.V1_21_11), path = "net.minecraft.network.chat.ChatClickable$SuggestCommand")
|
||||
private static class SuggestCommand extends WrappedComponent.ClickEvent
|
||||
{
|
||||
@@ -320,7 +320,7 @@ public class WrappedComponent extends Wrapper
|
||||
}
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.chat.ClickEvent$ChangePage")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.chat.ClickEvent$ChangePage")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_5, to = Versions.V1_21_11), path = "net.minecraft.network.chat.ChatClickable$ChangePage")
|
||||
private static class ChangePage extends WrappedComponent.ClickEvent
|
||||
{
|
||||
@@ -330,7 +330,7 @@ public class WrappedComponent extends Wrapper
|
||||
}
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.chat.ClickEvent$CopyToClipboard")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.chat.ClickEvent$CopyToClipboard")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_5, to = Versions.V1_21_11), path = "net.minecraft.network.chat.ChatClickable$CopyToClipboard")
|
||||
private static class CopyToClipboard extends WrappedComponent.ClickEvent
|
||||
{
|
||||
@@ -340,7 +340,7 @@ public class WrappedComponent extends Wrapper
|
||||
}
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.chat.ClickEvent$ShowDialog")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.chat.ClickEvent$ShowDialog")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_6, to = Versions.V1_21_11), path = "net.minecraft.network.chat.ChatClickable$h")
|
||||
private static class ShowDialog extends WrappedComponent.ClickEvent
|
||||
{
|
||||
@@ -350,7 +350,7 @@ public class WrappedComponent extends Wrapper
|
||||
}
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.chat.ClickEvent$Custom")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.chat.ClickEvent$Custom")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_6, to = Versions.V1_21_11), path = "net.minecraft.network.chat.ChatClickable$d")
|
||||
private static class Custom extends WrappedComponent.ClickEvent
|
||||
{
|
||||
@@ -361,7 +361,7 @@ public class WrappedComponent extends Wrapper
|
||||
}
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.chat.HoverEvent")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.chat.HoverEvent")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.chat.ChatHoverable")
|
||||
public static class HoverEvent extends Wrapper
|
||||
{
|
||||
@@ -377,7 +377,7 @@ public class WrappedComponent extends Wrapper
|
||||
return new ShowText(component);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.chat.HoverEvent$ShowText")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.chat.HoverEvent$ShowText")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_5, to = Versions.V1_21_11), path = "net.minecraft.network.chat.ChatHoverable$e")
|
||||
private static class ShowText extends HoverEvent
|
||||
{
|
||||
@@ -387,11 +387,11 @@ public class WrappedComponent extends Wrapper
|
||||
}
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.chat.HoverEvent$Action")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.chat.HoverEvent$Action")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.chat.ChatHoverable$EnumHoverAction")
|
||||
private static class HoverAction extends Wrapper
|
||||
{
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "SHOW_TEXT")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "SHOW_TEXT")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
private static final Object SHOW_TEXT = getStaticWrappedFieldValue("SHOW_TEXT").orElse(null);
|
||||
|
||||
@@ -420,7 +420,7 @@ public class WrappedComponent extends Wrapper
|
||||
}
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.chat.Style")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.chat.Style")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.chat.ChatModifier")
|
||||
public static class Style extends Wrapper
|
||||
{
|
||||
@@ -429,14 +429,14 @@ public class WrappedComponent extends Wrapper
|
||||
super(handle);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "withClickEvent")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "withClickEvent")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
public @NotNull Style withClickEvent(@NotNull ClickEvent clickEvent)
|
||||
{
|
||||
return new Style(invokeWrappedMethod(clickEvent));
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "withHoverEvent")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "withHoverEvent")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
public @NotNull Style withHoverEvent(@NotNull HoverEvent hoverEvent)
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ import io.netty.channel.Channel;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.server.network.ServerGamePacketListenerImpl")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.server.network.ServerGamePacketListenerImpl")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.server.network.PlayerConnection")
|
||||
public class WrappedConnection extends Wrapper
|
||||
{
|
||||
@@ -24,14 +24,14 @@ public class WrappedConnection extends Wrapper
|
||||
super(createInstance(WrappedConnection.class, server, networkManager, player, commonListenerCookie));
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "sendPacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "sendPacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "b")
|
||||
public void sendPacket(@NotNull PacketWrapper packet)
|
||||
{
|
||||
invokeWrappedMethod(packet);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "connection")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "connection")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "e")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_20_6), path = "c")
|
||||
public @NotNull WrappedNetworkManager networkManager()
|
||||
@@ -39,7 +39,7 @@ public class WrappedConnection extends Wrapper
|
||||
return new WrappedNetworkManager(getWrappedFieldValue());
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.Connection")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.Connection")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.NetworkManager")
|
||||
public static class WrappedNetworkManager extends Wrapper
|
||||
{
|
||||
@@ -53,7 +53,7 @@ public class WrappedConnection extends Wrapper
|
||||
return new WrappedNetworkManager(createInstance(WrappedNetworkManager.class, packetFlow));
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "channel")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "channel")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_11, to = Versions.V1_21_11), path = "k")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_9), path = "n")
|
||||
public @NotNull Channel channel()
|
||||
@@ -61,7 +61,7 @@ public class WrappedConnection extends Wrapper
|
||||
return getWrappedFieldValue();
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "channel")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "channel")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_11, to = Versions.V1_21_11), path = "k")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_9), path = "n")
|
||||
public void setChannel(@Nullable Channel channel)
|
||||
@@ -69,15 +69,15 @@ public class WrappedConnection extends Wrapper
|
||||
setWrappedFieldValue(channel);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.protocol.PacketFlow")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.protocol.PacketFlow")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.protocol.EnumProtocolDirection")
|
||||
public enum PacketFlow implements EnumWrapper
|
||||
{
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "SERVERBOUND")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "SERVERBOUND")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
SERVERBOUND,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "CLIENTBOUND")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "CLIENTBOUND")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "b")
|
||||
CLIENTBOUND;
|
||||
|
||||
@@ -89,7 +89,7 @@ public class WrappedConnection extends Wrapper
|
||||
}
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_2), path = "net.minecraft.server.network.CommonListenerCookie")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_3), path = "net.minecraft.server.network.CommonListenerCookie")
|
||||
public static class CommonListenerCookie extends Wrapper
|
||||
{
|
||||
public CommonListenerCookie(@NotNull GameProfile profile, int latency, boolean transferred)
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.bukkit.entity.EnderDragon;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.world.entity.boss.enderdragon.EnderDragon")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.world.entity.boss.enderdragon.EnderDragon")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.world.entity.boss.EntityEnderDragon")
|
||||
public class WrappedEnderDragon extends WrappedEntity<EnderDragon>
|
||||
{
|
||||
@@ -16,7 +16,7 @@ public class WrappedEnderDragon extends WrappedEntity<EnderDragon>
|
||||
super(handle);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "subEntities")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "subEntities")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_11), path = "cF")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_9), path = "cD")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_6), path = "cu")
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.Arrays;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_2), path = "net.minecraft.world.entity.Entity")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_3), path = "net.minecraft.world.entity.Entity")
|
||||
public class WrappedEntity<T extends Entity> extends Wrapper
|
||||
{
|
||||
public String data = "{}";
|
||||
@@ -58,20 +58,20 @@ public class WrappedEntity<T extends Entity> extends Wrapper
|
||||
return false;
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_2), path = "getBukkitEntity")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_3), path = "getBukkitEntity")
|
||||
public @NotNull T getBukkitPlayer()
|
||||
{
|
||||
return invokeWrappedMethod();
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "absSnapTo")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "absSnapTo")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
public void moveTo(@NotNull Location location)
|
||||
{
|
||||
invokeWrappedMethod(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "getEntityData")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "getEntityData")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_11), path = "aD")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_9), path = "aC")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_6), path = "au")
|
||||
@@ -84,7 +84,7 @@ public class WrappedEntity<T extends Entity> extends Wrapper
|
||||
return new WrappedEntityData(invokeWrappedMethod());
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "passengers")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "passengers")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_9, to = Versions.V1_21_11), path = "aS")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_6), path = "aR")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_5), path = "u")
|
||||
@@ -95,7 +95,7 @@ public class WrappedEntity<T extends Entity> extends Wrapper
|
||||
setWrappedFieldValue(ImmutableList.copyOf(Arrays.stream(entities).map(wrappedEntity -> wrappedEntity.handle).toList()));
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "level")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "level")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_11), path = "ao")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_9), path = "an")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_6), path = "ai")
|
||||
@@ -106,7 +106,7 @@ public class WrappedEntity<T extends Entity> extends Wrapper
|
||||
return invokeWrappedMethod();
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "getAddEntityPacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "getAddEntityPacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21, to = Versions.V1_21_11), path = "a")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_20_6), path = "dl")
|
||||
public @NotNull PacketWrapper getAddEntityPacket()
|
||||
@@ -116,7 +116,7 @@ public class WrappedEntity<T extends Entity> extends Wrapper
|
||||
return new CustomPacket(invokeWrappedMethod(new WrappedEntityTrackerEntry(this)));
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "getBoundingBox")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "getBoundingBox")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_11), path = "dj")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_9), path = "de")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_6), path = "cV")
|
||||
@@ -132,7 +132,7 @@ public class WrappedEntity<T extends Entity> extends Wrapper
|
||||
return defaultBoundingBox;
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "setId")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "setId")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_9, to = Versions.V1_21_11), path = "e")
|
||||
public void setId(int id)
|
||||
{
|
||||
@@ -149,10 +149,10 @@ public class WrappedEntity<T extends Entity> extends Wrapper
|
||||
return getBukkitPlayer().getWorld();
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_2), path = "net.minecraft.world.entity.Entity$RemovalReason")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_3), path = "net.minecraft.world.entity.Entity$RemovalReason")
|
||||
enum RemovalReason implements EnumWrapper
|
||||
{
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "DISCARDED")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "DISCARDED")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "b")
|
||||
DISCARDED;
|
||||
|
||||
@@ -163,10 +163,10 @@ public class WrappedEntity<T extends Entity> extends Wrapper
|
||||
}
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_2, to = Versions.V26_2), path = "net.minecraft.world.entity.EntitySpawnReason")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_2, to = Versions.V26_3), path = "net.minecraft.world.entity.EntitySpawnReason")
|
||||
enum SpawnReason implements EnumWrapper
|
||||
{
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "LOAD")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "LOAD")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_2, to = Versions.V1_21_11), path = "r")
|
||||
LOAD;
|
||||
|
||||
@@ -177,10 +177,10 @@ public class WrappedEntity<T extends Entity> extends Wrapper
|
||||
}
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_11, to = Versions.V26_2), path = "net.minecraft.world.entity.EntityProcessor")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_11, to = Versions.V26_3), path = "net.minecraft.world.entity.EntityProcessor")
|
||||
static class EntityProcessor extends Wrapper
|
||||
{
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "NOP")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "NOP")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_11), path = "a")
|
||||
public static final Object NOP = getStaticWrappedFieldValue("NOP").orElse(null);
|
||||
|
||||
@@ -190,19 +190,19 @@ public class WrappedEntity<T extends Entity> extends Wrapper
|
||||
}
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_2, to = Versions.V26_2), path = "net.minecraft.world.entity.EntityTypes")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_2, to = Versions.V26_3), path = "net.minecraft.world.entity.EntityTypes")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V26_1), path = "net.minecraft.world.entity.EntityType")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.world.entity.EntityTypes")
|
||||
public static class EntityTypes extends Wrapper
|
||||
{
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "ARMOR_STAND")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "ARMOR_STAND")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_9, to = Versions.V1_21_11), path = "h")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_5, to = Versions.V1_21_6), path = "g")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_2, to = Versions.V1_21_4), path = "f")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21), path = "d")
|
||||
public static final Object ARMOR_STAND = getStaticWrappedFieldValue("ARMOR_STAND").orElse(null);
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "TEXT_DISPLAY")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "TEXT_DISPLAY")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_11), path = "bD")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_9), path = "bA")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_6), path = "bx")
|
||||
@@ -212,7 +212,7 @@ public class WrappedEntity<T extends Entity> extends Wrapper
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21), path = "bb")
|
||||
public static final Object TEXT_DISPLAY = getStaticWrappedFieldValue("TEXT_DISPLAY").orElse(null);
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "INTERACTION")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "INTERACTION")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_11), path = "at")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_9), path = "as")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_6), path = "aq")
|
||||
@@ -228,7 +228,7 @@ public class WrappedEntity<T extends Entity> extends Wrapper
|
||||
}
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.world.phys.AABB")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.world.phys.AABB")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.world.phys.AxisAlignedBB")
|
||||
public static class BoundingBox extends Wrapper
|
||||
{
|
||||
@@ -237,21 +237,21 @@ public class WrappedEntity<T extends Entity> extends Wrapper
|
||||
super(handle);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "getXsize")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "getXsize")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "b")
|
||||
public double getXSize()
|
||||
{
|
||||
return invokeWrappedMethod();
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "getYsize")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "getYsize")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "c")
|
||||
public double getYSize()
|
||||
{
|
||||
return invokeWrappedMethod();
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "getZsize")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "getZsize")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "d")
|
||||
public double getZSize()
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.util.Optional;
|
||||
import java.util.OptionalInt;
|
||||
import java.util.UUID;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.syncher.SynchedEntityData")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.syncher.SynchedEntityData")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.syncher.DataWatcher")
|
||||
public class WrappedEntityData extends Wrapper
|
||||
{
|
||||
@@ -22,7 +22,7 @@ public class WrappedEntityData extends Wrapper
|
||||
super(handle);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "set")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "set")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
public <T> void set(@NotNull EntityDataAccessor<T> accessor, @Nullable T value)
|
||||
{
|
||||
@@ -30,34 +30,34 @@ public class WrappedEntityData extends Wrapper
|
||||
markDirty(accessor);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "get")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "get")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
public <T> @Nullable T get(@NotNull EntityDataAccessor<T> accessor)
|
||||
{
|
||||
return invokeWrappedMethod(accessor);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "packDirty")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "packDirty")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "b")
|
||||
public @NotNull List<?> packDirty()
|
||||
{
|
||||
return invokeWrappedMethod();
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_2), path = "markDirty")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_3), path = "markDirty")
|
||||
public <T> void markDirty(@NotNull EntityDataAccessor<T> accessor)
|
||||
{
|
||||
invokeWrappedMethod(accessor);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "getNonDefaultValues")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "getNonDefaultValues")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "c")
|
||||
public List<?> getAll()
|
||||
{
|
||||
return invokeWrappedMethod();
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.syncher.EntityDataAccessor")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.syncher.EntityDataAccessor")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.syncher.DataWatcherObject")
|
||||
public static class EntityDataAccessor<T> extends Wrapper
|
||||
{
|
||||
@@ -72,7 +72,7 @@ public class WrappedEntityData extends Wrapper
|
||||
}
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.syncher.EntityDataSerializer")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.syncher.EntityDataSerializer")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.syncher.DataWatcherSerializer")
|
||||
public static class EntityDataSerializer<T> extends Wrapper
|
||||
{
|
||||
@@ -87,83 +87,83 @@ public class WrappedEntityData extends Wrapper
|
||||
}
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.syncher.EntityDataSerializers")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.syncher.EntityDataSerializers")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.syncher.DataWatcherRegistry")
|
||||
public static class EntityDataSerializers extends Wrapper
|
||||
{
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "BYTE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "BYTE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
public static final EntityDataSerializer<Byte> BYTE = new EntityDataSerializer<>(getStaticWrappedFieldValue("BYTE").orElse(null));
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "INT")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_4, to = Versions.V1_21_11), path = "b")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "INT")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "b")
|
||||
public static final EntityDataSerializer<Integer> INT = new EntityDataSerializer<>(getStaticWrappedFieldValue("INT").orElse(null));
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "LONG")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "LONG")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "c")
|
||||
public static final EntityDataSerializer<Long> LONG = new EntityDataSerializer<>(getStaticWrappedFieldValue("LONG").orElse(null));
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "FLOAT")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "FLOAT")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "d")
|
||||
public static final EntityDataSerializer<Float> FLOAT = new EntityDataSerializer<>(getStaticWrappedFieldValue("FLOAT").orElse(null));
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "STRING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "STRING")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "e")
|
||||
public static final EntityDataSerializer<String> STRING = new EntityDataSerializer<>(getStaticWrappedFieldValue("STRING").orElse(null));
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "COMPONENT")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "COMPONENT")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "f")
|
||||
public static final EntityDataSerializer<?> CHAT_COMPONENT = new EntityDataSerializer<>(
|
||||
getStaticWrappedFieldValue("CHAT_COMPONENT").orElse(null));
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "OPTIONAL_COMPONENT")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "OPTIONAL_COMPONENT")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "g")
|
||||
public static final EntityDataSerializer<Optional<?>> OPTIONAL_CHAT_COMPONENT = new EntityDataSerializer<>(
|
||||
getStaticWrappedFieldValue("OPTIONAL_CHAT_COMPONENT").orElse(null));
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "ITEM_STACK")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "ITEM_STACK")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "h")
|
||||
public static final EntityDataSerializer<?> ITEM_STACK = new EntityDataSerializer<>(getStaticWrappedFieldValue("ITEM_STACK").orElse(null));
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "BLOCK_STATE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "BLOCK_STATE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "i")
|
||||
public static final EntityDataSerializer<?> BLOCK_DATA = new EntityDataSerializer<>(
|
||||
getStaticWrappedFieldValue("BLOCK_DATA").orElse(null));
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "OPTIONAL_BLOCK_STATE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "OPTIONAL_BLOCK_STATE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "j")
|
||||
public static final EntityDataSerializer<Optional<?>> OPTIONAL_BLOCK_DATA = new EntityDataSerializer<>(
|
||||
getStaticWrappedFieldValue("OPTIONAL_BLOCK_DATA").orElse(null));
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "BOOLEAN")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "BOOLEAN")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "k")
|
||||
public static final EntityDataSerializer<Boolean> BOOLEAN = new EntityDataSerializer<>(getStaticWrappedFieldValue("BOOLEAN").orElse(null));
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "PARTICLE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "PARTICLE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "l")
|
||||
public static final EntityDataSerializer<?> PARTICLE_PARAM = new EntityDataSerializer<>(
|
||||
getStaticWrappedFieldValue("PARTICLE_PARAM").orElse(null));
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "PARTICLES")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "PARTICLES")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "m")
|
||||
public static final EntityDataSerializer<List<?>> PARTICLE_PARAM_LIST = new EntityDataSerializer<>(
|
||||
getStaticWrappedFieldValue("PARTICLE_PARAM_LIST").orElse(null));
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "ROTATIONS")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "ROTATIONS")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "n")
|
||||
public static final EntityDataSerializer<?> VECTOR = new EntityDataSerializer<>(getStaticWrappedFieldValue("VECTOR").orElse(null));
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "BLOCK_POS")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "BLOCK_POS")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "o")
|
||||
public static final EntityDataSerializer<?> BLOCK_POSITION = new EntityDataSerializer<>(
|
||||
getStaticWrappedFieldValue("BLOCK_POSITION").orElse(null));
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "OPTIONAL_BLOCK_POS")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "OPTIONAL_BLOCK_POS")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "p")
|
||||
public static final EntityDataSerializer<?> OPTIONAL_BLOCK_POSITION = new EntityDataSerializer<>(
|
||||
getStaticWrappedFieldValue("OPTIONAL_BLOCK_POSITION").orElse(null));
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "DIRECTION")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "DIRECTION")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "q")
|
||||
public static final EntityDataSerializer<?> ENUM_DIRECTION = new EntityDataSerializer<>(
|
||||
getStaticWrappedFieldValue("ENUM_DIRECTION").orElse(null));
|
||||
@@ -172,12 +172,12 @@ public class WrappedEntityData extends Wrapper
|
||||
public static final EntityDataSerializer<Optional<UUID>> OPTIONAL_UUID = new EntityDataSerializer<>(
|
||||
getStaticWrappedFieldValue("OPTIONAL_UUID").orElse(null));
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "OPTIONAL_LIVING_ENTITY_REFERENCE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "OPTIONAL_LIVING_ENTITY_REFERENCE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_5, to = Versions.V1_21_11), path = "r")
|
||||
public static final EntityDataSerializer<Optional<?>> OPTIONAL_ENTITY_REFERENCE = new EntityDataSerializer<>(
|
||||
getStaticWrappedFieldValue("OPTIONAL_ENTITY_REFERENCE").orElse(null));
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "OPTIONAL_GLOBAL_POS")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "OPTIONAL_GLOBAL_POS")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "s")
|
||||
public static final EntityDataSerializer<Optional<?>> OPTIONAL_GLOBAL_POS = new EntityDataSerializer<>(
|
||||
getStaticWrappedFieldValue("OPTIONAL_GLOBAL_POS").orElse(null));
|
||||
@@ -185,25 +185,25 @@ public class WrappedEntityData extends Wrapper
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_6), path = "t")
|
||||
public static final EntityDataSerializer<?> NBT_TAG = new EntityDataSerializer<>(getStaticWrappedFieldValue("NBT_TAG").orElse(null));
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "VILLAGER_DATA")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "VILLAGER_DATA")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_9, to = Versions.V1_21_11), path = "t")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_6), path = "u")
|
||||
public static final EntityDataSerializer<?> VILLAGER_DATA = new EntityDataSerializer<>(
|
||||
getStaticWrappedFieldValue("VILLAGER_DATA").orElse(null));
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "OPTIONAL_UNSIGNED_INT")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "OPTIONAL_UNSIGNED_INT")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_9, to = Versions.V1_21_11), path = "u")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_6), path = "v")
|
||||
public static final EntityDataSerializer<OptionalInt> OPTIONAL_INT = new EntityDataSerializer<>(
|
||||
getStaticWrappedFieldValue("OPTIONAL_INT").orElse(null));
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "POSE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "POSE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_9, to = Versions.V1_21_11), path = "v")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_6), path = "w")
|
||||
public static final EntityDataSerializer<Pose> ENTITY_POSE = new EntityDataSerializer<>(
|
||||
getStaticWrappedFieldValue("ENTITY_POSE").orElse(null));
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "VECTOR3")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "VECTOR3")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_11), path = "J")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_9), path = "I")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_5, to = Versions.V1_21_6), path = "H")
|
||||
@@ -211,7 +211,7 @@ public class WrappedEntityData extends Wrapper
|
||||
public static final EntityDataSerializer<Vector3f> VECTOR3 = new EntityDataSerializer<>(
|
||||
getStaticWrappedFieldValue("VECTOR3").orElse(null));
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "QUARTERNION")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "QUARTERNION")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_11), path = "K")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_9), path = "J")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_5, to = Versions.V1_21_6), path = "I")
|
||||
@@ -219,17 +219,21 @@ public class WrappedEntityData extends Wrapper
|
||||
public static final EntityDataSerializer<?> QUARTERNION = new EntityDataSerializer<>(
|
||||
getStaticWrappedFieldValue("QUARTERNION").orElse(null));
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "RESOLVABLE_PROFILE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "RESOLVABLE_PROFILE")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_11), path = "L")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_9), path = "K")
|
||||
public static final EntityDataSerializer<?> RESOLVABLE_PROFILE = new EntityDataSerializer<>(
|
||||
getStaticWrappedFieldValue("RESOLVABLE_PROFILE").orElse(null));
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "HUMANOID_ARM")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "HUMANOID_ARM")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_11), path = "M")
|
||||
public static final EntityDataSerializer<?> HAND = new EntityDataSerializer<>(
|
||||
getStaticWrappedFieldValue("HAND").orElse(null));
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_3, to = Versions.V26_3), path = "DYE_COLOR")
|
||||
public static final EntityDataSerializer<?> DYE_COLOR = new EntityDataSerializer<>(
|
||||
getStaticWrappedFieldValue("DYE_COLOR").orElse(null));
|
||||
|
||||
private EntityDataSerializers()
|
||||
{
|
||||
super(null);
|
||||
|
||||
@@ -141,7 +141,7 @@ public class WrappedEntitySnapshot implements Serializable
|
||||
/**
|
||||
* A wrapper for Minecraft's NBT (Named Binary Tag) compound tag system, providing a type-safe way to read and write NBT data.
|
||||
*/
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.nbt.CompoundTag")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.nbt.CompoundTag")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.nbt.NBTTagCompound")
|
||||
public static class WrappedCompoundTag extends Wrapper
|
||||
{
|
||||
@@ -211,7 +211,7 @@ public class WrappedEntitySnapshot implements Serializable
|
||||
* @param key The key to store the value under
|
||||
* @param value The string value to store
|
||||
*/
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "putString")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "putString")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
public void putString(@NotNull String key, @NotNull String value)
|
||||
{
|
||||
@@ -224,7 +224,7 @@ public class WrappedEntitySnapshot implements Serializable
|
||||
* @param key The key of the boolean value
|
||||
* @return The boolean value, or false if the key doesn't exist
|
||||
*/
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "getBooleanOr")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "getBooleanOr")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_5, to = Versions.V1_21_11), path = "b")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_4), path = "q")
|
||||
public boolean getBoolean(@NotNull String key)
|
||||
@@ -251,7 +251,7 @@ public class WrappedEntitySnapshot implements Serializable
|
||||
}
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.nbt.NbtAccounter")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.nbt.NbtAccounter")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.nbt.NBTReadLimiter")
|
||||
public static class NbtAccounter extends Wrapper
|
||||
{
|
||||
@@ -260,7 +260,7 @@ public class WrappedEntitySnapshot implements Serializable
|
||||
super(handle);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "unlimitedHeap")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "unlimitedHeap")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_11), path = "c")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_9), path = "a")
|
||||
public static NbtAccounter unlimitedHeap()
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.UUID;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.server.level.ServerEntity")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.server.level.ServerEntity")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21, to = Versions.V1_21_11), path = "net.minecraft.server.level.EntityTrackerEntry")
|
||||
public class WrappedEntityTrackerEntry extends Wrapper
|
||||
{
|
||||
@@ -32,7 +32,16 @@ public class WrappedEntityTrackerEntry extends Wrapper
|
||||
}, (BiConsumer<Object, List<UUID>>) (o, uuids) ->
|
||||
{
|
||||
}, Set.of());
|
||||
else
|
||||
else if(Versions.isCurrentVersionSmallerThan(Versions.V26_3))
|
||||
return createInstance(WrappedEntityTrackerEntry.class, entity.getServer(), entity, 0, false, null, Set.of());
|
||||
else
|
||||
return createInstance(WrappedEntityTrackerEntry.class, entity.getServer(), entity, UpdateInterval.NEVER, false, null, Set.of());
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_3, to = Versions.V26_3), path = "net.minecraft.world.entity.UpdateInterval")
|
||||
private static class UpdateInterval
|
||||
{
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_3, to = Versions.V26_3), path = "NEVER")
|
||||
private static final Object NEVER = getStaticWrappedFieldValue("NEVER").orElse(null);
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import org.bukkit.World;
|
||||
import org.bukkit.entity.Interaction;
|
||||
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_2), path = "net.minecraft.world.entity.Interaction")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_3), path = "net.minecraft.world.entity.Interaction")
|
||||
public class WrappedInteraction extends WrappedEntity<Interaction>
|
||||
{
|
||||
WrappedInteraction(Object handle)
|
||||
|
||||
@@ -8,7 +8,7 @@ import de.eisi05.npc.api.wrapper.Wrapper;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_2), path = "net.minecraft.server.MinecraftServer")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_3), path = "net.minecraft.server.MinecraftServer")
|
||||
public class WrappedMinecraftServer extends Wrapper
|
||||
{
|
||||
public static final WrappedMinecraftServer INSTANCE = new WrappedMinecraftServer(Reflections.invokeMethod(Bukkit.getServer(), "getServer").get());
|
||||
@@ -23,13 +23,13 @@ public class WrappedMinecraftServer extends Wrapper
|
||||
return Reflections.getStaticField(INSTANCE.handle.getClass(), "currentTick");
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_2), path = "vanillaCommandDispatcher")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_3), path = "vanillaCommandDispatcher")
|
||||
public @NotNull WrappedMinecraftServer commands()
|
||||
{
|
||||
return new WrappedMinecraftServer(getWrappedFieldValue());
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "registryAccess")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "registryAccess")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_11), path = "bc")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_9), path = "bg")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_2, to = Versions.V1_21_6), path = "ba")
|
||||
@@ -39,7 +39,7 @@ public class WrappedMinecraftServer extends Wrapper
|
||||
return invokeWrappedMethod();
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "getDispatcher")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "getDispatcher")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
@SuppressWarnings("unchecked")
|
||||
public @NotNull CommandDispatcher<Object> getCommandDispatcher()
|
||||
@@ -49,6 +49,7 @@ public class WrappedMinecraftServer extends Wrapper
|
||||
|
||||
public static Object vanillaRegistry() {
|
||||
return Reflections.invokeStaticMethod("net.minecraft.data.registries.VanillaRegistries",
|
||||
Versions.isCurrentVersionSmallerThan(Versions.V26_1) ? "a" : "createLookup").get();
|
||||
Versions.isCurrentVersionSmallerThan(Versions.V26_1) ? "a" :
|
||||
Versions.isCurrentVersionSmallerThan(Versions.V26_3) ? "createLookup" : "createWorldLookup").get();
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.world.scores.PlayerTeam")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.world.scores.PlayerTeam")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.world.scores.ScoreboardTeam")
|
||||
public class WrappedPlayerTeam extends Wrapper
|
||||
{
|
||||
@@ -28,7 +28,7 @@ public class WrappedPlayerTeam extends Wrapper
|
||||
.thanInvoke(switch(Versions.getVersion())
|
||||
{
|
||||
case V1_20_6, V1_21, V1_21_2, V1_21_4, V1_21_5, V1_21_6, V1_21_9, V1_21_11 -> "e";
|
||||
case V26_1, V26_2 -> "getPlayersTeam";
|
||||
case V26_1, V26_2, V26_3 -> "getPlayersTeam";
|
||||
default -> null;
|
||||
}, WrappedServerPlayer.fromPlayer(player).getName()).get());
|
||||
}
|
||||
@@ -75,7 +75,7 @@ public class WrappedPlayerTeam extends Wrapper
|
||||
return teams.getOrDefault(player.getUniqueId(), new HashMap<>()).containsKey(name);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "nameTagVisibility")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "nameTagVisibility")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_5, to = Versions.V1_21_11), path = "k")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_4), path = "j")
|
||||
public @Nullable Visibility getNameTagVisibility()
|
||||
@@ -89,28 +89,28 @@ public class WrappedPlayerTeam extends Wrapper
|
||||
return null;
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "setNameTagVisibility")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "setNameTagVisibility")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
public void setNameTagVisibility(@NotNull Visibility visibility)
|
||||
{
|
||||
invokeWrappedMethod(visibility.getHandle());
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "setCollisionRule")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "setCollisionRule")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
public void setCollisionRule(@NotNull CollisionRule collisionRule)
|
||||
{
|
||||
invokeWrappedMethod(collisionRule.getHandle());
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "setSeeFriendlyInvisibles")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "setSeeFriendlyInvisibles")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "b")
|
||||
public void setCanSeeFriendlyInvisible(boolean canSeeFriendlyInvisible)
|
||||
{
|
||||
invokeWrappedMethod(canSeeFriendlyInvisible);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "canSeeFriendlyInvisibles")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "canSeeFriendlyInvisibles")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_5, to = Versions.V1_21_11), path = "j")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_4), path = "i")
|
||||
public boolean canSeeFriendlyInvisible()
|
||||
@@ -118,7 +118,7 @@ public class WrappedPlayerTeam extends Wrapper
|
||||
return invokeWrappedMethod();
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "getPlayers")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "getPlayers")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_5, to = Versions.V1_21_11), path = "h")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_4), path = "g")
|
||||
public @NotNull Collection<String> getPlayers()
|
||||
@@ -126,7 +126,7 @@ public class WrappedPlayerTeam extends Wrapper
|
||||
return invokeWrappedMethod();
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "getName")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "getName")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_5, to = Versions.V1_21_11), path = "c")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_4), path = "b")
|
||||
public @NotNull String getName()
|
||||
@@ -134,7 +134,7 @@ public class WrappedPlayerTeam extends Wrapper
|
||||
return invokeWrappedMethod();
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "setColor")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "setColor")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
public void setColor(@NotNull ChatFormat color)
|
||||
{
|
||||
@@ -147,31 +147,31 @@ public class WrappedPlayerTeam extends Wrapper
|
||||
}
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "setPlayerPrefix")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "setPlayerPrefix")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
public void setPrefix(@NotNull WrappedComponent prefix)
|
||||
{
|
||||
invokeWrappedMethod(prefix);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.world.scores.Team$Visibility")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.world.scores.Team$Visibility")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.world.scores" +
|
||||
".ScoreboardTeamBase$EnumNameTagVisibility")
|
||||
public enum Visibility implements EnumWrapper
|
||||
{
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "ALWAYS")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "ALWAYS")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
ALWAYS,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "NEVER")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "NEVER")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "b")
|
||||
NEVER,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "HIDE_FOR_OTHER_TEAMS")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "HIDE_FOR_OTHER_TEAMS")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "c")
|
||||
HIDE_FOR_OTHER_TEAMS,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "HIDE_FOR_OWN_TEAM")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "HIDE_FOR_OWN_TEAM")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "d")
|
||||
HIDE_FOR_OWN_TEAM;
|
||||
|
||||
@@ -182,23 +182,23 @@ public class WrappedPlayerTeam extends Wrapper
|
||||
}
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.world.scores.Team$CollisionRule")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.world.scores.Team$CollisionRule")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.world.scores.ScoreboardTeamBase$EnumTeamPush")
|
||||
public enum CollisionRule implements EnumWrapper
|
||||
{
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "ALWAYS")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "ALWAYS")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
ALWAYS,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "NEVER")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "NEVER")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "b")
|
||||
NEVER,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "PUSH_OTHER_TEAMS")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "PUSH_OTHER_TEAMS")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "c")
|
||||
PUSH_OTHER_TEAMS,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "PUSH_OWN_TEAM")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "PUSH_OWN_TEAM")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "d")
|
||||
PUSH_OWN_TEAM;
|
||||
|
||||
@@ -209,7 +209,7 @@ public class WrappedPlayerTeam extends Wrapper
|
||||
}
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_2, to = Versions.V26_2), path = "net.minecraft.world.scores.TeamColor")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_2, to = Versions.V26_3), path = "net.minecraft.world.scores.TeamColor")
|
||||
public static class TeamColor
|
||||
{
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.server.level.ServerPlayer")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.server.level.ServerPlayer")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.server.level.EntityPlayer")
|
||||
public class WrappedServerPlayer extends WrappedEntity<Player>
|
||||
{
|
||||
@@ -53,7 +53,7 @@ public class WrappedServerPlayer extends WrappedEntity<Player>
|
||||
|
||||
WrappedServerPlayer wrappedServerPlayer = switch(Versions.getVersion())
|
||||
{
|
||||
case V1_20_6, V1_21, V1_21_2, V1_21_4, V1_21_5, V1_21_6, V1_21_9, V1_21_11, V26_1, V26_2 ->
|
||||
case V1_20_6, V1_21, V1_21_2, V1_21_4, V1_21_5, V1_21_6, V1_21_9, V1_21_11, V26_1, V26_2, V26_3 ->
|
||||
{
|
||||
WrappedServerPlayer serverPlayer = createWrappedInstance(WrappedServerPlayer.class, mcServer, serverLevel, gameProfile,
|
||||
WrappedClientInformation.createDefault().getHandle());
|
||||
@@ -86,7 +86,7 @@ public class WrappedServerPlayer extends WrappedEntity<Player>
|
||||
return create(location, uuid, new GameProfile(uuid, "NPC" + uuid.toString().substring(0, 13)), name, nameDisplay);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "getAttribute")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "getAttribute")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_6, to = Versions.V1_21_11), path = "h")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_2, to = Versions.V1_21_5), path = "g")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21), path = "f")
|
||||
@@ -95,7 +95,7 @@ public class WrappedServerPlayer extends WrappedEntity<Player>
|
||||
return new WrappedAttributeInstance(invokeWrappedMethod(attribute));
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "getGameProfile")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "getGameProfile")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_11), path = "gI")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_9), path = "gz")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_6), path = "gr")
|
||||
@@ -108,7 +108,7 @@ public class WrappedServerPlayer extends WrappedEntity<Player>
|
||||
return invokeWrappedMethod();
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "connection")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "connection")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_6, to = Versions.V1_21_11), path = "g")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_2, to = Versions.V1_21_5), path = "f")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21), path = "c")
|
||||
@@ -117,7 +117,7 @@ public class WrappedServerPlayer extends WrappedEntity<Player>
|
||||
return new WrappedConnection(getWrappedFieldValue());
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "connection")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "connection")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_6, to = Versions.V1_21_11), path = "g")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_2, to = Versions.V1_21_5), path = "f")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21), path = "c")
|
||||
@@ -126,32 +126,32 @@ public class WrappedServerPlayer extends WrappedEntity<Player>
|
||||
setWrappedFieldValue(newConnection.getHandle());
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_2), path = "listName")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_3), path = "listName")
|
||||
public void setListName(@Nullable WrappedComponent component)
|
||||
{
|
||||
setWrappedFieldValue(component.getHandle());
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_2), path = "listName")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_3), path = "listName")
|
||||
public void setListName(@Nullable String name)
|
||||
{
|
||||
setListName(WrappedComponent.create(name));
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_2), path = "listOrder")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_3), path = "listOrder")
|
||||
public void setListOrder(int order)
|
||||
{
|
||||
setWrappedFieldValue(order);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "setPose")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "setPose")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "b")
|
||||
public void setPose(@NotNull Pose pose)
|
||||
{
|
||||
invokeWrappedMethod(pose);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "createCommandSourceStack")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "createCommandSourceStack")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_9, to = Versions.V1_21_11), path = "C")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_6), path = "A")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_5), path = "z")
|
||||
@@ -162,7 +162,7 @@ public class WrappedServerPlayer extends WrappedEntity<Player>
|
||||
return new WrappedCommandSourceStack(invokeWrappedMethod());
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "stopUsingItem")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "stopUsingItem")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_11), path = "gf")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_9), path = "fU")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_6), path = "fM")
|
||||
@@ -174,14 +174,14 @@ public class WrappedServerPlayer extends WrappedEntity<Player>
|
||||
invokeWrappedMethod();
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "sendSystemMessage")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "sendSystemMessage")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
public void sendRawMessage(@NotNull WrappedComponent component)
|
||||
{
|
||||
invokeWrappedMethod(component);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "removePlayerImmediately")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "removePlayerImmediately")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
public void remove()
|
||||
{
|
||||
@@ -191,7 +191,7 @@ public class WrappedServerPlayer extends WrappedEntity<Player>
|
||||
Reflections.invokeMethod(nmsLevel, getPath(), getHandle(), RemovalReason.DISCARDED.getHandle());
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_2, to = Versions.V26_2), path = "getAdvancements-clearTriggers")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_2, to = Versions.V26_3), path = "getAdvancements-clearTriggers")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V26_1), path = "getAdvancements-stopListening")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_9, to = Versions.V1_21_11), path = "U-a")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_6), path = "S-a")
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_2), path = "net.minecraft.world.entity.Display$TextDisplay")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_3), path = "net.minecraft.world.entity.Display$TextDisplay")
|
||||
public class WrappedTextDisplay extends WrappedEntity.WrappedNameTag<Entity>
|
||||
{
|
||||
private final Map<WrappedEntityData.EntityDataAccessor<?>, Object> dataMap = new LinkedHashMap<>();
|
||||
|
||||
@@ -4,7 +4,7 @@ import de.eisi05.npc.api.utils.Versions;
|
||||
import de.eisi05.npc.api.wrapper.Mapping;
|
||||
import de.eisi05.npc.api.wrapper.Wrapper;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.world.phys.Vec2")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.world.phys.Vec2")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.world.phys.Vec2F")
|
||||
|
||||
public class WrappedVec2F extends Wrapper
|
||||
@@ -19,7 +19,7 @@ public class WrappedVec2F extends Wrapper
|
||||
super(handle);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "x")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "x")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_11), path = "j")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_9), path = "i")
|
||||
public float getPitch()
|
||||
@@ -27,7 +27,7 @@ public class WrappedVec2F extends Wrapper
|
||||
return getWrappedFieldValue();
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "y")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "y")
|
||||
@Mapping(fixed = @Mapping.Fixed(Versions.V1_21_11), path = "k")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_9), path = "j")
|
||||
public float getYaw()
|
||||
|
||||
@@ -6,7 +6,7 @@ import de.eisi05.npc.api.wrapper.Wrapper;
|
||||
import org.bukkit.util.Vector;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.world.phys.Vec3")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.world.phys.Vec3")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.world.phys.Vec3D")
|
||||
public class WrappedVec3D extends Wrapper
|
||||
{
|
||||
@@ -30,7 +30,7 @@ public class WrappedVec3D extends Wrapper
|
||||
return new WrappedVec3D(handle);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "x")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "x")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_9, to = Versions.V1_21_11), path = "g")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_2, to = Versions.V1_21_6), path = "d")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21), path = "c")
|
||||
@@ -39,7 +39,7 @@ public class WrappedVec3D extends Wrapper
|
||||
return getWrappedFieldValue();
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "y")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "y")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_9, to = Versions.V1_21_11), path = "h")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_2, to = Versions.V1_21_6), path = "e")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21), path = "d")
|
||||
@@ -48,7 +48,7 @@ public class WrappedVec3D extends Wrapper
|
||||
return getWrappedFieldValue();
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "z")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "z")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_9, to = Versions.V1_21_11), path = "i")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_2, to = Versions.V1_21_6), path = "f")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21), path = "e")
|
||||
|
||||
@@ -2,14 +2,17 @@ package de.eisi05.npc.api.wrapper.packets;
|
||||
|
||||
import de.eisi05.npc.api.utils.Versions;
|
||||
import de.eisi05.npc.api.wrapper.Mapping;
|
||||
import de.eisi05.npc.api.wrapper.Wrapper;
|
||||
import de.eisi05.npc.api.wrapper.enums.InteractionHand;
|
||||
import de.eisi05.npc.api.wrapper.objects.WrappedEntity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.protocol.game.ClientboundAnimatePacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.protocol.game.ClientboundAnimatePacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.protocol.game.PacketPlayOutAnimation")
|
||||
public class AnimatePacket extends PacketWrapper
|
||||
{
|
||||
@@ -21,7 +24,32 @@ public class AnimatePacket extends PacketWrapper
|
||||
public static @Nullable PacketWrapper create(@NotNull WrappedEntity<?> entity, @NotNull Animation animation)
|
||||
{
|
||||
if(animation != Animation.HURT)
|
||||
{
|
||||
if(!Versions.isCurrentVersionSmallerThan(Versions.V26_3))
|
||||
{
|
||||
return switch(animation)
|
||||
{
|
||||
case WAKE_UP -> new AnimatePacket(entity, 0);
|
||||
case CRITICAL_HIT -> new AnimatePacket(entity, 1);
|
||||
case MAGIC_CRITICAL_HIT -> new AnimatePacket(entity, 2);
|
||||
case SWING_MAIN_HAND -> new SwingAnimationPacket(entity.getId(), InteractionHand.MAIN_HAND,
|
||||
new SwingAnimationPacket.SwingAnimation(SwingAnimationPacket.SwingAnimationType.WHACK,
|
||||
SwingAnimationPacket.SwingAnimation.DEFAULT_DURATION_WHACK));
|
||||
case SWING_OFF_HAND -> new SwingAnimationPacket(entity.getId(), InteractionHand.OFF_HAND,
|
||||
new SwingAnimationPacket.SwingAnimation(SwingAnimationPacket.SwingAnimationType.WHACK,
|
||||
SwingAnimationPacket.SwingAnimation.DEFAULT_DURATION_WHACK));
|
||||
case STAB_MAIN_HAND -> new SwingAnimationPacket(entity.getId(), InteractionHand.MAIN_HAND,
|
||||
new SwingAnimationPacket.SwingAnimation(SwingAnimationPacket.SwingAnimationType.STAB,
|
||||
SwingAnimationPacket.SwingAnimation.DEFAULT_DURATION_STAB));
|
||||
case STAB_OFF_HAND -> new SwingAnimationPacket(entity.getId(), InteractionHand.OFF_HAND,
|
||||
new SwingAnimationPacket.SwingAnimation(SwingAnimationPacket.SwingAnimationType.STAB,
|
||||
SwingAnimationPacket.SwingAnimation.DEFAULT_DURATION_STAB));
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
|
||||
return new AnimatePacket(entity, animation.ordinal());
|
||||
}
|
||||
|
||||
if(!(entity.getBukkitPlayer() instanceof LivingEntity))
|
||||
return null;
|
||||
@@ -36,10 +64,25 @@ public class AnimatePacket extends PacketWrapper
|
||||
WAKE_UP,
|
||||
SWING_OFF_HAND,
|
||||
CRITICAL_HIT,
|
||||
MAGIC_CRITICAL_HIT
|
||||
MAGIC_CRITICAL_HIT,
|
||||
/**
|
||||
* @since 26.3
|
||||
*/
|
||||
STAB_MAIN_HAND,
|
||||
/**
|
||||
* @since 26.3
|
||||
*/
|
||||
STAB_OFF_HAND;
|
||||
|
||||
public static Animation[] getCompatibleAnimations()
|
||||
{
|
||||
if(Versions.isCurrentVersionSmallerThan(Versions.V26_3))
|
||||
return Arrays.stream(values()).filter(animation -> animation != STAB_MAIN_HAND && animation != STAB_OFF_HAND).toArray(Animation[]::new);
|
||||
return values();
|
||||
}
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_2),
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_3),
|
||||
path = "net.minecraft.network.protocol.game.ClientboundHurtAnimationPacket")
|
||||
public static class HurtAnimationPacket extends PacketWrapper
|
||||
{
|
||||
@@ -48,4 +91,44 @@ public class AnimatePacket extends PacketWrapper
|
||||
super(HurtAnimationPacket.class, entity);
|
||||
}
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_3, to = Versions.V26_3), path = "net.minecraft.network.protocol.game.ClientboundSwingAnimationPacket")
|
||||
public static class SwingAnimationPacket extends PacketWrapper
|
||||
{
|
||||
protected SwingAnimationPacket(int entityId, InteractionHand hand, SwingAnimation animation)
|
||||
{
|
||||
super(createInstance(SwingAnimationPacket.class, entityId, hand.getHandle(), animation.getHandle()));
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_3, to = Versions.V26_3), path = "net.minecraft.world.item.component.SwingAnimation")
|
||||
public static class SwingAnimation extends Wrapper
|
||||
{
|
||||
private static final int DEFAULT_DURATION_WHACK = 6;
|
||||
private static final int DEFAULT_DURATION_STAB = 12;
|
||||
|
||||
public SwingAnimation(SwingAnimationType type, int duration)
|
||||
{
|
||||
super(createInstance(SwingAnimation.class, type.getHandle(), duration));
|
||||
}
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_3, to = Versions.V26_3), path = "net.minecraft.world.item.SwingAnimationType")
|
||||
public enum SwingAnimationType implements EnumWrapper
|
||||
{
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_3, to = Versions.V26_3), path = "NONE")
|
||||
NONE,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_3, to = Versions.V26_3), path = "WHACK")
|
||||
WHACK,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_3, to = Versions.V26_3), path = "STAB")
|
||||
STAB;
|
||||
|
||||
@Override
|
||||
public @NotNull Object getHandle()
|
||||
{
|
||||
return cast(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package de.eisi05.npc.api.wrapper.packets;
|
||||
import de.eisi05.npc.api.utils.Versions;
|
||||
import de.eisi05.npc.api.wrapper.Mapping;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.protocol.game.ServerboundAttackPacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.protocol.game.ServerboundAttackPacket")
|
||||
public class AttackPacket extends PacketWrapper.PacketHolder
|
||||
{
|
||||
protected AttackPacket(Object handle)
|
||||
@@ -11,7 +11,7 @@ public class AttackPacket extends PacketWrapper.PacketHolder
|
||||
super(handle);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "entityId")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "entityId")
|
||||
public int getId()
|
||||
{
|
||||
return getWrappedFieldValue();
|
||||
|
||||
@@ -3,11 +3,11 @@ package de.eisi05.npc.api.wrapper.packets;
|
||||
import de.eisi05.npc.api.utils.Versions;
|
||||
import de.eisi05.npc.api.wrapper.Mapping;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.protocol.game.ClientboundMoveEntityPacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.protocol.game.ClientboundMoveEntityPacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.protocol.game.PacketPlayOutEntity")
|
||||
public class MoveEntityPacket
|
||||
{
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.protocol.game.ClientboundMoveEntityPacket$Rot")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.protocol.game.ClientboundMoveEntityPacket$Rot")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.protocol.game" +
|
||||
".PacketPlayOutEntity$PacketPlayOutEntityLook")
|
||||
public static class Rot extends PacketWrapper
|
||||
|
||||
@@ -19,7 +19,7 @@ public abstract class PacketWrapper extends Wrapper
|
||||
super(createInstance(clazz, args));
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_2), path = "net.minecraft.network.protocol.Packet")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_3), path = "net.minecraft.network.protocol.Packet")
|
||||
public static abstract class PacketHolder extends PacketWrapper
|
||||
{
|
||||
public PacketHolder(Object handle)
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_2), path = "net.minecraft.network.protocol.game" +
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_3), path = "net.minecraft.network.protocol.game" +
|
||||
".ClientboundPlayerInfoRemovePacket")
|
||||
public class PlayerInfoRemovePacket extends PacketWrapper
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ import de.eisi05.npc.api.wrapper.Mapping;
|
||||
import de.eisi05.npc.api.wrapper.objects.WrappedServerPlayer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_2), path = "net.minecraft.network.protocol.game" +
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_3), path = "net.minecraft.network.protocol.game" +
|
||||
".ClientboundPlayerInfoUpdatePacket")
|
||||
public class PlayerInfoUpdatePacket extends PacketWrapper
|
||||
{
|
||||
@@ -14,41 +14,41 @@ public class PlayerInfoUpdatePacket extends PacketWrapper
|
||||
super(PlayerInfoUpdatePacket.class, action, serverPlayer);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.protocol.game" +
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.protocol.game" +
|
||||
".ClientboundPlayerInfoUpdatePacket$Action")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.protocol.game" +
|
||||
".ClientboundPlayerInfoUpdatePacket$a")
|
||||
public enum Action implements EnumWrapper
|
||||
{
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "ADD_PLAYER")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "ADD_PLAYER")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "a")
|
||||
ADD_PLAYER,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "INITIALIZE_CHAT")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "INITIALIZE_CHAT")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "b")
|
||||
INITIALIZE_CHAT,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "UPDATE_GAME_MODE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "UPDATE_GAME_MODE")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "c")
|
||||
UPDATE_GAME_MODE,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "UPDATE_LISTED")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "UPDATE_LISTED")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "d")
|
||||
UPDATE_LISTED,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "UPDATE_LATENCY")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "UPDATE_LATENCY")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "e")
|
||||
UPDATE_LATENCY,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "UPDATE_DISPLAY_NAME")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "UPDATE_DISPLAY_NAME")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "f")
|
||||
UPDATE_DISPLAY_NAME,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "UPDATE_LIST_ORDER")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "UPDATE_LIST_ORDER")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_2, to = Versions.V1_21_11), path = "g")
|
||||
UPDATE_LIST_ORDER,
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "UPDATE_HAT")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "UPDATE_HAT")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_4, to = Versions.V1_21_11), path = "h")
|
||||
UPDATE_HAT;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package de.eisi05.npc.api.wrapper.packets;
|
||||
import de.eisi05.npc.api.utils.Versions;
|
||||
import de.eisi05.npc.api.wrapper.Mapping;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.protocol.game.ClientboundRemoveEntitiesPacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.protocol.game.ClientboundRemoveEntitiesPacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy")
|
||||
public class RemoveEntityPacket extends PacketWrapper
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ import de.eisi05.npc.api.wrapper.Mapping;
|
||||
import de.eisi05.npc.api.wrapper.objects.WrappedEntity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.protocol.game.ClientboundRotateHeadPacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.protocol.game.ClientboundRotateHeadPacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.protocol.game.PacketPlayOutEntityHeadRotation")
|
||||
public class RotateHeadPacket extends PacketWrapper
|
||||
{
|
||||
|
||||
@@ -8,13 +8,13 @@ import org.jetbrains.annotations.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.protocol.game.ClientboundSetEntityDataPacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.protocol.game.ClientboundSetEntityDataPacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.protocol.game.PacketPlayOutEntityMetadata")
|
||||
public class SetEntityDataPacket extends PacketWrapper
|
||||
{
|
||||
public List<?> data;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_2), path = "")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V26_3), path = "")
|
||||
private SetEntityDataPacket(int id, @NotNull List<?> data)
|
||||
{
|
||||
super(SetEntityDataPacket.class, id, data);
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.protocol.game.ClientboundSetEquipmentPacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.protocol.game.ClientboundSetEquipmentPacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.protocol.game.PacketPlayOutEntityEquipment")
|
||||
public class SetEquipmentPacket extends PacketWrapper
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@ import de.eisi05.npc.api.utils.Versions;
|
||||
import de.eisi05.npc.api.wrapper.Mapping;
|
||||
import de.eisi05.npc.api.wrapper.objects.WrappedEntity;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.protocol.game.ClientboundSetPassengersPacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.protocol.game.ClientboundSetPassengersPacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.protocol.game.PacketPlayOutMount")
|
||||
public class SetPassengerPacket extends PacketWrapper
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import java.util.Collection;
|
||||
import java.util.Optional;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.protocol.game.ClientboundSetPlayerTeamPacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.protocol.game.ClientboundSetPlayerTeamPacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.protocol.game.PacketPlayOutScoreboardTeam")
|
||||
public class SetPlayerTeamPacket extends PacketWrapper
|
||||
{
|
||||
@@ -41,7 +41,7 @@ public class SetPlayerTeamPacket extends PacketWrapper
|
||||
REMOVE
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.protocol.game" +
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.protocol.game" +
|
||||
".ClientboundSetPlayerTeamPacket$Parameters")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.protocol.game.PacketPlayOutScoreboardTeam$b")
|
||||
public static class Parameters extends Wrapper
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.bukkit.util.Vector;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.protocol.game.PacketPlayOutEntityTeleport")
|
||||
public class TeleportEntityPacket extends PacketWrapper
|
||||
{
|
||||
@@ -35,7 +35,7 @@ public class TeleportEntityPacket extends PacketWrapper
|
||||
return createInstance(TeleportEntityPacket.class, entity.getId(), positionMoveRotation.getHandle(), relatives, onGround);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_2, to = Versions.V26_2), path = "net.minecraft.world.entity.PositionMoveRotation")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_21_2, to = Versions.V26_3), path = "net.minecraft.world.entity.PositionMoveRotation")
|
||||
public static class PositionMoveRotation extends Wrapper
|
||||
{
|
||||
private final Vector position;
|
||||
|
||||
@@ -6,7 +6,7 @@ import de.eisi05.npc.api.wrapper.objects.WrappedAttributeInstance;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.protocol.game.ClientboundUpdateAttributesPacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.protocol.game.ClientboundUpdateAttributesPacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.protocol.game.PacketPlayOutUpdateAttributes")
|
||||
public class UpdateAttributesPacket extends PacketWrapper
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ import de.eisi05.npc.api.wrapper.enums.InteractionHand;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.protocol.game.ServerboundInteractPacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.protocol.game.ServerboundInteractPacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.protocol.game.PacketPlayInUseEntity")
|
||||
public class UseEntityPacketWrapper extends PacketWrapper.PacketHolder
|
||||
{
|
||||
@@ -19,14 +19,14 @@ public class UseEntityPacketWrapper extends PacketWrapper.PacketHolder
|
||||
super(handle);
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "entityId")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "entityId")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "b")
|
||||
public int getId()
|
||||
{
|
||||
return getWrappedFieldValue();
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "hand")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "hand")
|
||||
public @Nullable InteractionHand getHand()
|
||||
{
|
||||
Object enumHandle = getWrappedFieldValue();
|
||||
@@ -38,7 +38,7 @@ public class UseEntityPacketWrapper extends PacketWrapper.PacketHolder
|
||||
return null;
|
||||
}
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "usingSecondaryAction")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "usingSecondaryAction")
|
||||
public boolean usingSecondaryAction()
|
||||
{
|
||||
return getWrappedFieldValue();
|
||||
|
||||
@@ -3,7 +3,7 @@ package de.eisi05.npc.api.wrapper.packets;
|
||||
import de.eisi05.npc.api.utils.Versions;
|
||||
import de.eisi05.npc.api.wrapper.Mapping;
|
||||
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_2), path = "net.minecraft.network.protocol.game.ServerboundUseItemPacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V26_1, to = Versions.V26_3), path = "net.minecraft.network.protocol.game.ServerboundUseItemPacket")
|
||||
@Mapping(range = @Mapping.Range(from = Versions.V1_20_6, to = Versions.V1_21_11), path = "net.minecraft.network.protocol.game.PacketPlayInUseItem")
|
||||
public class UseItemPacketWrapper extends PacketWrapper.PacketHolder
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user