mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-08-21 22:42:49 +02:00
Clean up the ItemFrameWatcher and add a small description to config.yml
This commit is contained in:
parent
bcee5d9677
commit
c7127f56f5
|
@ -113,7 +113,8 @@ PacketsEnabled:
|
||||||
# To be honest. This is basically "Disable entity animations". That option is called 'AddEntityAnimations' in the config but unlike that, this is always in effect.
|
# To be honest. This is basically "Disable entity animations". That option is called 'AddEntityAnimations' in the config but unlike that, this is always in effect.
|
||||||
# Animations set by use of the api or through the disguise command are still in effect.
|
# Animations set by use of the api or through the disguise command are still in effect.
|
||||||
Metadata: true
|
Metadata: true
|
||||||
# Movement packets are the biggest cpu hit. These are majorly used to ensure that the disguises facing direction isn't bugged up
|
# Movement packets are the biggest cpu hit. These are majorly used to ensure that the disguises facing direction isn't bugged up.
|
||||||
|
# If you are using the Item_Frame disguise, when a packet is sent (Roughly every 2min) the disguise will bug up until they move.
|
||||||
Movement: true
|
Movement: true
|
||||||
# Disable this if you don't mind crashing everytime you see someone riding something disguised as a non-living entity
|
# Disable this if you don't mind crashing everytime you see someone riding something disguised as a non-living entity
|
||||||
Riding: true
|
Riding: true
|
||||||
|
|
|
@ -10,26 +10,28 @@ public class ItemFrameWatcher extends FlagWatcher {
|
||||||
super(disguise);
|
super(disguise);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getItemRotation() {
|
public ItemStack getItem() {
|
||||||
return (Integer) getValue(3, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemStack getItemStack() {
|
|
||||||
if (getValue(2, null) == null)
|
if (getValue(2, null) == null)
|
||||||
return new ItemStack(0);
|
return new ItemStack(0);
|
||||||
return (ItemStack) getValue(2, null);
|
return (ItemStack) getValue(2, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setItemRotation(int rotation) {
|
public int getRotation() {
|
||||||
setValue(3, (byte) (rotation % 4));
|
return (Integer) getValue(3, 0);
|
||||||
sendData(3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setItemStack(ItemStack newItem) {
|
public void setItem(ItemStack newItem) {
|
||||||
|
if (newItem == null)
|
||||||
|
newItem = new ItemStack(0);
|
||||||
newItem = newItem.clone();
|
newItem = newItem.clone();
|
||||||
newItem.setAmount(1);
|
newItem.setAmount(1);
|
||||||
setValue(2, newItem);
|
setValue(2, newItem);
|
||||||
sendData(2);
|
sendData(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setRotation(int rotation) {
|
||||||
|
setValue(3, (byte) (rotation % 4));
|
||||||
|
sendData(3);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user