-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d0817f
commit a8fb6e3
Showing
4 changed files
with
62 additions
and
8 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
api/src/main/java/de/oliver/fancysitula/api/entities/FS_ItemDisplay.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package de.oliver.fancysitula.api.entities; | ||
|
||
import de.oliver.fancysitula.api.packets.FS_ClientboundSetEntityDataPacket; | ||
import de.oliver.fancysitula.api.utils.entityData.FS_ItemDisplayData; | ||
import org.bukkit.entity.EntityType; | ||
|
||
import java.util.List; | ||
|
||
public class FS_ItemDisplay extends FS_Display { | ||
|
||
protected FS_ClientboundSetEntityDataPacket.EntityData itemData = new FS_ClientboundSetEntityDataPacket.EntityData(FS_ItemDisplayData.ITEM, null); | ||
|
||
public FS_ItemDisplay() { | ||
super(EntityType.ITEM_DISPLAY); | ||
} | ||
|
||
public org.bukkit.inventory.ItemStack getItem() { | ||
return (org.bukkit.inventory.ItemStack) this.itemData.getValue(); | ||
} | ||
|
||
public void setItem(org.bukkit.inventory.ItemStack item) { | ||
this.itemData.setValue(item); | ||
} | ||
|
||
@Override | ||
public List<FS_ClientboundSetEntityDataPacket.EntityData> getEntityData() { | ||
List<FS_ClientboundSetEntityDataPacket.EntityData> entityData = super.getEntityData(); | ||
entityData.add(this.itemData); | ||
return entityData; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
api/src/main/java/de/oliver/fancysitula/api/utils/entityData/FS_ItemDisplayData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package de.oliver.fancysitula.api.utils.entityData; | ||
|
||
import de.oliver.fancysitula.api.packets.FS_ClientboundSetEntityDataPacket; | ||
|
||
public class FS_ItemDisplayData { | ||
|
||
/** | ||
* Use {@link org.bukkit.inventory.ItemStack} as value | ||
*/ | ||
public static final FS_ClientboundSetEntityDataPacket.EntityDataAccessor ITEM = new FS_ClientboundSetEntityDataPacket.EntityDataAccessor("net.minecraft.world.entity.Display$ItemDisplay", "DATA_ITEM_STACK_ID"); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters