diff --git a/MODSRC/vazkii/botania/client/core/handler/BoundTileRenderer.java b/MODSRC/vazkii/botania/client/core/handler/BoundTileRenderer.java index 646b40584..5c2f3031a 100644 --- a/MODSRC/vazkii/botania/client/core/handler/BoundTileRenderer.java +++ b/MODSRC/vazkii/botania/client/core/handler/BoundTileRenderer.java @@ -47,7 +47,7 @@ public final class BoundTileRenderer { if(stack != null && stack.getItem() instanceof ICoordBoundItem) { ChunkCoordinates coords = ((ICoordBoundItem) stack.getItem()).getBinding(stack); if(coords != null) - renderBlockOutlineAt(coords, Color.HSBtoRGB(world.getTotalWorldTime() % 200 / 200F, 0.6F, 1F)); + renderBlockOutlineAt(coords, Color.HSBtoRGB(ClientTickHandler.ticksInGame % 200 / 200F, 0.6F, 1F)); } GL11.glEnable(GL11.GL_DEPTH_TEST); diff --git a/MODSRC/vazkii/botania/client/core/helper/RenderHelper.java b/MODSRC/vazkii/botania/client/core/helper/RenderHelper.java index 5b00e26c1..98c2cd10f 100644 --- a/MODSRC/vazkii/botania/client/core/helper/RenderHelper.java +++ b/MODSRC/vazkii/botania/client/core/helper/RenderHelper.java @@ -20,6 +20,8 @@ import net.minecraft.client.renderer.Tessellator; import org.lwjgl.opengl.GL11; +import vazkii.botania.client.core.handler.ClientTickHandler; + public final class RenderHelper { public static void renderTooltip(int x, int y, List tooltipData) { @@ -134,7 +136,7 @@ public final class RenderHelper { public static void renderStar(int color, float xScale, float yScale, float zScale, long seed) { Tessellator tessellator = Tessellator.instance; - int ticks = (int) (Minecraft.getMinecraft().theWorld.getTotalWorldTime() % 200); + int ticks = (int) (ClientTickHandler.ticksInGame % 200); if (ticks >= 100) ticks = 200 - ticks - 1; diff --git a/MODSRC/vazkii/botania/client/render/tile/RenderTileAlfPortal.java b/MODSRC/vazkii/botania/client/render/tile/RenderTileAlfPortal.java index 9e4466a9d..1552f7834 100644 --- a/MODSRC/vazkii/botania/client/render/tile/RenderTileAlfPortal.java +++ b/MODSRC/vazkii/botania/client/render/tile/RenderTileAlfPortal.java @@ -20,6 +20,7 @@ import net.minecraft.util.IIcon; import org.lwjgl.opengl.GL11; +import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.common.block.BlockAlfPortal; import vazkii.botania.common.block.tile.TileAlfPortal; @@ -41,7 +42,7 @@ public class RenderTileAlfPortal extends TileEntitySpecialRenderer { GL11.glColor4f(1F, 1F, 1F, 1F); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_CULL_FACE); - float alpha = (float) Math.min(1F, (Math.sin(portal.getWorldObj().getTotalWorldTime() / 8D) + 1D) / 7D + 0.6D) * (Math.min(60, portal.ticksOpen) / 60F); + float alpha = (float) Math.min(1F, (Math.sin(ClientTickHandler.ticksInGame / 8D) + 1D) / 7D + 0.6D) * (Math.min(60, portal.ticksOpen) / 60F); GL11.glColor4f(1F, 1F, 1F, alpha); Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); diff --git a/MODSRC/vazkii/botania/client/render/tile/RenderTileEnchanter.java b/MODSRC/vazkii/botania/client/render/tile/RenderTileEnchanter.java index 4b9920f85..7ba7165e3 100644 --- a/MODSRC/vazkii/botania/client/render/tile/RenderTileEnchanter.java +++ b/MODSRC/vazkii/botania/client/render/tile/RenderTileEnchanter.java @@ -25,6 +25,7 @@ import net.minecraft.util.IIcon; import org.lwjgl.opengl.GL11; +import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.client.core.helper.ShaderHelper; import vazkii.botania.common.block.BlockEnchanter; import vazkii.botania.common.block.tile.TileEnchanter; @@ -50,7 +51,7 @@ public class RenderTileEnchanter extends TileEntitySpecialRenderer { if(item == null) item = new EntityItem(enchanter.getWorldObj(), enchanter.xCoord, enchanter.yCoord + 1, enchanter.zCoord, enchanter.itemToEnchant); - item.age = (int) tileentity.getWorldObj().getTotalWorldTime(); + item.age = (int) ClientTickHandler.ticksInGame; item.setEntityItemStack(enchanter.itemToEnchant); GL11.glColor4f(1F, 1F, 1F, 1F); @@ -69,7 +70,7 @@ public class RenderTileEnchanter extends TileEntitySpecialRenderer { GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(1F, 1F, 1F, 1F); GL11.glDisable(GL11.GL_ALPHA_TEST); - float alpha = (float) ((Math.sin(enchanter.getWorldObj().getTotalWorldTime() / 8D) + 1D) / 5D + 0.4D) * alphaMod; + float alpha = (float) ((Math.sin(ClientTickHandler.ticksInGame / 8D) + 1D) / 5D + 0.4D) * alphaMod; if(ShaderHelper.useShaders()) GL11.glColor4f(1F, 1F, 1F, alpha); else { @@ -77,7 +78,7 @@ public class RenderTileEnchanter extends TileEntitySpecialRenderer { int lightmapX = light % 65536; int lightmapY = light / 65536; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY); - GL11.glColor4f(0.6F + (float) ((Math.cos(enchanter.getWorldObj().getTotalWorldTime() / 6D) + 1D) / 5D), 0.1F, 0.9F, alpha); + GL11.glColor4f(0.6F + (float) ((Math.cos(ClientTickHandler.ticksInGame / 6D) + 1D) / 5D), 0.1F, 0.9F, alpha); } Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); diff --git a/MODSRC/vazkii/botania/client/render/tile/RenderTileMiniIsland.java b/MODSRC/vazkii/botania/client/render/tile/RenderTileMiniIsland.java index 20d4a5205..d4b5148b6 100644 --- a/MODSRC/vazkii/botania/client/render/tile/RenderTileMiniIsland.java +++ b/MODSRC/vazkii/botania/client/render/tile/RenderTileMiniIsland.java @@ -24,6 +24,7 @@ import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; +import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.client.lib.LibResources; import vazkii.botania.client.model.ModelMiniIsland; import vazkii.botania.common.block.BlockModFlower; @@ -41,9 +42,9 @@ public class RenderTileMiniIsland extends TileEntitySpecialRenderer { GL11.glColor4f(1F, 1F, 1F, 1F); GL11.glTranslated(d0, d1, d2); - int worldTime = (int) (tile.getWorldObj() == null ? 0 : tile.getWorldObj().getTotalWorldTime()); + int worldTime = (int) (tile.getWorldObj() == null ? 0 : ClientTickHandler.ticksInGame); if(tile.getWorldObj() != null) - worldTime += new Random(tile.xCoord ^ tile.yCoord ^ tile.zCoord).nextInt(360); + worldTime += new Random(tile.xCoord ^ tile.yCoord ^ tile.zCoord).nextInt(1000); GL11.glTranslatef(0.5F, 0F, 0.5F); GL11.glRotatef(-(worldTime * 0.5F), 0F, 1F, 0F); diff --git a/MODSRC/vazkii/botania/client/render/tile/RenderTilePool.java b/MODSRC/vazkii/botania/client/render/tile/RenderTilePool.java index b176561c7..448e48038 100644 --- a/MODSRC/vazkii/botania/client/render/tile/RenderTilePool.java +++ b/MODSRC/vazkii/botania/client/render/tile/RenderTilePool.java @@ -27,6 +27,7 @@ import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; import vazkii.botania.api.mana.IPoolOverlayProvider; +import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.client.core.helper.ShaderHelper; import vazkii.botania.client.lib.LibResources; import vazkii.botania.client.model.ModelPool; @@ -85,7 +86,7 @@ public class RenderTilePool extends TileEntitySpecialRenderer { GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glColor4f(1F, 1F, 1F, (float) ((Math.sin(pool.getWorldObj().getTotalWorldTime() / 20.0) + 1) * 0.3 + 0.2)); + GL11.glColor4f(1F, 1F, 1F, (float) ((Math.sin(ClientTickHandler.ticksInGame / 20.0) + 1) * 0.3 + 0.2)); GL11.glTranslatef(-0.5F, -1F - 0.43F, -0.5F); GL11.glRotatef(90F, 1F, 0F, 0F); GL11.glScalef(s, s, s); diff --git a/MODSRC/vazkii/botania/client/render/tile/RenderTilePylon.java b/MODSRC/vazkii/botania/client/render/tile/RenderTilePylon.java index 972030ee2..afbdbda6c 100644 --- a/MODSRC/vazkii/botania/client/render/tile/RenderTilePylon.java +++ b/MODSRC/vazkii/botania/client/render/tile/RenderTilePylon.java @@ -22,6 +22,7 @@ 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.helper.ShaderHelper; import vazkii.botania.client.lib.LibResources; import vazkii.botania.client.model.IPylonModel; @@ -63,7 +64,7 @@ public class RenderTilePylon extends TileEntitySpecialRenderer { Minecraft.getMinecraft().renderEngine.bindTexture(pink ? texturePinkOld : green ? textureGreenOld : textureOld); else Minecraft.getMinecraft().renderEngine.bindTexture(pink ? texturePink : green ? textureGreen : texture); - int worldTime = (int) (tileentity.getWorldObj() == null ? 0 : tileentity.getWorldObj().getTotalWorldTime()); + int worldTime = (int) (tileentity.getWorldObj() == null ? 0 : ClientTickHandler.ticksInGame); if(tileentity != null) worldTime += new Random(tileentity.xCoord ^ tileentity.yCoord ^ tileentity.zCoord).nextInt(360); diff --git a/MODSRC/vazkii/botania/client/render/tile/RenderTileRuneAltar.java b/MODSRC/vazkii/botania/client/render/tile/RenderTileRuneAltar.java index cb9140a29..96552511e 100644 --- a/MODSRC/vazkii/botania/client/render/tile/RenderTileRuneAltar.java +++ b/MODSRC/vazkii/botania/client/render/tile/RenderTileRuneAltar.java @@ -29,6 +29,7 @@ import net.minecraftforge.client.ForgeHooksClient; import org.lwjgl.opengl.GL11; +import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.client.model.ModelSpinningCubes; import vazkii.botania.common.block.tile.TileRuneAltar; @@ -62,10 +63,10 @@ public class RenderTileRuneAltar extends TileEntitySpecialRenderer { GL11.glPushMatrix(); GL11.glScalef(0.5F, 0.5F, 0.5F); GL11.glTranslatef(1F, 2.5F, 1F); - GL11.glRotatef(angles[i] + altar.getWorldObj().getTotalWorldTime(), 0F, 1F, 0F); + GL11.glRotatef(angles[i] + ClientTickHandler.ticksInGame, 0F, 1F, 0F); GL11.glTranslatef(2.25F, 0F, 0.5F); GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glTranslated(0D, 0.15 * Math.sin((tileentity.getWorldObj().getTotalWorldTime() + i * 10) / 5D), 0F); + GL11.glTranslated(0D, 0.15 * Math.sin((ClientTickHandler.ticksInGame + i * 10) / 5D), 0F); ItemStack stack = altar.getStackInSlot(i); Minecraft mc = Minecraft.getMinecraft(); if(stack != null) { diff --git a/MODSRC/vazkii/botania/client/render/tile/RenderTileSpreader.java b/MODSRC/vazkii/botania/client/render/tile/RenderTileSpreader.java index 87f5daaa4..9abc02a13 100644 --- a/MODSRC/vazkii/botania/client/render/tile/RenderTileSpreader.java +++ b/MODSRC/vazkii/botania/client/render/tile/RenderTileSpreader.java @@ -22,6 +22,7 @@ import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; import vazkii.botania.api.mana.ILens; +import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.client.lib.LibResources; import vazkii.botania.client.model.ModelSpreader; import vazkii.botania.client.render.item.RenderLens; @@ -54,7 +55,7 @@ public class RenderTileSpreader extends TileEntitySpecialRenderer { model.render(); GL11.glPushMatrix(); - long worldTicks = tileentity.getWorldObj() == null ? 0 : tileentity.getWorldObj().getTotalWorldTime(); + long worldTicks = tileentity.getWorldObj() == null ? 0 : ClientTickHandler.ticksInGame; GL11.glRotatef(worldTicks % 360, 0F, 1F, 0F); GL11.glTranslatef(0F, (float) Math.sin(worldTicks / 20.0) * 0.05F, 0F); model.renderCube(); diff --git a/MODSRC/vazkii/botania/common/item/block/ItemBlockSpecialFlower.java b/MODSRC/vazkii/botania/common/item/block/ItemBlockSpecialFlower.java index f4717eb7a..cdea5c8cf 100644 --- a/MODSRC/vazkii/botania/common/item/block/ItemBlockSpecialFlower.java +++ b/MODSRC/vazkii/botania/common/item/block/ItemBlockSpecialFlower.java @@ -16,6 +16,7 @@ import java.util.List; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; @@ -51,10 +52,13 @@ public class ItemBlockSpecialFlower extends ItemBlockMod implements IRecipeKeyPr boolean placed = super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata); if(placed) { String type = getType(stack); - TileSpecialFlower tile = (TileSpecialFlower) world.getTileEntity(x, y, z); - tile.setSubTile(type); - if(!world.isRemote) - world.markBlockForUpdate(x, y, z); + TileEntity te = world.getTileEntity(x, y, z); + if(te instanceof TileSpecialFlower) { + TileSpecialFlower tile = (TileSpecialFlower) te; + tile.setSubTile(type); + if(!world.isRemote) + world.markBlockForUpdate(x, y, z); + } } return placed; diff --git a/resources/assets/botania/textures/model/pylon2.png b/resources/assets/botania/textures/model/pylon2.png index f1f817dec..b3bf0dbeb 100644 Binary files a/resources/assets/botania/textures/model/pylon2.png and b/resources/assets/botania/textures/model/pylon2.png differ