if(slot instanceof FluidSlot) {
if(currentlyEquippedStack != null) {
FluidStack liquidId = FluidContainerRegistry.getFluidForFilledItem(currentlyEquippedStack);
if(liquidId != null) {
FluidIdentifier ident = FluidIdentifier.get(liquidId);
if(mouseButton == 0) {
if(ident == null) {
slot.putStack(null);
} else {
slot.putStack(ident.getItemIdentifier().unsafeMakeNormalStack(1));
}
} else {
slot.putStack(null);
}
return currentlyEquippedStack;
}
}
FluidIdentifier ident = null;
if(slot.getStack() != null) {
ident = FluidIdentifier.get(ItemIdentifier.get(slot.getStack()));
}
if(mouseButton == 0) {
if(ident != null) {
ident = ident.next();
} else {
ident = FluidIdentifier.first();
}
} else if(mouseButton == 1) {
if(ident != null) {
ident = ident.prev();
} else {
ident = FluidIdentifier.last();
}
} else {
ident = null;
}
if(ident == null) {
slot.putStack(null);
} else {
slot.putStack(ident.getItemIdentifier().unsafeMakeNormalStack(1));
}
if(entityplayer instanceof EntityPlayerMP && MainProxy.isServer(entityplayer.worldObj)) {
((EntityPlayerMP)entityplayer).sendSlotContents(this, slotId, slot.getStack());
}
return currentlyEquippedStack;