Updated EntityHuman template, adding the DATA_PLAYER_MODE_CUSTOMISATION field.

This field allows for change of players skin layer.
This commit is contained in:
xxminersx committed 2024-07-18 12:31:50 +02:00
1 parent cd26b8f21c
commit bbe4cd3932
2 files changed
+49 -1

No files matched your search

@@ -1,6 +1,7 @@
package com.bergerkiller.generated.net.minecraft.world.entity.player;
import com.bergerkiller.mountiplex.reflection.declarations.Template;
import com.bergerkiller.bukkit.common.wrappers.DataWatcher.Key;
import com.bergerkiller.bukkit.common.wrappers.PlayerAbilities;
import com.bergerkiller.generated.com.mojang.authlib.GameProfileHandle;
import com.bergerkiller.generated.net.minecraft.world.entity.EntityLivingHandle;
@@ -25,6 +26,7 @@ public abstract class EntityHumanHandle extends EntityLivingHandle {
/* ============================================================================== */
public abstract void attack(Entity entity);
public static final Key<Byte> DATA_PLAYER_MODE_CUSTOMISATION = Key.Type.BYTE.createKey(T.DATA_PLAYER_MODE_CUSTOMISATION, -1);
public abstract Object getInventoryRaw();
public abstract void setInventoryRaw(Object value);
public abstract Object getEnderChestRaw();
@@ -50,6 +52,9 @@ public abstract class EntityHumanHandle extends EntityLivingHandle {
* Methods, fields, and constructors can be used without using Handle Objects.
*/
public static final class EntityHumanClass extends Template.Class<EntityHumanHandle> {
@Template.Optional
public final Template.StaticField.Converted<Key<Byte>> DATA_PLAYER_MODE_CUSTOMISATION = new Template.StaticField.Converted<Key<Byte>>();
public final Template.Field.Converted<Object> inventoryRaw = new Template.Field.Converted<Object>();
public final Template.Field.Converted<Object> enderChestRaw = new Template.Field.Converted<Object>();
public final Template.Field.Converted<ContainerHandle> activeContainer = new Template.Field.Converted<ContainerHandle>();
@@ -7,7 +7,9 @@ import net.minecraft.world.inventory.Container;
import net.minecraft.world.inventory.InventoryEnderChest;
import com.bergerkiller.bukkit.common.bases.IntVector3;
import net.minecraft.network.syncher.DataWatcherObject;
import com.bergerkiller.bukkit.common.wrappers.DataWatcher;
import com.bergerkiller.bukkit.common.wrappers.DataWatcher.Key;
import com.bergerkiller.generated.com.mojang.authlib.GameProfileHandle;
import com.bergerkiller.generated.net.minecraft.world.inventory.ContainerHandle;
@@ -137,5 +139,46 @@ class EntityHuman extends net.minecraft.world.entity.EntityLiving {
private final (GameProfileHandle) com.mojang.authlib.GameProfile gameProfile:bF;
#endif
#if version >= 1.17
protected static optional final (DataWatcher.Key<Byte>) DataWatcherObject<Byte> DATA_PLAYER_MODE_CUSTOMISATION;
#elseif version >= 1.16.2
protected static optional final (DataWatcher.Key<Byte>) DataWatcherObject<Byte> DATA_PLAYER_MODE_CUSTOMISATION:bi;
#elseif version >= 1.16
protected static optional final (DataWatcher.Key<Byte>) DataWatcherObject<Byte> DATA_PLAYER_MODE_CUSTOMISATION:bp;
#elseif version >= 1.15
protected static optional final (DataWatcher.Key<Byte>) DataWatcherObject<Byte> DATA_PLAYER_MODE_CUSTOMISATION:bq;
#elseif version >= 1.14
protected static optional final (DataWatcher.Key<Byte>) DataWatcherObject<Byte> DATA_PLAYER_MODE_CUSTOMISATION:bt;
#elseif version >= 1.13
protected static optional final (DataWatcher.Key<Byte>) DataWatcherObject<Byte> DATA_PLAYER_MODE_CUSTOMISATION:bx;
#elseif version >= 1.12
protected static optional final (DataWatcher.Key<Byte>) DataWatcherObject<Byte> DATA_PLAYER_MODE_CUSTOMISATION:br;
#elseif version >= 1.11
protected static optional final (DataWatcher.Key<Byte>) DataWatcherObject<Byte> DATA_PLAYER_MODE_CUSTOMISATION:bq;
#elseif version >= 1.10
protected static optional final (DataWatcher.Key<Byte>) DataWatcherObject<Byte> DATA_PLAYER_MODE_CUSTOMISATION:br;
#elseif version >= 1.9.4
protected static optional final (DataWatcher.Key<Byte>) DataWatcherObject<Byte> DATA_PLAYER_MODE_CUSTOMISATION:bq;
#elseif version >= 1.9
protected static optional final (DataWatcher.Key<Byte>) DataWatcherObject<Byte> DATA_PLAYER_MODE_CUSTOMISATION:bp;
#else
/* === MC 1.8.9: These constants do not exist == */
protected static optional final (DataWatcher.Key<Byte>) DataWatcherObject<Byte> DATA_PLAYER_MODE_CUSTOMISATION:###;
#endif
<code>
public static final Key<Byte> DATA_PLAYER_MODE_CUSTOMISATION = Key.Type.BYTE.createKey(T.DATA_PLAYER_MODE_CUSTOMISATION, -1);
</code>
public void attack((org.bukkit.entity.Entity) Entity entity);
}