Get rid of all the nullable-nonnull stuff, warning huge diff

This commit is contained in:
Vincent Lee committed 2016-05-18 21:03:12 -05:00
1 parent bdf51cbc8b
commit 8fb3b886a8
344 files changed
+1603 -582

No files matched your search

+1 -1
View File
@@ -11,7 +11,7 @@ buildscript {
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT'
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
classpath 'com.matthewprenger:CurseGradle:1.0-SNAPSHOT'
}
}
+1 -1
View File
@@ -4,6 +4,6 @@ version=r1.8
dir_output=../Build Output/Botania/
dir_repo=./
mc_version=1.9.4
forge_version=12.16.1.1909-1.9.4
forge_version=12.17.0.1909-1.9.4
build_number=306
mod_name=Botania
@@ -15,6 +15,8 @@ import net.minecraft.util.text.translation.I18n;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import javax.annotation.Nonnull;
/** Use minecraft's EnumDyeColor in as many places as possible. */
@Deprecated
public enum EnumColor implements IStringSerializable {
@@ -111,6 +113,7 @@ public enum EnumColor implements IStringSerializable {
return name().replace("_", ".").toLowerCase(Locale.ENGLISH);
}
@Nonnull
@Override
public String getName() {
return NAMES[ordinal()];
@@ -2,10 +2,10 @@
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
*
* Botania is Open Source and distributed under the
* Botania License: http://botaniamod.net/license.php
*
*
* File Created @ [Jan 14, 2014, 6:15:28 PM (GMT)]
*/
package vazkii.botania.api;
@@ -32,6 +32,7 @@ import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.Loader;
@@ -74,7 +75,7 @@ public final class BotaniaAPI {
public static final Map<String, KnowledgeType> knowledgeTypes = new HashMap<>();
public static final Map<String, Brew> brewMap = new LinkedHashMap<>();
public static final List<String> disposableBlocks = new ArrayList<>();
public static final List<String> semiDisposableBlocks = new ArrayList<>();
@@ -102,16 +103,24 @@ public final class BotaniaAPI {
public static final Set<Class<? extends Entity>> gravityRodBlacklist = new LinkedHashSet<>();
public static final ArmorMaterial manasteelArmorMaterial = EnumHelper.addArmorMaterial("MANASTEEL", "manasteel", 16, new int[] { 2, 6, 5, 2 }, 18, SoundEvents.ITEM_ARMOR_EQUIP_IRON);
public static final ArmorMaterial manasteelArmorMaterial = EnumHelper.addEnum(ArmorMaterial.class, "MANASTEEL",
new Class[] { String.class, int.class, int[].class, int.class, SoundEvent.class, float.class },
"manasteel", 16, new int[] { 2, 6, 5, 2 }, 18, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 1.0F); // todo 1.9.4 toughness
public static final ToolMaterial manasteelToolMaterial = EnumHelper.addToolMaterial("MANASTEEL", 3, 300, 6.2F, 2F, 20);
public static final ArmorMaterial elementiumArmorMaterial = EnumHelper.addArmorMaterial("B_ELEMENTIUM", "b_elementium", 18, new int[] { 2, 6, 5, 2 }, 18, SoundEvents.ITEM_ARMOR_EQUIP_IRON);
public static final ArmorMaterial elementiumArmorMaterial = EnumHelper.addEnum(ArmorMaterial.class, "B_ELEMENTIUM",
new Class[] { String.class, int.class, int[].class, int.class, SoundEvent.class, float.class },
"b_elementium", 18, new int[] { 2, 6, 5, 2 }, 18, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 1.0F); // todo 1.9.4 toughness
public static final ToolMaterial elementiumToolMaterial = EnumHelper.addToolMaterial("B_ELEMENTIUM", 3, 720, 6.2F, 2F, 20);
public static final ArmorMaterial terrasteelArmorMaterial = EnumHelper.addArmorMaterial("TERRASTEEL", "terrasteel", 34, new int[] {3, 8, 6, 3}, 26, SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND);
public static final ArmorMaterial terrasteelArmorMaterial = EnumHelper.addEnum(ArmorMaterial.class, "TERRASTEEL",
new Class[] { String.class, int.class, int[].class, int.class, SoundEvent.class, float.class },
"terrasteel", 34, new int[] {3, 8, 6, 3}, 26, SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND, 1.0F); // todo 1.9.4 toughness
public static final ToolMaterial terrasteelToolMaterial = EnumHelper.addToolMaterial("TERRASTEEL", 4, 2300, 9F, 3F, 26);
public static final ArmorMaterial manaweaveArmorMaterial = EnumHelper.addArmorMaterial("MANAWEAVE", "manaweave", 5, new int[] { 1, 2, 2, 1 }, 18, SoundEvents.ITEM_ARMOR_EQUIP_LEATHER);
public static final ArmorMaterial manaweaveArmorMaterial = EnumHelper.addEnum(ArmorMaterial.class, "MANAWEAVE",
new Class[] { String.class, int.class, int[].class, int.class, SoundEvent.class, float.class },
"manaweave", 5, new int[] { 1, 2, 2, 1 }, 18, SoundEvents.ITEM_ARMOR_EQUIP_LEATHER, 1.0F); // todo 1.9.4 toughness
public static final EnumRarity rarityRelic = EnumHelper.addRarity("RELIC", TextFormatting.GOLD, "Relic");
@@ -251,7 +260,7 @@ public final class BotaniaAPI {
registerPaintableBlock(Blocks.STAINED_HARDENED_CLAY, BlockColored.COLOR);
registerPaintableBlock(Blocks.WOOL, BlockColored.COLOR);
registerPaintableBlock(Blocks.CARPET, BlockCarpet.COLOR);
registerDisposableBlock("dirt"); // Vanilla
registerDisposableBlock("sand"); // Vanilla
registerDisposableBlock("gravel"); // Vanilla
@@ -306,7 +315,7 @@ public final class BotaniaAPI {
public static void registerDisposableBlock(String oreDictName) {
disposableBlocks.add(oreDictName);
}
/**
* Registers a Block as semi disposable using its Ore Dictionary Name.
* This means it will not be trashed when sneaking.
@@ -314,7 +323,7 @@ public final class BotaniaAPI {
public static void registerSemiDisposableBlock(String oreDictName) {
semiDisposableBlocks.add(oreDictName);
}
/**
* Registers a paintableBlock and returns it.
* You must also provide the PropertyEnum that this block uses to express its color
@@ -331,7 +340,7 @@ public final class BotaniaAPI {
public static void blacklistEntityFromGravityRod(Class<? extends Entity> entity) {
gravityRodBlacklist.add(entity);
}
/**
* Checks if the provided Entity is contained in the Blacklist.
* Pass in the class for the Entity, e.g. entity.getClass()
@@ -339,7 +348,7 @@ public final class BotaniaAPI {
public static boolean isEntityBlacklistedFromGravityRod(Class entity) {
return gravityRodBlacklist.contains(entity);
}
/**
* Blacklists an item from being pulled by the Ring of Magnetization.
* Short.MAX_VALUE can be used as the stack's damage for a wildcard.
@@ -361,11 +370,11 @@ public final class BotaniaAPI {
public static boolean isItemBlacklistedFromMagnet(ItemStack stack) {
return isItemBlacklistedFromMagnet(stack, 0);
}
public static boolean isItemBlacklistedFromMagnet(ItemStack stack, int recursion) {
if(recursion > 5)
return false;
if(stack.getItemDamage() != Short.MAX_VALUE) {
ItemStack copy = new ItemStack(stack.getItem(), 0, Short.MAX_VALUE);
boolean general = isItemBlacklistedFromMagnet(copy, recursion + 1);
@@ -388,7 +397,7 @@ public final class BotaniaAPI {
public static boolean isBlockBlacklistedFromMagnet(Block block, int meta, int recursion) {
if(recursion >= 5)
return false;
if(meta != Short.MAX_VALUE) {
boolean general = isBlockBlacklistedFromMagnet(block, Short.MAX_VALUE, recursion + 1);
if(general)
@@ -12,6 +12,7 @@ package vazkii.botania.api.lexicon;
import net.minecraft.util.ResourceLocation;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
@@ -70,7 +71,7 @@ public class LexiconCategory implements Comparable<LexiconCategory> {
}
@Override
public int compareTo(LexiconCategory category) {
public int compareTo(@Nonnull LexiconCategory category) {
return priority == category.priority ? sortingId - category.sortingId : category.priority - priority;
}
}
@@ -16,6 +16,7 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import vazkii.botania.api.BotaniaAPI;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -159,7 +160,7 @@ public class LexiconEntry implements Comparable<LexiconEntry> {
}
@Override
public int compareTo(LexiconEntry o) {
public int compareTo(@Nonnull LexiconEntry o) {
return getNameForSorting().compareTo(o.getNameForSorting());
}
@@ -33,10 +33,12 @@ import vazkii.botania.common.core.handler.ConfigHandler;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.item.equipment.armor.terrasteel.ItemTerrasteelHelm;
import javax.annotation.Nonnull;
public final class BaubleRenderHandler implements LayerRenderer<EntityPlayer> {
@Override
public void doRenderLayer(EntityPlayer player, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) {
public void doRenderLayer(@Nonnull EntityPlayer player, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) {
if(!ConfigHandler.renderBaubles || player.getActivePotionEffect(MobEffects.INVISIBILITY) != null)
return;
@@ -24,6 +24,7 @@ import vazkii.botania.common.block.tile.TileCamo;
import vazkii.botania.common.item.IColorable;
import vazkii.botania.common.item.ModItems;
import javax.annotation.Nonnull;
import java.awt.*;
import java.util.Map;
@@ -40,7 +41,7 @@ public final class ColorHandler {
blocks.registerBlockColorHandler(
new IBlockColor() {
@Override
public int colorMultiplier(IBlockState state, IBlockAccess p_186720_2_, BlockPos pos, int tintIndex) {
public int colorMultiplier(@Nonnull IBlockState state, IBlockAccess p_186720_2_, BlockPos pos, int tintIndex) {
return state.getValue(BotaniaStateProps.COLOR).getMapColor().colorValue;
}
},
@@ -50,7 +51,7 @@ public final class ColorHandler {
blocks.registerBlockColorHandler(
new IBlockColor() {
@Override
public int colorMultiplier(IBlockState state, IBlockAccess p_186720_2_, BlockPos pos, int tintIndex) {
public int colorMultiplier(@Nonnull IBlockState state, IBlockAccess p_186720_2_, BlockPos pos, int tintIndex) {
if (state.getValue(BotaniaStateProps.POOL_VARIANT) == PoolVariant.FABULOUS) {
float time = ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks;
return Color.getHSBColor(time * 0.005F, 0.6F, 1F).hashCode();
@@ -66,7 +67,7 @@ public final class ColorHandler {
blocks.registerBlockColorHandler(
new IBlockColor() {
@Override
public int colorMultiplier(IBlockState state, IBlockAccess p_186720_2_, BlockPos pos, int tintIndex) {
public int colorMultiplier(@Nonnull IBlockState state, IBlockAccess p_186720_2_, BlockPos pos, int tintIndex) {
if(state.getValue(BotaniaStateProps.SPREADER_VARIANT) != SpreaderVariant.GAIA)
return 0xFFFFFF;
float time = ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks;
@@ -80,7 +81,7 @@ public final class ColorHandler {
blocks.registerBlockColorHandler(
new IBlockColor() {
@Override
public int colorMultiplier(IBlockState state, IBlockAccess world, BlockPos pos, int tintIndex) {
public int colorMultiplier(@Nonnull IBlockState state, IBlockAccess world, BlockPos pos, int tintIndex) {
TileEntity tile = world.getTileEntity(pos);
if(tile instanceof TileCamo) {
TileCamo camo = (TileCamo) tile;
@@ -96,7 +97,7 @@ public final class ColorHandler {
items.registerItemColorHandler(new IItemColor() {
@Override
public int getColorFromItemstack(ItemStack stack, int tintIndex) {
public int getColorFromItemstack(@Nonnull ItemStack stack, int tintIndex) {
Item item = stack.getItem();
if (item instanceof IColorable) {
return ((IColorable) item).getColorFromItemStack(stack, tintIndex);
@@ -30,6 +30,7 @@ import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.core.version.VersionChecker;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
import javax.annotation.Nonnull;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
@@ -45,7 +46,7 @@ public final class ContributorFancinessHandler implements LayerRenderer<EntityPl
public static final boolean phi = false;
@Override
public void doRenderLayer(EntityPlayer player, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) {
public void doRenderLayer(@Nonnull EntityPlayer player, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) {
String name = player.getDisplayName().getUnformattedText();
float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * partialTicks;
@@ -26,6 +26,7 @@ import org.lwjgl.input.Keyboard;
import vazkii.botania.api.corporea.CorporeaHelper;
import vazkii.botania.common.lib.LibObfuscation;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -173,7 +174,7 @@ public class CorporeaAutoCompleteHandler {
}
@Override
public int compareTo(CompletionData arg0) {
public int compareTo(@Nonnull CompletionData arg0) {
return string.compareTo(arg0.string);
}
}
@@ -116,6 +116,7 @@ import vazkii.botania.common.lib.LibBlockNames;
import vazkii.botania.common.lib.LibItemNames;
import vazkii.botania.common.lib.LibMisc;
import javax.annotation.Nonnull;
import java.util.List;
import java.util.Locale;
@@ -958,8 +959,9 @@ public final class ModelHandler {
ModelResourceLocation getLocation(ItemStack stack);
@Nonnull
@Override
default ModelResourceLocation getModelLocation(ItemStack stack) {
default ModelResourceLocation getModelLocation(@Nonnull ItemStack stack) {
return getLocation(stack);
}
@@ -21,6 +21,8 @@ import net.minecraft.world.biome.Biome;
import vazkii.botania.api.lexicon.multiblock.Multiblock;
import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent;
import javax.annotation.Nonnull;
/**
* This class acts as a wrapper around a block access to
* replace blocks with the blocks involved in the multiblock specified
@@ -32,8 +34,9 @@ public class MultiblockBlockAccess implements IBlockAccess {
private BlockPos anchorPos;
protected Multiblock multiblock;
@Nonnull
@Override
public IBlockState getBlockState(BlockPos pos) {
public IBlockState getBlockState(@Nonnull BlockPos pos) {
MultiblockComponent comp=getComponent(pos);
if(comp != null)
return comp.getBlockState();
@@ -43,7 +46,7 @@ public class MultiblockBlockAccess implements IBlockAccess {
}
@Override
public TileEntity getTileEntity(BlockPos pos) {
public TileEntity getTileEntity(@Nonnull BlockPos pos) {
MultiblockComponent comp=getComponent(pos);
if(comp != null)
return comp.getTileEntity();
@@ -53,24 +56,25 @@ public class MultiblockBlockAccess implements IBlockAccess {
}
@Override
public int getCombinedLight(BlockPos pos, int p_72802_4_) {
public int getCombinedLight(@Nonnull BlockPos pos, int p_72802_4_) {
if(hasBlockAccess)
return originalBlockAccess.getCombinedLight(pos, p_72802_4_);
return 15728640;
}
@Override
public int getStrongPower(BlockPos pos, EnumFacing direction) {
public int getStrongPower(@Nonnull BlockPos pos, @Nonnull EnumFacing direction) {
return 0;
}
@Nonnull
@Override
public WorldType getWorldType() {
return WorldType.DEFAULT;
}
@Override
public boolean isAirBlock(BlockPos pos) {
public boolean isAirBlock(@Nonnull BlockPos pos) {
MultiblockComponent comp=getComponent(pos);
if(comp != null)
return false;
@@ -79,8 +83,9 @@ public class MultiblockBlockAccess implements IBlockAccess {
return true;
}
@Nonnull
@Override
public Biome getBiomeGenForCoords(BlockPos pos) {
public Biome getBiomeGenForCoords(@Nonnull BlockPos pos) {
if(hasBlockAccess)
return originalBlockAccess.getBiomeGenForCoords(pos);
return null;
@@ -92,7 +97,7 @@ public class MultiblockBlockAccess implements IBlockAccess {
}
@Override
public boolean isSideSolid(BlockPos pos, EnumFacing side, boolean _default) {
public boolean isSideSolid(@Nonnull BlockPos pos, @Nonnull EnumFacing side, boolean _default) {
if(hasBlockAccess)
return originalBlockAccess.isSideSolid(pos, side, _default);
return _default;
@@ -17,6 +17,8 @@ import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import vazkii.botania.client.gui.SlotLocked;
import javax.annotation.Nonnull;
public class ContainerFlowerBag extends Container {
InventoryFlowerBag flowerBagInv;
@@ -48,7 +50,7 @@ public class ContainerFlowerBag extends Container {
}
@Override
public boolean canInteractWith(EntityPlayer player) {
public boolean canInteractWith(@Nonnull EntityPlayer player) {
boolean can = flowerBagInv.isUseableByPlayer(player);
if(!can)
onContainerClosed(player);
@@ -19,6 +19,7 @@ import vazkii.botania.common.item.ItemFlowerBag;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.lib.LibItemNames;
import javax.annotation.Nonnull;
import java.util.Arrays;
public class InventoryFlowerBag implements IInventory {
@@ -127,12 +128,12 @@ public class InventoryFlowerBag implements IInventory {
}
@Override
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
public boolean isUseableByPlayer(@Nonnull EntityPlayer entityplayer) {
return isFlowerBag(getStack());
}
@Override
public boolean isItemValidForSlot(int i, ItemStack itemstack) {
public boolean isItemValidForSlot(int i, @Nonnull ItemStack itemstack) {
return isFlowerBag(getStack());
}
@@ -161,21 +162,23 @@ public class InventoryFlowerBag implements IInventory {
return false;
}
@Nonnull
@Override
public ITextComponent getDisplayName() {
return new TextComponentString(getName());
}
@Override
public void openInventory(EntityPlayer player) {
public void openInventory(@Nonnull EntityPlayer player) {
// NO-OP
}
@Override
public void closeInventory(EntityPlayer player) {
public void closeInventory(@Nonnull EntityPlayer player) {
// NO-OP
}
@Nonnull
@Override
public String getName() {
return LibItemNames.FLOWER_BAG;
@@ -23,6 +23,8 @@ import net.minecraft.item.ItemStack;
import vazkii.botania.api.mana.IManaItem;
import vazkii.botania.client.gui.SlotLocked;
import javax.annotation.Nonnull;
public class ContainerBaubleBox extends Container {
InventoryBaubleBox baubleBoxInv;
@@ -65,7 +67,7 @@ public class ContainerBaubleBox extends Container {
}
@Override
public boolean canInteractWith(EntityPlayer player) {
public boolean canInteractWith(@Nonnull EntityPlayer player) {
boolean can = baubleBoxInv.isUseableByPlayer(player);
if(!can)
onContainerClosed(player);
@@ -19,6 +19,7 @@ import vazkii.botania.common.item.ItemBaubleBox;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.lib.LibItemNames;
import javax.annotation.Nonnull;
import java.util.Arrays;
public class InventoryBaubleBox implements IInventory {
@@ -127,12 +128,12 @@ public class InventoryBaubleBox implements IInventory {
}
@Override
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
public boolean isUseableByPlayer(@Nonnull EntityPlayer entityplayer) {
return isBaubleBox(getStack());
}
@Override
public boolean isItemValidForSlot(int i, ItemStack itemstack) {
public boolean isItemValidForSlot(int i, @Nonnull ItemStack itemstack) {
return isBaubleBox(getStack());
}
@@ -160,21 +161,23 @@ public class InventoryBaubleBox implements IInventory {
return false;
}
@Nonnull
@Override
public ITextComponent getDisplayName() {
return new TextComponentString(getName());
}
@Override
public void openInventory(EntityPlayer player) {
public void openInventory(@Nonnull EntityPlayer player) {
// NO-OP
}
@Override
public void closeInventory(EntityPlayer player) {
public void closeInventory(@Nonnull EntityPlayer player) {
// NO-OP
}
@Nonnull
@Override
public String getName() {
return LibItemNames.BAUBLE_BOX;
@@ -18,6 +18,8 @@ import net.minecraft.inventory.SlotCrafting;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import javax.annotation.Nonnull;
public class ContainerCraftingHalo extends ContainerWorkbench {
public ContainerCraftingHalo(InventoryPlayer p_i1808_1_, World p_i1808_2_) {
@@ -58,7 +60,7 @@ public class ContainerCraftingHalo extends ContainerWorkbench {
}
@Override
public boolean canInteractWith(EntityPlayer p_75145_1_) {
public boolean canInteractWith(@Nonnull EntityPlayer p_75145_1_) {
return true;
}
}
@@ -17,6 +17,7 @@ import net.minecraft.util.text.translation.I18n;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.gui.lexicon.GuiLexicon;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
@@ -27,7 +28,7 @@ public class GuiButtonAchievement extends GuiButtonLexicon {
}
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
public void drawButton(@Nonnull Minecraft par1Minecraft, int par2, int par3) {
hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
int k = getHoverState(hovered);
@@ -16,6 +16,7 @@ import net.minecraft.util.text.translation.I18n;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.gui.lexicon.GuiLexicon;
import javax.annotation.Nonnull;
import java.util.Collections;
import java.util.List;
@@ -26,7 +27,7 @@ public class GuiButtonBack extends GuiButtonLexicon {
}
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
public void drawButton(@Nonnull Minecraft par1Minecraft, int par2, int par3) {
if(enabled) {
hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
int k = getHoverState(hovered);
@@ -6,6 +6,7 @@ import net.minecraft.util.text.translation.I18n;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.gui.lexicon.GuiLexicon;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
@@ -19,7 +20,7 @@ public class GuiButtonBookmark extends GuiButtonLexicon {
}
@Override
public void drawButton(Minecraft mc, int par2, int par3) {
public void drawButton(@Nonnull Minecraft mc, int par2, int par3) {
gui.drawBookmark(xPosition, yPosition, displayString, false);
hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
int k = getHoverState(hovered);
@@ -27,6 +27,8 @@ import vazkii.botania.client.gui.lexicon.GuiLexicon;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.common.core.handler.ConfigHandler;
import javax.annotation.Nonnull;
public class GuiButtonCategory extends GuiButtonLexicon {
private static final ResourceLocation fallbackResource = new ResourceLocation(LibResources.CATEGORY_INDEX);
@@ -71,7 +73,7 @@ public class GuiButtonCategory extends GuiButtonLexicon {
}
@Override
public void drawButton(Minecraft mc, int mx, int my) {
public void drawButton(@Nonnull Minecraft mc, int mx, int my) {
boolean inside = mx >= xPosition && my >= yPosition && mx < xPosition + width && my < yPosition + height;
if(inside)
ticksHovered = Math.min(time, ticksHovered + gui.timeDelta);
@@ -17,6 +17,7 @@ import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.translation.I18n;
import vazkii.botania.client.challenge.Challenge;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
@@ -30,7 +31,7 @@ public class GuiButtonChallengeIcon extends GuiButtonLexicon {
}
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
public void drawButton(@Nonnull Minecraft par1Minecraft, int par2, int par3) {
hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
int k = getHoverState(hovered);
@@ -15,6 +15,7 @@ import net.minecraft.util.text.translation.I18n;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.gui.lexicon.GuiLexicon;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
@@ -28,7 +29,7 @@ public class GuiButtonChallengeInfo extends GuiButtonLexicon {
}
@Override
public void drawButton(Minecraft mc, int par2, int par3) {
public void drawButton(@Nonnull Minecraft mc, int par2, int par3) {
gui.drawBookmark(xPosition, yPosition, displayString, false);
hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
int k = getHoverState(hovered);
@@ -17,6 +17,7 @@ import net.minecraft.util.text.translation.I18n;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.gui.lexicon.GuiLexicon;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
@@ -27,7 +28,7 @@ public class GuiButtonChallenges extends GuiButtonLexicon {
}
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
public void drawButton(@Nonnull Minecraft par1Minecraft, int par2, int par3) {
hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
int k = getHoverState(hovered);
@@ -19,6 +19,7 @@ import net.minecraft.util.text.TextFormatting;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.common.item.ModItems;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
@@ -31,7 +32,7 @@ public class GuiButtonDoot extends GuiButtonLexicon {
}
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
public void drawButton(@Nonnull Minecraft par1Minecraft, int par2, int par3) {
hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
int k = getHoverState(hovered);
@@ -16,6 +16,7 @@ import net.minecraft.util.text.translation.I18n;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.gui.lexicon.GuiLexicon;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
@@ -29,7 +30,7 @@ public class GuiButtonHistory extends GuiButtonLexicon {
}
@Override
public void drawButton(Minecraft mc, int par2, int par3) {
public void drawButton(@Nonnull Minecraft mc, int par2, int par3) {
gui.drawBookmark(xPosition, yPosition, displayString, false);
hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
int k = getHoverState(hovered);
@@ -24,6 +24,8 @@ import vazkii.botania.client.gui.lexicon.GuiLexiconIndex;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.common.lib.LibMisc;
import javax.annotation.Nonnull;
public class GuiButtonInvisible extends GuiButtonLexicon {
private static final ResourceLocation dogResource = new ResourceLocation(LibResources.GUI_DOG);
@@ -48,7 +50,7 @@ public class GuiButtonInvisible extends GuiButtonLexicon {
}
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
public void drawButton(@Nonnull Minecraft par1Minecraft, int par2, int par3) {
if(enableDog) {
dogPos += ClientTickHandler.delta * 10;
@@ -17,6 +17,7 @@ import net.minecraft.util.text.translation.I18n;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.gui.lexicon.GuiLexicon;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
@@ -30,7 +31,7 @@ public class GuiButtonNotes extends GuiButtonLexicon {
}
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
public void drawButton(@Nonnull Minecraft par1Minecraft, int par2, int par3) {
hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
int k = getHoverState(hovered);
@@ -17,6 +17,7 @@ import net.minecraft.util.text.translation.I18n;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.gui.lexicon.GuiLexicon;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
@@ -27,7 +28,7 @@ public class GuiButtonOptions extends GuiButtonLexicon {
}
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
public void drawButton(@Nonnull Minecraft par1Minecraft, int par2, int par3) {
hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
int k = getHoverState(hovered);
@@ -16,6 +16,7 @@ import net.minecraft.util.text.translation.I18n;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.gui.lexicon.GuiLexicon;
import javax.annotation.Nonnull;
import java.util.Collections;
public class GuiButtonPage extends GuiButtonLexicon {
@@ -28,7 +29,7 @@ public class GuiButtonPage extends GuiButtonLexicon {
}
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
public void drawButton(@Nonnull Minecraft par1Minecraft, int par2, int par3) {
if(enabled) {
hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
int k = getHoverState(hovered);
@@ -17,6 +17,7 @@ import net.minecraft.util.text.translation.I18n;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.gui.lexicon.GuiLexicon;
import javax.annotation.Nonnull;
import java.util.Collections;
import java.util.List;
@@ -27,7 +28,7 @@ public class GuiButtonShare extends GuiButtonLexicon {
}
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
public void drawButton(@Nonnull Minecraft par1Minecraft, int par2, int par3) {
hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
int k = getHoverState(hovered);
@@ -19,6 +19,7 @@ import vazkii.botania.client.core.handler.PersistentVariableHelper;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.gui.lexicon.GuiLexicon;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
@@ -29,7 +30,7 @@ public class GuiButtonUpdateWarning extends GuiButtonLexicon {
}
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
public void drawButton(@Nonnull Minecraft par1Minecraft, int par2, int par3) {
if(!visible || !enabled)
return;
@@ -17,6 +17,7 @@ import net.minecraft.util.text.translation.I18n;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.gui.lexicon.GuiLexicon;
import javax.annotation.Nonnull;
import java.util.Collections;
import java.util.List;
@@ -27,7 +28,7 @@ public class GuiButtonViewOnline extends GuiButtonLexicon {
}
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
public void drawButton(@Nonnull Minecraft par1Minecraft, int par2, int par3) {
hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
int k = getHoverState(hovered);
@@ -43,6 +43,7 @@ import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.item.block.ItemBlockFloatingSpecialFlower;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
import javax.annotation.Nonnull;
import javax.vecmath.Vector3f;
import javax.vecmath.Vector4f;
import java.util.List;
@@ -80,10 +81,11 @@ public class FloatingFlowerModel implements IBakedModel, IResourceManagerReloadL
}
@Override
public void onResourceManagerReload(IResourceManager resourceManager) {
public void onResourceManagerReload(@Nonnull IResourceManager resourceManager) {
CACHE.clear();
}
@Nonnull
@Override
public List<BakedQuad> getQuads(IBlockState state, EnumFacing face, long rand) {
if(state.getBlock() != ModBlocks.floatingSpecialFlower && state.getBlock() != ModBlocks.floatingFlower)
@@ -136,6 +138,7 @@ public class FloatingFlowerModel implements IBakedModel, IResourceManagerReloadL
}
}
@Nonnull
@Override
public ItemOverrideList getOverrides() {
return itemHandler;
@@ -144,7 +147,9 @@ public class FloatingFlowerModel implements IBakedModel, IResourceManagerReloadL
@Override public boolean isAmbientOcclusion() { return false; }
@Override public boolean isGui3d() { return true; }
@Override public boolean isBuiltInRenderer() { return false; }
@Nonnull
@Override public TextureAtlasSprite getParticleTexture() { return null; }
@Nonnull
@Override public ItemCameraTransforms getItemCameraTransforms() { return ItemCameraTransforms.DEFAULT; }
private static class CompositeBakedModel implements IBakedModel {
@@ -178,6 +183,7 @@ public class FloatingFlowerModel implements IBakedModel, IResourceManagerReloadL
}
// Forward all to flower model
@Nonnull
@Override
public List<BakedQuad> getQuads(IBlockState state, EnumFacing face, long rand) {
return genQuads;
@@ -198,22 +204,26 @@ public class FloatingFlowerModel implements IBakedModel, IResourceManagerReloadL
return base.isBuiltInRenderer();
}
@Nonnull
@Override
public TextureAtlasSprite getParticleTexture() {
return base.getParticleTexture();
}
@Nonnull
@Override
public ItemCameraTransforms getItemCameraTransforms() {
return base.getItemCameraTransforms();
}
@Nonnull
@Override public ItemOverrideList getOverrides() { return ItemOverrideList.NONE; }
}
private final ItemOverrideList itemHandler = new ItemOverrideList(ImmutableList.of()) {
@Nonnull
@Override
public IBakedModel handleItemState(IBakedModel model, ItemStack stack, World world, EntityLivingBase entity) {
public IBakedModel handleItemState(@Nonnull IBakedModel model, ItemStack stack, @Nonnull World world, @Nonnull EntityLivingBase entity) {
// Items always have GRASS island
IFloatingFlower.IslandType islandType = IFloatingFlower.IslandType.GRASS;
String identifier;
@@ -13,6 +13,7 @@ import net.minecraft.util.EnumFacing;
import net.minecraftforge.client.model.IPerspectiveAwareModel;
import org.apache.commons.lang3.tuple.Pair;
import javax.annotation.Nonnull;
import javax.vecmath.Matrix4f;
import java.util.List;
@@ -29,11 +30,15 @@ public class LexiconModel implements IPerspectiveAwareModel {
return ((IPerspectiveAwareModel) original).handlePerspective(cameraTransformType);
}
@Nonnull
@Override public List<BakedQuad> getQuads(IBlockState state, EnumFacing side, long rand) { return ImmutableList.of(); }
@Override public boolean isAmbientOcclusion() { return false; }
@Override public boolean isGui3d() { return false; }
@Override public boolean isBuiltInRenderer() { return false; }
@Nonnull
@Override public TextureAtlasSprite getParticleTexture() { return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite("botania:items/lexicon"); }
@Nonnull
@Override public ItemCameraTransforms getItemCameraTransforms() { return ItemCameraTransforms.DEFAULT; }
@Nonnull
@Override public ItemOverrideList getOverrides() { return ItemOverrideList.NONE; }
}
@@ -32,10 +32,12 @@ import vazkii.botania.common.block.BlockCamo;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.tile.TileCamo;
import javax.annotation.Nonnull;
import java.util.List;
public class PlatformModel implements IBakedModel {
@Nonnull
@Override
public List<BakedQuad> getQuads(IBlockState state, EnumFacing side, long rand) {
if(state.getBlock() != ModBlocks.platform)
@@ -91,16 +93,19 @@ public class PlatformModel implements IBakedModel {
return false;
}
@Nonnull
@Override
public TextureAtlasSprite getParticleTexture() {
return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite("botania:blocks/livingwood0");
}
@Nonnull
@Override
public ItemCameraTransforms getItemCameraTransforms() {
return ItemCameraTransforms.DEFAULT;
}
@Nonnull
@Override
public ItemOverrideList getOverrides() {
return ItemOverrideList.NONE;
@@ -115,7 +120,7 @@ public class PlatformModel implements IBakedModel {
}
@Override
public TileEntity getTileEntity(BlockPos pos) {
public TileEntity getTileEntity(@Nonnull BlockPos pos) {
/* todo is this actually needed? if so this can't be an iblockaccess anymore
IBlockState state = getBlockState(pos);
if(state == null || !state.getBlock().hasTileEntity(state))
@@ -133,12 +138,13 @@ public class PlatformModel implements IBakedModel {
}
@Override
public int getCombinedLight(BlockPos pos, int lightValue) {
public int getCombinedLight(@Nonnull BlockPos pos, int lightValue) {
return 15 << 20 | 15 << 4;
}
@Nonnull
@Override
public IBlockState getBlockState(BlockPos pos) {
public IBlockState getBlockState(@Nonnull BlockPos pos) {
IBlockState state = compose.getBlockState(pos);
if(state.getBlock() instanceof BlockCamo) {
state = ((TileCamo) compose.getTileEntity(pos)).camoState;
@@ -147,12 +153,13 @@ public class PlatformModel implements IBakedModel {
}
@Override
public boolean isAirBlock(BlockPos pos) {
public boolean isAirBlock(@Nonnull BlockPos pos) {
return compose.isAirBlock(pos);
}
@Nonnull
@Override
public Biome getBiomeGenForCoords(BlockPos pos) {
public Biome getBiomeGenForCoords(@Nonnull BlockPos pos) {
return compose.getBiomeGenForCoords(pos);
}
@@ -162,17 +169,18 @@ public class PlatformModel implements IBakedModel {
}
@Override
public int getStrongPower(BlockPos pos, EnumFacing direction) {
public int getStrongPower(@Nonnull BlockPos pos, @Nonnull EnumFacing direction) {
return compose.getStrongPower(pos, direction);
}
@Nonnull
@Override
public WorldType getWorldType() {
return compose.getWorldType();
}
@Override
public boolean isSideSolid(BlockPos pos, EnumFacing side, boolean _default) {
public boolean isSideSolid(@Nonnull BlockPos pos, @Nonnull EnumFacing side, boolean _default) {
return compose.isSideSolid(pos, side, _default);
}
}
@@ -48,6 +48,7 @@ import vazkii.botania.api.state.BotaniaStateProps;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
import javax.annotation.Nonnull;
import javax.vecmath.Matrix4f;
import java.io.IOException;
import java.util.Collection;
@@ -133,7 +134,7 @@ public class SpecialFlowerModel implements IModelCustomData {
public enum Loader implements ICustomModelLoader {
INSTANCE {
@Override
public void onResourceManagerReload(IResourceManager resourceManager) {
public void onResourceManagerReload(@Nonnull IResourceManager resourceManager) {
}
@Override
@@ -212,6 +213,7 @@ public class SpecialFlowerModel implements IModelCustomData {
return model.bake(new SimpleModelState(transforms), DefaultVertexFormats.ITEM, ModelLoader.defaultTextureGetter());
}
@Nonnull
@Override
public List<BakedQuad> getQuads(IBlockState state, EnumFacing face, long rand) {
if(state.getBlock() != ModBlocks.specialFlower)
@@ -224,14 +226,16 @@ public class SpecialFlowerModel implements IModelCustomData {
return ret.getQuads(state, face, rand);
}
@Nonnull
@Override
public ItemOverrideList getOverrides() {
return itemHandler;
}
private final ItemOverrideList itemHandler = new ItemOverrideList(ImmutableList.of()) {
@Nonnull
@Override
public IBakedModel handleItemState(IBakedModel original, ItemStack stack, World world, EntityLivingBase living) {
public IBakedModel handleItemState(@Nonnull IBakedModel original, ItemStack stack, @Nonnull World world, @Nonnull EntityLivingBase living) {
refreshBakedModels();
IBakedModel item = bakedItemModels.get(ItemBlockSpecialFlower.getType(stack));
if(item == null) {
@@ -260,12 +264,14 @@ public class SpecialFlowerModel implements IModelCustomData {
return baseModel.isBuiltInRenderer();
}
@Nonnull
@Override
public TextureAtlasSprite getParticleTexture() {
refreshBakedModels();
return baseModel.getParticleTexture();
}
@Nonnull
@Override
public ItemCameraTransforms getItemCameraTransforms() {
return baseModel.getItemCameraTransforms();
@@ -18,6 +18,8 @@ import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.EnumAction;
import net.minecraft.util.EnumHandSide;
import javax.annotation.Nonnull;
public class ModelArmorElementium extends ModelBiped {
public ModelRenderer helm;
@@ -210,7 +212,7 @@ public class ModelArmorElementium extends ModelBiped {
}
@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
public void render(@Nonnull Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
helm.showModel = slot == EntityEquipmentSlot.HEAD;
body.showModel = slot == EntityEquipmentSlot.CHEST;
armR.showModel = slot == EntityEquipmentSlot.CHEST;
@@ -18,6 +18,8 @@ import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.EnumAction;
import net.minecraft.util.EnumHandSide;
import javax.annotation.Nonnull;
public class ModelArmorManasteel extends ModelBiped {
@@ -140,7 +142,7 @@ public class ModelArmorManasteel extends ModelBiped {
}
@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
public void render(@Nonnull Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
helm.showModel = slot == EntityEquipmentSlot.HEAD;
body.showModel = slot == EntityEquipmentSlot.CHEST;
armR.showModel = slot == EntityEquipmentSlot.CHEST;
@@ -18,6 +18,8 @@ import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.EnumAction;
import net.minecraft.util.EnumHandSide;
import javax.annotation.Nonnull;
public class ModelArmorManaweave extends ModelBiped {
public ModelRenderer helm;
@@ -140,7 +142,7 @@ public class ModelArmorManaweave extends ModelBiped {
}
@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
public void render(@Nonnull Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
helm.showModel = slot == EntityEquipmentSlot.HEAD;
body.showModel = slot == EntityEquipmentSlot.CHEST;
armR.showModel = slot == EntityEquipmentSlot.CHEST;
@@ -18,6 +18,8 @@ import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.EnumAction;
import net.minecraft.util.EnumHandSide;
import javax.annotation.Nonnull;
public class ModelArmorTerrasteel extends ModelBiped {
public ModelRenderer helm;
@@ -231,7 +233,7 @@ public class ModelArmorTerrasteel extends ModelBiped {
}
@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
public void render(@Nonnull Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
helm.showModel = slot == EntityEquipmentSlot.HEAD;
body.showModel = slot == EntityEquipmentSlot.CHEST;
armr.showModel = slot == EntityEquipmentSlot.CHEST;
@@ -27,6 +27,7 @@ import vazkii.botania.client.core.helper.ShaderHelper;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.common.entity.EntityBabylonWeapon;
import javax.annotation.Nonnull;
import java.util.Random;
public class RenderBabylonWeapon extends Render<EntityBabylonWeapon> {
@@ -38,7 +39,7 @@ public class RenderBabylonWeapon extends Render<EntityBabylonWeapon> {
}
@Override
public void doRender(EntityBabylonWeapon weapon, double par2, double par4, double par6, float par8, float par9) {
public void doRender(@Nonnull EntityBabylonWeapon weapon, double par2, double par4, double par6, float par8, float par9) {
GlStateManager.pushMatrix();
GlStateManager.translate((float)par2, (float)par4, (float)par6);
GlStateManager.rotate(weapon.getRotation(), 0F, 1F, 0F);
@@ -104,8 +105,9 @@ public class RenderBabylonWeapon extends Render<EntityBabylonWeapon> {
GlStateManager.popMatrix();
}
@Nonnull
@Override
protected ResourceLocation getEntityTexture(EntityBabylonWeapon p_110775_1_) {
protected ResourceLocation getEntityTexture(@Nonnull EntityBabylonWeapon p_110775_1_) {
return null;
}
@@ -21,6 +21,8 @@ import vazkii.botania.client.core.handler.BossBarHandler;
import vazkii.botania.client.core.helper.ShaderHelper;
import vazkii.botania.common.entity.EntityDoppleganger;
import javax.annotation.Nonnull;
public class RenderDoppleganger extends RenderBiped<EntityDoppleganger> {
public static final float DEFAULT_GRAIN_INTENSITY = 0.05F;
@@ -54,7 +56,7 @@ public class RenderDoppleganger extends RenderBiped<EntityDoppleganger> {
}
@Override
public void doRender(EntityDoppleganger dopple, double par2, double par4, double par6, float par8, float par9) {
public void doRender(@Nonnull EntityDoppleganger dopple, double par2, double par4, double par6, float par8, float par9) {
int invulTime = dopple.getInvulTime();
if(invulTime > 0) {
grainIntensity = invulTime > 20 ? 1F : invulTime * 0.05F;
@@ -69,8 +71,9 @@ public class RenderDoppleganger extends RenderBiped<EntityDoppleganger> {
ShaderHelper.releaseShader();
}
@Nonnull
@Override
protected ResourceLocation getEntityTexture(EntityDoppleganger par1Entity) {
protected ResourceLocation getEntityTexture(@Nonnull EntityDoppleganger par1Entity) {
return DefaultPlayerSkin.getDefaultSkinLegacy();
}
@@ -17,6 +17,8 @@ import net.minecraft.util.ResourceLocation;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.common.entity.EntityManaStorm;
import javax.annotation.Nonnull;
public class RenderManaStorm extends Render<EntityManaStorm> {
public RenderManaStorm(RenderManager renderManager) {
@@ -24,7 +26,7 @@ public class RenderManaStorm extends Render<EntityManaStorm> {
}
@Override
public void doRender(EntityManaStorm storm, double x, double y, double z, float something, float pticks) {
public void doRender(@Nonnull EntityManaStorm storm, double x, double y, double z, float something, float pticks) {
GlStateManager.pushMatrix();
GlStateManager.translate(x, y, z);
float maxScale = 1.95F;
@@ -35,8 +37,9 @@ public class RenderManaStorm extends Render<EntityManaStorm> {
GlStateManager.popMatrix();
}
@Nonnull
@Override
protected ResourceLocation getEntityTexture(EntityManaStorm p_110775_1_) {
protected ResourceLocation getEntityTexture(@Nonnull EntityManaStorm p_110775_1_) {
return null;
}
@@ -19,6 +19,8 @@ import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import vazkii.botania.client.lib.LibResources;
import javax.annotation.Nonnull;
public class RenderPinkWither extends RenderWither {
private static final ResourceLocation resource = new ResourceLocation(LibResources.MODEL_PINK_WITHER);
@@ -27,6 +29,7 @@ public class RenderPinkWither extends RenderWither {
super(p_i46130_1_);
}
@Nonnull
@Override
protected ResourceLocation getEntityTexture(EntityWither p_110775_1_) {
return resource;
@@ -23,6 +23,8 @@ import vazkii.botania.client.lib.LibResources;
import vazkii.botania.client.model.ModelPixie;
import vazkii.botania.common.entity.EntityPixie;
import javax.annotation.Nonnull;
public class RenderPixie extends RenderLiving<EntityPixie> {
ShaderCallback callback = shader -> {
@@ -41,13 +43,14 @@ public class RenderPixie extends RenderLiving<EntityPixie> {
shadowSize = 0.0F;
}
@Nonnull
@Override
protected ResourceLocation getEntityTexture(EntityPixie entity) {
protected ResourceLocation getEntityTexture(@Nonnull EntityPixie entity) {
return new ResourceLocation(LibResources.MODEL_PIXIE);
}
@Override
public void doRender(EntityPixie pixie, double par2, double par4, double par6, float par8, float par9) {
public void doRender(@Nonnull EntityPixie pixie, double par2, double par4, double par6, float par8, float par9) {
if(pixie.getType() == 1)
ShaderHelper.useShader(ShaderHelper.doppleganger, callback);
super.doRender(pixie, par2, par4, par6, par8, par9);
@@ -20,6 +20,8 @@ import vazkii.botania.client.render.tile.RenderTilePool;
import vazkii.botania.common.block.tile.mana.TilePool;
import vazkii.botania.common.entity.EntityPoolMinecart;
import javax.annotation.Nonnull;
public class RenderPoolMinecart extends RenderMinecart<EntityPoolMinecart> {
public RenderPoolMinecart(RenderManager p_i46155_1_) {
@@ -27,7 +29,7 @@ public class RenderPoolMinecart extends RenderMinecart<EntityPoolMinecart> {
}
@Override
protected void renderCartContents(EntityPoolMinecart poolCart, float p_147910_2_, IBlockState state) {
protected void renderCartContents(EntityPoolMinecart poolCart, float p_147910_2_, @Nonnull IBlockState state) {
RenderTilePool.forceVariant = PoolVariant.DEFAULT;
RenderTilePool.forceManaNumber = poolCart.getMana();
TileEntityRendererDispatcher.instance.getSpecialRendererByClass(TilePool.class).renderTileEntityAt(null, poolCart.posX, poolCart.posY, poolCart.posZ, ClientTickHandler.partialTicks, -1);
@@ -16,6 +16,8 @@ import net.minecraft.entity.Entity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import javax.annotation.Nonnull;
// Same as RenderSnowball, but ItemStack sensitive
public class RenderSnowballStack<T extends Entity> extends RenderSnowball<T> {
@@ -26,6 +28,7 @@ public class RenderSnowballStack<T extends Entity> extends RenderSnowball<T> {
this.stackGetter = stackGetter;
}
@Nonnull
@Override
public ItemStack getStackToRender(T entity) {
return stackGetter.apply(entity);
@@ -24,6 +24,7 @@ import org.lwjgl.opengl.GL11;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.core.handler.MiscellaneousIcons;
import javax.annotation.Nonnull;
import java.util.Random;
public abstract class RenderSparkBase<T extends Entity> extends Render<T> {
@@ -33,7 +34,7 @@ public abstract class RenderSparkBase<T extends Entity> extends Render<T> {
}
@Override
public void doRender(T tEntity, double par2, double par4, double par6, float par8, float par9) {
public void doRender(@Nonnull T tEntity, double par2, double par4, double par6, float par8, float par9) {
TextureAtlasSprite iicon = getBaseIcon(tEntity);
GlStateManager.pushMatrix();
@@ -95,8 +96,9 @@ public abstract class RenderSparkBase<T extends Entity> extends Render<T> {
// NO-OP
}
@Nonnull
@Override
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
protected ResourceLocation getEntityTexture(@Nonnull Entity p_110775_1_) {
return TextureMap.LOCATION_BLOCKS_TEXTURE;
}
@@ -21,6 +21,8 @@ import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import vazkii.botania.common.entity.EntityThornChakram;
import javax.annotation.Nonnull;
// Basically a bit of an extension of RenderSnowball
public class RenderThornChakram extends Render<EntityThornChakram> {
@@ -29,7 +31,7 @@ public class RenderThornChakram extends Render<EntityThornChakram> {
}
@Override
public void doRender(EntityThornChakram c, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) {
public void doRender(@Nonnull EntityThornChakram c, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) {
boolean fire = c.isFire();
TextureAtlasSprite iicon = null;//ModItems.thornChakram.getIconFromDamage(fire ? 1 : 0);
@@ -47,8 +49,9 @@ public class RenderThornChakram extends Render<EntityThornChakram> {
}
}
@Nonnull
@Override
protected ResourceLocation getEntityTexture(EntityThornChakram p_110775_1_) {
protected ResourceLocation getEntityTexture(@Nonnull EntityThornChakram p_110775_1_) {
return TextureMap.LOCATION_BLOCKS_TEXTURE;
}
@@ -25,10 +25,12 @@ import vazkii.botania.client.core.handler.MiscellaneousIcons;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.tile.TileAlfPortal;
import javax.annotation.Nonnull;
public class RenderTileAlfPortal extends TileEntitySpecialRenderer<TileAlfPortal> {
@Override
public void renderTileEntityAt(TileAlfPortal portal, double d0, double d1, double d2, float f, int digProgress) {
public void renderTileEntityAt(@Nonnull TileAlfPortal portal, double d0, double d1, double d2, float f, int digProgress) {
if (!portal.getWorld().isBlockLoaded(portal.getPos(), false)
|| portal.getWorld().getBlockState(portal.getPos()).getBlock() != ModBlocks.alfPortal)
return;
@@ -27,10 +27,12 @@ import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.tile.TileAltar;
import javax.annotation.Nonnull;
public class RenderTileAltar extends TileEntitySpecialRenderer<TileAltar> {
@Override
public void renderTileEntityAt(TileAltar altar, double d0, double d1, double d2, float pticks, int digProgress) {
public void renderTileEntityAt(@Nonnull TileAltar altar, double d0, double d1, double d2, float pticks, int digProgress) {
if(!altar.getWorld().isBlockLoaded(altar.getPos(), false)
|| altar.getWorld().getBlockState(altar.getPos()).getBlock() != ModBlocks.altar)
return;
@@ -28,6 +28,8 @@ import vazkii.botania.client.model.ModelAvatar;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.tile.TileAvatar;
import javax.annotation.Nonnull;
public class RenderTileAvatar extends TileEntitySpecialRenderer<TileAvatar> {
private static final float[] ROTATIONS = new float[] {
@@ -38,7 +40,7 @@ public class RenderTileAvatar extends TileEntitySpecialRenderer<TileAvatar> {
private static final ModelAvatar model = new ModelAvatar();
@Override
public void renderTileEntityAt(TileAvatar avatar, double d0, double d1, double d2, float pticks, int digProgress) {
public void renderTileEntityAt(@Nonnull TileAvatar avatar, double d0, double d1, double d2, float pticks, int digProgress) {
if (avatar != null)
if (!avatar.getWorld().isBlockLoaded(avatar.getPos(), false)
|| avatar.getWorld().getBlockState(avatar.getPos()).getBlock() != ModBlocks.avatar)
@@ -19,6 +19,8 @@ import vazkii.botania.client.model.ModelBellows;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.tile.mana.TileBellows;
import javax.annotation.Nonnull;
public class RenderTileBellows extends TileEntitySpecialRenderer<TileBellows> {
private static final float[] ROTATIONS = new float[] {
@@ -29,7 +31,7 @@ public class RenderTileBellows extends TileEntitySpecialRenderer<TileBellows> {
private static final ModelBellows model = new ModelBellows();
@Override
public void renderTileEntityAt(TileBellows bellows, double d0, double d1, double d2, float f, int digProgress) {
public void renderTileEntityAt(@Nonnull TileBellows bellows, double d0, double d1, double d2, float f, int digProgress) {
if (bellows != null)
if (!bellows.getWorld().isBlockLoaded(bellows.getPos(), false)
|| bellows.getWorld().getBlockState(bellows.getPos()).getBlock() != ModBlocks.bellows)
@@ -22,6 +22,8 @@ import vazkii.botania.client.lib.LibResources;
import vazkii.botania.client.model.ModelBrewery;
import vazkii.botania.common.block.tile.TileBrewery;
import javax.annotation.Nonnull;
public class RenderTileBrewery extends TileEntitySpecialRenderer<TileBrewery> {
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_BREWERY);
@@ -29,7 +31,7 @@ public class RenderTileBrewery extends TileEntitySpecialRenderer<TileBrewery> {
public TileBrewery brewery;
@Override
public void renderTileEntityAt(TileBrewery brewery, double d0, double d1, double d2, float f, int digProgress) {
public void renderTileEntityAt(@Nonnull TileBrewery brewery, double d0, double d1, double d2, float f, int digProgress) {
this.brewery = brewery;
GlStateManager.pushMatrix();
GlStateManager.enableRescaleNormal();
@@ -19,10 +19,12 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import org.lwjgl.opengl.GL11;
import vazkii.botania.common.block.tile.TileCocoon;
import javax.annotation.Nonnull;
public class RenderTileCocoon extends TileEntitySpecialRenderer<TileCocoon> {
@Override
public void renderTileEntityAt(TileCocoon cocoon, double d0, double d1, double d2, float f, int digProgress) {
public void renderTileEntityAt(@Nonnull TileCocoon cocoon, double d0, double d1, double d2, float f, int digProgress) {
float rot = 0F;
float modval = 60F - (float) cocoon.timePassed / (float) TileCocoon.TOTAL_TIME * 30F;
if(cocoon.timePassed % modval < 10) {
@@ -43,13 +43,15 @@ import vazkii.botania.client.model.ModelCrystalCube;
import vazkii.botania.common.block.tile.corporea.TileCorporeaCrystalCube;
import vazkii.botania.common.core.handler.MethodHandles;
import javax.annotation.Nonnull;
public class RenderTileCorporeaCrystalCube extends TileEntitySpecialRenderer<TileCorporeaCrystalCube> {
private EntityItem entity = null;
private RenderEntityItem itemRenderer = null;
@Override
public void renderTileEntityAt(TileCorporeaCrystalCube cube, double d0, double d1, double d2, float f, int digProgress) {
public void renderTileEntityAt(@Nonnull TileCorporeaCrystalCube cube, double d0, double d1, double d2, float f, int digProgress) {
ItemStack stack = null;
if (cube != null) {
if(entity == null)
@@ -19,6 +19,8 @@ import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex;
import javax.annotation.Nonnull;
public class RenderTileCorporeaIndex extends TileEntitySpecialRenderer<TileCorporeaIndex> {
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_CORPOREA_INDEX);
@@ -26,7 +28,7 @@ public class RenderTileCorporeaIndex extends TileEntitySpecialRenderer<TileCorpo
public static boolean move = true;
@Override
public void renderTileEntityAt(TileCorporeaIndex index, double x, double y, double z, float partticks, int digProgress) {
public void renderTileEntityAt(@Nonnull TileCorporeaIndex index, double x, double y, double z, float partticks, int digProgress) {
move = index != null;
GlStateManager.pushMatrix();
@@ -27,12 +27,14 @@ import vazkii.botania.client.core.helper.ShaderHelper;
import vazkii.botania.common.block.tile.TileEnchanter;
import vazkii.botania.common.core.handler.MethodHandles;
import javax.annotation.Nonnull;
public class RenderTileEnchanter extends TileEntitySpecialRenderer<TileEnchanter> {
EntityItem item;
@Override
public void renderTileEntityAt(TileEnchanter enchanter, double d0, double d1, double d2, float f, int digProgress) {
public void renderTileEntityAt(@Nonnull TileEnchanter enchanter, double d0, double d1, double d2, float f, int digProgress) {
float alphaMod = 0F;
if(enchanter.stage == 2)
@@ -22,12 +22,13 @@ import net.minecraft.tileentity.TileEntity;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.model.FloatingFlowerModel;
import javax.annotation.Nonnull;
import java.util.Random;
public class RenderTileFloatingFlower extends TileEntitySpecialRenderer {
@Override
public void renderTileEntityAt(TileEntity tile, double d0, double d1, double d2, float t, int digProgress) {
public void renderTileEntityAt(@Nonnull TileEntity tile, double d0, double d1, double d2, float t, int digProgress) {
if (tile != null)
if (!tile.getWorld().isBlockLoaded(tile.getPos(), false))
return;
@@ -21,6 +21,7 @@ import vazkii.botania.client.lib.LibResources;
import vazkii.botania.client.model.ModelHourglass;
import vazkii.botania.common.block.tile.TileHourglass;
import javax.annotation.Nonnull;
import java.util.Random;
public class RenderTileHourglass extends TileEntitySpecialRenderer<TileHourglass> {
@@ -29,7 +30,7 @@ public class RenderTileHourglass extends TileEntitySpecialRenderer<TileHourglass
ModelHourglass model = new ModelHourglass();
@Override
public void renderTileEntityAt(TileHourglass hourglass, double d0, double d1, double d2, float ticks, int digProgress) {
public void renderTileEntityAt(@Nonnull TileHourglass hourglass, double d0, double d1, double d2, float ticks, int digProgress) {
GlStateManager.pushMatrix();
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
@@ -22,6 +22,7 @@ import vazkii.botania.api.state.BotaniaStateProps;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.tile.TileIncensePlate;
import javax.annotation.Nonnull;
import java.util.Map;
public class RenderTileIncensePlate extends TileEntitySpecialRenderer<TileIncensePlate> {
@@ -30,7 +31,7 @@ public class RenderTileIncensePlate extends TileEntitySpecialRenderer<TileIncens
@SuppressWarnings("deprecation")
@Override
public void renderTileEntityAt(TileIncensePlate plate, double d0, double d1, double d2, float ticks, int digProgress) {
public void renderTileEntityAt(@Nonnull TileIncensePlate plate, double d0, double d1, double d2, float ticks, int digProgress) {
if(!plate.getWorld().isBlockLoaded(plate.getPos(), false)
|| plate.getWorld().getBlockState(plate.getPos()).getBlock() != ModBlocks.incensePlate)
return;
@@ -26,10 +26,12 @@ import vazkii.botania.client.core.helper.ShaderHelper;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.tile.TileLightRelay;
import javax.annotation.Nonnull;
public class RenderTileLightRelay extends TileEntitySpecialRenderer<TileLightRelay> {
@Override
public void renderTileEntityAt(TileLightRelay tile, double x, double y, double z, float pticks, int digProgress) {
public void renderTileEntityAt(@Nonnull TileLightRelay tile, double x, double y, double z, float pticks, int digProgress) {
if(!tile.getWorld().isBlockLoaded(tile.getPos(), false)
|| tile.getWorld().getBlockState(tile.getPos()).getBlock() != ModBlocks.lightRelay)
return;
@@ -31,6 +31,7 @@ import vazkii.botania.client.core.helper.ShaderHelper;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.tile.mana.TilePool;
import javax.annotation.Nonnull;
import java.awt.*;
import java.util.Random;
@@ -41,7 +42,7 @@ public class RenderTilePool extends TileEntitySpecialRenderer<TilePool> {
public static int forceManaNumber = -1;
@Override
public void renderTileEntityAt(TilePool pool, double d0, double d1, double d2, float f, int digProgress) {
public void renderTileEntityAt(@Nonnull TilePool pool, double d0, double d1, double d2, float f, int digProgress) {
if(pool != null && (!pool.getWorld().isBlockLoaded(pool.getPos(), false)
|| pool.getWorld().getBlockState(pool.getPos()).getBlock() != ModBlocks.pool))
return;
@@ -20,12 +20,14 @@ import vazkii.botania.api.mana.ILens;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.common.block.tile.mana.TilePrism;
import javax.annotation.Nonnull;
//import vazkii.botania.client.render.item.RenderLens;
public class RenderTilePrism extends TileEntitySpecialRenderer<TilePrism> {
@Override
public void renderTileEntityAt(TilePrism prism, double x, double y, double z, float partTicks, int digProgress) {
public void renderTileEntityAt(@Nonnull TilePrism prism, double x, double y, double z, float partTicks, int digProgress) {
GlStateManager.pushMatrix();
GlStateManager.translate(x, y, z);
float pos = (float) Math.sin((ClientTickHandler.ticksInGame + partTicks) * 0.05F) * 0.5F * (1F - 1F / 16F) - 0.5F;
@@ -30,6 +30,7 @@ import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.tile.TilePylon;
import vazkii.botania.common.core.handler.ConfigHandler;
import javax.annotation.Nonnull;
import java.util.Random;
public class RenderTilePylon extends TileEntitySpecialRenderer<TilePylon> {
@@ -48,7 +49,7 @@ public class RenderTilePylon extends TileEntitySpecialRenderer<TilePylon> {
public static boolean pink = false;
@Override
public void renderTileEntityAt(TilePylon pylon, double d0, double d1, double d2, float pticks, int digProgress) {
public void renderTileEntityAt(@Nonnull TilePylon pylon, double d0, double d1, double d2, float pticks, int digProgress) {
if(!pylon.getWorld().isBlockLoaded(pylon.getPos(), false)
|| pylon.getWorld().getBlockState(pylon.getPos()).getBlock() != ModBlocks.pylon)
return;
@@ -21,12 +21,14 @@ import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.model.ModelSpinningCubes;
import vazkii.botania.common.block.tile.TileRuneAltar;
import javax.annotation.Nonnull;
public class RenderTileRuneAltar extends TileEntitySpecialRenderer<TileRuneAltar> {
ModelSpinningCubes cubes = new ModelSpinningCubes();
@Override
public void renderTileEntityAt(TileRuneAltar altar, double x, double y, double z, float partticks, int digProgress) {
public void renderTileEntityAt(@Nonnull TileRuneAltar altar, double x, double y, double z, float partticks, int digProgress) {
GlStateManager.pushMatrix();
GlStateManager.color(1F, 1F, 1F, 1F);
GlStateManager.translate(x, y, z);
@@ -18,10 +18,12 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.ItemStack;
import vazkii.botania.common.block.tile.TileSparkChanger;
import javax.annotation.Nonnull;
public class RenderTileSparkChanger extends TileEntitySpecialRenderer<TileSparkChanger> {
@Override
public void renderTileEntityAt(TileSparkChanger tileentity, double d0, double d1, double d2, float pticks, int digProgress) {
public void renderTileEntityAt(@Nonnull TileSparkChanger tileentity, double d0, double d1, double d2, float pticks, int digProgress) {
GlStateManager.pushMatrix();
GlStateManager.translate(d0, d1, d2);
GlStateManager.rotate(90F, 1F, 0F, 0F);
@@ -29,6 +29,7 @@ import vazkii.botania.client.model.ModelSpreader;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.tile.mana.TileSpreader;
import javax.annotation.Nonnull;
import java.awt.*;
import java.util.Random;
@@ -45,7 +46,7 @@ public class RenderTileSpreader extends TileEntitySpecialRenderer<TileSpreader>
private static final ModelSpreader model = new ModelSpreader();
@Override
public void renderTileEntityAt(TileSpreader spreader, double d0, double d1, double d2, float ticks, int digProgress) {
public void renderTileEntityAt(@Nonnull TileSpreader spreader, double d0, double d1, double d2, float ticks, int digProgress) {
if(!spreader.getWorld().isBlockLoaded(spreader.getPos(), false)
|| spreader.getWorld().getBlockState(spreader.getPos()).getBlock() != ModBlocks.spreader)
return;
@@ -21,6 +21,7 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.util.ResourceLocation;
import vazkii.botania.common.block.tile.TileStarfield;
import javax.annotation.Nonnull;
import java.awt.*;
import java.nio.FloatBuffer;
import java.util.Random;
@@ -33,7 +34,7 @@ public class RenderTileStarfield extends TileEntitySpecialRenderer<TileStarfield
private static final Random field_147527_e = new Random(31100L);
FloatBuffer field_147528_b = GLAllocation.createDirectFloatBuffer(16);
public void renderTileEntityAt(TileStarfield starfield, double x, double y, double z, float partialTicks, int destroyStage)
public void renderTileEntityAt(@Nonnull TileStarfield starfield, double x, double y, double z, float partialTicks, int destroyStage)
{
float f = (float)this.rendererDispatcher.entityX;
float f1 = (float)this.rendererDispatcher.entityY;
@@ -24,10 +24,12 @@ import vazkii.botania.client.core.handler.MiscellaneousIcons;
import vazkii.botania.client.core.helper.ShaderHelper;
import vazkii.botania.common.block.tile.TileTerraPlate;
import javax.annotation.Nonnull;
public class RenderTileTerraPlate extends TileEntitySpecialRenderer<TileTerraPlate> {
@Override
public void renderTileEntityAt(TileTerraPlate plate, double d0, double d1, double d2, float f, int digProgress) {
public void renderTileEntityAt(@Nonnull TileTerraPlate plate, double d0, double d1, double d2, float f, int digProgress) {
float max = TileTerraPlate.MAX_MANA / 10F;
float alphaMod = Math.min(max, plate.getCurrentMana()) / max;
GlStateManager.pushMatrix();
@@ -21,6 +21,7 @@ import vazkii.botania.client.model.ModelTeruTeruBozu;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.tile.TileTeruTeruBozu;
import javax.annotation.Nonnull;
import java.util.Random;
public class RenderTileTeruTeruBozu extends TileEntitySpecialRenderer<TileTeruTeruBozu> {
@@ -30,7 +31,7 @@ public class RenderTileTeruTeruBozu extends TileEntitySpecialRenderer<TileTeruTe
ModelTeruTeruBozu model = new ModelTeruTeruBozu();
@Override
public void renderTileEntityAt(TileTeruTeruBozu tileentity, double d0, double d1, double d2, float f, int digProgress) {
public void renderTileEntityAt(@Nonnull TileTeruTeruBozu tileentity, double d0, double d1, double d2, float f, int digProgress) {
GlStateManager.pushMatrix();
GlStateManager.enableRescaleNormal();
GlStateManager.enableBlend();
@@ -41,6 +41,8 @@ import vazkii.botania.common.block.tile.TileTinyPotato;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.item.equipment.bauble.ItemFlightTiara;
import javax.annotation.Nonnull;
public class RenderTileTinyPotato extends TileEntitySpecialRenderer<TileTinyPotato> {
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_TINY_POTATO);
private static final ResourceLocation textureGrayscale = new ResourceLocation(LibResources.MODEL_TINY_POTATO_GS);
@@ -48,7 +50,7 @@ public class RenderTileTinyPotato extends TileEntitySpecialRenderer<TileTinyPota
private static final ModelTinyPotato model = new ModelTinyPotato();
@Override
public void renderTileEntityAt(TileTinyPotato potato, double x, double y, double z, float partialTicks, int destroyStage) {
public void renderTileEntityAt(@Nonnull TileTinyPotato potato, double x, double y, double z, float partialTicks, int destroyStage) {
if(!potato.getWorld().isBlockLoaded(potato.getPos(), false)
|| potato.getWorld().getBlockState(potato.getPos()).getBlock() != ModBlocks.tinyPotato)
return;
@@ -31,6 +31,8 @@ import vazkii.botania.common.block.tile.TileAlfPortal;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import javax.annotation.Nonnull;
public class BlockAlfPortal extends BlockMod implements IWandable, ILexiconable {
public BlockAlfPortal() {
@@ -40,11 +42,13 @@ public class BlockAlfPortal extends BlockMod implements IWandable, ILexiconable
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.ALFPORTAL_STATE, AlfPortalState.OFF));
}
@Nonnull
@Override
public BlockStateContainer createBlockState() {
return new BlockStateContainer(this, BotaniaStateProps.ALFPORTAL_STATE);
}
@Nonnull
@Override
public IBlockState getStateFromMeta(int meta) {
if (meta > AlfPortalState.values().length) {
@@ -63,8 +67,9 @@ public class BlockAlfPortal extends BlockMod implements IWandable, ILexiconable
return true;
}
@Nonnull
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) {
return new TileAlfPortal();
}
@@ -82,7 +87,7 @@ public class BlockAlfPortal extends BlockMod implements IWandable, ILexiconable
}
@Override
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
public int getLightValue(@Nonnull IBlockState state, IBlockAccess world, @Nonnull BlockPos pos) {
if(world.getBlockState(pos).getBlock() != this)
return world.getBlockState(pos).getLightValue(world, pos);
return state.getValue(BotaniaStateProps.ALFPORTAL_STATE) != AlfPortalState.OFF ? 15 : 0;
@@ -38,6 +38,7 @@ import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import javax.annotation.Nonnull;
import java.util.List;
import java.util.Random;
@@ -51,13 +52,14 @@ public class BlockAltGrass extends BlockMod implements ILexiconable {
setTickRandomly(true);
}
@Nonnull
@Override
public BlockStateContainer createBlockState() {
return new BlockStateContainer(this, BotaniaStateProps.ALTGRASS_VARIANT);
}
@Override
public boolean isToolEffective(String type, IBlockState state) {
public boolean isToolEffective(String type, @Nonnull IBlockState state) {
return type.equals("shovel");
}
@@ -66,6 +68,7 @@ public class BlockAltGrass extends BlockMod implements ILexiconable {
return state.getValue(BotaniaStateProps.ALTGRASS_VARIANT).ordinal();
}
@Nonnull
@Override
public IBlockState getStateFromMeta(int meta) {
return getDefaultState().withProperty(BotaniaStateProps.ALTGRASS_VARIANT, AltGrassVariant.values()[meta]);
@@ -77,7 +80,7 @@ public class BlockAltGrass extends BlockMod implements ILexiconable {
}
@Override
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> list) {
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> list) {
for(int i = 0; i < 6; i++)
list.add(new ItemStack(item, 1, i));
}
@@ -102,13 +105,14 @@ public class BlockAltGrass extends BlockMod implements ILexiconable {
return Blocks.DIRT.getItemDropped(state, p_149650_2_, p_149650_3_);
}
@Nonnull
@Override
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player) {
return new ItemStack(this, 1, getMetaFromState(world.getBlockState(pos)));
}
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable) {
public boolean canSustainPlant(@Nonnull IBlockState state, @Nonnull IBlockAccess world, BlockPos pos, @Nonnull EnumFacing direction, IPlantable plantable) {
EnumPlantType type = plantable.getPlantType(world, pos.down());
return type == EnumPlantType.Plains || type == EnumPlantType.Beach;
}
@@ -50,6 +50,7 @@ import vazkii.botania.common.item.rod.ItemWaterRod;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import javax.annotation.Nonnull;
import java.util.List;
import java.util.Random;
@@ -68,11 +69,13 @@ public class BlockAltar extends BlockMod implements ILexiconable {
);
}
@Nonnull
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
return AABB;
}
@Nonnull
@Override
public BlockStateContainer createBlockState() {
return new BlockStateContainer(this, BotaniaStateProps.ALTAR_VARIANT);
@@ -83,6 +86,7 @@ public class BlockAltar extends BlockMod implements ILexiconable {
return state.getValue(BotaniaStateProps.ALTAR_VARIANT).ordinal();
}
@Nonnull
@Override
public IBlockState getStateFromMeta(int meta) {
if (meta < 0 || meta >= AltarVariant.values().length ) {
@@ -91,8 +95,9 @@ public class BlockAltar extends BlockMod implements ILexiconable {
return getDefaultState().withProperty(BotaniaStateProps.ALTAR_VARIANT, AltarVariant.values()[meta]);
}
@Nonnull
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
public IBlockState getActualState(@Nonnull IBlockState state, IBlockAccess worldIn, BlockPos pos) {
TileEntity te = worldIn.getTileEntity(pos);
if (te instanceof TileAltar) {
TileAltar altar = ((TileAltar) te);
@@ -104,6 +109,7 @@ public class BlockAltar extends BlockMod implements ILexiconable {
return state;
}
@Nonnull
@Override
public BlockRenderLayer getBlockLayer() {
return BlockRenderLayer.CUTOUT;
@@ -115,7 +121,7 @@ public class BlockAltar extends BlockMod implements ILexiconable {
}
@Override
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> list) {
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> list) {
for(int i = 0; i < 9; i++)
list.add(new ItemStack(item, 1, i));
}
@@ -130,7 +136,7 @@ public class BlockAltar extends BlockMod implements ILexiconable {
}
@Override
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
public int getLightValue(@Nonnull IBlockState state, IBlockAccess world, @Nonnull BlockPos pos) {
if(world.getBlockState(pos).getBlock() != this)
return world.getBlockState(pos).getLightValue(world, pos);
TileAltar tile = (TileAltar) world.getTileEntity(pos);
@@ -260,13 +266,14 @@ public class BlockAltar extends BlockMod implements ILexiconable {
return true;
}
@Nonnull
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) {
return new TileAltar();
}
@Override
public void breakBlock(World par1World, BlockPos pos, IBlockState state) {
public void breakBlock(@Nonnull World par1World, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(pos);
if (inv != null) {
@@ -36,6 +36,7 @@ import vazkii.botania.common.block.tile.TileSimpleInventory;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import javax.annotation.Nonnull;
import java.util.Random;
public class BlockAvatar extends BlockMod implements ILexiconable {
@@ -52,6 +53,7 @@ public class BlockAvatar extends BlockMod implements ILexiconable {
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.NORTH));
}
@Nonnull
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
if(state.getValue(BotaniaStateProps.CARDINALS).getAxis() == EnumFacing.Axis.X)
@@ -59,6 +61,7 @@ public class BlockAvatar extends BlockMod implements ILexiconable {
else return Z_AABB;
}
@Nonnull
@Override
public BlockStateContainer createBlockState() {
return new BlockStateContainer(this, BotaniaStateProps.CARDINALS);
@@ -69,6 +72,7 @@ public class BlockAvatar extends BlockMod implements ILexiconable {
return state.getValue(BotaniaStateProps.CARDINALS).getIndex();
}
@Nonnull
@Override
public IBlockState getStateFromMeta(int meta) {
if (meta < 2 || meta > 5) {
@@ -98,7 +102,7 @@ public class BlockAvatar extends BlockMod implements ILexiconable {
}
@Override
public void breakBlock(World par1World, BlockPos pos, IBlockState state) {
public void breakBlock(@Nonnull World par1World, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(pos);
if (inv != null) {
@@ -150,6 +154,7 @@ public class BlockAvatar extends BlockMod implements ILexiconable {
return false;
}
@Nonnull
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
@@ -160,8 +165,9 @@ public class BlockAvatar extends BlockMod implements ILexiconable {
return true;
}
@Nonnull
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) {
return new TileAvatar();
}
@@ -31,6 +31,7 @@ import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import javax.annotation.Nonnull;
import java.util.Random;
public class BlockBifrost extends BlockMod implements ILexiconable {
@@ -54,24 +55,26 @@ public class BlockBifrost extends BlockMod implements ILexiconable {
return false;
}
@Nonnull
@Override
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player) {
return new ItemStack(ModItems.rainbowRod);
}
@Override
public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
public boolean shouldSideBeRendered(IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, EnumFacing side) {
Block block = world.getBlockState(pos.offset(side)).getBlock();
return block != this && super.shouldSideBeRendered(state, world, pos, side);
}
@Nonnull
@Override
public BlockRenderLayer getBlockLayer() {
return BlockRenderLayer.TRANSLUCENT;
}
@Override
public int quantityDropped(IBlockState state, int fortune, Random random) {
public int quantityDropped(IBlockState state, int fortune, @Nonnull Random random) {
return 0;
}
@@ -80,8 +83,9 @@ public class BlockBifrost extends BlockMod implements ILexiconable {
return true;
}
@Nonnull
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) {
return new TileBifrost();
}
@@ -26,6 +26,7 @@ import vazkii.botania.common.Botania;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import javax.annotation.Nonnull;
import java.util.Random;
public class BlockBifrostPerm extends BlockMod implements ILexiconable {
@@ -45,7 +46,7 @@ public class BlockBifrostPerm extends BlockMod implements ILexiconable {
}
@Override
public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
public boolean shouldSideBeRendered(IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, EnumFacing side) {
if (world.getBlockState(pos.offset(side)).getBlock() == this) {
return false;
}
@@ -58,6 +59,7 @@ public class BlockBifrostPerm extends BlockMod implements ILexiconable {
Botania.proxy.sparkleFX(world, pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 0.45F + 0.2F * (float) Math.random(), 6);
}
@Nonnull
@Override
public BlockRenderLayer getBlockLayer() {
return BlockRenderLayer.TRANSLUCENT;
@@ -25,6 +25,7 @@ import vazkii.botania.api.state.BotaniaStateProps;
import vazkii.botania.common.block.tile.TileCacophonium;
import vazkii.botania.common.lib.LibBlockNames;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
@@ -36,6 +37,7 @@ public class BlockCacophonium extends BlockMod {
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.POWERED, false));
}
@Nonnull
@Override
public BlockStateContainer createBlockState() {
return new BlockStateContainer(this, BotaniaStateProps.POWERED);
@@ -46,13 +48,14 @@ public class BlockCacophonium extends BlockMod {
return state.getValue(BotaniaStateProps.POWERED) ? 8 : 0;
}
@Nonnull
@Override
public IBlockState getStateFromMeta(int meta) {
return getDefaultState().withProperty(BotaniaStateProps.POWERED, meta == 8);
}
@Override
public boolean canSilkHarvest(World world, BlockPos pos, IBlockState state, EntityPlayer player) {
public boolean canSilkHarvest(World world, BlockPos pos, @Nonnull IBlockState state, EntityPlayer player) {
return false;
}
@@ -76,7 +79,7 @@ public class BlockCacophonium extends BlockMod {
}
@Override
public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest) {
public boolean removedByPlayer(@Nonnull IBlockState state, World world, @Nonnull BlockPos pos, @Nonnull EntityPlayer player, boolean willHarvest) {
if (willHarvest) {
// Copy of super.removedByPlayer but don't set to air yet
// This is so getDrops below will have a TE to work with
@@ -88,14 +91,15 @@ public class BlockCacophonium extends BlockMod {
}
@Override
public void harvestBlock(World world, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te, ItemStack stack) {
public void harvestBlock(@Nonnull World world, EntityPlayer player, @Nonnull BlockPos pos, @Nonnull IBlockState state, TileEntity te, ItemStack stack) {
super.harvestBlock(world, player, pos, state, te, stack);
// Now delete the block and TE
world.setBlockToAir(pos);
}
@Nonnull
@Override
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, @Nonnull IBlockState state, int fortune) {
ArrayList<ItemStack> stacks = new ArrayList<>();
TileEntity tile = world.getTileEntity(pos);
@@ -114,8 +118,9 @@ public class BlockCacophonium extends BlockMod {
return true;
}
@Nonnull
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) {
return new TileCacophonium();
}
@@ -25,6 +25,7 @@ import vazkii.botania.common.block.tile.TileCell;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
@@ -35,8 +36,9 @@ public class BlockCell extends BlockMod implements ILexiconable {
setSoundType(SoundType.CLOTH);
}
@Nonnull
@Override
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, @Nonnull IBlockState state, int fortune) {
return new ArrayList<>();
}
@@ -45,8 +47,9 @@ public class BlockCell extends BlockMod implements ILexiconable {
return true;
}
@Nonnull
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) {
return new TileCell();
}
@@ -30,6 +30,7 @@ import vazkii.botania.common.block.tile.TileCocoon;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
@@ -44,6 +45,7 @@ public class BlockCocoon extends BlockMod implements ILexiconable {
setSoundType(SoundType.CLOTH);
}
@Nonnull
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
return AABB;
@@ -59,6 +61,7 @@ public class BlockCocoon extends BlockMod implements ILexiconable {
return false;
}
@Nonnull
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
@@ -76,13 +79,14 @@ public class BlockCocoon extends BlockMod implements ILexiconable {
return false;
}
@Nonnull
@Override
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, @Nonnull IBlockState state, int fortune) {
return new ArrayList<>();
}
@Override
public boolean canSilkHarvest(World world, BlockPos pos, IBlockState state, EntityPlayer player) {
public boolean canSilkHarvest(World world, BlockPos pos, @Nonnull IBlockState state, EntityPlayer player) {
return false;
}
@@ -91,8 +95,9 @@ public class BlockCocoon extends BlockMod implements ILexiconable {
return true;
}
@Nonnull
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) {
return new TileCocoon();
}
@@ -28,6 +28,7 @@ import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import javax.annotation.Nonnull;
import java.util.Random;
public class BlockEnchantedSoil extends BlockMod implements ILexiconable {
@@ -49,12 +50,12 @@ public class BlockEnchantedSoil extends BlockMod implements ILexiconable {
}
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable) {
public boolean canSustainPlant(@Nonnull IBlockState state, @Nonnull IBlockAccess world, BlockPos pos, @Nonnull EnumFacing direction, IPlantable plantable) {
return plantable.getPlantType(world, pos.down()) == EnumPlantType.Plains;
}
@Override
public boolean canSilkHarvest(World world, BlockPos pos, IBlockState state, EntityPlayer player) {
public boolean canSilkHarvest(World world, BlockPos pos, @Nonnull IBlockState state, EntityPlayer player) {
return false;
}
@@ -28,6 +28,8 @@ import vazkii.botania.common.block.tile.TileEnderEye;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import javax.annotation.Nonnull;
public class BlockEnderEye extends BlockMod implements ILexiconable {
protected BlockEnderEye() {
@@ -38,11 +40,13 @@ public class BlockEnderEye extends BlockMod implements ILexiconable {
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.POWERED, false));
}
@Nonnull
@Override
public BlockStateContainer createBlockState() {
return new BlockStateContainer(this, BotaniaStateProps.POWERED);
}
@Nonnull
@Override
public IBlockState getStateFromMeta(int meta) {
return getDefaultState().withProperty(BotaniaStateProps.POWERED, meta == 15);
@@ -68,8 +72,9 @@ public class BlockEnderEye extends BlockMod implements ILexiconable {
return true;
}
@Nonnull
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) {
return new TileEnderEye();
}
@@ -27,6 +27,7 @@ import net.minecraft.world.World;
import vazkii.botania.common.block.tile.TileFakeAir;
import vazkii.botania.common.lib.LibBlockNames;
import javax.annotation.Nonnull;
import java.util.List;
import java.util.Random;
@@ -39,11 +40,13 @@ public class BlockFakeAir extends BlockMod {
setTickRandomly(true);
}
@Nonnull
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
return AABB;
}
@Nonnull
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
return EnumBlockRenderType.INVISIBLE;
@@ -108,13 +111,14 @@ public class BlockFakeAir extends BlockMod {
return false;
}
@Nonnull
@Override
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, @Nonnull IBlockState state, int fortune) {
return ImmutableList.of();
}
@Override
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, World par1World, BlockPos pos) {
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, @Nonnull World par1World, @Nonnull BlockPos pos) {
return null;
}
@@ -128,8 +132,9 @@ public class BlockFakeAir extends BlockMod {
return true;
}
@Nonnull
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) {
return new TileFakeAir();
}
@@ -33,6 +33,8 @@ import vazkii.botania.api.state.BotaniaStateProps;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import javax.annotation.Nonnull;
public class BlockFelPumpkin extends BlockMod implements ILexiconable {
private static final String TAG_FEL_SPAWNED = "Botania-FelSpawned";
@@ -45,6 +47,7 @@ public class BlockFelPumpkin extends BlockMod implements ILexiconable {
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.SOUTH));
}
@Nonnull
@Override
public BlockStateContainer createBlockState() {
return new BlockStateContainer(this, BotaniaStateProps.CARDINALS);
@@ -55,6 +58,7 @@ public class BlockFelPumpkin extends BlockMod implements ILexiconable {
return state.getValue(BotaniaStateProps.CARDINALS).getHorizontalIndex();
}
@Nonnull
@Override
public IBlockState getStateFromMeta(int meta) {
return getDefaultState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.getHorizontal(meta));
@@ -51,6 +51,7 @@ import vazkii.botania.common.item.block.ItemBlockFloatingSpecialFlower;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
import vazkii.botania.common.lib.LibBlockNames;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
@@ -68,13 +69,15 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
.withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE));
}
@Nonnull
@Override
public BlockStateContainer createBlockState() {
return new ExtendedBlockState(this, new IProperty[] { BotaniaStateProps.COLOR }, new IUnlistedProperty[] { BotaniaStateProps.SUBTILE_ID, BotaniaStateProps.ISLAND_TYPE });
}
@Nonnull
@Override
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) {
public IBlockState getExtendedState(@Nonnull IBlockState state, IBlockAccess world, BlockPos pos) {
state = super.getExtendedState(state, world, pos);
TileEntity te = world.getTileEntity(pos);
if (te instanceof TileFloatingSpecialFlower) {
@@ -84,7 +87,7 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
}
@Override
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
public int getLightValue(@Nonnull IBlockState state, IBlockAccess world, @Nonnull BlockPos pos) {
if(world.getBlockState(pos).getBlock() != this)
return world.getBlockState(pos).getLightValue(world, pos);
@@ -126,7 +129,7 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
}
@Override
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
public void getSubBlocks(@Nonnull Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
for(String s : BotaniaAPI.subtilesForCreativeMenu) {
par3List.add(ItemBlockSpecialFlower.ofType(new ItemStack(par1), s));
if(BotaniaAPI.miniFlowers.containsKey(s))
@@ -134,8 +137,9 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
}
}
@Nonnull
@Override
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player) {
String name = ((TileSpecialFlower) world.getTileEntity(pos)).subTileName;
return ItemBlockSpecialFlower.ofType(new ItemStack(state.getBlock()), name);
}
@@ -146,7 +150,7 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
}
@Override
public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest) {
public boolean removedByPlayer(@Nonnull IBlockState state, World world, @Nonnull BlockPos pos, @Nonnull EntityPlayer player, boolean willHarvest) {
if (willHarvest) {
// Copy of super.removedByPlayer but don't set to air yet
// This is so getDrops below will have a TE to work with
@@ -158,14 +162,15 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
}
@Override
public void harvestBlock(World world, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te, ItemStack stack) {
public void harvestBlock(@Nonnull World world, EntityPlayer player, @Nonnull BlockPos pos, @Nonnull IBlockState state, TileEntity te, ItemStack stack) {
super.harvestBlock(world, player, pos, state, te, stack);
// Now delete the block and TE
world.setBlockToAir(pos);
}
@Nonnull
@Override
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, @Nonnull IBlockState state, int fortune) {
ArrayList<ItemStack> list = new ArrayList<>();
TileEntity tile = world.getTileEntity(pos);
@@ -215,8 +220,9 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
GameRegistry.register(new ItemBlockFloatingSpecialFlower(this), getRegistryName());
}
@Nonnull
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) {
return new TileFloatingSpecialFlower();
}
@@ -26,6 +26,8 @@ import vazkii.botania.common.block.tile.TileForestEye;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import javax.annotation.Nonnull;
public class BlockForestEye extends BlockMod implements ILexiconable {
private static final AxisAlignedBB AABB = new AxisAlignedBB(0.25, 0.25, 0.25, 0.75, 0.75, 0.75);
@@ -37,6 +39,7 @@ public class BlockForestEye extends BlockMod implements ILexiconable {
setSoundType(SoundType.METAL);
}
@Nonnull
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
return AABB;
@@ -68,8 +71,9 @@ public class BlockForestEye extends BlockMod implements ILexiconable {
return true;
}
@Nonnull
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) {
return new TileForestEye();
}
@@ -28,6 +28,7 @@ import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.lib.LibBlockNames;
import vazkii.botania.common.lib.LibMisc;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
@@ -40,13 +41,15 @@ public class BlockGaiaHead extends BlockSkull {
setHardness(1.0F);
}
@Nonnull
@Override
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player) {
return new ItemStack(ModItems.gaiaHead);
}
@Override
public List<ItemStack> getDrops(IBlockAccess p_149749_1_, BlockPos pos, IBlockState state, int fortune) {
@Nonnull
@Override
public List<ItemStack> getDrops(@Nonnull IBlockAccess p_149749_1_, @Nonnull BlockPos pos, IBlockState state, int fortune) {
ArrayList<ItemStack> ret = new ArrayList<>();
if(!state.getValue(NODROP)) {
@@ -71,6 +74,7 @@ public class BlockGaiaHead extends BlockSkull {
return 0;
}
@Nonnull
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
return new TileGaiaHead();
@@ -34,6 +34,8 @@ import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import vazkii.botania.common.lib.LibMisc;
import javax.annotation.Nonnull;
public class BlockGhostRail extends BlockRailBase implements ILexiconable {
private static final String TAG_FLOAT_TICKS = "Botania_FloatTicks";
@@ -48,6 +50,7 @@ public class BlockGhostRail extends BlockRailBase implements ILexiconable {
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.RAIL_DIRECTION, EnumRailDirection.NORTH_SOUTH));
}
@Nonnull
@Override
public BlockStateContainer createBlockState() {
return new BlockStateContainer(this, BotaniaStateProps.RAIL_DIRECTION);
@@ -58,6 +61,7 @@ public class BlockGhostRail extends BlockRailBase implements ILexiconable {
return state.getValue(BotaniaStateProps.RAIL_DIRECTION).getMetadata();
}
@Nonnull
@Override
public IBlockState getStateFromMeta(int meta) {
return getDefaultState().withProperty(BotaniaStateProps.RAIL_DIRECTION, EnumRailDirection.byMetadata(meta));
@@ -99,6 +103,7 @@ public class BlockGhostRail extends BlockRailBase implements ILexiconable {
return LexiconData.ghostRail;
}
@Nonnull
@Override
public IProperty<EnumRailDirection> getShapeProperty() {
return BlockRailPowered.SHAPE;
@@ -43,6 +43,7 @@ import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import javax.annotation.Nonnull;
import java.util.Random;
public class BlockHourglass extends BlockMod implements IManaTrigger, IWandable, IWandHUD, ILexiconable {
@@ -58,11 +59,13 @@ public class BlockHourglass extends BlockMod implements IManaTrigger, IWandable,
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.POWERED, false));
}
@Nonnull
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
return AABB;
}
@Nonnull
@Override
public BlockStateContainer createBlockState() {
return new BlockStateContainer(this, BotaniaStateProps.POWERED);
@@ -73,6 +76,7 @@ public class BlockHourglass extends BlockMod implements IManaTrigger, IWandable,
return state.getValue(BotaniaStateProps.POWERED) ? 1 : 0;
}
@Nonnull
@Override
public IBlockState getStateFromMeta(int meta) {
return getDefaultState().withProperty(BotaniaStateProps.POWERED, meta == 1);
@@ -130,7 +134,7 @@ public class BlockHourglass extends BlockMod implements IManaTrigger, IWandable,
}
@Override
public void breakBlock(World par1World, BlockPos pos, IBlockState state) {
public void breakBlock(@Nonnull World par1World, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(pos);
if (inv != null) {
@@ -177,6 +181,7 @@ public class BlockHourglass extends BlockMod implements IManaTrigger, IWandable,
return false;
}
@Nonnull
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
@@ -187,8 +192,9 @@ public class BlockHourglass extends BlockMod implements IManaTrigger, IWandable,
return true;
}
@Nonnull
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) {
return new TileHourglass();
}
@@ -33,6 +33,8 @@ import vazkii.botania.common.block.tile.TileIncensePlate;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import javax.annotation.Nonnull;
public class BlockIncensePlate extends BlockMod implements ILexiconable {
private static final AxisAlignedBB X_AABB = new AxisAlignedBB(0.375, 0, 0.125, 0.625, 1/16.0, 0.875);
@@ -45,6 +47,7 @@ public class BlockIncensePlate extends BlockMod implements ILexiconable {
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.SOUTH));
}
@Nonnull
@Override
public BlockStateContainer createBlockState() {
return new BlockStateContainer(this, BotaniaStateProps.CARDINALS);
@@ -55,6 +58,7 @@ public class BlockIncensePlate extends BlockMod implements ILexiconable {
return state.getValue(BotaniaStateProps.CARDINALS).getIndex();
}
@Nonnull
@Override
public IBlockState getStateFromMeta(int meta) {
if (meta < 2 || meta > 5) {
@@ -112,6 +116,7 @@ public class BlockIncensePlate extends BlockMod implements ILexiconable {
return ((TileIncensePlate) world.getTileEntity(pos)).comparatorOutput;
}
@Nonnull
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
if(state.getValue(BotaniaStateProps.CARDINALS).getAxis() == EnumFacing.Axis.X) {
@@ -136,8 +141,9 @@ public class BlockIncensePlate extends BlockMod implements ILexiconable {
return true;
}
@Nonnull
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) {
return new TileIncensePlate();
}
@@ -33,6 +33,7 @@ import vazkii.botania.common.block.tile.TileLightRelay;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
@@ -47,11 +48,13 @@ public class BlockLightLauncher extends BlockMod implements ILexiconable {
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.POWERED, false));
}
@Nonnull
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
return AABB;
}
@Nonnull
@Override
public BlockStateContainer createBlockState() {
return new BlockStateContainer(this, BotaniaStateProps.POWERED);
@@ -62,6 +65,7 @@ public class BlockLightLauncher extends BlockMod implements ILexiconable {
return state.getValue(BotaniaStateProps.POWERED) ? 8 : 0;
}
@Nonnull
@Override
public IBlockState getStateFromMeta(int meta) {
return getDefaultState().withProperty(BotaniaStateProps.POWERED, meta == 8);
@@ -36,6 +36,7 @@ import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import javax.annotation.Nonnull;
import java.util.List;
import java.util.Random;
@@ -48,11 +49,13 @@ public class BlockLightRelay extends BlockMod implements IWandable, ILexiconable
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.LUMINIZER_VARIANT, LuminizerVariant.DEFAULT).withProperty(BotaniaStateProps.POWERED, false));
}
@Nonnull
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
return AABB;
}
@Nonnull
@Override
public BlockStateContainer createBlockState() {
return new BlockStateContainer(this, BotaniaStateProps.LUMINIZER_VARIANT, BotaniaStateProps.POWERED);
@@ -69,6 +72,7 @@ public class BlockLightRelay extends BlockMod implements IWandable, ILexiconable
return meta;
}
@Nonnull
@Override
public IBlockState getStateFromMeta(int meta) {
boolean powered = (meta & 8) != 0;
@@ -82,7 +86,7 @@ public class BlockLightRelay extends BlockMod implements IWandable, ILexiconable
}
@Override
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> list) {
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> list) {
for(int i = 0; i < 2; i++)
list.add(new ItemStack(item, 1, i));
}
@@ -104,7 +108,7 @@ public class BlockLightRelay extends BlockMod implements IWandable, ILexiconable
}
@Override
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, World p_149668_1_, BlockPos pos) {
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, @Nonnull World p_149668_1_, @Nonnull BlockPos pos) {
return null;
}
@@ -139,6 +143,7 @@ public class BlockLightRelay extends BlockMod implements IWandable, ILexiconable
return false;
}
@Nonnull
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
@@ -149,8 +154,9 @@ public class BlockLightRelay extends BlockMod implements IWandable, ILexiconable
return true;
}
@Nonnull
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) {
return new TileLightRelay();
}
@@ -30,6 +30,7 @@ import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import javax.annotation.Nonnull;
import java.util.List;
public class BlockLivingrock extends BlockMod implements ILexiconable {
@@ -42,6 +43,7 @@ public class BlockLivingrock extends BlockMod implements ILexiconable {
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.LIVINGROCK_VARIANT, LivingRockVariant.DEFAULT));
}
@Nonnull
@Override
public BlockStateContainer createBlockState() {
return new BlockStateContainer(this, BotaniaStateProps.LIVINGROCK_VARIANT);
@@ -52,6 +54,7 @@ public class BlockLivingrock extends BlockMod implements ILexiconable {
return state.getValue(BotaniaStateProps.LIVINGROCK_VARIANT).ordinal();
}
@Nonnull
@Override
public IBlockState getStateFromMeta(int meta) {
if (meta >= LivingRockVariant.values().length) {
@@ -71,13 +74,14 @@ public class BlockLivingrock extends BlockMod implements ILexiconable {
}
@Override
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
public void getSubBlocks(@Nonnull Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
for(int i = 0; i < LivingRockVariant.values().length; i++)
par3List.add(new ItemStack(par1, 1, i));
}
@Nonnull
@Override
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player) {
return new ItemStack(this, 1, getMetaFromState(state));
}
@@ -31,6 +31,7 @@ import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import javax.annotation.Nonnull;
import java.util.List;
public class BlockLivingwood extends BlockMod implements ILexiconable {
@@ -46,6 +47,7 @@ public class BlockLivingwood extends BlockMod implements ILexiconable {
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.DEFAULT));
}
@Nonnull
@Override
public BlockStateContainer createBlockState() {
return new BlockStateContainer(this, BotaniaStateProps.LIVINGWOOD_VARIANT);
@@ -56,6 +58,7 @@ public class BlockLivingwood extends BlockMod implements ILexiconable {
return state.getValue(BotaniaStateProps.LIVINGWOOD_VARIANT).ordinal();
}
@Nonnull
@Override
public IBlockState getStateFromMeta(int meta) {
if (meta >= LivingWoodVariant.values().length) {
@@ -75,18 +78,19 @@ public class BlockLivingwood extends BlockMod implements ILexiconable {
}
@Override
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
public void getSubBlocks(@Nonnull Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
for(int i = 0; i < LivingWoodVariant.values().length; i++)
par3List.add(new ItemStack(par1, 1, i));
}
@Nonnull
@Override
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player) {
return new ItemStack(this, 1, getMetaFromState(state));
}
@Override
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
public int getLightValue(@Nonnull IBlockState state, IBlockAccess world, @Nonnull BlockPos pos) {
if(world.getBlockState(pos).getBlock() != this)
return world.getBlockState(pos).getLightValue(world, pos);
return state.getValue(BotaniaStateProps.LIVINGWOOD_VARIANT) == LivingWoodVariant.GLIMMERING ? 12 : 0;
@@ -20,6 +20,8 @@ import vazkii.botania.common.item.block.ItemBlockElven;
import vazkii.botania.common.item.block.ItemBlockMod;
import vazkii.botania.common.lib.LibMisc;
import javax.annotation.Nonnull;
public class BlockMod extends Block {
protected int originalLight;
@@ -37,6 +39,7 @@ public class BlockMod extends Block {
GameRegistry.register(this instanceof IElvenItem ? new ItemBlockElven(this) : new ItemBlockMod(this), getRegistryName());
}
@Nonnull
@Override
public Block setLightLevel(float p_149715_1_) {
originalLight = (int) (p_149715_1_ * 15);
@@ -44,6 +44,7 @@ import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import vazkii.botania.common.lib.LibMisc;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
@@ -66,17 +67,19 @@ public abstract class BlockModDoubleFlower extends BlockDoublePlant implements I
setCreativeTab(BotaniaCreativeTab.INSTANCE);
}
@Nonnull
@Override
public abstract BlockStateContainer createBlockState();
@Override
public abstract int getMetaFromState(IBlockState state);
@Nonnull
@Override
public abstract IBlockState getStateFromMeta(int meta);
@Override
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
public Item getItemDropped(IBlockState state, @Nonnull Random rand, int fortune) {
return null;
}
@@ -86,12 +89,12 @@ public abstract class BlockModDoubleFlower extends BlockDoublePlant implements I
}
@Override
public boolean canGrow(World world, BlockPos pos, IBlockState state, boolean fuckifiknow) {
public boolean canGrow(@Nonnull World world, @Nonnull BlockPos pos, IBlockState state, boolean fuckifiknow) {
return false;
}
@Override
public boolean canHarvestBlock(IBlockAccess world, BlockPos pos, EntityPlayer player) {
public boolean canHarvestBlock(IBlockAccess world, @Nonnull BlockPos pos, @Nonnull EntityPlayer player) {
return false;
}
@@ -101,7 +104,7 @@ public abstract class BlockModDoubleFlower extends BlockDoublePlant implements I
}
@Override
public void onBlockHarvested(World world, BlockPos pos, IBlockState state, EntityPlayer player) {
public void onBlockHarvested(World world, BlockPos pos, IBlockState state, @Nonnull EntityPlayer player) {
if(state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) {
if(world.getBlockState(pos.down()).getBlock() == this) {
if (!player.capabilities.isCreativeMode) {
@@ -131,12 +134,13 @@ public abstract class BlockModDoubleFlower extends BlockDoublePlant implements I
}
@Override
public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos) {
public boolean isShearable(ItemStack item, IBlockAccess world, @Nonnull BlockPos pos) {
return true;
}
@Nonnull
@Override
public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune) {
public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, @Nonnull BlockPos pos, int fortune) {
ArrayList<ItemStack> ret = new ArrayList<>();
IBlockState state = world.getBlockState(pos);
IBlockState stateBelow = world.getBlockState(pos.down());
@@ -152,17 +156,19 @@ public abstract class BlockModDoubleFlower extends BlockDoublePlant implements I
return ret;
}
@Nonnull
@Override
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, @Nonnull IBlockState state, int fortune) {
return ImmutableList.of();
}
@Override
public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List<ItemStack> p_149666_3_) {
public void getSubBlocks(@Nonnull Item p_149666_1_, CreativeTabs p_149666_2_, @Nonnull List<ItemStack> p_149666_3_) {
for(int i = 0; i < COUNT; ++i)
p_149666_3_.add(new ItemStack(p_149666_1_, 1, i));
}
@Nonnull
@Override
@SideOnly(Side.CLIENT)
public Block.EnumOffsetType getOffsetType()
@@ -189,8 +195,9 @@ public abstract class BlockModDoubleFlower extends BlockDoublePlant implements I
return LexiconData.flowers;
}
@Nonnull
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
public IBlockState getActualState(IBlockState state, @Nonnull IBlockAccess worldIn, @Nonnull BlockPos pos) {
if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) {
IBlockState iblockstate = worldIn.getBlockState(pos.down());
@@ -203,8 +210,9 @@ public abstract class BlockModDoubleFlower extends BlockDoublePlant implements I
return state.withProperty(VARIANT, EnumPlantType.SUNFLOWER).withProperty(FACING, EnumFacing.SOUTH);
}
@Nonnull
@Override
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player) {
state = state.getBlock().getActualState(state, world, pos);
PropertyEnum<EnumDyeColor> prop = second ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1;
return new ItemStack(Item.getItemFromBlock(state.getBlock()), 1, state.getValue(prop).ordinal() - (second ? 8 : 0));
@@ -7,6 +7,8 @@ import net.minecraft.item.EnumDyeColor;
import net.minecraft.util.EnumFacing;
import vazkii.botania.api.state.BotaniaStateProps;
import javax.annotation.Nonnull;
// White to Gray
public class BlockModDoubleFlower1 extends BlockModDoubleFlower {
public BlockModDoubleFlower1() {
@@ -18,6 +20,7 @@ public class BlockModDoubleFlower1 extends BlockModDoubleFlower {
.withProperty(BotaniaStateProps.DOUBLEFLOWER_VARIANT_1, EnumDyeColor.WHITE));
}
@Nonnull
@Override
public BlockStateContainer createBlockState() {
return new BlockStateContainer(this, FACING, VARIANT, HALF, BotaniaStateProps.DOUBLEFLOWER_VARIANT_1);
@@ -32,6 +35,7 @@ public class BlockModDoubleFlower1 extends BlockModDoubleFlower {
return meta;
}
@Nonnull
@Override
public IBlockState getStateFromMeta(int meta) {
BlockDoublePlant.EnumBlockHalf half = (meta & 8) > 0 ? BlockDoublePlant.EnumBlockHalf.UPPER : BlockDoublePlant.EnumBlockHalf.LOWER;
@@ -7,6 +7,8 @@ import net.minecraft.item.EnumDyeColor;
import net.minecraft.util.EnumFacing;
import vazkii.botania.api.state.BotaniaStateProps;
import javax.annotation.Nonnull;
// Silver to black
public class BlockModDoubleFlower2 extends BlockModDoubleFlower {
@@ -19,6 +21,7 @@ public class BlockModDoubleFlower2 extends BlockModDoubleFlower {
.withProperty(BotaniaStateProps.DOUBLEFLOWER_VARIANT_2, EnumDyeColor.SILVER));
}
@Nonnull
@Override
public BlockStateContainer createBlockState() {
return new BlockStateContainer(this, FACING, VARIANT, HALF, BotaniaStateProps.DOUBLEFLOWER_VARIANT_2);
@@ -33,6 +36,7 @@ public class BlockModDoubleFlower2 extends BlockModDoubleFlower {
return meta;
}
@Nonnull
@Override
public IBlockState getStateFromMeta(int meta) {
BlockDoublePlant.EnumBlockHalf half = (meta & 8) > 0 ? BlockDoublePlant.EnumBlockHalf.UPPER : BlockDoublePlant.EnumBlockHalf.LOWER;
Loaded 100 of 344 files, more files were not shown because too many files have changed in this diff. Show more