mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 02:45:13 +00:00
Punt on apothecary. Items first
This commit is contained in:
1 parent
33a8d5e33c
commit
65837fbf38
8 files changed
+42
-63
No files matched your search
@@ -67,7 +67,6 @@ public class BotaniaStateProps {
|
||||
public static final PropertyEnum<AlfPortalState> ALFPORTAL_STATE = PropertyEnum.create("state", AlfPortalState.class);
|
||||
|
||||
// BlockAltar
|
||||
public static final PropertyEnum<AltarLiquidState> ALTAR_LIQUID_STATE = PropertyEnum.create("liquid", AltarLiquidState.class);
|
||||
public static final PropertyEnum<AltarVariant> ALTAR_VARIANT = PropertyEnum.create("variant", AltarVariant.class);
|
||||
public static final PropertyBool MOSSY = PropertyBool.create("mossy");
|
||||
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
package vazkii.botania.api.state.enums;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public enum AltarLiquidState implements IStringSerializable {
|
||||
NONE,
|
||||
WATER,
|
||||
LAVA;
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
}
|
||||
@@ -639,7 +639,7 @@ public final class ModelHandler {
|
||||
Item item = Item.getItemFromBlock(ModBlocks.altar);
|
||||
String name = GameData.getBlockRegistry().getNameForObject(ModBlocks.altar).toString();
|
||||
for (int i = 0; i < AltarVariant.values().length; i++) {
|
||||
String variantName = "liquid=none,mossy=false,variant=" + AltarVariant.values()[i].getName();
|
||||
String variantName = "mossy=false,variant=" + AltarVariant.values()[i].getName();
|
||||
ModelLoader.registerItemVariants(item, new ModelResourceLocation(name, variantName));
|
||||
ModelLoader.setCustomModelResourceLocation(item, i, new ModelResourceLocation(name, variantName));
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
@@ -62,11 +64,11 @@ public class RenderTileAltar extends TileEntitySpecialRenderer {
|
||||
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)]);
|
||||
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();
|
||||
model.render();
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
GlStateManager.enableRescaleNormal();
|
||||
|
||||
@@ -130,6 +132,28 @@ public class RenderTileAltar extends TileEntitySpecialRenderer {
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
Fluid fluid = lava ? FluidRegistry.LAVA : FluidRegistry.WATER;
|
||||
int brightness = lava ? 240 : -1;
|
||||
float alpha = lava ? 1F : 0.7F;
|
||||
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GlStateManager.disableAlpha();
|
||||
if(lava)
|
||||
GlStateManager.disableLighting();
|
||||
GlStateManager.color(1F, 1F, 1F, alpha);
|
||||
GlStateManager.translate(w, -0.3F, w);
|
||||
GlStateManager.rotate(90F, 1F, 0F, 0F);
|
||||
GlStateManager.scale(s, s, s);
|
||||
|
||||
renderIcon(0, 0, fluid.getStill(), 16, 16, brightness);
|
||||
if(lava)
|
||||
GlStateManager.enableLighting();
|
||||
GlStateManager.enableAlpha();
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
GlStateManager.popMatrix();
|
||||
@@ -137,11 +161,12 @@ public class RenderTileAltar extends TileEntitySpecialRenderer {
|
||||
forceMeta = -1;
|
||||
}
|
||||
|
||||
public void renderIcon(int par1, int par2, TextureAtlasSprite par3Icon, int par4, int par5, int brightness) {
|
||||
public void renderIcon(int par1, int par2, ResourceLocation loc, int par4, int par5, int brightness) {
|
||||
TextureAtlasSprite par3Icon = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(loc.toString());
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
tessellator.getWorldRenderer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
|
||||
if(brightness != -1)
|
||||
//tessellator.getWorldRenderer().setBrightness(brightness);
|
||||
//if(brightness != -1)
|
||||
//tessellator.getWorldRenderer().putBrightness4(brightness, brightness, brightness, brightness);
|
||||
tessellator.getWorldRenderer().pos(par1 + 0, par2 + par5, 0).tex(par3Icon.getMinU(), par3Icon.getMaxV()).endVertex();
|
||||
tessellator.getWorldRenderer().pos(par1 + par4, par2 + par5, 0).tex(par3Icon.getMaxU(), par3Icon.getMaxV()).endVertex();
|
||||
tessellator.getWorldRenderer().pos(par1 + par4, par2 + 0, 0).tex(par3Icon.getMaxU(), par3Icon.getMinV()).endVertex();
|
||||
|
||||
@@ -28,6 +28,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumWorldBlockLayer;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
@@ -39,7 +40,6 @@ import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.AltarLiquidState;
|
||||
import vazkii.botania.api.state.enums.AltarVariant;
|
||||
import vazkii.botania.client.lib.LibRenderIDs;
|
||||
import vazkii.botania.common.Botania;
|
||||
@@ -69,14 +69,13 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
|
||||
|
||||
setDefaultState(blockState.getBaseState()
|
||||
.withProperty(BotaniaStateProps.MOSSY, false)
|
||||
.withProperty(BotaniaStateProps.ALTAR_LIQUID_STATE, AltarLiquidState.NONE)
|
||||
.withProperty(BotaniaStateProps.ALTAR_VARIANT, AltarVariant.DEFAULT)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState createBlockState() {
|
||||
return new BlockState(this, BotaniaStateProps.ALTAR_LIQUID_STATE, BotaniaStateProps.ALTAR_VARIANT, BotaniaStateProps.MOSSY);
|
||||
return new BlockState(this, BotaniaStateProps.ALTAR_VARIANT, BotaniaStateProps.MOSSY);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -97,19 +96,19 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
|
||||
TileEntity te = worldIn.getTileEntity(pos);
|
||||
if (te instanceof TileAltar) {
|
||||
TileAltar altar = ((TileAltar) te);
|
||||
|
||||
if (altar.isMossy) {
|
||||
state = state.withProperty(BotaniaStateProps.MOSSY, true);
|
||||
}
|
||||
if (altar.hasLava()) {
|
||||
state = state.withProperty(BotaniaStateProps.ALTAR_LIQUID_STATE, AltarLiquidState.LAVA);
|
||||
}
|
||||
if (altar.hasWater()) {
|
||||
state = state.withProperty(BotaniaStateProps.ALTAR_LIQUID_STATE, AltarLiquidState.WATER);
|
||||
}
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldRegisterInNameSet() {
|
||||
return false;
|
||||
@@ -171,6 +170,7 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
|
||||
|
||||
tile.setWater(true);
|
||||
par1World.updateComparatorOutputLevel(pos, this);
|
||||
par1World.checkLight(pos);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -181,6 +181,7 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
|
||||
tile.setLava(true);
|
||||
tile.setWater(false);
|
||||
par1World.updateComparatorOutputLevel(pos, this);
|
||||
par1World.checkLight(pos);
|
||||
|
||||
return true;
|
||||
} else if(stack != null && stack.getItem() == Items.bucket && (tile.hasWater || tile.hasLava) && !Botania.gardenOfGlassLoaded) {
|
||||
@@ -197,6 +198,7 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
|
||||
tile.setLava(false);
|
||||
else tile.setWater(false);
|
||||
par1World.updateComparatorOutputLevel(pos, this);
|
||||
par1World.checkLight(pos);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user