mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 00:38:35 +01:00
Creative tabs are client only.
This commit is contained in:
parent
a315acc50d
commit
02a58c5397
1 changed files with 3 additions and 16 deletions
|
@ -38,30 +38,17 @@ public class LensDisruption extends Lens{
|
|||
ItemStack stack = item.getEntityItem();
|
||||
if(!item.isDead && stack != null){
|
||||
if(!stack.hasTagCompound() || !stack.getTagCompound().getBoolean(ModUtil.MOD_ID+"DisruptedAlready")){
|
||||
ItemStack newStack = null;
|
||||
|
||||
boolean done = false;
|
||||
while(!done){
|
||||
ItemStack newStack;
|
||||
do{
|
||||
if(Util.RANDOM.nextBoolean()){
|
||||
newStack = new ItemStack(Item.REGISTRY.getRandomObject(Util.RANDOM));
|
||||
}
|
||||
else{
|
||||
newStack = new ItemStack(Block.REGISTRY.getRandomObject(Util.RANDOM));
|
||||
}
|
||||
|
||||
if(newStack != null){
|
||||
Item newItem = newStack.getItem();
|
||||
if(newItem != null){
|
||||
CreativeTabs[] tabs = newItem.getCreativeTabs();
|
||||
for(CreativeTabs tab : tabs){
|
||||
if(tab != null){
|
||||
done = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
while(newStack == null || newStack.getItem() == null);
|
||||
|
||||
newStack.stackSize = stack.stackSize;
|
||||
|
||||
|
|
Loading…
Reference in a new issue