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

Method canPlaceOn

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

Source from the content-addressed store, hash-verified

1061 }
1062
1063 public boolean canPlaceOn(Block blockIn)
1064 {
1065 if (blockIn == this.canPlaceOnCacheBlock)
1066 {
1067 return this.canPlaceOnCacheResult;
1068 }
1069 else
1070 {
1071 this.canPlaceOnCacheBlock = blockIn;
1072
1073 if (this.hasTagCompound() && this.stackTagCompound.hasKey("CanPlaceOn", 9))
1074 {
1075 NBTTagList nbttaglist = this.stackTagCompound.getTagList("CanPlaceOn", 8);
1076
1077 for (int i = 0; i < nbttaglist.tagCount(); ++i)
1078 {
1079 Block block = Block.getBlockFromName(nbttaglist.getStringTagAt(i));
1080
1081 if (block == blockIn)
1082 {
1083 this.canPlaceOnCacheResult = true;
1084 return true;
1085 }
1086 }
1087 }
1088
1089 this.canPlaceOnCacheResult = false;
1090 return false;
1091 }
1092 }
1093}

Callers 2

isDrawBlockOutlineMethod · 0.95
canPlayerEditMethod · 0.45

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