mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-22 08:15:05 +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();
|
return getHandle().isHandRaised();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack getItemInUse() {
|
||||||
|
net.minecraft.world.item.ItemStack item = getHandle().getActiveItem();
|
||||||
|
return item.isEmpty() ? null : CraftItemStack.asCraftMirror(item);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setWindowProperty(InventoryView.Property prop, int value) {
|
public boolean setWindowProperty(InventoryView.Property prop, int value) {
|
||||||
return false;
|
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
|
@Test
|
||||||
public void testBlockDataCreation() {
|
public void testBlockDataCreation() {
|
||||||
if (material.isBlock()) {
|
if (material.isBlock()) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue