mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 10:55:17 +00:00
Tweak tesr guards. closes #142
This commit is contained in:
1 parent
b12cd80ad3
commit
076a7ee23a
13 files changed
+48
-61
No files matched your search
@@ -24,15 +24,16 @@ import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.AlfPortalState;
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.core.handler.MiscellaneousIcons;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.TileAlfPortal;
|
||||
|
||||
public class RenderTileAlfPortal extends TileEntitySpecialRenderer<TileAlfPortal> {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileAlfPortal portal, double d0, double d1, double d2, float f, int digProgress) {
|
||||
if (portal != null && portal.getWorld() != null && !portal.getWorld().isBlockLoaded(portal.getPos(), false)) {
|
||||
if (!portal.getWorld().isBlockLoaded(portal.getPos(), false)
|
||||
|| portal.getWorld().getBlockState(portal.getPos()).getBlock() != ModBlocks.alfPortal)
|
||||
return;
|
||||
}
|
||||
|
||||
AlfPortalState state = portal.getWorld().getBlockState(portal.getPos()).getValue(BotaniaStateProps.ALFPORTAL_STATE);
|
||||
|
||||
|
||||
@@ -28,42 +28,22 @@ import org.lwjgl.opengl.GL11;
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelAltar;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.TileAltar;
|
||||
|
||||
public class RenderTileAltar extends TileEntitySpecialRenderer<TileAltar> {
|
||||
|
||||
private static final ResourceLocation[] textures = new ResourceLocation[] {
|
||||
new ResourceLocation(LibResources.MODEL_ALTAR),
|
||||
new ResourceLocation(String.format(LibResources.MODEL_ALTAR_META, 0)),
|
||||
new ResourceLocation(String.format(LibResources.MODEL_ALTAR_META, 1)),
|
||||
new ResourceLocation(String.format(LibResources.MODEL_ALTAR_META, 2)),
|
||||
new ResourceLocation(String.format(LibResources.MODEL_ALTAR_META, 3)),
|
||||
new ResourceLocation(String.format(LibResources.MODEL_ALTAR_META, 4)),
|
||||
new ResourceLocation(String.format(LibResources.MODEL_ALTAR_META, 5)),
|
||||
new ResourceLocation(String.format(LibResources.MODEL_ALTAR_META, 6)),
|
||||
new ResourceLocation(String.format(LibResources.MODEL_ALTAR_META, 7))
|
||||
};
|
||||
|
||||
private static final ResourceLocation textureMossy = new ResourceLocation(LibResources.MODEL_ALTAR_MOSSY);
|
||||
|
||||
ModelAltar model = new ModelAltar();
|
||||
public static int forceMeta = -1;
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileAltar altar, double d0, double d1, double d2, float pticks, int digProgress) {
|
||||
if (altar != null && altar.getWorld() != null && !altar.getWorld().isBlockLoaded(altar.getPos(), false)) {
|
||||
if(!altar.getWorld().isBlockLoaded(altar.getPos(), false)
|
||||
|| altar.getWorld().getBlockState(altar.getPos()).getBlock() != ModBlocks.altar)
|
||||
return;
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
// Minecraft.getMinecraft().renderEngine.bindTexture(altar.isMossy ? textureMossy : textures[Math.min(textures.length - 1, forceMeta == -1 ? tileentity.getBlockMetadata() : forceMeta)]);
|
||||
|
||||
GlStateManager.translate(d0 + 0.5, d1 + 1.5, d2 + 0.5);
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
// model.render();
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
GlStateManager.enableRescaleNormal();
|
||||
|
||||
boolean water = altar.hasWater();
|
||||
@@ -151,8 +131,6 @@ public class RenderTileAltar extends TileEntitySpecialRenderer<TileAltar> {
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
GlStateManager.popMatrix();
|
||||
|
||||
forceMeta = -1;
|
||||
}
|
||||
|
||||
public void renderIcon(int par1, int par2, ResourceLocation loc, int par4, int par5, int brightness) {
|
||||
|
||||
@@ -27,6 +27,7 @@ import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelAvatar;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.TileAvatar;
|
||||
|
||||
public class RenderTileAvatar extends TileEntitySpecialRenderer<TileAvatar> {
|
||||
@@ -40,9 +41,10 @@ public class RenderTileAvatar extends TileEntitySpecialRenderer<TileAvatar> {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileAvatar avatar, double d0, double d1, double d2, float pticks, int digProgress) {
|
||||
if (avatar != null && avatar.getWorld() != null && !avatar.getWorld().isBlockLoaded(avatar.getPos(), false)) {
|
||||
return;
|
||||
}
|
||||
if (avatar != null)
|
||||
if (!avatar.getWorld().isBlockLoaded(avatar.getPos(), false)
|
||||
|| avatar.getWorld().getBlockState(avatar.getPos()).getBlock() != ModBlocks.avatar)
|
||||
return;
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelBellows;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.mana.TileBellows;
|
||||
|
||||
public class RenderTileBellows extends TileEntitySpecialRenderer<TileBellows> {
|
||||
@@ -30,9 +31,10 @@ public class RenderTileBellows extends TileEntitySpecialRenderer<TileBellows> {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileBellows bellows, double d0, double d1, double d2, float f, int digProgress) {
|
||||
if (bellows != null && bellows.getWorld() != null && !bellows.getWorld().isBlockLoaded(bellows.getPos(), false)) {
|
||||
return;
|
||||
}
|
||||
if (bellows != null)
|
||||
if (!bellows.getWorld().isBlockLoaded(bellows.getPos(), false)
|
||||
|| bellows.getWorld().getBlockState(bellows.getPos()).getBlock() != ModBlocks.bellows)
|
||||
return;
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
|
||||
@@ -28,7 +28,6 @@ public class RenderTileBrewery extends TileEntitySpecialRenderer<TileBrewery> {
|
||||
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_BREWERY);
|
||||
ModelBrewery model = new ModelBrewery();
|
||||
public TileBrewery brewery;
|
||||
public static boolean rotate = true;
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileBrewery brewery, double d0, double d1, double d2, float f, int digProgress) {
|
||||
@@ -43,8 +42,6 @@ public class RenderTileBrewery extends TileEntitySpecialRenderer<TileBrewery> {
|
||||
GlStateManager.translate(0.5F, -1.5F, -0.5F);
|
||||
|
||||
double time = ClientTickHandler.ticksInGame + f;
|
||||
if(!rotate)
|
||||
time = -1;
|
||||
|
||||
model.render(this, time);
|
||||
GlStateManager.enableRescaleNormal();
|
||||
|
||||
@@ -23,25 +23,22 @@ import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.model.FloatingFlowerModel;
|
||||
import vazkii.botania.client.model.ModelMiniIsland;
|
||||
import vazkii.botania.api.item.IFloatingFlower;
|
||||
|
||||
public class RenderTileFloatingFlower extends TileEntitySpecialRenderer {
|
||||
|
||||
private static final ModelMiniIsland model = new ModelMiniIsland();
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double d0, double d1, double d2, float t, int digProgress) {
|
||||
if (tile != null && tile.getWorld() != null && !tile.getWorld().isBlockLoaded(tile.getPos(), false)) {
|
||||
return;
|
||||
}
|
||||
if (tile != null)
|
||||
if (!tile.getWorld().isBlockLoaded(tile.getPos(), false))
|
||||
return;
|
||||
|
||||
|
||||
BlockRendererDispatcher brd = Minecraft.getMinecraft().getBlockRendererDispatcher();
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
GlStateManager.translate(d0, d1, d2);
|
||||
|
||||
double worldTime = tile.getWorld() == null ? 0 : (double) (ClientTickHandler.ticksInGame + t);
|
||||
double worldTime = (double) (ClientTickHandler.ticksInGame + t);
|
||||
if(tile.getWorld() != null)
|
||||
worldTime += new Random(tile.getPos().hashCode()).nextInt(1000);
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.TileIncensePlate;
|
||||
|
||||
import java.util.Map;
|
||||
@@ -31,9 +32,9 @@ public class RenderTileIncensePlate extends TileEntitySpecialRenderer<TileIncens
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void renderTileEntityAt(TileIncensePlate plate, double d0, double d1, double d2, float ticks, int digProgress) {
|
||||
if (plate != null && plate.getWorld() != null && !plate.getWorld().isBlockLoaded(plate.getPos(), false)) {
|
||||
if(!plate.getWorld().isBlockLoaded(plate.getPos(), false)
|
||||
|| plate.getWorld().getBlockState(plate.getPos()).getBlock() != ModBlocks.incensePlate)
|
||||
return;
|
||||
}
|
||||
|
||||
EnumFacing facing = plate.getWorld().getBlockState(plate.getPos()).getValue(BotaniaStateProps.CARDINALS);
|
||||
|
||||
|
||||
@@ -20,21 +20,27 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.LuminizerVariant;
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.core.handler.MiscellaneousIcons;
|
||||
import vazkii.botania.client.core.helper.ShaderHelper;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.TileLightRelay;
|
||||
|
||||
public class RenderTileLightRelay extends TileEntitySpecialRenderer<TileLightRelay> {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileLightRelay tile, double x, double y, double z, float pticks, int digProgress) {
|
||||
if (tile != null && tile.getWorld() != null && !tile.getWorld().isBlockLoaded(tile.getPos(), false)) {
|
||||
if(!tile.getWorld().isBlockLoaded(tile.getPos(), false)
|
||||
|| tile.getWorld().getBlockState(tile.getPos()).getBlock() != ModBlocks.lightRelay)
|
||||
return;
|
||||
}
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
TextureAtlasSprite iicon = tile.getBlockMetadata() > 0 ? MiscellaneousIcons.INSTANCE.lightRelayWorldIconRed : MiscellaneousIcons.INSTANCE.lightRelayWorldIcon;
|
||||
TextureAtlasSprite iicon = tile.getWorld().getBlockState(tile.getPos())
|
||||
.getValue(BotaniaStateProps.LUMINIZER_VARIANT) == LuminizerVariant.DEFAULT
|
||||
? MiscellaneousIcons.INSTANCE.lightRelayWorldIcon
|
||||
: MiscellaneousIcons.INSTANCE.lightRelayWorldIconRed;
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate(x + 0.5, y + 0.3, z + 0.5);
|
||||
|
||||
@@ -45,9 +45,9 @@ public class RenderTilePool extends TileEntitySpecialRenderer<TilePool> {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TilePool pool, double d0, double d1, double d2, float f, int digProgress) {
|
||||
if (pool != null && pool.getWorld() != null && !pool.getWorld().isBlockLoaded(pool.getPos(), false)) {
|
||||
if(pool != null && (!pool.getWorld().isBlockLoaded(pool.getPos(), false)
|
||||
|| pool.getWorld().getBlockState(pool.getPos()).getBlock() != ModBlocks.pool))
|
||||
return;
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableBlend();
|
||||
|
||||
@@ -19,6 +19,7 @@ import net.minecraft.util.ResourceLocation;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelPump;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.mana.TilePump;
|
||||
|
||||
public class RenderTilePump extends TileEntitySpecialRenderer<TilePump> {
|
||||
@@ -32,9 +33,9 @@ public class RenderTilePump extends TileEntitySpecialRenderer<TilePump> {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TilePump pump, double d0, double d1, double d2, float f, int digProgress) {
|
||||
if (pump != null && pump.getWorld() != null && !pump.getWorld().isBlockLoaded(pump.getPos(), false)) {
|
||||
if(!pump.getWorld().isBlockLoaded(pump.getPos(), false)
|
||||
|| pump.getWorld().getBlockState(pump.getPos()).getBlock() != ModBlocks.pump)
|
||||
return;
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
@@ -42,12 +43,12 @@ public class RenderTilePump extends TileEntitySpecialRenderer<TilePump> {
|
||||
GlStateManager.translate(d0, d1, d2);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
EnumFacing facing = pump != null && pump.getWorld() != null ? pump.getWorld().getBlockState(pump.getPos()).getValue(BotaniaStateProps.CARDINALS) : EnumFacing.SOUTH;
|
||||
EnumFacing facing = pump.getWorld() != null ? pump.getWorld().getBlockState(pump.getPos()).getValue(BotaniaStateProps.CARDINALS) : EnumFacing.SOUTH;
|
||||
|
||||
GlStateManager.translate(0.5F, 0.5F, 0.5F);
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
GlStateManager.rotate(ROTATIONS[Math.max(Math.min(ROTATIONS.length - 1, facing.getIndex() - 2), 0)], 0F, 1F, 0F);
|
||||
model.render(Math.max(0F, Math.min(8F, pump == null ? 8 : pump.innerRingPos + pump.moving * f)));
|
||||
model.render(Math.max(0F, Math.min(8F, pump.innerRingPos + pump.moving * f)));
|
||||
GlStateManager.color(1F, 1F, 1F);
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
GlStateManager.enableRescaleNormal();
|
||||
|
||||
@@ -51,9 +51,9 @@ public class RenderTilePylon extends TileEntitySpecialRenderer<TilePylon> {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TilePylon pylon, double d0, double d1, double d2, float pticks, int digProgress) {
|
||||
if (pylon != null && pylon.getWorld() != null && !pylon.getWorld().isBlockLoaded(pylon.getPos(), false)) {
|
||||
if(!pylon.getWorld().isBlockLoaded(pylon.getPos(), false)
|
||||
|| pylon.getWorld().getBlockState(pylon.getPos()).getBlock() != ModBlocks.pylon)
|
||||
return;
|
||||
}
|
||||
|
||||
if(model == null)
|
||||
model = ConfigHandler.oldPylonModel ? new ModelPylonOld() : new ModelPylon();
|
||||
|
||||
@@ -30,6 +30,7 @@ import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.core.proxy.ClientProxy;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelSpreader;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.mana.TileSpreader;
|
||||
|
||||
public class RenderTileSpreader extends TileEntitySpecialRenderer<TileSpreader> {
|
||||
@@ -46,9 +47,9 @@ public class RenderTileSpreader extends TileEntitySpecialRenderer<TileSpreader>
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileSpreader spreader, double d0, double d1, double d2, float ticks, int digProgress) {
|
||||
if (spreader != null && spreader.getWorld() != null && !spreader.getWorld().isBlockLoaded(spreader.getPos(), false)) {
|
||||
if(!spreader.getWorld().isBlockLoaded(spreader.getPos(), false)
|
||||
|| spreader.getWorld().getBlockState(spreader.getPos()).getBlock() != ModBlocks.spreader)
|
||||
return;
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
|
||||
@@ -36,6 +36,7 @@ import vazkii.botania.client.core.helper.ShaderHelper;
|
||||
import vazkii.botania.client.core.proxy.ClientProxy;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelTinyPotato;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.TileTinyPotato;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemFlightTiara;
|
||||
@@ -48,9 +49,9 @@ public class RenderTileTinyPotato extends TileEntitySpecialRenderer<TileTinyPota
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileTinyPotato potato, double x, double y, double z, float partialTicks, int destroyStage) {
|
||||
if (potato != null && potato.getWorld() != null && !potato.getWorld().isBlockLoaded(potato.getPos(), false)) {
|
||||
if(!potato.getWorld().isBlockLoaded(potato.getPos(), false)
|
||||
|| potato.getWorld().getBlockState(potato.getPos()).getBlock() != ModBlocks.tinyPotato)
|
||||
return;
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
|
||||
Reference in new issue
Block a user