MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / canDestroy

Method canDestroy

src/main/java/net/minecraft/item/ItemStack.java:1032–1061  ·  view source on GitHub ↗
(Block blockIn)

Source from the content-addressed store, hash-verified

1030 }
1031
1032 public boolean canDestroy(Block blockIn)
1033 {
1034 if (blockIn == this.canDestroyCacheBlock)
1035 {
1036 return this.canDestroyCacheResult;
1037 }
1038 else
1039 {
1040 this.canDestroyCacheBlock = blockIn;
1041
1042 if (this.hasTagCompound() && this.stackTagCompound.hasKey("CanDestroy", 9))
1043 {
1044 NBTTagList nbttaglist = this.stackTagCompound.getTagList("CanDestroy", 8);
1045
1046 for (int i = 0; i < nbttaglist.tagCount(); ++i)
1047 {
1048 Block block = Block.getBlockFromName(nbttaglist.getStringTagAt(i));
1049
1050 if (block == blockIn)
1051 {
1052 this.canDestroyCacheResult = true;
1053 return true;
1054 }
1055 }
1056 }
1057
1058 this.canDestroyCacheResult = false;
1059 return false;
1060 }
1061 }
1062
1063 public boolean canPlaceOn(Block blockIn)
1064 {

Callers 5

isDrawBlockOutlineMethod · 0.95
onPlayerDestroyBlockMethod · 0.95
clickBlockMethod · 0.95
onBlockClickedMethod · 0.95
tryHarvestBlockMethod · 0.95

Calls 6

hasTagCompoundMethod · 0.95
tagCountMethod · 0.95
getBlockFromNameMethod · 0.95
getStringTagAtMethod · 0.95
hasKeyMethod · 0.80
getTagListMethod · 0.80

Tested by

no test coverage detected