Merge branch 'Tofaa2:master' into master

This commit is contained in:
Felipe Paschoal Bergamo 2025-06-03 18:38:12 -03:00 committed by GitHub
commit b5481f783d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 8 additions and 19 deletions

View file

@ -39,6 +39,7 @@ jobs:
run: chmod +x ./gradlew && ./gradlew build
- name: Create Release
if: github.ref != 'refs/heads/master'
uses: softprops/action-gh-release@v2
with:
name: '${{ github.ref_name }}: ${{ github.event.head_commit.message }} (${{ github.sha }})'

View file

@ -9,6 +9,7 @@ dependencies {
compileOnly(libs.bundles.adventure)
compileOnly(libs.packetevents.api)
testCompileOnly(libs.packetevents.api)
}
tasks {

View file

@ -23,11 +23,11 @@ public class ShulkerMeta extends MobMeta {
}
public Direction getAttachFace() {
return super.metadata.getIndex(OFFSET, Direction.DOWN);
return super.metadata.getIndex((byte)16, Direction.DOWN);
}
public void setAttachFace(Direction value) {
super.metadata.setIndex(OFFSET, EntityDataTypes.INT, value.ordinal());
super.metadata.setIndex((byte)16, EntityDataTypes.INT, value.ordinal());
}
public byte getShieldHeight() {

View file

@ -1,16 +1,12 @@
package me.tofaa.entitylib.meta.mobs.horse;
import com.github.retrooper.packetevents.protocol.entity.data.EntityDataTypes;
import me.tofaa.entitylib.meta.Metadata;
import me.tofaa.entitylib.meta.types.MobMeta;
import me.tofaa.entitylib.meta.types.AgeableMeta;
import java.util.Optional;
import java.util.UUID;
public abstract class BaseHorseMeta extends AgeableMeta {
public abstract class BaseHorseMeta extends MobMeta {
public static final byte OFFSET = MobMeta.MAX_OFFSET;
public static final byte MAX_OFFSET = OFFSET + 2;
public static final byte OFFSET = AgeableMeta.MAX_OFFSET;
public static final byte MAX_OFFSET = OFFSET + 1;
private final static byte TAMED_BIT = 0x02;
private final static byte SADDLED_BIT = 0x04;
@ -70,13 +66,4 @@ public abstract class BaseHorseMeta extends MobMeta {
public void setMouthOpen(boolean value) {
setMaskBit(OFFSET, MOUTH_OPEN_BIT, value);
}
public Optional<UUID> getOwner() {
return super.metadata.getIndex(offset(OFFSET, 1), Optional.empty());
}
public void setOwner(UUID value) {
super.metadata.setIndex(offset(OFFSET, 1), EntityDataTypes.OPTIONAL_UUID, Optional.of(value));
}
}