mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
middle click fixerrrr
This commit is contained in:
parent
15a0f11a74
commit
5223998fcb
@ -1,5 +1,7 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.hbm.blocks.BlockEnums.*;
|
||||
import com.hbm.blocks.bomb.*;
|
||||
import com.hbm.blocks.fluid.*;
|
||||
@ -29,7 +31,10 @@ import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.material.MaterialLiquid;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
|
||||
@ -3466,4 +3471,20 @@ public class ModBlocks {
|
||||
Block remap = new BlockRemap(block, meta).setBlockName(unloc);
|
||||
register(remap, ItemBlockRemap.class);
|
||||
}
|
||||
|
||||
// Pretty much the default getDrops function but with no damage set on the item (fucks with recipes)
|
||||
// but setting the meta via damageDropped breaks creative middle-click and any WAILA-like overlays
|
||||
public static ArrayList<ItemStack> getDropsWithoutDamage(World world, Block block, int metadata, int fortune) {
|
||||
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
|
||||
int count = block.quantityDropped(metadata, fortune, world.rand);
|
||||
for(int i = 0; i < count; i++) {
|
||||
Item item = block.getItemDropped(metadata, world.rand, fortune);
|
||||
if(item != null) {
|
||||
ret.add(new ItemStack(item, 1, 0));
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user