mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-15 17:45:10 +00:00
more misc cleaning, remove IModelRegister
This commit is contained in:
1 parent
e7f953881e
commit
c7913430a4
10 files changed
+21
-41
No files matched your search
@@ -11,16 +11,14 @@
|
||||
package vazkii.botania.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraftforge.common.config.ConfigElement;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.fml.client.config.GuiConfig;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
public class GuiBotaniaConfig extends GuiConfig {
|
||||
// todo 1.13
|
||||
public class GuiBotaniaConfig extends /*GuiConfig*/ GuiScreen {
|
||||
|
||||
public GuiBotaniaConfig(GuiScreen parentScreen) {
|
||||
super(parentScreen, new ConfigElement(ConfigHandler.config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(), LibMisc.MOD_ID, false, false, GuiConfig.getAbridgedConfigPath(ConfigHandler.config.toString()));
|
||||
// super(parentScreen, new ConfigElement(ConfigHandler.config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(), LibMisc.MOD_ID, false, false, GuiConfig.getAbridgedConfigPath(ConfigHandler.config.toString()));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -120,8 +120,8 @@ public class GuiLexiconChallenge extends GuiLexicon implements IParented {
|
||||
|
||||
private void back() {
|
||||
if(backButton.enabled) {
|
||||
actionPerformed(backButton);
|
||||
backButton.playPressSound(mc.getSoundHandler());
|
||||
backButton.onClick(backButton.x, backButton.y);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -343,6 +343,7 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented {
|
||||
if(button == GLFW.GLFW_MOUSE_BUTTON_LEFT)
|
||||
swiped = false;
|
||||
|
||||
// todo 1.13 might not be needed with focus changes in super?
|
||||
if (searchField.mouseClicked(mouseX, mouseY, button))
|
||||
return true;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ public class GuiButtonOptions extends GuiButtonLexicon {
|
||||
@Override
|
||||
public void onClick(double mouseX, double mouseY) {
|
||||
super.onClick(mouseX, mouseY);
|
||||
Minecraft.getInstance().displayGuiScreen(new GuiBotaniaConfig(lexicon));
|
||||
// todo 1.13 Minecraft.getInstance().displayGuiScreen(new GuiBotaniaConfig(lexicon));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
package vazkii.botania.client.render;
|
||||
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
public interface IModelRegister {
|
||||
/**
|
||||
* Do whatever needs to be done to register models
|
||||
* For Blocks, statemapper registration needs to be done BEFORE itemblock registration
|
||||
* Exceptions to that rule are noted
|
||||
*/
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
void registerModels();
|
||||
}
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
@@ -106,7 +107,6 @@ public class RenderTileAltar extends TileEntityRenderer<TileAltar> {
|
||||
|
||||
|
||||
Minecraft.getInstance().textureManager.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
|
||||
Fluid fluid = lava ? FluidRegistry.LAVA : FluidRegistry.WATER;
|
||||
int brightness = lava ? 240 : -1;
|
||||
float alpha = lava ? 1F : 0.7F;
|
||||
|
||||
@@ -120,7 +120,9 @@ public class RenderTileAltar extends TileEntityRenderer<TileAltar> {
|
||||
GlStateManager.rotatef(90F, 1F, 0F, 0F);
|
||||
GlStateManager.scalef(s, s, s);
|
||||
|
||||
renderIcon(0, 0, fluid.getStill(), 16, 16, brightness);
|
||||
TextureAtlasSprite sprite = lava ? Minecraft.getInstance().getModelManager().getBlockModelShapes().getModel(Blocks.LAVA.getDefaultState()).getParticleTexture()
|
||||
: Minecraft.getInstance().getModelManager().getBlockModelShapes().getModel(Blocks.WATER.getDefaultState()).getParticleTexture();
|
||||
renderIcon(0, 0, sprite, 16, 16, brightness);
|
||||
if(lava)
|
||||
GlStateManager.enableLighting();
|
||||
GlStateManager.enableAlphaTest();
|
||||
@@ -130,16 +132,15 @@ public class RenderTileAltar extends TileEntityRenderer<TileAltar> {
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
public void renderIcon(int par1, int par2, ResourceLocation loc, int par4, int par5, int brightness) {
|
||||
TextureAtlasSprite par3Icon = Minecraft.getInstance().getTextureMap().getAtlasSprite(loc.toString());
|
||||
private void renderIcon(int x, int y, TextureAtlasSprite sprite, int width, int height, int brightness) {
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
|
||||
//if(brightness != -1)
|
||||
//tessellator.getBuffer().putBrightness4(brightness, brightness, brightness, brightness);
|
||||
tessellator.getBuffer().pos(par1 + 0, par2 + par5, 0).tex(par3Icon.getMinU(), par3Icon.getMaxV()).endVertex();
|
||||
tessellator.getBuffer().pos(par1 + par4, par2 + par5, 0).tex(par3Icon.getMaxU(), par3Icon.getMaxV()).endVertex();
|
||||
tessellator.getBuffer().pos(par1 + par4, par2 + 0, 0).tex(par3Icon.getMaxU(), par3Icon.getMinV()).endVertex();
|
||||
tessellator.getBuffer().pos(par1 + 0, par2 + 0, 0).tex(par3Icon.getMinU(), par3Icon.getMinV()).endVertex();
|
||||
tessellator.getBuffer().pos(x + 0, y + height, 0).tex(sprite.getMinU(), sprite.getMaxV()).endVertex();
|
||||
tessellator.getBuffer().pos(x + width, y + height, 0).tex(sprite.getMaxU(), sprite.getMaxV()).endVertex();
|
||||
tessellator.getBuffer().pos(x + width, y + 0, 0).tex(sprite.getMaxU(), sprite.getMinV()).endVertex();
|
||||
tessellator.getBuffer().pos(x + 0, y + 0, 0).tex(sprite.getMinU(), sprite.getMinV()).endVertex();
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
|
||||
@@ -104,9 +104,9 @@ public class RenderTileTinyPotato extends TileEntityRenderer<TileTinyPotato> {
|
||||
|
||||
GlStateManager.translatef(0.5F, 1.5F, 0.5F);
|
||||
GlStateManager.scalef(1F, -1F, -1F);
|
||||
int meta = potato.getWorld() == null ? 3 : potato.getBlockMetadata();
|
||||
int meta = potato.getBlockState().get(BotaniaStateProps.CARDINALS).getHorizontalIndex();
|
||||
float rotY = meta * 90F - 180F;
|
||||
GlStateManager.rotatef(rotY, 0F, 1F, 0F);
|
||||
GlStateManager.rotatef(rotY, 0F, 1F, 0F); // todo 1.13 recheck
|
||||
|
||||
float jump = potato.jumpTicks;
|
||||
if (jump > 0)
|
||||
|
||||
@@ -47,8 +47,8 @@ public class SkyblockSkyRenderer implements IRenderHandler {
|
||||
@Override
|
||||
public void render(float partialTicks, WorldClient world, Minecraft mc) {
|
||||
// Environment setup
|
||||
int glSkyList = mc.renderGlobal.glSkyList;
|
||||
net.minecraft.client.renderer.vertex.VertexBuffer skyVBO = mc.renderGlobal.skyVBO;
|
||||
int glSkyList = mc.worldRenderer.glSkyList;
|
||||
net.minecraft.client.renderer.vertex.VertexBuffer skyVBO = mc.worldRenderer.skyVBO;
|
||||
|
||||
// Begin
|
||||
GlStateManager.disableTexture2D();
|
||||
|
||||
@@ -96,10 +96,4 @@ public class BlockGhostRail extends BlockRailBase implements ILexiconable, IMode
|
||||
public IProperty<RailShape> getShapeProperty() {
|
||||
return BlockStateProperties.RAIL_SHAPE_STRAIGHT;
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void registerModels() {
|
||||
ModelHandler.registerCustomItemblock(this, "ghost_rail");
|
||||
}
|
||||
}
|
||||
@@ -38,7 +38,7 @@ import javax.annotation.Nonnull;
|
||||
import java.util.Random;
|
||||
|
||||
@Optional.Interface(modid = "thaumcraft", iface = "thaumcraft.api.crafting.IInfusionStabiliser", striprefs = true)
|
||||
public class BlockModMushroom extends BlockMushroom implements IInfusionStabiliser, IHornHarvestable, ILexiconable, IModelRegister, ICustomApothecaryColor {
|
||||
public class BlockModMushroom extends BlockMushroom implements IInfusionStabiliser, IHornHarvestable, ILexiconable, ICustomApothecaryColor {
|
||||
|
||||
private static final VoxelShape SHAPE = makeCuboidShape(4.8, 0, 4.8, 12.8, 16, 12.8);
|
||||
private final EnumDyeColor color;
|
||||
@@ -73,7 +73,7 @@ public class BlockModMushroom extends BlockMushroom implements IInfusionStabilis
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void animateTick(IBlockState state, World world, BlockPos pos, Random rand) {
|
||||
int hex = color.getColorValue();
|
||||
int hex = color.colorValue;
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = hex & 0xFF;
|
||||
|
||||
Reference in new issue
Block a user