mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-12 14:50:03 +01:00
#855: Add HumanEntity#getItemInUse and Material#getSlipperiness
By: konsolas <vincentyntang@gmail.com>
This commit is contained in:
parent
3e7e42a371
commit
02ebbcfc81
@ -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…
Reference in New Issue
Block a user