mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-13 16:54:06 +00:00
Cleanup
This commit is contained in:
1 parent
50099866db
commit
3ad1c46da5
10 files changed
+96
-34
No files matched your search
@@ -15,6 +15,7 @@ import java.net.URI;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -49,6 +50,7 @@ import vazkii.botania.client.gui.lexicon.button.GuiButtonBookmark;
|
||||
import vazkii.botania.client.gui.lexicon.button.GuiButtonCategory;
|
||||
import vazkii.botania.client.gui.lexicon.button.GuiButtonChallengeInfo;
|
||||
import vazkii.botania.client.gui.lexicon.button.GuiButtonChallenges;
|
||||
import vazkii.botania.client.gui.lexicon.button.GuiButtonDoot;
|
||||
import vazkii.botania.client.gui.lexicon.button.GuiButtonHistory;
|
||||
import vazkii.botania.client.gui.lexicon.button.GuiButtonInvisible;
|
||||
import vazkii.botania.client.gui.lexicon.button.GuiButtonNotes;
|
||||
@@ -168,7 +170,11 @@ public class GuiLexicon extends GuiScreen {
|
||||
button.enabled = false;
|
||||
button.visible = false;
|
||||
}
|
||||
|
||||
if(Calendar.getInstance().get(Calendar.MONTH) == Calendar.NOVEMBER && Calendar.getInstance().get(Calendar.DATE) == 22)
|
||||
buttonList.add(new GuiButtonDoot(-99, left + 110, top + 12));
|
||||
}
|
||||
|
||||
buttonList.add(new GuiButtonNotes(this, NOTES_BUTTON_ID, left - 4, top - 4));
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* 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 @ [Oct 11, 2015, 7:04:46 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.client.gui.lexicon.button;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
|
||||
// Ssssshhhhhhh
|
||||
// I should've done this last year
|
||||
public class GuiButtonDoot extends GuiButtonLexicon {
|
||||
|
||||
public GuiButtonDoot(int id, int x, int y) {
|
||||
super(id, x, y, 16, 16, "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
|
||||
field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
|
||||
int k = getHoverState(field_146123_n);
|
||||
|
||||
par1Minecraft.renderEngine.bindTexture(TextureMap.locationItemsTexture);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
RenderItem.getInstance().renderItemIntoGUI(par1Minecraft.fontRenderer, par1Minecraft.renderEngine, new ItemStack(ModItems.cacophonium), xPosition, yPosition);
|
||||
RenderItem.getInstance().renderItemIntoGUI(par1Minecraft.fontRenderer, par1Minecraft.renderEngine, new ItemStack(Items.fireworks), xPosition + 8, yPosition + 2);
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
|
||||
|
||||
List<String> tooltip = new ArrayList();
|
||||
tooltip.add(EnumChatFormatting.LIGHT_PURPLE + "Happy Birthday Vazkii!");
|
||||
tooltip.add(EnumChatFormatting.GRAY + "doot doot");
|
||||
|
||||
if(k == 2)
|
||||
RenderHelper.renderTooltip(xPosition - 100, yPosition + 36, tooltip);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -33,9 +33,6 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.util.Color;
|
||||
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
@@ -251,13 +248,13 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid
|
||||
public void onBlockAdded(World world, int x, int y, int z) {
|
||||
((TileSpecialFlower) world.getTileEntity(x, y, z)).onBlockAdded(world, x, y, z);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
|
||||
float[] rgb = EntitySheep.fleeceColorTable[world.getBlockMetadata(x, y, z)];
|
||||
return ((int) (rgb[0] * 255) << 16) + ((int) (rgb[1] * 255) << 8) + ((int) (rgb[2] * 255));
|
||||
return ((int) (rgb[0] * 255) << 16) + ((int) (rgb[1] * 255) << 8) + (int) (rgb[2] * 255);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
@@ -267,7 +264,7 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid
|
||||
if(newMeta != oldMeta)
|
||||
world.setBlockMetadataWithNotify(x, y, z, newMeta, 1 | 2);
|
||||
}
|
||||
|
||||
|
||||
return ((TileSpecialFlower) world.getTileEntity(x, y, z)).onBlockActivated(world, x, y, z, player, side, hitX, hitY, hitZ);
|
||||
}
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ public final class ModFluffBlocks {
|
||||
public static Block shimmerwoodPlankSlab;
|
||||
public static Block shimmerwoodPlankSlabFull;
|
||||
public static Block shimmerwoodPlankStairs;
|
||||
|
||||
|
||||
public static Block managlassPane;
|
||||
public static Block alfglassPane;
|
||||
public static Block bifrostPane;
|
||||
@@ -326,14 +326,14 @@ public final class ModFluffBlocks {
|
||||
enderBrickSlab = new BlockEnderBrickSlab(false);
|
||||
enderBrickSlabFull = new BlockEnderBrickSlab(true);
|
||||
enderBrickStairs = new BlockEnderBrickStairs();
|
||||
|
||||
|
||||
shimmerrockSlab = new BlockShimmerrockSlab(false);
|
||||
shimmerrockSlabFull = new BlockShimmerrockSlab(true);
|
||||
shimmerrockStairs = new BlockShimmerrockStairs();
|
||||
shimmerwoodPlankSlab = new BlockShimmerwoodPlankSlab(false);
|
||||
shimmerwoodPlankSlabFull = new BlockShimmerwoodPlankSlab(true);
|
||||
shimmerwoodPlankStairs = new BlockShimmerwoodPlankStairs();
|
||||
|
||||
|
||||
managlassPane = new BlockManaglassPane();
|
||||
alfglassPane = new BlockAlfglassPane();
|
||||
bifrostPane = new BlockBifrostPane();
|
||||
@@ -401,7 +401,7 @@ public final class ModFluffBlocks {
|
||||
((BlockModSlab) shimmerrockSlabFull).register();
|
||||
((BlockModSlab) shimmerwoodPlankSlab).register();
|
||||
((BlockModSlab) shimmerwoodPlankSlabFull).register();
|
||||
|
||||
|
||||
for(int i = 0; i < 24; i++) {
|
||||
((BlockModSlab) biomeStoneSlabs[i]).register();
|
||||
((BlockModSlab) biomeStoneFullSlabs[i]).register();
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.decor;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
@@ -27,6 +24,9 @@ import vazkii.botania.client.render.block.InterpolatedIcon;
|
||||
import vazkii.botania.common.block.BlockMod;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockShimmerrock extends BlockMod implements ILexiconable {
|
||||
|
||||
@@ -38,7 +38,7 @@ public class BlockShimmerrock extends BlockMod implements ILexiconable {
|
||||
setBlockName(LibBlockNames.SHIMMERROCK);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void loadTextures(TextureStitchEvent.Pre event) {
|
||||
|
||||
@@ -37,7 +37,7 @@ public class BlockShimmerwoodPlanks extends BlockMod implements ILexiconable {
|
||||
setBlockName(LibBlockNames.SHIMMERWOOD_PLANKS);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void loadTextures(TextureStitchEvent.Pre event) {
|
||||
@@ -53,7 +53,7 @@ public class BlockShimmerwoodPlanks extends BlockMod implements ILexiconable {
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) {
|
||||
return LexiconData.rainbowRod;
|
||||
|
||||
+2
-2
@@ -87,14 +87,14 @@ public class SubTileDandelifeon extends SubTileGenerating {
|
||||
int x = supertile.xCoord;
|
||||
int y = supertile.yCoord;
|
||||
int z = supertile.zCoord;
|
||||
|
||||
|
||||
for(int[] change : changes) {
|
||||
int px = x - RANGE + change[0];
|
||||
int pz = z - RANGE + change[1];
|
||||
int val = change[2];
|
||||
if(val != -2 && wipe)
|
||||
val = -1;
|
||||
|
||||
|
||||
int old = change[3];
|
||||
|
||||
setBlockForGeneration(px, y, pz, val, old);
|
||||
|
||||
+13
-13
@@ -30,10 +30,10 @@ public class SubTileRafflowsia extends SubTileGenerating {
|
||||
|
||||
private static final String TAG_LAST_FLOWER = "lastFlower";
|
||||
private static final String TAG_LAST_FLOWER_TIMES = "lastFlowerTimes";
|
||||
|
||||
|
||||
String lastFlower;
|
||||
int lastFlowerTimes;
|
||||
|
||||
|
||||
private static final int RANGE = 5;
|
||||
|
||||
@Override
|
||||
@@ -54,7 +54,7 @@ public class SubTileRafflowsia extends SubTileGenerating {
|
||||
if(tile instanceof ISubTileContainer) {
|
||||
SubTileEntity stile = ((ISubTileContainer) tile).getSubTile();
|
||||
String name = stile.getUnlocalizedName();
|
||||
|
||||
|
||||
if(stile instanceof SubTileGenerating && ((SubTileGenerating) stile).isPassiveFlower()) {
|
||||
boolean last = name.equals(lastFlower);
|
||||
if(last)
|
||||
@@ -63,7 +63,7 @@ public class SubTileRafflowsia extends SubTileGenerating {
|
||||
lastFlower = name;
|
||||
lastFlowerTimes = 1;
|
||||
}
|
||||
|
||||
|
||||
float mod = 1F / lastFlowerTimes;
|
||||
|
||||
int meta = supertile.getWorldObj().getBlockMetadata(x, y, z) + 1;
|
||||
@@ -78,32 +78,32 @@ public class SubTileRafflowsia extends SubTileGenerating {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void writeToPacketNBT(NBTTagCompound cmp) {
|
||||
super.writeToPacketNBT(cmp);
|
||||
|
||||
|
||||
cmp.setString(TAG_LAST_FLOWER, lastFlower);
|
||||
cmp.setInteger(TAG_LAST_FLOWER_TIMES, lastFlowerTimes);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void readFromPacketNBT(NBTTagCompound cmp) {
|
||||
super.readFromPacketNBT(cmp);
|
||||
|
||||
|
||||
lastFlower = cmp.getString(TAG_LAST_FLOWER);
|
||||
lastFlowerTimes = cmp.getInteger(TAG_LAST_FLOWER_TIMES);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void populateDropStackNBTs(List<ItemStack> drops) {
|
||||
super.populateDropStackNBTs(drops);
|
||||
|
||||
ItemStack stack = drops.get(0);
|
||||
ItemNBTHelper.setString(stack, TAG_LAST_FLOWER, lastFlower);
|
||||
ItemNBTHelper.setInt(stack, TAG_LAST_FLOWER_TIMES, lastFlowerTimes);
|
||||
ItemNBTHelper.setInt(stack, TAG_LAST_FLOWER_TIMES, lastFlowerTimes);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) {
|
||||
super.onBlockPlacedBy(world, x, y, z, entity, stack);
|
||||
@@ -126,10 +126,10 @@ public class SubTileRafflowsia extends SubTileGenerating {
|
||||
public int getMaxMana() {
|
||||
return 6000;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry() {
|
||||
return LexiconData.rafflowsia;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1993,7 +1993,7 @@ public final class ModCraftingRecipes {
|
||||
recipeShimmerrock = BotaniaAPI.getLatestAddedRecipe();
|
||||
addShapelessOreDictRecipe(new ItemStack(ModBlocks.shimmerwoodPlanks), new ItemStack(ModBlocks.dreamwood, 1, 1), new ItemStack(ModBlocks.bifrostPerm));
|
||||
recipeShimmerwoodPlanks = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
|
||||
// Manufactory Halo Recipe
|
||||
addShapelessOreDictRecipe(new ItemStack(ModItems.autocraftingHalo), new ItemStack(ModItems.craftingHalo), LibOreDict.MANA_DIAMOND);
|
||||
recipeAutocraftingHalo = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
@@ -573,7 +573,7 @@ public final class LexiconData {
|
||||
|
||||
rafflowsia = new ALexiconEntry(LibLexicon.GFLOWER_RAFFLOWSIA, categoryGenerationFlowers);
|
||||
rafflowsia.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageText("3"), new PagePetalRecipe("4", ModPetalRecipes.rafflowsiaRecipe));
|
||||
|
||||
|
||||
dandelifeon = new ALexiconEntry(LibLexicon.GFLOWER_DANDELIFEON, categoryGenerationFlowers);
|
||||
dandelifeon.setLexiconPages(new PageText("_w"), new PageText("0"), new PageText("1"), new PageText("2"), new PageText("3"), new PageText("4"), new PageText("5"), new PageText("6"), new PageText("10"), new PageText("7"), new PagePetalRecipe("8", ModPetalRecipes.dandelifeonRecipe), new PageCraftingRecipe("9", ModCraftingRecipes.recipeCellBlock));
|
||||
|
||||
|
||||
Reference in new issue
Block a user