diff --git a/build.properties b/build.properties index 94e996974..ed6bf3472 100644 --- a/build.properties +++ b/build.properties @@ -1,9 +1,9 @@ # -#Sun Dec 13 01:59:42 GMT 2015 +#Sat Dec 19 19:29:56 GMT 2015 version=r1.8 dir_output=../Build Output/Botania/ -mc_version=1.8.8 -forge_version=11.15.0.1635-1.8.8 dir_repo=./ -build_number=244 +forge_version=11.15.0.1635-1.8.8 +mc_version=1.8.8 +build_number=246 mod_name=Botania diff --git a/src/main/java/vazkii/botania/api/lexicon/LexiconRecipeMappings.java b/src/main/java/vazkii/botania/api/lexicon/LexiconRecipeMappings.java index f755b8300..8202a40a7 100644 --- a/src/main/java/vazkii/botania/api/lexicon/LexiconRecipeMappings.java +++ b/src/main/java/vazkii/botania/api/lexicon/LexiconRecipeMappings.java @@ -51,6 +51,9 @@ public final class LexiconRecipeMappings { } public static String stackToString(ItemStack stack) { + if(stack == null || stack.getItem() == null) + return "NULL"; + if(stack.hasTagCompound() && stack.getItem() instanceof IRecipeKeyProvider) return ((IRecipeKeyProvider) stack.getItem()).getKey(stack); diff --git a/src/main/java/vazkii/botania/api/package-info.java b/src/main/java/vazkii/botania/api/package-info.java index de31701cb..47e4b5479 100644 --- a/src/main/java/vazkii/botania/api/package-info.java +++ b/src/main/java/vazkii/botania/api/package-info.java @@ -1,4 +1,4 @@ -@API(owner = "Botania", apiVersion = "73", provides = "BotaniaAPI") +@API(owner = "Botania", apiVersion = "74", provides = "BotaniaAPI") package vazkii.botania.api; import net.minecraftforge.fml.common.API; diff --git a/src/main/java/vazkii/botania/client/core/handler/BoundTileRenderer.java b/src/main/java/vazkii/botania/client/core/handler/BoundTileRenderer.java index f7d237647..625b8266c 100644 --- a/src/main/java/vazkii/botania/client/core/handler/BoundTileRenderer.java +++ b/src/main/java/vazkii/botania/client/core/handler/BoundTileRenderer.java @@ -42,6 +42,7 @@ public final class BoundTileRenderer { @SubscribeEvent public void onWorldRenderLast(RenderWorldLastEvent event) { GlStateManager.pushMatrix(); + GL11.glPushAttrib(GL11.GL_LIGHTING); GlStateManager.disableDepth(); GlStateManager.disableTexture2D(); GlStateManager.enableBlend(); @@ -88,6 +89,7 @@ public final class BoundTileRenderer { GlStateManager.enableDepth(); GlStateManager.enableTexture2D(); GlStateManager.disableBlend(); + GL11.glPopAttrib(); GlStateManager.popMatrix(); } diff --git a/src/main/java/vazkii/botania/client/core/handler/MultiblockRenderHandler.java b/src/main/java/vazkii/botania/client/core/handler/MultiblockRenderHandler.java index 05ea7be33..f990e9760 100644 --- a/src/main/java/vazkii/botania/client/core/handler/MultiblockRenderHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/MultiblockRenderHandler.java @@ -79,6 +79,11 @@ public final class MultiblockRenderHandler { if(currentMultiblock != null && dimension == player.worldObj.provider.getDimensionId()) { BlockPos anchorPos = anchor != null ? anchor : src.getBlockPos(); + GL11.glPushMatrix(); + GL11.glPushAttrib(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glDisable(GL11.GL_LIGHTING); rendering = true; Multiblock mb = anchor != null ? currentMultiblock.getForFacing(EnumFacing.getHorizontal(angle)) : currentMultiblock.getForEntity(player); boolean didAny = false; @@ -89,7 +94,9 @@ public final class MultiblockRenderHandler { if(renderComponentInWorld(player.worldObj, mb, comp, anchorPos)) didAny = true; rendering = false; - + GL11.glPopAttrib(); + GL11.glPopMatrix(); + if(!didAny) { setMultiblock(null); player.addChatComponentMessage(new ChatComponentTranslation("botaniamisc.structureComplete").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GREEN))); diff --git a/src/main/java/vazkii/botania/client/core/handler/PersistentVariableHelper.java b/src/main/java/vazkii/botania/client/core/handler/PersistentVariableHelper.java index ca1f7033c..a341a024e 100644 --- a/src/main/java/vazkii/botania/client/core/handler/PersistentVariableHelper.java +++ b/src/main/java/vazkii/botania/client/core/handler/PersistentVariableHelper.java @@ -27,6 +27,7 @@ import vazkii.botania.common.lib.LibMisc; public final class PersistentVariableHelper { private static final String TAG_FIRST_LOAD = "firstLoad"; + private static final String TAG_DOG = "dog"; private static final String TAG_BOOKMARK_COUNT = "bookmarkCount"; private static final String TAG_BOOKMARK_PREFIX = "bookmark"; private static final String TAG_BOOKMARKS = "bookmarks"; @@ -37,6 +38,7 @@ public final class PersistentVariableHelper { private static File cacheFile; public static boolean firstLoad = true; + public static boolean dog = true; public static String lastBotaniaVersion = ""; public static void save() throws IOException { @@ -68,6 +70,7 @@ public final class PersistentVariableHelper { cmp.setTag(TAG_LEXICON_NOTES, notesCmp); cmp.setBoolean(TAG_FIRST_LOAD, firstLoad); + cmp.setBoolean(TAG_DOG, dog); cmp.setString(TAG_LAST_BOTANIA_VERSION, lastBotaniaVersion); injectNBTToFile(cmp, getCacheFile()); @@ -109,6 +112,8 @@ public final class PersistentVariableHelper { firstLoad = cmp.hasKey(TAG_FIRST_LOAD) ? cmp.getBoolean(TAG_FIRST_LOAD) : firstLoad; if(firstLoad) lastBotaniaVersion = LibMisc.VERSION; + + dog = cmp.getBoolean(TAG_DOG); } public static void saveSafe() { diff --git a/src/main/java/vazkii/botania/client/core/handler/RedStringRenderer.java b/src/main/java/vazkii/botania/client/core/handler/RedStringRenderer.java index 467e74d96..bbf08863a 100644 --- a/src/main/java/vazkii/botania/client/core/handler/RedStringRenderer.java +++ b/src/main/java/vazkii/botania/client/core/handler/RedStringRenderer.java @@ -38,11 +38,10 @@ public final class RedStringRenderer { public static void renderAll() { if(!redStringTiles.isEmpty()) { GlStateManager.pushMatrix(); - boolean lighting = GL11.glGetBoolean(GL11.GL_LIGHTING); GlStateManager.disableTexture2D(); GlStateManager.enableBlend(); - if(lighting) - GlStateManager.disableLighting(); + GL11.glPushAttrib(GL11.GL_LIGHTING); + GlStateManager.disableLighting(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.color(1F, 0F, 0F, sizeAlpha); @@ -51,10 +50,9 @@ public final class RedStringRenderer { while((tile = redStringTiles.poll()) != null) renderTile(tile); - if(lighting) - GlStateManager.enableLighting(); GlStateManager.enableTexture2D(); GlStateManager.disableBlend(); + GL11.glPopAttrib(); GlStateManager.popMatrix(); } diff --git a/src/main/java/vazkii/botania/client/core/handler/SubTileRadiusRenderHandler.java b/src/main/java/vazkii/botania/client/core/handler/SubTileRadiusRenderHandler.java index 0b72f7cca..2224ecfe9 100644 --- a/src/main/java/vazkii/botania/client/core/handler/SubTileRadiusRenderHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/SubTileRadiusRenderHandler.java @@ -65,28 +65,22 @@ public final class SubTileRadiusRenderHandler { if(descriptor == null) return; - - boolean light = GL11.glGetBoolean(GL11.GL_LIGHTING); - GlStateManager.pushMatrix(); GlStateManager.disableTexture2D(); + GL11.glPushAttrib(GL11.GL_LIGHTING); GlStateManager.disableLighting(); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); // todo 1.8 Tessellator.renderingWorldRenderer = false; - if(descriptor.isCircle()) renderCircle(descriptor.getSubtileCoords(), descriptor.getCircleRadius()); else renderRectangle(descriptor.getAABB()); - - if(light) - GlStateManager.enableLighting(); GlStateManager.enableTexture2D(); GlStateManager.disableBlend(); + GL11.glPopAttrib(); GlStateManager.popMatrix(); - } public void renderRectangle(AxisAlignedBB aabb) { diff --git a/src/main/java/vazkii/botania/client/core/handler/TooltipAdditionDisplayHandler.java b/src/main/java/vazkii/botania/client/core/handler/TooltipAdditionDisplayHandler.java index b7871192a..081742fa2 100644 --- a/src/main/java/vazkii/botania/client/core/handler/TooltipAdditionDisplayHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/TooltipAdditionDisplayHandler.java @@ -189,16 +189,17 @@ public final class TooltipAdditionDisplayHandler { Gui.drawRect(mouseX + offx + rainbowWidth, mouseY - offy - height, mouseX + offx + width, mouseY - offy, 0xFF555555); String rank = StatCollector.translateToLocal("botania.rank" + level).replaceAll("&", "\u00a7"); - boolean light = GL11.glGetBoolean(GL11.GL_LIGHTING); + + GL11.glPushAttrib(GL11.GL_LIGHTING); GlStateManager.disableLighting(); font.drawStringWithShadow(rank, mouseX + offx, mouseY - offy - 12, 0xFFFFFF); if(!ss) { rank = StatCollector.translateToLocal("botania.rank" + (level + 1)).replaceAll("&", "\u00a7"); font.drawStringWithShadow(rank, mouseX + offx + width - font.getStringWidth(rank), mouseY - offy - 12, 0xFFFFFF); } - if(light) - GlStateManager.enableLighting(); + GlStateManager.enableDepth(); + GL11.glPopAttrib(); } private static void drawManaBar(ItemStack stack, IManaTooltipDisplay display, int mouseX, int mouseY, int offx, int offy, int width, int height) { diff --git a/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java b/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java index f121c395f..1d437bec3 100644 --- a/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java +++ b/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java @@ -98,6 +98,8 @@ import vazkii.botania.client.render.tile.RenderTileStarfield; import vazkii.botania.client.render.tile.RenderTileTerraPlate; import vazkii.botania.client.render.tile.RenderTileTeruTeruBozu; import vazkii.botania.client.render.tile.RenderTileTinyPotato; +import vazkii.botania.client.render.world.SkyblockRenderEvents; +import vazkii.botania.common.Botania; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.tile.TileAlfPortal; import vazkii.botania.common.block.tile.TileAltar; @@ -161,7 +163,7 @@ import net.minecraftforge.fml.relauncher.ReflectionHelper; public class ClientProxy extends CommonProxy { - public static boolean singAnnoyingChristmasSongsTillVazkiisHeadExplodesFromAllTheDamnJingle = false; + public static boolean jingleTheBells = false; public static boolean dootDoot = false; @Override @@ -194,8 +196,9 @@ public class ClientProxy extends CommonProxy { MinecraftForge.EVENT_BUS.register(new DebugHandler()); MinecraftForge.EVENT_BUS.register(new SubTileRadiusRenderHandler()); MinecraftForge.EVENT_BUS.register(new MultiblockRenderHandler()); + MinecraftForge.EVENT_BUS.register(new SkyblockRenderEvents()); FMLCommonHandler.instance().bus().register(new CorporeaAutoCompleteHandler()); - + if(ConfigHandler.useAdaptativeConfig) FMLCommonHandler.instance().bus().register(new AdaptorNotifier()); if(ConfigHandler.versionCheckEnabled) @@ -203,13 +206,12 @@ public class ClientProxy extends CommonProxy { if(ConfigHandler.enableSeasonalFeatures) { Calendar calendar = Calendar.getInstance(); - if(calendar.get(2) == 11 && calendar.get(5) >= 24 && calendar.get(5) <= 26 || calendar.get(2) == 0 && calendar.get(5) <= 6) - singAnnoyingChristmasSongsTillVazkiisHeadExplodesFromAllTheDamnJingle = true; + if((calendar.get(2) == 11 && calendar.get(5) >= 16) || (calendar.get(2) == 0 && calendar.get(5) <= 2)) + jingleTheBells = true; if(calendar.get(2) == 9) dootDoot = true; } - initRenderers(); } diff --git a/src/main/java/vazkii/botania/client/fx/ParticleRenderDispatcher.java b/src/main/java/vazkii/botania/client/fx/ParticleRenderDispatcher.java index 60b90e49b..a4743cb10 100644 --- a/src/main/java/vazkii/botania/client/fx/ParticleRenderDispatcher.java +++ b/src/main/java/vazkii/botania/client/fx/ParticleRenderDispatcher.java @@ -31,15 +31,14 @@ public final class ParticleRenderDispatcher { public static void dispatch() { Tessellator tessellator = Tessellator.getInstance(); - boolean isLightingEnabled = GL11.glGetBoolean(GL11.GL_LIGHTING); Profiler profiler = Minecraft.getMinecraft().mcProfiler; + GL11.glPushAttrib(GL11.GL_LIGHTING); GlStateManager.depthMask(false); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); GlStateManager.alphaFunc(GL11.GL_GREATER, 0.003921569F); - if(isLightingEnabled) - GlStateManager.disableLighting(); + GlStateManager.disableLighting(); profiler.startSection("sparkle"); FXSparkle.dispatchQueuedRenders(tessellator); @@ -47,11 +46,10 @@ public final class ParticleRenderDispatcher { FXWisp.dispatchQueuedRenders(tessellator); profiler.endSection(); - if(isLightingEnabled) - GlStateManager.enableLighting(); GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1F); GlStateManager.disableBlend(); GlStateManager.depthMask(true); + GL11.glPopAttrib(); } } diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexicon.java b/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexicon.java index c917be4c6..81512fa9d 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexicon.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexicon.java @@ -208,7 +208,7 @@ public class GuiLexicon extends GuiScreen { mc.renderEngine.bindTexture(texture); drawTexturedModalRect(left, top, 0, 0, guiWidth, guiHeight); - if(ClientProxy.singAnnoyingChristmasSongsTillVazkiisHeadExplodesFromAllTheDamnJingle) + if(ClientProxy.jingleTheBells) drawTexturedModalRect(left + 3, top + 1, 0, 212, 138, 6); String subtitle = getSubtitle(); diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconIndex.java b/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconIndex.java index 95feb7d7b..cb5dcd705 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconIndex.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconIndex.java @@ -38,6 +38,7 @@ import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.client.gui.lexicon.button.GuiButtonBack; import vazkii.botania.client.gui.lexicon.button.GuiButtonInvisible; import vazkii.botania.client.gui.lexicon.button.GuiButtonPage; +import vazkii.botania.common.lexicon.DLexiconEntry; public class GuiLexiconIndex extends GuiLexicon implements IParented { @@ -146,6 +147,9 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented { button.displayStack = entry.getIcon(); if(entry == tutEntry) tutPage = page; + + if(entry instanceof DLexiconEntry) + button.dog = true; } else button.displayString = ""; } } @@ -291,8 +295,12 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented { ClientTickHandler.notifyPageChange(); break; default : - int index = par1GuiButton.id + page * 12; - openEntry(index); + if(par1GuiButton instanceof GuiButtonInvisible && ((GuiButtonInvisible) par1GuiButton).dog) + ((GuiButtonInvisible) par1GuiButton).click(); + else { + int index = par1GuiButton.id + page * 12; + openEntry(index); + } } } diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonInvisible.java b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonInvisible.java index 21bedd7fc..5d0766590 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonInvisible.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonInvisible.java @@ -16,28 +16,56 @@ import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; +import vazkii.botania.client.core.handler.ClientTickHandler; +import vazkii.botania.client.core.handler.PersistentVariableHelper; import vazkii.botania.client.core.helper.FontHelper; import vazkii.botania.client.gui.lexicon.GuiLexiconIndex; +import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.lib.LibMisc; public class GuiButtonInvisible extends GuiButtonLexicon { + private static final ResourceLocation dogResource = new ResourceLocation(LibResources.GUI_DOG); + GuiLexiconIndex gui; public ItemStack displayStack = null; + public boolean dog = false; float timeHover = 0; + + boolean enableDog = false; + double dogPos = 0; public GuiButtonInvisible(GuiLexiconIndex gui, int par1, int par2, int par3, int par4, int par5, String par6Str) { super(par1, par2, par3, par4, par5, par6Str); this.gui = gui; } - + + public void click() { + enableDog = true; + PersistentVariableHelper.dog = true; + PersistentVariableHelper.saveSafe(); + } @Override public void drawButton(Minecraft par1Minecraft, int par2, int par3) { + if(enableDog) { + dogPos += ClientTickHandler.delta * 10; + + par1Minecraft.renderEngine.bindTexture(dogResource); + float f = 1F / 64F; + GL11.glTranslated(dogPos, 0, 0); + GL11.glColor4f(1F, 1F, 1F, 1F); + vazkii.botania.client.core.helper.RenderHelper.drawTexturedModalRect(0, yPosition, zLevel + 10, (dogPos % 100 < 50) ? 23 : 0, 0, 23, 19, f, f); + xPosition = (int) Math.max(xPosition, dogPos + 10); + + GL11.glTranslated(-dogPos, 0, 0); + } + hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; int k = getHoverState(hovered); boolean showStack = displayStack != null && !displayString.isEmpty(); diff --git a/src/main/java/vazkii/botania/client/lib/LibResources.java b/src/main/java/vazkii/botania/client/lib/LibResources.java index 49a7d1b80..2b6391857 100644 --- a/src/main/java/vazkii/botania/client/lib/LibResources.java +++ b/src/main/java/vazkii/botania/client/lib/LibResources.java @@ -47,6 +47,8 @@ public final class LibResources { public static final String GUI_BAUBLE_BOX = PREFIX_GUI + "baubleBox.png"; public static final String GUI_HUD_ICONS = PREFIX_GUI + "hudIcons.png"; public static final String GUI_STENCIL = PREFIX_GUI + "stencil.png"; + public static final String GUI_DOG = PREFIX_GUI + "dog.png"; + public static final String GUI_FLOWEY = PREFIX_GUI + "flowey.png"; public static final String ENTRY_FLOWERS = PREFIX_ENTRIES + "flowers.png"; public static final String ENTRY_APOTHECARY = PREFIX_ENTRIES + "apothecary.png"; @@ -97,6 +99,7 @@ public final class LibResources { public static final String MODEL_MANAWEAVE_0 = PREFIX_MODEL + "manaweave0.png"; public static final String MODEL_MANAWEAVE_1 = PREFIX_MODEL + "manaweave1.png"; public static final String MODEL_MANAWEAVE_NEW = PREFIX_MODEL + "manaweaveNew.png"; + public static final String MODEL_MANAWEAVE_NEW_HOLIDAY = PREFIX_MODEL + "manaweaveNewHoliday.png"; public static final String MODEL_PIXIE = PREFIX_MODEL + "pixie.png"; public static final String MODEL_TINY_POTATO = PREFIX_MODEL + "tinyPotato.png"; public static final String MODEL_TINY_POTATO_GS = PREFIX_MODEL + "tinyPotatoGray.png"; @@ -144,6 +147,9 @@ public final class LibResources { public static final String MISC_GLOW_GREEN = PREFIX_MISC + "glow0.png"; public static final String MISC_GLOW_CYAN = PREFIX_MISC + "glow1.png"; public static final String MISC_BABYLON = PREFIX_MISC + "babylon.png"; + public static final String MISC_SKYBOX = PREFIX_MISC + "skybox.png"; + public static final String MISC_RAINBOW = PREFIX_MISC + "rainbow.png"; + public static final String MISC_PLANET = PREFIX_MISC + "planet"; public static final String OBJ_MODEL_PYLON = PREFIX_OBJ_MODEL + "pylon.obj"; diff --git a/src/main/java/vazkii/botania/client/model/ModelHourglass.java b/src/main/java/vazkii/botania/client/model/ModelHourglass.java index 582d7a41a..d6a0e23dd 100644 --- a/src/main/java/vazkii/botania/client/model/ModelHourglass.java +++ b/src/main/java/vazkii/botania/client/model/ModelHourglass.java @@ -67,7 +67,7 @@ public class ModelHourglass extends ModelBase { base2.render(f); Color c = new Color(color); GlStateManager.color((byte) c.getRed(), (byte) c.getGreen(), (byte) c.getBlue()); - boolean normalize = GL11.glGetBoolean(GL11.GL_NORMALIZE); + GL11.glPushAttrib(GL11.GL_NORMALIZE); GlStateManager.enableNormalize(); if(fract1 > 0) { @@ -98,8 +98,7 @@ public class ModelHourglass extends ModelBase { GlStateManager.popMatrix(); } - if(!normalize) - GlStateManager.disableNormalize(); + GL11.glPopAttrib(); GlStateManager.color(1F, 1F, 1F); glass1.render(f); glass2.render(f); diff --git a/src/main/java/vazkii/botania/client/render/world/SkyblockRenderEvents.java b/src/main/java/vazkii/botania/client/render/world/SkyblockRenderEvents.java new file mode 100644 index 000000000..007b637fb --- /dev/null +++ b/src/main/java/vazkii/botania/client/render/world/SkyblockRenderEvents.java @@ -0,0 +1,31 @@ +/** + * This class was created by . 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 @ [18/12/2015, 02:19:53 (GMT)] + */ +package vazkii.botania.client.render.world; + +import net.minecraft.client.Minecraft; +import net.minecraft.world.World; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import vazkii.botania.common.core.handler.ConfigHandler; +import vazkii.botania.common.world.WorldTypeSkyblock; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public final class SkyblockRenderEvents { + + @SubscribeEvent + public void onRender(RenderWorldLastEvent event) { + World world = Minecraft.getMinecraft().theWorld; + if(ConfigHandler.enableFancySkybox && world.provider.dimensionId == 0 && (ConfigHandler.enableFancySkyboxInNormalWorlds || WorldTypeSkyblock.isWorldSkyblock(Minecraft.getMinecraft().theWorld))) { + if(!(world.provider.getSkyRenderer() instanceof SkyblockSkyRenderer)) + world.provider.setSkyRenderer(new SkyblockSkyRenderer()); + } + } + +} diff --git a/src/main/java/vazkii/botania/client/render/world/SkyblockSkyRenderer.java b/src/main/java/vazkii/botania/client/render/world/SkyblockSkyRenderer.java new file mode 100644 index 000000000..64bef6bee --- /dev/null +++ b/src/main/java/vazkii/botania/client/render/world/SkyblockSkyRenderer.java @@ -0,0 +1,368 @@ +/** + * This class was created by . 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 @ [18/12/2015, 02:06:56 (GMT)] + */ +package vazkii.botania.client.render.world; + +import java.util.Random; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec3; +import net.minecraftforge.client.IRenderHandler; + +import org.lwjgl.opengl.GL11; + +import vazkii.botania.client.core.handler.ClientTickHandler; +import vazkii.botania.client.lib.LibResources; +import vazkii.botania.common.lib.LibObfuscation; +import cpw.mods.fml.relauncher.ReflectionHelper; + +public class SkyblockSkyRenderer extends IRenderHandler { + + private static final ResourceLocation textureSkybox = new ResourceLocation(LibResources.MISC_SKYBOX); + private static final ResourceLocation textureRainbow = new ResourceLocation(LibResources.MISC_RAINBOW); + private static final ResourceLocation textureMoonPhases = new ResourceLocation("textures/environment/moon_phases.png"); + private static final ResourceLocation textureSun = new ResourceLocation("textures/environment/sun.png"); + private static final ResourceLocation[] planetTextures = new ResourceLocation[] { + new ResourceLocation(LibResources.MISC_PLANET + "0.png"), + new ResourceLocation(LibResources.MISC_PLANET + "1.png"), + new ResourceLocation(LibResources.MISC_PLANET + "2.png"), + new ResourceLocation(LibResources.MISC_PLANET + "3.png"), + new ResourceLocation(LibResources.MISC_PLANET + "4.png"), + new ResourceLocation(LibResources.MISC_PLANET + "5.png") + }; + + @Override + public void render(float partialTicks, WorldClient world, Minecraft mc) { + boolean test = false; + if(test) + return; + + int glSkyList = ReflectionHelper.getPrivateValue(RenderGlobal.class, mc.renderGlobal, LibObfuscation.GL_SKY_LIST); + int glSkyList2 = ReflectionHelper.getPrivateValue(RenderGlobal.class, mc.renderGlobal, LibObfuscation.GL_SKY_LIST2); // Horizon line. We don't have it here + int starGLCallList = ReflectionHelper.getPrivateValue(RenderGlobal.class, mc.renderGlobal, LibObfuscation.STAR_GL_CALL_LIST); + + GL11.glDisable(GL11.GL_TEXTURE_2D); + Vec3 vec3 = world.getSkyColor(mc.renderViewEntity, partialTicks); + float f1 = (float)vec3.xCoord; + float f2 = (float)vec3.yCoord; + float f3 = (float)vec3.zCoord; + float f6; + + int startFade = 25; + float insideVoid = Math.max(0F, ((float) (startFade - mc.thePlayer.posY) / startFade)); + f1 = Math.max(0F, f1 - insideVoid); + f2 = Math.max(0F, f2 - insideVoid); + f3 = Math.max(0F, f3 - insideVoid); + + Tessellator tessellator1 = Tessellator.instance; + GL11.glDepthMask(false); + GL11.glEnable(GL11.GL_FOG); + GL11.glColor3f(f1, f2, f3); + GL11.glCallList(glSkyList); + GL11.glDisable(GL11.GL_FOG); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + RenderHelper.disableStandardItemLighting(); + float[] afloat = world.provider.calcSunriseSunsetColors(world.getCelestialAngle(partialTicks), partialTicks); + float f7; + float f8; + float f9; + float f10; + + // === Sunset + if(afloat != null) { + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glShadeModel(GL11.GL_SMOOTH); + GL11.glPushMatrix(); + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(MathHelper.sin(world.getCelestialAngleRadians(partialTicks)) < 0.0F ? 180.0F : 0.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); + f6 = afloat[0]; + f7 = afloat[1]; + f8 = afloat[2]; + float f11; + + tessellator1.startDrawing(6); + tessellator1.setColorRGBA_F(f6, f7, f8, afloat[3] * (1F - insideVoid)); + tessellator1.addVertex(0.0D, 100.0D, 0.0D); + byte b0 = 16; + tessellator1.setColorRGBA_F(afloat[0], afloat[1], afloat[2], 0.0F); + + for(int j = 0; j <= b0; ++j) { + f11 = (float)j * (float)Math.PI * 2.0F / (float)b0; + float f12 = MathHelper.sin(f11); + float f13 = MathHelper.cos(f11); + tessellator1.addVertex((double)(f12 * 120.0F), (double)(f13 * 120.0F), (double)(-f13 * 40.0F * afloat[3])); + } + + tessellator1.draw(); + GL11.glPopMatrix(); + GL11.glShadeModel(GL11.GL_FLAT); + } + + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glPushMatrix(); + f6 = Math.max(0.2F, 1.0F - world.getRainStrength(partialTicks)) * (1F - insideVoid); + f7 = 0.0F; + f8 = 0.0F; + f9 = 0.0F; + + GL11.glTranslatef(f7, f8, f9); + GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); + + float celAng = world.getCelestialAngle(partialTicks); + float effCelAng = celAng; + if(celAng > 0.5) + effCelAng = 0.5F - (celAng - 0.5F); + + // === Planets + f10 = 20F; + float lowA = Math.max(0F, effCelAng - 0.3F) * f6; + float a = Math.max(0.1F, lowA); + + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glPushMatrix(); + GL11.glColor4f(1F, 1F, 1F, a * 4); + GL11.glRotatef(90F, 0.5F, 0.5F, 0.0F); + for(int p = 0; p < planetTextures.length; p++) { + mc.renderEngine.bindTexture(planetTextures[p]); + drawObject(tessellator1, f10); + + switch(p) { + case 0: + GL11.glRotatef(70F, 1F, 0F, 0F); + f10 = 12F; + break; + case 1: + GL11.glRotatef(120F, 0F, 0F, 1F); + f10 = 15F; + break; + case 2: + GL11.glRotatef(80F, 1F, 0F, 1F); + f10 = 25F; + break; + case 3: + GL11.glRotatef(100F, 0F, 0F, 1F); + f10 = 10F; + break; + case 4: + GL11.glRotatef(-60F, 1F, 0F, 0.5F); + f10 = 40F; + } + } + GL11.glColor4f(1F, 1F, 1F, 1F); + GL11.glPopMatrix(); + + // === Rays + mc.renderEngine.bindTexture(textureSkybox); + + f10 = 20F; + a = lowA; + GL11.glPushMatrix(); + OpenGlHelper.glBlendFunc(770, 1, 1, 0); + GL11.glTranslatef(0F, -1F, 0F); + GL11.glRotatef(220F, 1F, 0F, 0F); + GL11.glColor4f(1F, 1F, 1F, a); + int angles = 90; + float s = 3F; + float m = 1F; + float y = 2F; + float y0 = 0F; + float uPer = 1F / 360F; + float anglePer = 360F / angles; + double fuzzPer = (Math.PI * 10) / angles; + float rotSpeed = 1F; + float rotSpeedMod = 0.4F; + + for(int p = 0; p < 3; p++) { + float baseAngle = rotSpeed * rotSpeedMod * (ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks); + GL11.glRotatef((ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks) * 0.25F * rotSpeed * rotSpeedMod, 0F, 1F, 0F); + + tessellator1.startDrawingQuads(); + for(int i = 0; i < angles; i++) { + int j = i; + if(i % 2 == 0) + j--; + + float ang = j * anglePer + baseAngle; + double xp = Math.cos(ang * Math.PI / 180F) * f10; + double zp = Math.sin(ang * Math.PI / 180F) * f10; + double yo = Math.sin(fuzzPer * j) * 1; + + float ut = ang * uPer; + if(i % 2 == 0) { + tessellator1.addVertexWithUV(xp, yo + y0 + y, zp, ut, 1F); + tessellator1.addVertexWithUV(xp, yo + y0, zp, ut, 0); + } else { + tessellator1.addVertexWithUV(xp, yo + y0, zp, ut, 0); + tessellator1.addVertexWithUV(xp, yo + y0 + y, zp, ut, 1F); + } + + } + tessellator1.draw(); + + switch(p) { + case 0: + GL11.glRotatef(20F, 1F, 0F, 0F); + GL11.glColor4f(1F, 0.4F, 0.4F, a); + fuzzPer = (Math.PI * 14) / angles; + rotSpeed = 0.2F; + break; + case 1: + GL11.glRotatef(50F, 1F, 0F, 0F); + GL11.glColor4f(0.4F, 1F, 0.7F, a); + fuzzPer = (Math.PI * 6) / angles; + rotSpeed = 2F; + break; + } + } + GL11.glPopMatrix(); + + // === Rainbow + GL11.glPushMatrix(); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + mc.renderEngine.bindTexture(textureRainbow); + f10 = 10F; + float effCelAng1 = celAng; + if(effCelAng1 > 0.25F) + effCelAng1 = 1F - effCelAng1; + effCelAng1 = 0.25F - Math.min(0.25F, effCelAng1); + + long time = world.getWorldTime() + 1000; + int day = (int) (time / 24000L); + Random rand = new Random(day * 0xFF); + float angle1 = rand.nextFloat() * 360F; + float angle2 = rand.nextFloat() * 360F; + GL11.glColor4f(1F, 1F, 1F, effCelAng1 * (1F - insideVoid)); + GL11.glRotatef(angle1, 0F, 1F, 0F); + GL11.glRotatef(angle2, 0F, 0F, 1F); + + tessellator1.startDrawingQuads(); + for(int i = 0; i < angles; i++) { + int j = i; + if(i % 2 == 0) + j--; + + float ang = j * anglePer; + double xp = Math.cos(ang * Math.PI / 180F) * f10; + double zp = Math.sin(ang * Math.PI / 180F) * f10; + double yo = 0; + + float ut = ang * uPer; + if(i % 2 == 0) { + tessellator1.addVertexWithUV(xp, yo + y0 + y, zp, ut, 1F); + tessellator1.addVertexWithUV(xp, yo + y0, zp, ut, 0); + } else { + tessellator1.addVertexWithUV(xp, yo + y0, zp, ut, 0); + tessellator1.addVertexWithUV(xp, yo + y0 + y, zp, ut, 1F); + } + + } + tessellator1.draw(); + GL11.glPopMatrix(); + + GL11.glColor4f(1F, 1F, 1F, 1F - insideVoid); + + OpenGlHelper.glBlendFunc(770, 1, 1, 0); + + // === Sun + GL11.glRotatef(world.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F); + f10 = 60.0F; + mc.renderEngine.bindTexture(textureSun); + drawObject(tessellator1, f10); + + // === Moon + f10 = 60.0F; + mc.renderEngine.bindTexture(textureMoonPhases); + int k = world.getMoonPhase(); + int l = k % 4; + int i1 = k / 4 % 2; + float f14 = (float)(l + 0) / 4.0F; + float f15 = (float)(i1 + 0) / 2.0F; + float f16 = (float)(l + 1) / 4.0F; + float f17 = (float)(i1 + 1) / 2.0F; + tessellator1.startDrawingQuads(); + tessellator1.addVertexWithUV((double)(-f10), -100.0D, (double)f10, (double)f16, (double)f17); + tessellator1.addVertexWithUV((double)f10, -100.0D, (double)f10, (double)f14, (double)f17); + tessellator1.addVertexWithUV((double)f10, -100.0D, (double)(-f10), (double)f14, (double)f15); + tessellator1.addVertexWithUV((double)(-f10), -100.0D, (double)(-f10), (double)f16, (double)f15); + tessellator1.draw(); + + // === Stars + f6 *= Math.max(0.1F, effCelAng * 2); + float t = (ClientTickHandler.ticksInGame + partialTicks + 2000) * 0.005F; + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_TEXTURE_2D); + + GL11.glPushMatrix(); + GL11.glRotatef(t * 3, 0F, 1F, 0F); + GL11.glColor4f(1F, 1F, 1F, f6); + GL11.glCallList(starGLCallList); + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + GL11.glRotatef(t, 0F, 1F, 0F); + GL11.glColor4f(0.5F, 1F, 1F, f6); + GL11.glCallList(starGLCallList); + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + GL11.glRotatef(t * 2, 0F, 1F, 0F); + GL11.glColor4f(1F, 0.75F, 0.75F, f6); + GL11.glCallList(starGLCallList); + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + GL11.glRotatef(t * 3, 0F, 0F, 1F); + GL11.glColor4f(1F, 1F, 1F, 0.25F * f6); + GL11.glCallList(starGLCallList); + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + GL11.glRotatef(t, 0F, 0F, 1F); + GL11.glColor4f(0.5F, 1F, 1F, 0.25F * f6); + GL11.glCallList(starGLCallList); + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + GL11.glRotatef(t * 2, 0F, 0F, 1F); + GL11.glColor4f(1F, 0.75F, 0.75F, 0.25F * f6); + GL11.glCallList(starGLCallList); + GL11.glPopMatrix(); + + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glPopMatrix(); + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_FOG); + GL11.glPopMatrix(); + GL11.glDepthMask(true); + } + + private void drawObject(Tessellator tess, float f10) { + tess.startDrawingQuads(); + tess.addVertexWithUV((double)(-f10), 100.0D, (double)(-f10), 0.0D, 0.0D); + tess.addVertexWithUV((double)f10, 100.0D, (double)(-f10), 1.0D, 0.0D); + tess.addVertexWithUV((double)f10, 100.0D, (double)f10, 1.0D, 1.0D); + tess.addVertexWithUV((double)(-f10), 100.0D, (double)f10, 0.0D, 1.0D); + tess.draw(); + } + +} diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHopperhock.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHopperhock.java index 236a407cf..4edcefa40 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHopperhock.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHopperhock.java @@ -55,7 +55,7 @@ public class SubTileHopperhock extends SubTileFunctional { public void onUpdate() { super.onUpdate(); - if(redstoneSignal > 0 || supertile.getWorld().isRemote) + if(redstoneSignal > 0) return; boolean pulledAny = false; @@ -100,10 +100,15 @@ public class SubTileHopperhock extends SubTileFunctional { } if(invToPutItemIn != null) { - InventoryHelper.insertItemIntoInventory(invToPutItemIn, stack.copy(), sideToPutItemIn, -1); - invToPutItemIn.markDirty(); - item.setDead(); - pulledAny = true; + boolean remote = supertile.getWorld().isRemote; + if(!item.isDead && remote) + SubTileSpectranthemum.spawnExplosionParticles(item, 1); + else { + InventoryHelper.insertItemIntoInventory(invToPutItemIn, stack.copy(), sideToPutItemIn, -1); + invToPutItemIn.markDirty(); + item.setDead(); + pulledAny = true; + } } } diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSpectranthemum.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSpectranthemum.java index f64333e4b..65340a8be 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSpectranthemum.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSpectranthemum.java @@ -64,11 +64,11 @@ public class SubTileSpectranthemum extends SubTileFunctional { int cost = stack.stackSize * COST; if(mana >= cost) { - spawnExplosionParticles(item); + spawnExplosionParticles(item, 10); item.setPosition(bindPos.getX() + 0.5, bindPos.getY() + 1.5, bindPos.getZ() + 0.5); item.getEntityData().setBoolean(TAG_TELEPORTED, true); item.motionX = item.motionY = item.motionZ = 0; - spawnExplosionParticles(item); + spawnExplosionParticles(item, 10); if(!supertile.getWorld().isRemote) { mana -= cost; did = true; @@ -82,8 +82,8 @@ public class SubTileSpectranthemum extends SubTileFunctional { } } - void spawnExplosionParticles(EntityItem item) { - for(int i = 0; i < 10; i++) { + public static void spawnExplosionParticles(EntityItem item, int p) { + for(int i = 0; i < p; i++) { double m = 0.01; double d0 = item.worldObj.rand.nextGaussian() * m; double d1 = item.worldObj.rand.nextGaussian() * m; diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEndoflame.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEndoflame.java index 300743a91..3173f52b1 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEndoflame.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEndoflame.java @@ -18,6 +18,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntityFurnace; import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumParticleTypes; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileGenerating; @@ -39,7 +40,7 @@ public class SubTileEndoflame extends SubTileGenerating { if(linkedCollector != null) { if(burnTime == 0) { - if(mana < getMaxMana() && !supertile.getWorld().isRemote) { + if(mana < getMaxMana()) { boolean didSomething = false; List items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1))); @@ -53,13 +54,19 @@ public class SubTileEndoflame extends SubTileGenerating { if(burnTime > 0 && stack.stackSize > 0) { this.burnTime = Math.min(FUEL_CAP, burnTime) / 2; - stack.stackSize--; - supertile.getWorld().playSoundEffect(supertile.getPos().getX(), supertile.getPos().getY(), supertile.getPos().getZ(), "botania:endoflame", 0.2F, 1F); + if(!supertile.getWorld().isRemote) { + stack.stackSize--; + supertile.getWorld().playSoundEffect(supertile.getPos().getX(), supertile.getPos().getY(), supertile.getPos().getZ(), "botania:endoflame", 0.2F, 1F); - if(stack.stackSize == 0) - item.setDead(); + if(stack.stackSize == 0) + item.setDead(); + + didSomething = true; + } else { + item.worldObj.spawnParticle(EnumParticleTypes.SMOKE_LARGE, item.posX, item.posY + 0.1, item.posZ, 0.0D, 0.0D, 0.0D); + item.worldObj.spawnParticle(EnumParticleTypes.FLAME, item.posX, item.posY, item.posZ, 0.0D, 0.0D, 0.0D); + } - didSomething = true; break; } @@ -70,8 +77,8 @@ public class SubTileEndoflame extends SubTileGenerating { sync(); } } else { - if(supertile.getWorld().rand.nextInt(8) == 0) - Botania.proxy.wispFX(supertile.getWorld(), supertile.getPos().getX() + 0.55 + Math.random() * 0.2 - 0.1, supertile.getPos().getY() + 0.55 + Math.random() * 0.2 - 0.1, supertile.getPos().getZ() + 0.5, 0.7F, 0.05F, 0.05F, (float) Math.random() / 6, (float) -Math.random() / 60); + if(supertile.getWorld().rand.nextInt(10) == 0) + supertile.getWorld().spawnParticle(EnumParticleTypes.FLAME, supertile.getPos().getX() + 0.4 + Math.random() * 0.2, supertile.getPos().getY() + 0.65, supertile.getPos().getZ() + 0.4 + Math.random() * 0.2, 0.0D, 0.0D, 0.0D); burnTime--; } diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileGourmaryllis.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileGourmaryllis.java index dfae13460..7e7c0fde2 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileGourmaryllis.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileGourmaryllis.java @@ -13,10 +13,12 @@ package vazkii.botania.common.block.subtile.generating; import java.util.List; import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumParticleTypes; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileGenerating; @@ -42,21 +44,31 @@ public class SubTileGourmaryllis extends SubTileGenerating { sync(); } - if(!supertile.getWorld().isRemote) { - List items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1))); - for(EntityItem item : items) { - ItemStack stack = item.getEntityItem(); - if(stack != null && stack.getItem() instanceof ItemFood && !item.isDead) { - if(cooldown == 0) { + boolean remote = supertile.getWorld().isRemote; + List items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1))); + for(EntityItem item : items) { + ItemStack stack = item.getEntityItem(); + if(stack != null && stack.getItem() instanceof ItemFood && !item.isDead) { + if(cooldown == 0) { + if(!remote) { int val = ((ItemFood) stack.getItem()).getHealAmount(stack); storedMana = val * val * 64; cooldown = val * 10; supertile.getWorld().playSoundEffect(supertile.getPos().getX(), supertile.getPos().getY(), supertile.getPos().getZ(), "random.eat", 0.2F, 0.5F + (float) Math.random() * 0.5F); sync(); - } - - item.setDead(); + } else + for(int i = 0; i < 10; i++) { + float m = 0.2F; + float mx = (float) (Math.random() - 0.5) * m; + float my = (float) (Math.random() - 0.5) * m; + float mz = (float) (Math.random() - 0.5) * m; + supertile.getWorld().spawnParticle(EnumParticleTypes.ITEM_CRACK, item.posX, item.posY, item.posZ, mx, my, mz, Item.getIdFromItem(stack.getItem()), stack.getItemDamage()); + } + } + + if(!remote) + item.setDead(); } } } diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileSpectrolus.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileSpectrolus.java index 308d78862..9dad9f7c3 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileSpectrolus.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileSpectrolus.java @@ -25,6 +25,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumParticleTypes; import org.lwjgl.opengl.GL11; import vazkii.botania.api.lexicon.LexiconEntry; @@ -44,21 +45,32 @@ public class SubTileSpectrolus extends SubTileGenerating { public void onUpdate() { super.onUpdate(); - if(!supertile.getWorld().isRemote) { - Item wool = Item.getItemFromBlock(Blocks.wool); - List items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1))); - for(EntityItem item : items) { - ItemStack stack = item.getEntityItem(); - if(stack != null && stack.getItem() == wool) { - int meta = stack.getItemDamage(); - if(meta == nextColor) { + boolean remote = supertile.getWorld().isRemote; + Item wool = Item.getItemFromBlock(Blocks.wool); + List items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1))); + for(EntityItem item : items) { + ItemStack stack = item.getEntityItem(); + if(stack != null && stack.getItem() == wool) { + int meta = stack.getItemDamage(); + if(meta == nextColor) { + if(!remote) { mana = Math.min(getMaxMana(), mana + 300); nextColor = nextColor == 15 ? 0 : nextColor + 1; - sync(); } - item.setDead(); + + for(int i = 0; i < 10; i++) { + float m = 0.2F; + float mx = (float) (Math.random() - 0.5) * m; + float my = (float) (Math.random() - 0.5) * m; + float mz = (float) (Math.random() - 0.5) * m; + // todo 1.8.8 verify. old: supertile.getWorld().spawnParticle("blockcrack_" + Item.getIdFromItem(stack.getItem()) + "_" + meta, item.posX, item.posY, item.posZ, mx, my, mz); + supertile.getWorld().spawnParticle(EnumParticleTypes.ITEM_CRACK, item.posX, item.posY, item.posZ, mx, my, mz, Item.getIdFromItem(stack.getItem()), stack.getItemDamage()); + } } + + if(!remote) + item.setDead(); } } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileEnderEye.java b/src/main/java/vazkii/botania/common/block/tile/TileEnderEye.java index f71f78f30..b0e95abd5 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileEnderEye.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileEnderEye.java @@ -16,6 +16,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.ITickable; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.MovingObjectPosition; @@ -26,9 +27,6 @@ public class TileEnderEye extends TileMod implements ITickable { @Override public void update() { - if(worldObj.isRemote) - return; - boolean wasLooking = ((Boolean) worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED)); int range = 80; List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(pos.add(-range, -range, -range), pos.add(range, range, range))); @@ -46,8 +44,16 @@ public class TileEnderEye extends TileMod implements ITickable { } } - if(looking != wasLooking) + if(looking != wasLooking && !worldObj.isRemote) worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, looking), 1 | 2); + + if(looking) { + double x = getPos().getX() - 0.1 + Math.random() * 1.2; + double y = getPos().getY() - 0.1 + Math.random() * 1.2; + double z = getPos().getZ() - 0.1 + Math.random() * 1.2; + + worldObj.spawnParticle(EnumParticleTypes.REDSTONE, x, y, z, 1, 0, 0); + } } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileLightRelay.java b/src/main/java/vazkii/botania/common/block/tile/TileLightRelay.java index 3c89cc627..0dbacae49 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileLightRelay.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileLightRelay.java @@ -227,8 +227,9 @@ public class TileLightRelay extends TileMod implements IWandBindable, ITickable worldObj.scheduleUpdate(pos, tile.getBlockType(), tile.getBlockType().tickRate(worldObj)); } - BlockPos bind = ((TileLightRelay) tile).getBinding(); - if(bind != null) { + TileLightRelay relay = (TileLightRelay) tile; + BlockPos bind = relay.getBinding(); + if(bind != null && relay.isValidBinding()) { setExit(bind); return; } diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TilePump.java b/src/main/java/vazkii/botania/common/block/tile/mana/TilePump.java index e16f1c53c..fbbe79279 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TilePump.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TilePump.java @@ -52,6 +52,8 @@ public class TilePump extends TileMod implements ITickable { if(innerRingPos >= max) { innerRingPos = Math.min(max, innerRingPos); moving = 0F; + for(int x = 0; x < 2; x++) + worldObj.spawnParticle("explode", xCoord + Math.random(), yCoord + Math.random(), zCoord + Math.random(), 0, 0, 0); } } else if(innerRingPos > min) { innerRingPos -= incr * 2; diff --git a/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java b/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java index 772e84f19..44fa7db32 100644 --- a/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java +++ b/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java @@ -62,7 +62,12 @@ public final class ConfigHandler { public static boolean enableSeasonalFeatures = true; public static boolean useShiftForQuickLookup = false; public static boolean enableArmorModels = true; + public static boolean enableFancySkybox = true; + public static boolean enableFancySkyboxInNormalWorlds = false; + public static int manaBarHeight = 29; + public static int flightBarHeight = 49; + public static int flightBarBreathHeight = 59; public static int glSecondaryTextureUnit = 7; public static boolean altFlowerTextures = false; @@ -174,9 +179,21 @@ public final class ConfigHandler { desc = "Set this to false to disable custom armor models."; enableArmorModels = loadPropBool("armorModels.enable", desc, enableArmorModels); + desc = "Set this to false to disable the fancy skybox in Garden of Glass."; + enableFancySkybox = loadPropBool("fancySkybox.enable", desc, enableFancySkybox); + + desc = "Set this to true to enable the fancy skybox in non Garden of Glass worlds. (Does not require Garden of Glass loaded to use, needs 'fancySkybox.enable' to be true as well)"; + enableFancySkyboxInNormalWorlds = loadPropBool("fancySkybox.normalWorlds", desc, enableFancySkyboxInNormalWorlds); + desc = "The height of the mana display bar in above the XP bar. You can change this if you have a mod that changes where the XP bar is."; manaBarHeight = loadPropInt("manaBar.height", desc, manaBarHeight); + desc = "The height of the Flugel Tiara flight bar. You can change this if you have a mod that adds a bar in that spot."; + flightBarHeight = loadPropInt("flightBar.height", desc, flightBarHeight); + + desc = "The height of the Flugel Tiara flight bar if your breath bar is shown. You can change this if you have a mod that adds a bar in that spot."; + flightBarBreathHeight = loadPropInt("flightBarBreath.height", desc, flightBarBreathHeight); + desc = "The GL Texture Unit to use for the secondary sampler passed in to the Lexica Botania's category button shader. DO NOT TOUCH THIS IF YOU DON'T KNOW WHAT YOU'RE DOING"; glSecondaryTextureUnit = loadPropInt("shaders.secondaryUnit", desc, glSecondaryTextureUnit); diff --git a/src/main/java/vazkii/botania/common/core/proxy/CommonProxy.java b/src/main/java/vazkii/botania/common/core/proxy/CommonProxy.java index 372bd5971..150212ed3 100644 --- a/src/main/java/vazkii/botania/common/core/proxy/CommonProxy.java +++ b/src/main/java/vazkii/botania/common/core/proxy/CommonProxy.java @@ -68,6 +68,7 @@ import vazkii.botania.common.item.ModItems; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibMisc; import vazkii.botania.common.network.GuiHandler; +import vazkii.botania.common.world.SkyblockWorldEvents; import vazkii.botania.common.world.WorldTypeSkyblock; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.FMLLog; @@ -123,6 +124,9 @@ public class CommonProxy { MinecraftForge.EVENT_BUS.register(new SpawnerChangingHandler()); MinecraftForge.EVENT_BUS.register(new SubTileNarslimmus.SpawnIntercepter()); MinecraftForge.EVENT_BUS.register(TileCorporeaIndex.getInputHandler()); + + if(Botania.gardenOfGlassLoaded) + MinecraftForge.EVENT_BUS.register(new SkyblockWorldEvents()); FMLCommonHandler.instance().bus().register(new CommonTickHandler()); diff --git a/src/main/java/vazkii/botania/common/crafting/recipe/KeepIvyRecipe.java b/src/main/java/vazkii/botania/common/crafting/recipe/KeepIvyRecipe.java index 5dfe8f63d..0d81332cf 100644 --- a/src/main/java/vazkii/botania/common/crafting/recipe/KeepIvyRecipe.java +++ b/src/main/java/vazkii/botania/common/crafting/recipe/KeepIvyRecipe.java @@ -31,7 +31,7 @@ public class KeepIvyRecipe implements IRecipe { if(stack != null) { if(stack.getItem() == ModItems.keepIvy) foundIvy = true; - else if(!foundItem && !(ItemNBTHelper.detectNBT(stack) && ItemNBTHelper.getBoolean(stack, ItemKeepIvy.TAG_KEEP, false)) && stack.getItem().hasContainerItem(stack)) + else if(!foundItem && !(ItemNBTHelper.detectNBT(stack) && ItemNBTHelper.getBoolean(stack, ItemKeepIvy.TAG_KEEP, false)) && !stack.getItem().hasContainerItem(stack)) foundItem = true; else return false; } diff --git a/src/main/java/vazkii/botania/common/item/ItemOpenBucket.java b/src/main/java/vazkii/botania/common/item/ItemOpenBucket.java index e1da38641..9f8a51466 100644 --- a/src/main/java/vazkii/botania/common/item/ItemOpenBucket.java +++ b/src/main/java/vazkii/botania/common/item/ItemOpenBucket.java @@ -17,6 +17,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; +import vazkii.botania.common.block.subtile.functional.SubTileSpectranthemum; import vazkii.botania.common.lib.LibItemNames; public class ItemOpenBucket extends ItemMod { @@ -45,13 +46,12 @@ public class ItemOpenBucket extends ItemMod { Material material = par2World.getBlockState(pos).getBlock().getMaterial(); int l = ((Integer) par2World.getBlockState(pos).getValue(BlockLiquid.LEVEL)); - if(material == Material.water && l == 0) { + if((material == Material.lava || material == Material.water) && l == 0) { par2World.setBlockToAir(pos); - return par1ItemStack; - } + + for(int x = 0; x < 5; x++) + par2World.spawnParticle("explode", pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), 0, 0, 0); - if(material == Material.lava && l == 0) { - par2World.setBlockToAir(pos); return par1ItemStack; } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelArmor.java b/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelArmor.java index c9b0cc5f3..1e54ba580 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelArmor.java +++ b/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelArmor.java @@ -154,17 +154,21 @@ public class ItemManasteelArmor extends ItemArmor implements ISpecialArmor, IMan @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) { - if(GuiScreen.isShiftKeyDown()) { - addStringToTooltip(getArmorSetTitle(player), list); - addArmorSetDescription(stack, list); - ItemStack[] stacks = getArmorSetStacks(); - for(int i = 0; i < stacks.length; i++) - addStringToTooltip((hasArmorSetItem(player, i) ? EnumChatFormatting.GREEN : "") + " - " + stacks[i].getDisplayName(), list); - if(hasPhantomInk(stack)) - addStringToTooltip(StatCollector.translateToLocal("botaniamisc.hasPhantomInk"), list); - } else addStringToTooltip(StatCollector.translateToLocal("botaniamisc.shiftinfo"), list); + if(GuiScreen.isShiftKeyDown()) + addInformationAfterShift(stack, player, list, adv); + else addStringToTooltip(StatCollector.translateToLocal("botaniamisc.shiftinfo"), list); } + public void addInformationAfterShift(ItemStack stack, EntityPlayer player, List list, boolean adv) { + addStringToTooltip(getArmorSetTitle(player), list); + addArmorSetDescription(stack, list); + ItemStack[] stacks = getArmorSetStacks(); + for(int i = 0; i < stacks.length; i++) + addStringToTooltip((hasArmorSetItem(player, i) ? EnumChatFormatting.GREEN : "") + " - " + stacks[i].getDisplayName(), list); + if(hasPhantomInk(stack)) + addStringToTooltip(StatCollector.translateToLocal("botaniamisc.hasPhantomInk"), list); + } + public void addStringToTooltip(String s, List tooltip) { tooltip.add(s.replaceAll("&", "\u00a7")); } diff --git a/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveArmor.java b/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveArmor.java index c7bddefc1..be9d9f1f1 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveArmor.java +++ b/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveArmor.java @@ -13,12 +13,16 @@ package vazkii.botania.common.item.equipment.armor.manaweave; import java.util.List; import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; +import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import vazkii.botania.api.BotaniaAPI; +import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.client.core.proxy.ClientProxy; import vazkii.botania.client.lib.LibResources; import vazkii.botania.client.model.armor.ModelArmorManaweave; import vazkii.botania.common.achievement.ICraftAchievement; @@ -31,6 +35,8 @@ import net.minecraftforge.fml.relauncher.SideOnly; public class ItemManaweaveArmor extends ItemManasteelArmor implements ICraftAchievement { + IIcon iconChristmas; + public ItemManaweaveArmor(int type, String name) { super(type, name, BotaniaAPI.manaweaveArmorMaterial); } @@ -41,12 +47,32 @@ public class ItemManaweaveArmor extends ItemManasteelArmor implements ICraftAchi models[slot] = new ModelArmorManaweave(slot); return models[slot]; } - + + @Override + public void registerIcons(IIconRegister par1IconRegister) { + super.registerIcons(par1IconRegister); + iconChristmas = IconHelper.forItem(par1IconRegister, this, "Holiday"); + } + @Override public String getArmorTextureAfterInk(ItemStack stack, int slot) { - return ConfigHandler.enableArmorModels ? LibResources.MODEL_MANAWEAVE_NEW : slot == 2 ? LibResources.MODEL_MANAWEAVE_1 : LibResources.MODEL_MANAWEAVE_0; + return ConfigHandler.enableArmorModels ? (ClientProxy.jingleTheBells ? LibResources.MODEL_MANAWEAVE_NEW_HOLIDAY : LibResources.MODEL_MANAWEAVE_NEW) : slot == 2 ? LibResources.MODEL_MANAWEAVE_1 : LibResources.MODEL_MANAWEAVE_0; } + @Override + public IIcon getIconFromDamage(int dmg) { + return ClientProxy.jingleTheBells ? iconChristmas : super.getIconFromDamage(dmg); + } + + @Override + @SideOnly(Side.CLIENT) + public String getUnlocalizedName(ItemStack p_77667_1_) { + String name = super.getUnlocalizedName(p_77667_1_); + if(ClientProxy.jingleTheBells) + name = name.replaceAll("manaweave", "santaweave"); + return name; + } + @Override public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 22 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); @@ -87,11 +113,22 @@ public class ItemManaweaveArmor extends ItemManasteelArmor implements ICraftAchi public String getArmorSetName() { return StatCollector.translateToLocal("botania.armorset.manaweave.name"); } - + + @Override + public void addInformationAfterShift(ItemStack stack, EntityPlayer player, List list, boolean adv) { + if(ClientProxy.jingleTheBells) { + addStringToTooltip(StatCollector.translateToLocal("botaniamisc.santaweaveInfo"), list); + addStringToTooltip("", list); + } + + super.addInformationAfterShift(stack, player, list, adv); + } + @Override public void addArmorSetDescription(ItemStack stack, List list) { addStringToTooltip(StatCollector.translateToLocal("botania.armorset.manaweave.desc0"), list); - addStringToTooltip(StatCollector.translateToLocal("botania.armorset.manaweave.desc1"), list); } + addStringToTooltip(StatCollector.translateToLocal("botania.armorset.manaweave.desc1"), list); + } @Override public Achievement getAchievementOnCraft(ItemStack stack, EntityPlayer player, IInventory matrix) { diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemFlightTiara.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemFlightTiara.java index f858c8e58..def00a596 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemFlightTiara.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemFlightTiara.java @@ -53,6 +53,7 @@ import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.Botania; import vazkii.botania.common.achievement.ICraftAchievement; import vazkii.botania.common.achievement.ModAchievements; +import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.core.helper.Vector3; import vazkii.botania.common.item.ModItems; @@ -496,9 +497,9 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub mc.renderEngine.bindTexture(textureHud); int xo = resolution.getScaledWidth() / 2 + 10; int x = xo; - int y = resolution.getScaledHeight() - 49; + int y = resolution.getScaledHeight() - ConfigHandler.flightBarHeight; if(player.getAir() < 300) - y -= 10; + y = resolution.getScaledHeight() - ConfigHandler.flightBarBreathHeight; int left = ItemNBTHelper.getInt(stack, TAG_TIME_LEFT, MAX_FLY_TIME); diff --git a/src/main/java/vazkii/botania/common/lexicon/DLexiconEntry.java b/src/main/java/vazkii/botania/common/lexicon/DLexiconEntry.java new file mode 100644 index 000000000..00a0fc499 --- /dev/null +++ b/src/main/java/vazkii/botania/common/lexicon/DLexiconEntry.java @@ -0,0 +1,27 @@ +/** + * This class was created by . 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 @ [16/12/2015, 20:38:33 (GMT)] + */ +package vazkii.botania.common.lexicon; + +import vazkii.botania.api.lexicon.LexiconCategory; +import vazkii.botania.client.core.handler.PersistentVariableHelper; + +public class DLexiconEntry extends BLexiconEntry { + + public DLexiconEntry(String unlocalizedName, LexiconCategory category) { + super(unlocalizedName, category); + } + + @Override + public boolean isVisible() { + return !PersistentVariableHelper.dog; + } + +} diff --git a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java index 6ecb7f040..302e27625 100644 --- a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java +++ b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java @@ -287,6 +287,7 @@ public final class LexiconData { public static LexiconEntry challenges; public static LexiconEntry cacophonium; public static LexiconEntry pavement; + public static LexiconEntry preventingDecay; public static LexiconEntry tcIntegration; public static LexiconEntry bcIntegration; @@ -1081,6 +1082,9 @@ public final class LexiconData { pavement = new BLexiconEntry(LibLexicon.MISC_PAVEMENT, categoryMisc); pavement.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipesPavement)); + preventingDecay = new DLexiconEntry(LibLexicon.MISC_PRENTING_DECAY, categoryMisc); + preventingDecay.setLexiconPages(new PageText("0")).setIcon(new ItemStack(Blocks.deadbush)); + if(Botania.bcTriggersLoaded) { bcIntegration = new CLexiconEntry(LibLexicon.MISC_BC_INTEGRATION, categoryMisc, "BuildCraft"); bcIntegration.setLexiconPages(new PageText("0")).setIcon(new ItemStack(Items.redstone)); diff --git a/src/main/java/vazkii/botania/common/lib/LibLexicon.java b/src/main/java/vazkii/botania/common/lib/LibLexicon.java index fc884c301..a02891387 100644 --- a/src/main/java/vazkii/botania/common/lib/LibLexicon.java +++ b/src/main/java/vazkii/botania/common/lib/LibLexicon.java @@ -258,6 +258,7 @@ public final class LibLexicon { public static final String MISC_CHALLENGES = "challenges"; public static final String MISC_CACOPHONIUM = "cacophonium"; public static final String MISC_PAVEMENT = "pavement"; + public static final String MISC_PRENTING_DECAY = "preventingDecay"; public static final String MISC_TC_INTEGRATION = "tcIntegration"; public static final String MISC_BC_INTEGRATION = "bcIntegration"; diff --git a/src/main/java/vazkii/botania/common/lib/LibObfuscation.java b/src/main/java/vazkii/botania/common/lib/LibObfuscation.java index e448d97ea..c454fa1d9 100644 --- a/src/main/java/vazkii/botania/common/lib/LibObfuscation.java +++ b/src/main/java/vazkii/botania/common/lib/LibObfuscation.java @@ -92,4 +92,10 @@ public final class LibObfuscation { // TextureAtlasSprite public static final String[] ANIMATION_METADATA = new String[] { "animationMetadata", "field_110982_k", "k" }; + + // RenderGlobal + public static final String[] STAR_GL_CALL_LIST = new String[] { "starGLCallList", "field_72772_v", "p" }; + public static final String[] GL_SKY_LIST = new String[] { "glSkyList", "field_72771_w", "q" }; + public static final String[] GL_SKY_LIST2 = new String[] { "glSkyList2", "field_72781_x", "r" }; + } diff --git a/src/main/java/vazkii/botania/common/world/SkyblockWorldEvents.java b/src/main/java/vazkii/botania/common/world/SkyblockWorldEvents.java index 89bad781c..673e3a708 100644 --- a/src/main/java/vazkii/botania/common/world/SkyblockWorldEvents.java +++ b/src/main/java/vazkii/botania/common/world/SkyblockWorldEvents.java @@ -14,6 +14,7 @@ import java.awt.Color; import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; @@ -23,10 +24,12 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.BlockPos; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; +import net.minecraftforge.client.event.RenderWorldEvent; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action; import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent; +import vazkii.botania.client.render.world.SkyblockSkyRenderer; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.tile.TileManaFlame; import vazkii.botania.common.item.ModItems; @@ -102,7 +105,7 @@ public final class SkyblockWorldEvents { if(WorldTypeSkyblock.isWorldSkyblock(event.world) && event.state.getBlock() == Blocks.tallgrass) { ItemStack stackToRemove = null; for(ItemStack stack : event.drops) - if(stack.getItem() == Items.wheat_seeds && event.world.rand.nextInt(10) == 0) { + if(stack.getItem() == Items.wheat_seeds && event.world.rand.nextInt(4) == 0) { stackToRemove = stack; break; } diff --git a/src/main/java/vazkii/botania/common/world/WorldTypeSkyblock.java b/src/main/java/vazkii/botania/common/world/WorldTypeSkyblock.java index f0b4b4bbd..993477ed9 100644 --- a/src/main/java/vazkii/botania/common/world/WorldTypeSkyblock.java +++ b/src/main/java/vazkii/botania/common/world/WorldTypeSkyblock.java @@ -20,7 +20,6 @@ public class WorldTypeSkyblock extends WorldType { public WorldTypeSkyblock() { super("botania-skyblock"); - MinecraftForge.EVENT_BUS.register(new SkyblockWorldEvents()); } public static boolean isWorldSkyblock(World world) { @@ -46,10 +45,10 @@ public class WorldTypeSkyblock extends WorldType { public float getCloudHeight() { return 260f; } - + @Override public IChunkProvider getChunkGenerator(World world, String generatorOptions) { return new ChunkProviderFlat(world, world.getSeed(), false, "2;1x0;"); } - + } diff --git a/src/main/resources/assets/botania/lang/en_US.lang b/src/main/resources/assets/botania/lang/en_US.lang index 412f39978..ae2aaf8a9 100644 --- a/src/main/resources/assets/botania/lang/en_US.lang +++ b/src/main/resources/assets/botania/lang/en_US.lang @@ -150,6 +150,7 @@ botaniamisc.noVideo=&4Video will be back soon. Sorry :( botaniamisc.adaptativeConfigChanges=Botania's Adaptative Config has changed the following config defaults for you: botaniamisc.altarRefill0=Right click with an empty hand to botaniamisc.altarRefill1=add back the last recipe +botaniamisc.santaweaveInfo=Manaweave, changed up for the &cs&fe&ca&fs&co&fn # NEI INTEGRATION botania.nei.brewery=Botanical Brewery @@ -1644,6 +1645,10 @@ item.botania:manaweaveHelm.name=Manaweave Cowl item.botania:manaweaveChest.name=Manaweave Robe Top item.botania:manaweaveLegs.name=Manaweave Robe Bottom item.botania:manaweaveBoots.name=Manaweave Boots +item.botania:santaweaveHelm.name=Santaweave Cowl +item.botania:santaweaveChest.name=Santaweave Robe Top +item.botania:santaweaveLegs.name=Santaweave Robe Bottom +item.botania:santaweaveBoots.name=Santaweave Boots item.botania:gaiaHead.name=Gaia Guardian's Head item.botania:sextant.name=Worldshaper's Sextant item.botania:speedUpBelt.name=Planestrider's Sash @@ -3840,3 +3845,8 @@ botania.entry.banners=Banner Additions botania.tagline.banners=Lots of new banner patterns botania.page.banners0=In the presence of the &1Banners&0 from the future, &1Botania&0 adds &415&0 new icons to them, which can be mixed and matched with the original patterns and icons.
The following items can be used alongside a dye in the crafting grid to add an icon to a &1Banner&0: &1All Iron Tools&0, &1Spark Augments&0, &1Raw Fish&0, &1Livingwood and Dreamwood Twigs&0, &1Lexica Botania&0, &1Terrasteel&0 and the &1Tiny Potato&0. botania.page.banners1=Showcase of the various banners + +# -- PREVNTING DECAY +botania.entry.preventingDecay=Preventing Decay +botania.tagline.preventingDecay=Preventing passive flowers' decay +botania.page.preventingDecay0=no diff --git a/src/main/resources/assets/botania/textures/gui/dog.png b/src/main/resources/assets/botania/textures/gui/dog.png new file mode 100644 index 000000000..3d99571b6 Binary files /dev/null and b/src/main/resources/assets/botania/textures/gui/dog.png differ diff --git a/src/main/resources/assets/botania/textures/items/manaweaveBootsHoliday.png b/src/main/resources/assets/botania/textures/items/manaweaveBootsHoliday.png new file mode 100644 index 000000000..2a69486ca Binary files /dev/null and b/src/main/resources/assets/botania/textures/items/manaweaveBootsHoliday.png differ diff --git a/src/main/resources/assets/botania/textures/items/manaweaveChestHoliday.png b/src/main/resources/assets/botania/textures/items/manaweaveChestHoliday.png new file mode 100644 index 000000000..3dfeef409 Binary files /dev/null and b/src/main/resources/assets/botania/textures/items/manaweaveChestHoliday.png differ diff --git a/src/main/resources/assets/botania/textures/items/manaweaveHelmHoliday.png b/src/main/resources/assets/botania/textures/items/manaweaveHelmHoliday.png new file mode 100644 index 000000000..ca047acc7 Binary files /dev/null and b/src/main/resources/assets/botania/textures/items/manaweaveHelmHoliday.png differ diff --git a/src/main/resources/assets/botania/textures/items/manaweaveLegsHoliday.png b/src/main/resources/assets/botania/textures/items/manaweaveLegsHoliday.png new file mode 100644 index 000000000..ee437de87 Binary files /dev/null and b/src/main/resources/assets/botania/textures/items/manaweaveLegsHoliday.png differ diff --git a/src/main/resources/assets/botania/textures/misc/planet0.png b/src/main/resources/assets/botania/textures/misc/planet0.png new file mode 100644 index 000000000..0f36c34ce Binary files /dev/null and b/src/main/resources/assets/botania/textures/misc/planet0.png differ diff --git a/src/main/resources/assets/botania/textures/misc/planet1.png b/src/main/resources/assets/botania/textures/misc/planet1.png new file mode 100644 index 000000000..d9b66c532 Binary files /dev/null and b/src/main/resources/assets/botania/textures/misc/planet1.png differ diff --git a/src/main/resources/assets/botania/textures/misc/planet2.png b/src/main/resources/assets/botania/textures/misc/planet2.png new file mode 100644 index 000000000..7af89bb0d Binary files /dev/null and b/src/main/resources/assets/botania/textures/misc/planet2.png differ diff --git a/src/main/resources/assets/botania/textures/misc/planet3.png b/src/main/resources/assets/botania/textures/misc/planet3.png new file mode 100644 index 000000000..a3e59043c Binary files /dev/null and b/src/main/resources/assets/botania/textures/misc/planet3.png differ diff --git a/src/main/resources/assets/botania/textures/misc/planet4.png b/src/main/resources/assets/botania/textures/misc/planet4.png new file mode 100644 index 000000000..58d647dcc Binary files /dev/null and b/src/main/resources/assets/botania/textures/misc/planet4.png differ diff --git a/src/main/resources/assets/botania/textures/misc/planet5.png b/src/main/resources/assets/botania/textures/misc/planet5.png new file mode 100644 index 000000000..ced8e3cd5 Binary files /dev/null and b/src/main/resources/assets/botania/textures/misc/planet5.png differ diff --git a/src/main/resources/assets/botania/textures/misc/rainbow.png b/src/main/resources/assets/botania/textures/misc/rainbow.png new file mode 100644 index 000000000..32366c2e3 Binary files /dev/null and b/src/main/resources/assets/botania/textures/misc/rainbow.png differ diff --git a/src/main/resources/assets/botania/textures/misc/skybox.png b/src/main/resources/assets/botania/textures/misc/skybox.png new file mode 100644 index 000000000..2cad3db1d Binary files /dev/null and b/src/main/resources/assets/botania/textures/misc/skybox.png differ diff --git a/src/main/resources/assets/botania/textures/model/manaweaveNewHoliday.png b/src/main/resources/assets/botania/textures/model/manaweaveNewHoliday.png new file mode 100644 index 000000000..4ac472b4e Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/manaweaveNewHoliday.png differ diff --git a/version/1.7.10.txt b/version/1.7.10.txt index 77601fc9d..88c892c4a 100644 --- a/version/1.7.10.txt +++ b/version/1.7.10.txt @@ -1 +1 @@ -r1.8-243 \ No newline at end of file +r1.8-245 \ No newline at end of file diff --git a/web/changelog.txt b/web/changelog.txt index 6ad0764c3..59a56b1ab 100644 --- a/web/changelog.txt +++ b/web/changelog.txt @@ -1,3 +1,19 @@ +r1.8 245 +*Added a new fancy skybox effect to Garden of Glass. Here's an album. It looks cooler ingame. (there are config options to disable it and enable it in normal worlds as well, if you want) +*Added configs to move the Flugel Tiara's flight bar as apparently I'm not the only person that thought it was cute to put a bar there. +*Changed the period in which the mod enabled Christmas features to be in sync with Winter's Veil in World of Warcraft. Priorities! +*Fixed a bunch of stuff in the mod not rendering properly (going all gray) if some mod disables GL_LIGHTING (See: NEI, Neat). +*Fixed Luminizers that have been bound to another Luminizer that has then been removed taking you to the position where the removed one was. +*Increased the drop rate of Melon and Pumpkin seeds on Garden of Glass. Again. +*Manaweave armor is now Santaweave during Christmas. +r1.8 244 +*Added a "Preventing Decay" entry to the Miscellaneous section. Something seems a bit off with it though. +*Fixed a crash with NEI when some mods think it's a good idea to use stacks without a valid item. +*Fixed Resolute Ivy not working. +*Fixed the Ring of Chordata stopping the player from drowning if they have no mana. (howtonotwin) +*Polished a few things all with completely inconsequential particle effects.
  • Hopperhock makes smoke
  • Extrapolated Bucket makes smoke
  • Mana Pump makes smoke
  • Endoflame makes fire and smoke
  • Gourmaryllismakes food bits go all over the place
  • Spectrolus makes wool bits go all over the place
  • Ender Overseer has redstone particles when looked at
+*[API] Added a fallback for LexiconRecipeMappings.stackToString(). +*[API] Increased version number to 74 r1.8 243 *Added NEI integration for the Lexica Botania, it sometiles also tells you which entry something is in and gives you little tidbits of info like how to make livingwood/livingrock or terrasteel. *Added recipe indicators (the items that appear when you hover shift on an entry's name) to a few entries that don't have direct recipes. (like pure daisy or ender air) diff --git a/web/versions.ini b/web/versions.ini index 5581ec57e..c97d8ea18 100644 --- a/web/versions.ini +++ b/web/versions.ini @@ -240,4 +240,6 @@ r1.8-239=1.7.10 r1.8-240=1.7.10 r1.8-241=1.7.10 r1.8-242=1.7.10 -r1.8-243=1.7.10 \ No newline at end of file +r1.8-243=1.7.10 +r1.8-244=1.7.10 +r1.8-245=1.7.10 \ No newline at end of file