mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 08:48:34 +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();
|
ItemStack stack = item.getEntityItem();
|
||||||
if(!item.isDead && stack != null){
|
if(!item.isDead && stack != null){
|
||||||
if(!stack.hasTagCompound() || !stack.getTagCompound().getBoolean(ModUtil.MOD_ID+"DisruptedAlready")){
|
if(!stack.hasTagCompound() || !stack.getTagCompound().getBoolean(ModUtil.MOD_ID+"DisruptedAlready")){
|
||||||
ItemStack newStack = null;
|
|
||||||
|
|
||||||
boolean done = false;
|
ItemStack newStack;
|
||||||
while(!done){
|
do{
|
||||||
if(Util.RANDOM.nextBoolean()){
|
if(Util.RANDOM.nextBoolean()){
|
||||||
newStack = new ItemStack(Item.REGISTRY.getRandomObject(Util.RANDOM));
|
newStack = new ItemStack(Item.REGISTRY.getRandomObject(Util.RANDOM));
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
newStack = new ItemStack(Block.REGISTRY.getRandomObject(Util.RANDOM));
|
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;
|
newStack.stackSize = stack.stackSize;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue