mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 02:35:49 +01:00
#855: Add HumanEntity#getItemInUse and Material#getSlipperiness
By: konsolas <vincentyntang@gmail.com>
This commit is contained in:
parent
3e7e42a371
commit
02ebbcfc81
2 changed files with 13 additions and 0 deletions
|
@ -450,6 +450,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
|||
return getHandle().isHandRaised();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemInUse() {
|
||||
net.minecraft.world.item.ItemStack item = getHandle().getActiveItem();
|
||||
return item.isEmpty() ? null : CraftItemStack.asCraftMirror(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setWindowProperty(InventoryView.Property prop, int value) {
|
||||
return false;
|
||||
|
|
|
@ -242,6 +242,13 @@ public class PerMaterialTest extends AbstractTestingBase {
|
|||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSlipperiness() {
|
||||
if (material.isBlock()) {
|
||||
assertThat(material.getSlipperiness(), is(CraftMagicNumbers.getBlock(material).getFrictionFactor()));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBlockDataCreation() {
|
||||
if (material.isBlock()) {
|
||||
|
|
Loading…
Reference in a new issue