mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 03:49:14 +00:00
Fix pick-block for items that map to multiple blocks. Closes #8080
This commit is contained in:
1 parent
4e562664f4
commit
ca2023fa80
1 file changed
+28
@@ -8,3 +8,31 @@
|
||||
public class Items {
|
||||
public static final Item f_41852_ = m_42810_(Blocks.f_50016_, new AirItem(Blocks.f_50016_, new Item.Properties()));
|
||||
public static final Item f_41905_ = m_42807_(Blocks.f_50069_, CreativeModeTab.f_40749_);
|
||||
@@ -1137,11 +_,23 @@
|
||||
}
|
||||
|
||||
private static Item m_151089_(Block p_151090_, CreativeModeTab p_151091_, Block... p_151092_) {
|
||||
- BlockItem blockitem = new BlockItem(p_151090_, (new Item.Properties()).m_41491_(p_151091_));
|
||||
+ BlockItem blockitem = new BlockItem(p_151090_, (new Item.Properties()).m_41491_(p_151091_)) {
|
||||
+ @Override
|
||||
+ public void m_6192_(java.util.Map<Block, Item> map, Item self) {
|
||||
+ super.m_6192_(map, self);
|
||||
+ for (Block b : p_151092_) {
|
||||
+ map.put(b, self);
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- for(Block block : p_151092_) {
|
||||
- Item.f_41373_.put(block, blockitem);
|
||||
- }
|
||||
+ @Override
|
||||
+ public void removeFromBlockToItemMap(java.util.Map<Block, Item> map, Item self) {
|
||||
+ super.removeFromBlockToItemMap(map, self);
|
||||
+ for (Block b : p_151092_) {
|
||||
+ map.remove(b);
|
||||
+ }
|
||||
+ }
|
||||
+ };
|
||||
|
||||
return m_42803_(blockitem);
|
||||
}
|
||||
Reference in new issue
Block a user