mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-27 23:45:57 +00:00
Client renders now make use of ClientTickHandler.ticksInGame. Closes #154
This commit is contained in:
1 parent
afe16d18e2
commit
aab3f204a6
11 files changed
+30
-17
No files matched your search
@@ -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);
|
||||
|
||||
@@ -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<String> 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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.6 KiB |
Reference in new issue
Block a user