Everything posted by 61352151511
-
[1.8] Can't get block to render in inventory
That somewhat helps, I didn't have models/item/connected_polished_granite Now I have that and the log doesn't say "Model definition for location unnamed:connected_polished_granite#inventory not found", however the texture for dropped, first, and third person is still null. Here's the item json file [spoiler=assets/unnamed/models/item/connected_polished_granite.json] { "parent": "unnamed:block/cpg", "display": { "thirdperson": { "rotation": [ -90, 0, 0 ], "translation": [ 0, 1, -3 ], "scale": [ 0.55, 0.55, 0.55 ] }, "firstperson": { "rotation": [ 0, -135, 25 ], "translation": [ 0, 4, 2 ], "scale": [ 1.7, 1.7, 1.7 ] } } } and the block model [spoiler=assets/unnamed/models/block/cpg.json] { "parent": "block/cube", "textures": { "up": "unnamed:blocks/cpg", "down": "unnamed:blocks/cpg", "north": "unnamed:blocks/cpg", "east": "unnamed:blocks/cpg", "south": "unnamed:blocks/cpg", "west": "unnamed:blocks/cpg", "particle": "unnamed:blocks/cpg" } }
-
[1.8] Can't get block to render in inventory
So I know the answer is pretty much all over the place by now, however no matter where I look I just can't get it to work. Here's my code [spoiler=ModBlocks] public class ModBlocks { public static final BlockConnected connected_polished_granite = new BlockConnectedPolishedGranite(); public static final BlockConnected connected_polished_andesite = new BlockConnectedPolishedAndesite(); public static final BlockConnected connected_polished_diorite = new BlockConnectedPolishedDiorite(); public static void init() { GameRegistry.registerBlock(connected_polished_granite, "connected_polished_granite"); GameRegistry.registerBlock(connected_polished_andesite, "connected_polished_andesite"); GameRegistry.registerBlock(connected_polished_diorite, "connected_polished_diorite"); if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) { ItemModelMesher mesher = Minecraft.getMinecraft().getRenderItem().getItemModelMesher(); String id = Reference.MOD_ID.toLowerCase(); mesher.register(GameRegistry.findItem(id, "connected_polished_granite"), 0, new ModelResourceLocation(id + ":cpg", "inventory")); mesher.register(GameRegistry.findItem(id, "connected_polished_andesite"), 0, new ModelResourceLocation(id + ":cpa", "inventory")); mesher.register(GameRegistry.findItem(id, "connected_polished_diorite"), 0, new ModelResourceLocation(id + ":cpd", "inventory")); } } } That class is run in the FMLInitializationEvent, the blocks register fine and render fine when placed. It's just the part where they don't render in the inventory, so if I could get like very clear instructions on what I need to fix it, I would really appreciate it. I know one person had an issue where it wouldn't render in his inventory/hand and someone cloned the github repo and it worked fine for me, so it might just be an issue on my end for some reason, but I've got no clue.
-
[1.8] Don't know how to convert <blockstatedata> back into data...
Ok that fixed that however now the textures don't work. For now I only have a texture for a block connected to nothing, here's the code [spoiler=BlockConnected] package com.zalthonethree.unnamed.block; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.IBlockAccess; import com.zalthonethree.unnamed.Reference; import com.zalthonethree.unnamed.client.CreativeTab; public class BlockConnected extends Block { protected BlockConnected(Material materialIn) { super(materialIn); } public static final PropertyBool UP = PropertyBool.create("up"); public static final PropertyBool DOWN = PropertyBool.create("down"); public static final PropertyBool NORTH = PropertyBool.create("north"); public static final PropertyBool EAST = PropertyBool.create("east"); public static final PropertyBool SOUTH = PropertyBool.create("south"); public static final PropertyBool WEST = PropertyBool.create("west"); public BlockConnected() { this(Material.rock); this.setDefaultState(this.blockState.getBaseState() .withProperty(UP, false) .withProperty(DOWN, false) .withProperty(NORTH, false) .withProperty(EAST, false) .withProperty(SOUTH, false) .withProperty(WEST, false) ); this.setCreativeTab(CreativeTab.unNamed); } public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) { return state.withProperty(UP, canTextureConnect(worldIn, pos, EnumFacing.UP)) .withProperty(DOWN, canTextureConnect(worldIn, pos, EnumFacing.DOWN)) .withProperty(NORTH, canTextureConnect(worldIn, pos, EnumFacing.NORTH)) .withProperty(EAST, canTextureConnect(worldIn, pos, EnumFacing.EAST)) .withProperty(SOUTH, canTextureConnect(worldIn, pos, EnumFacing.SOUTH)) .withProperty(WEST, canTextureConnect(worldIn, pos, EnumFacing.WEST)); } public int getMetaFromState(IBlockState state) { return 0; } public IBlockState getStateFromMeta(int meta) { return this.getDefaultState(); } private boolean canTextureConnect(IBlockAccess worldIn, BlockPos origin, EnumFacing side) { BlockPos off = origin.offset(side); Block block = worldIn.getBlockState(off).getBlock(); return block == this; } protected BlockState createBlockState() { return new BlockState(this, new IProperty[] {UP, DOWN, NORTH, EAST, WEST, SOUTH}); } @Override public String getUnlocalizedName() { return String.format("tile.%s%s", Reference.RESOURCE_PREFIX, getUnwrappedUnlocalizedName(super.getUnlocalizedName())); } protected String getUnwrappedUnlocalizedName(String unlocalizedName) { return unlocalizedName.substring(unlocalizedName.indexOf(".") + 1); } } [spoiler=BlockConnectedPolishedGranite] package com.zalthonethree.unnamed.block; public class BlockConnectedPolishedGranite extends BlockConnected { public BlockConnectedPolishedGranite() { super(); this.setUnlocalizedName("connected_polished_granite"); } } [spoiler=assets/unnamed/blockstates/connected_polished_granite.json] { "variants": { "down=true,east=true,north=true,south=true,up=true,west=true": { "model": "c_p_g_udnesw"}, "down=false,east=false,north=false,south=false,up=false,west=false": { "model": "c_p_g"} } } [spoiler=c_p_g] { "parent": "block/cube_all", "textures": { "all": "unnamed:blocks/c_p_g" } } and the texture does exist in assets/unnamed/textures/blocks/c_p_g Edit: Fixed by putting modid:model instead of just model
-
[1.8] Don't know how to convert <blockstatedata> back into data...
[spoiler=BlockConnected] package com.zalthonethree.unnamed.block; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.IBlockAccess; import com.zalthonethree.unnamed.Reference; import com.zalthonethree.unnamed.client.CreativeTab; public class BlockConnected extends Block { protected BlockConnected(Material materialIn) { super(materialIn); } public static final PropertyBool UP = PropertyBool.create("up"); public static final PropertyBool DOWN = PropertyBool.create("down"); public static final PropertyBool NORTH = PropertyBool.create("north"); public static final PropertyBool EAST = PropertyBool.create("east"); public static final PropertyBool SOUTH = PropertyBool.create("south"); public static final PropertyBool WEST = PropertyBool.create("west"); public BlockConnected() { this(Material.rock); this.setDefaultState(this.blockState.getBaseState() .withProperty(UP, false) .withProperty(DOWN, false) .withProperty(NORTH, false) .withProperty(EAST, false) .withProperty(SOUTH, false) .withProperty(WEST, false) ); this.setCreativeTab(CreativeTab.unNamed); } public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) { return state.withProperty(UP, true) .withProperty(DOWN, true) .withProperty(NORTH, true) .withProperty(EAST, true) .withProperty(SOUTH, true) .withProperty(WEST, true); } private boolean canTextureConnect(IBlockAccess worldIn, BlockPos origin, EnumFacing side) { BlockPos off = origin.offset(side); Block block = worldIn.getBlockState(off).getBlock(); return block == this; } protected BlockState createBlockState() { return new BlockState(this, new IProperty[] {UP, DOWN, NORTH, EAST, WEST, SOUTH}); } @Override public String getUnlocalizedName() { return String.format("tile.%s%s", Reference.RESOURCE_PREFIX, getUnwrappedUnlocalizedName(super.getUnlocalizedName())); } protected String getUnwrappedUnlocalizedName(String unlocalizedName) { return unlocalizedName.substring(unlocalizedName.indexOf(".") + 1); } } [spoiler=BlockConnectedPolishedGranite] public class BlockConnectedPolishedGranite extends BlockConnected { public BlockConnectedPolishedGranite() { super(); this.setUnlocalizedName("connected_polished_granite"); } }
-
[1.8] Don't know how to convert <blockstatedata> back into data...
Trying to make a block that will have connected textures in 1.8, I took a look at the glass panes models, block state data, and code. When trying to launch I get net.minecraftforge.fml.common.LoaderException: java.lang.IllegalArgumentException: Don't know how to convert unnamed:connected_polished_granite[down=true,east=true,north=true,south=true,up=true,west=true] back into data... I do have a blockstate file for connected_polished_granite in assets/unnamed/blockstates I do have model files for it as well. No idea why I'm getting the error if anyone knows, please let me know.
-
How Minecraft 1.8 works
Is there anything, or will there be anything, on connected models (connected textures) for 1.8?
-
Command prompt closes upon gradle task finishing (Automation question)
Thanks Now would you know how I can have a build.properties in the main directory and all the build.gradles can pull the forge version and mappings from there. I tried looking at https://github.com/SlimeKnights/TinkersConstruct/blob/master/build.gradle and copied these lines ext.configFile = file "C:/Users/Mitch/Central Storage/eclipseworkspace/build.properties" configFile.withReader { def prop = new Properties() prop.load(it) project.ext.config = new ConfigSlurper().parse prop } However now when running gradle (Testing with gradle tasks) I get FAILURE: Build failed with an exception. * Where: Build file 'C:\Users\Mitch\Central Storage\eclipseworkspace\Durability Show 1.8\build.gradle' line: 28 * What went wrong: A problem occurred evaluating root project 'Durability Show 1.8'. > [Ljava/util/HashMap$Entry; BUILD FAILED Total time: 9.735 secs Where line 28 is project.ext.config = new ConfigSlurper().parse prop Any idea?
-
Command prompt closes upon gradle task finishing (Automation question)
I'm trying to make a quick way for me to be able to update forge for all my 1.8 mods. I'm using a .cmd file ran from the directory where I store all my projects. cd Durability Show 1.8 gradle clean setupDecompWorkspace eclipse build cd ../Random Utilities 1.8 gradle clean setupDecompWorkspace eclipse build pause I have more projects than this however that's the gist. After the first gradle line finishes (After durability show builds) the command prompt closes. I have no idea why this happens, it's always whenever I try to run any command after gradle, typing them manually works fine but in the automated file it refuses to work. Any idea how this can be fixed?
-
Help with Forge Modded Server
Morph{0.9.1} [Morph] (Morph-Beta-0.9.1.jar) Unloaded Morph requires iChunUtil
-
Forge Modded Server Crashes on Start
You have mods installed that require other mods to be installed. In this case I believe your issue is you have Thermal Expansion which requires Thermal Foundation. Here's a link to the "Core-Mods" page for TeamCOFH mods http://teamcofh.com/core-mods/
-
[1.8][Solved] Crash on loading.
[12:24:47] [main/ERROR] [LaunchWrapper]: Unable to launch java.lang.ClassNotFoundException: cpw.mods.fml.common.launcher.FMLTweaker In 1.8, the tweakClass as well as everything else to do with cpw.mods was changed to net.minecraftforge, that was your problem is upon launch you never changed the tweak class
-
[1.8] Manipulate villager trades on custom villagers.
In 1.7.10 to register a custom villager with a custom trade system it was as simple as. VillagerRegistry.instance().registerVillagerId(ConfigurationHandler.getVillagerID()); VillagerRegistry.instance().registerVillagerSkin(ConfigurationHandler.getVillagerID(), new ResourceLocation(Reference.MOD_ID.toLowerCase(), "textures/entity/medic.png")); // ClientProxy VillagerRegistry.instance().registerVillageTradeHandler(ConfigurationHandler.getVillagerID(), new MedicVillagerTradeHandler()); //Where MedicVilalgerTradeHandler implements IVillageTradeHandler However in 1.8 IVillageTradeHandler is gone, registerVillageTradeHandler is also gone, I've gotten to the point where I have code like this. VillagerRegistry.instance().registerVillagerId(ConfigurationHandler.getVillagerID()); VillagerRegistry.instance().registerVillagerSkin(ConfigurationHandler.getVillagerID(), new ResourceLocation(Reference.MOD_ID.toLowerCase(), "textures/entity/medic.png")); // ClientProxy VillagerProfession prof = new VillagerProfession("zombieinfection:medic", "zombieinfection:textures/entity/medic.png"); VillagerRegistry.instance().register(prof); (new VillagerCareer(prof, "Medic")).init(); Is what appears to be the trades, the argument passed is EntityVillager.ITradeList[][] I'm not sure how this would look like and how I would create my own to pass as an argument. Any help would be great.
-
[1.8] Get who/what the player is spectating client sided.
In EntityPlayerMP There's a method .getSpectatingEntity() to get the entity the player is spectating, my problem is that I need to get that on the client side (From minecraftInstance.thePlayer) which is EntityPlayerSP, I can't find a method for it anywhere and when trying to cast EntityPlayerSP to EntityPlayerMP you can't, I can however cast EntityPlayerSP to EntityPlayer, then EntityPlayer to EntityPlayerMP, however for some reason in-game (Doesn't show it in eclipse) It thinks I'm casting EntityPlayerSP to EntityPlayerMP and crashes. So anyone know how to get what the player is spectating from the client side?
-
[1.7.10] Prevent block placement above a certain block?
I don't know how to word the title correctly. Basically I have a block with the dimensions being 16x26x13 When you look at it the bounding box is the correct size, however that's only when you look in the default 16x16x16 area. If you look at it at the upper part the bounding box is not there. That's one problem I'd like help solving. The second part is that you can still place other blocks in the position above it, so only the top 6 pixels of that block will be visible. I want to prevent blocks from being placed one block above it so technically the block added will take up 1x2x1 blocks. If anyone knows how to solve either of these issues I'd appreciate the help.
-
[1.8] onItemUseFinish called twice?
That makes sense. Should have looked harder, however what I can't figure out is why the hunger is being overfilled then... I'll have to check that out, thanks for pointing that out.
-
[1.8] onItemUseFinish called twice?
In 1.7 I had an item called "Lunchbox" which you could put in a crafting table with food items to fill up. You could then "eat" the lunchbox in order to take some food stored from it. In my item class the onEaten method from Item was overridden, in 1.8 however the onFoodEaten method is in the ItemFood class so I decided to switch to onItemUseFinish (Changing to extending ItemFood would cause more problems for me) This is the method I have @Override public ItemStack onItemUseFinish(ItemStack stack, World world, EntityPlayer player) { int PlayerFood = player.getFoodStats().getFoodLevel(); if (PlayerFood < 20) { float StoredFoodA = 0F; if (stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); } try { StoredFoodA = stack.getTagCompound().getFloat("Food_Stored"); } catch (NullPointerException e) { StoredFoodA = 0F; } int StoredFood = (int) Math.floor(StoredFoodA); int FoodToGive = 20 - PlayerFood; LogHelper.warn("*****"); LogHelper.warn(StoredFood + "Food Stored"); LogHelper.warn(FoodToGive + "FTG"); if (FoodToGive > StoredFood) { LogHelper.warn("Exceeds stored food"); FoodToGive = StoredFood; LogHelper.warn(FoodToGive + "FTG"); } LogHelper.warn("*****"); player.getFoodStats().addStats(PlayerFood + FoodToGive, FoodToGive > 0 ? 20F : 0F); stack.getTagCompound().setFloat("Food_Stored", StoredFood - FoodToGive); } return stack; } In the console this is spit out after "eating" once [08:17:54] [server thread/WARN] [RandomUtilities]: ***** [08:17:54] [server thread/WARN] [RandomUtilities]: 12Food Stored [08:17:54] [server thread/WARN] [RandomUtilities]: 20FTG [08:17:54] [server thread/WARN] [RandomUtilities]: Exceeds stored food [08:17:54] [server thread/WARN] [RandomUtilities]: 12FTG [08:17:54] [server thread/WARN] [RandomUtilities]: ***** [08:17:54] [Client thread/WARN] [RandomUtilities]: ***** [08:17:54] [Client thread/WARN] [RandomUtilities]: 12Food Stored [08:17:54] [Client thread/WARN] [RandomUtilities]: 20FTG [08:17:54] [Client thread/WARN] [RandomUtilities]: Exceeds stored food [08:17:54] [Client thread/WARN] [RandomUtilities]: 12FTG [08:17:54] [Client thread/WARN] [RandomUtilities]: ***** Any help appreciated
-
[1.8] Check if player is Op?
Thank you!
-
[1.8] Check if player is Op?
In 1.7.10 I could check if a player was op by using ConfigHandler.func_152596_g(((EntityPlayerMP) player).getGameProfile()); However this changed in 1.8 and I can't seem to find a way to check if a player is op. Op meaning they are either op on a multiplayer server or the host of a lan server or on singleplayer with cheats (That function covered all of them) If anyone knows what the method changed to please let me know.
-
[1.7.10][Client thread/ERROR]:Couldn't render entity [CLOSED]
ok so looking at something from my code I have MinecraftInstance.renderEngine.bindTexture(new ResourceLocation("randomutilities", "textures/gui/lunchbox.png")); So you should try something like private static final ResourceLocation EntityTexture = new ResourceLocation("mineplusalpha", "textures/entity/DogTextureMap.png");
-
[1.7.10][Client thread/ERROR]:Couldn't render entity [CLOSED]
I'm not saying you reference anything wrongly, I'm saying instead of returning the entitytexture in the getEntityTexture method you're returning null (Nothing) which would cause an error. Simply replace "return null;" with "return EntityTexture;"
-
[1.7.10][Client thread/ERROR]:Couldn't render entity [CLOSED]
Not 100% sure if this is completely the problem but at least TRY before posting. @Override protected ResourceLocation getEntityTexture(Entity entity) { // TODO Auto-generated method stub return null; } You're returning nothing for the entity texture, at the top you have a variable called EntityTexture so just return that instead of null
-
RenderGameOverlayEvent help?
Thanks for your help so far, one last question (I hope) Now that I'm using RenderGameOverlayEvent.Post instead of the food textures being messed with, the bubble textures are messed up instead. There's an image below of what I mean. Here's the method part of the code, the complete code is provided underneath. @SubscribeEvent(priority = EventPriority.NORMAL) public void onRenderExperienceBar(RenderGameOverlayEvent.Post event) { if (event.isCanceled() || event.type != ElementType.FOOD || !hasLunchbox() || !ConfigurationHandler.getLunchboxOnScreen()) { return; } GL11.glColor4f(1F, 1F, 1F, 1F); GL11.glDisable(GL11.GL_LIGHTING); MinecraftInstance.renderEngine.bindTexture(new ResourceLocation("snapshot", "textures/gui/lunchbox.png")); ScaledResolution Scaled = new ScaledResolution(MinecraftInstance, MinecraftInstance.displayWidth, MinecraftInstance.displayHeight); int Food = getFoodStored(); int Difference = 5 * (String.valueOf(Food).length()) + 4; int Width = Scaled.getScaledWidth() - Difference - 32; int Height = Scaled.getScaledHeight() - 32; drawNonStandardTexturedRect(Width, Height, 0, 0, 32, 32, 32, 32); MinecraftInstance.fontRenderer.drawString(String.valueOf(Food), Width + 32, Height + 16, 0); } protected void drawNonStandardTexturedRect(int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight) { double f = 1F / (double) textureWidth; double f1 = 1F / (double) textureHeight; Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertexWithUV(x, y + height, 0, u * f, (v + height) * f1); tessellator.addVertexWithUV(x + width, y + height, 0, (u + width) * f, (v + height) * f1); tessellator.addVertexWithUV(x + width, y, 0, (u + width) * f, v * f1); tessellator.addVertexWithUV(x, y, 0, u * f, v * f1); tessellator.draw(); } package com.sixonethree.snapshot.client.gui; import java.util.ArrayList; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.Tessellator; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; import org.lwjgl.opengl.GL11; import com.sixonethree.snapshot.handler.ConfigurationHandler; import com.sixonethree.snapshot.item.ItemLunchbox; import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class GuiLunchbox extends Gui { private Minecraft MinecraftInstance; public GuiLunchbox(Minecraft MC) { super(); MinecraftInstance = MC; } public ItemStack[] getLocalInventory() { ItemStack[] Items = MinecraftInstance.thePlayer.inventory.mainInventory; return Items; } public boolean hasLunchbox() { ItemStack[] Items = getLocalInventory(); for (ItemStack is : Items) { if (is != null) { if (is.getItem() != null) { if (is.getItem() instanceof ItemLunchbox) { return true; } } } } return false; } public ItemStack[] getLunchboxes() { ArrayList<ItemStack> Primitive = new ArrayList<ItemStack>(); if (hasLunchbox()) { ItemStack[] Inventory = getLocalInventory(); for (ItemStack Stack : Inventory) { if (Stack != null) { if (Stack.getItem() != null) { if (Stack.getItem() instanceof ItemLunchbox) { Primitive.add(Stack); } } } } } ItemStack[] Lunchboxes = new ItemStack[Primitive.size()]; int Cur = 0; for (ItemStack Stack : Primitive) { Lunchboxes[Cur] = Stack; Cur ++; } return Lunchboxes; } public int getFoodStored() { int Stored = 0; if (hasLunchbox()) { for (ItemStack Lunchbox : getLunchboxes()) { if (Lunchbox.getTagCompound() != null) { float ThisStored = 0F; try { ThisStored = Lunchbox.getTagCompound().getFloat("Food_Stored"); } catch (NullPointerException e) { ThisStored = 0F; } Stored = Stored + (int) (ThisStored / 2); } } } return Stored; } @SubscribeEvent(priority = EventPriority.NORMAL) public void onRenderExperienceBar(RenderGameOverlayEvent.Post event) { if (event.isCanceled() || event.type != ElementType.FOOD || !hasLunchbox() || !ConfigurationHandler.getLunchboxOnScreen()) { return; } GL11.glColor4f(1F, 1F, 1F, 1F); GL11.glDisable(GL11.GL_LIGHTING); MinecraftInstance.renderEngine.bindTexture(new ResourceLocation("snapshot", "textures/gui/lunchbox.png")); ScaledResolution Scaled = new ScaledResolution(MinecraftInstance, MinecraftInstance.displayWidth, MinecraftInstance.displayHeight); int Food = getFoodStored(); int Difference = 5 * (String.valueOf(Food).length()) + 4; int Width = Scaled.getScaledWidth() - Difference - 32; int Height = Scaled.getScaledHeight() - 32; drawNonStandardTexturedRect(Width, Height, 0, 0, 32, 32, 32, 32); MinecraftInstance.fontRenderer.drawString(String.valueOf(Food), Width + 32, Height + 16, 0); } protected void drawNonStandardTexturedRect(int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight) { double f = 1F / (double) textureWidth; double f1 = 1F / (double) textureHeight; Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertexWithUV(x, y + height, 0, u * f, (v + height) * f1); tessellator.addVertexWithUV(x + width, y + height, 0, (u + width) * f, (v + height) * f1); tessellator.addVertexWithUV(x + width, y, 0, (u + width) * f, v * f1); tessellator.addVertexWithUV(x, y, 0, u * f, v * f1); tessellator.draw(); } }
-
[1.7.10] Loading other mods in eclipse
I believe you're able to test your mod with other mods by using codechickencore. See the "For Mod Developers" section on chicken bones thread. http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1279956-chickenbones-mods
-
RenderGameOverlayEvent help?
Thanks to both of you, I'm now using int w = MinecraftInstance.displayWidth / 2; int h = MinecraftInstance.displayHeight / 2; drawNonStandardTexturedRect(w - 32, h - 32, 0, 0, 32, 32, 32, 32); To try and get it to draw in the bottom right of the screen, however this only works when the screen is certain sizes for some reason. If I'm in full screen it seems to be drawing it off the screen for some reason. The width and height are being divided by 2, I don't know why but that makes it work when the window is half the screen size. If you know what parameters I should use for getting it to draw in the bottom right I would appreciate it.
-
RenderGameOverlayEvent help?
Hi, I'm trying to make it so that my picture of a lunchbox is rendered on the screen whenever you have one in your inventory. First I want to make it render on the screen any time so I know it works, however following this tutorial (http://www.minecraftforge.net/wiki/Gui_Overlay) with minor edits to make it work with 1.7.10 just makes it render oddly... Here is the code I ended up with in the end. package com.sixonethree.snapshot.client.gui; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; import org.lwjgl.opengl.GL11; import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class GuiLunchbox extends Gui { private Minecraft MinecraftInstance; public GuiLunchbox(Minecraft MC) { super(); MinecraftInstance = MC; } @SubscribeEvent(priority = EventPriority.NORMAL) public void onRenderExperienceBar(RenderGameOverlayEvent event) { if (event.isCanceled() || event.type != ElementType.FOOD) { return; } int xPos = 0; int yPos = 0; GL11.glColor4f(1F, 1F, 1F, 1F); GL11.glDisable(GL11.GL_LIGHTING); MinecraftInstance.renderEngine.bindTexture(new ResourceLocation("snapshot", "textures/gui/lunchbox.png")); drawTexturedModalRect(xPos, yPos, 0, 0, 32, 32); } } Here are some pictures of what happens, Picture 1 is the lunchbox texture (src/main/resources/assets/snapshot/textures/gui/lunchbox.png), Picture 2 is what happens using the code above. Picture 3 is what happens when I tweak drawTexturedModalRect(xPos, yPos, 0, 0, 32, 32); to drawTexturedModalRect(xPos, yPos, 32, 32, 32, 32);. Also if anyone knows why the food bars get affected by this as well I would like that to be fixed
IPS spam blocked by CleanTalk.