mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-18 19:29:31 +00:00
Merge upstream release 245
This commit is contained in:
commit
dbb549ba2a
57 files changed
+734
-108
No files matched your search
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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)));
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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();
|
||||
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* 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 @ [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());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,368 @@
|
||||
/**
|
||||
* 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 @ [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();
|
||||
}
|
||||
|
||||
}
|
||||
+10
-5
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -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;
|
||||
|
||||
@@ -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<EntityItem> 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--;
|
||||
}
|
||||
|
||||
+21
-9
@@ -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<EntityItem> 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<EntityItem> 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+22
-10
@@ -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<EntityItem> 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<EntityItem> 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<EntityPlayer> 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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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());
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
+13
-9
@@ -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<String> tooltip) {
|
||||
tooltip.add(s.replaceAll("&", "\u00a7"));
|
||||
}
|
||||
|
||||
+41
-4
@@ -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<String> 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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* 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 @ [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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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));
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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" };
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user