-
Posts
176 -
Joined
Everything posted by Silly511
-
What do dark colors have to do with this? I have a color switching algorithm that works fine, it's just I can't specify a specific color with ItemTooltipEvent. You can only put EnumChatFormattings on the tooltip, and EnumChatFormatting has RED, GREEN, BLUE, YELLOW, ect. but not a way specify a RGB value. Line 215 in GuiScreen is: font.drawStringWithShadow(s1, j2, k2, -1); Where the very last arrangement in drawStringWithShadow is a RGB value for the color. What I want to replace line 215 with is a if statement that checks if the tooltip has a specific string of characters in it, and if true then do drawStringWithShadow with a ever changing color value, if false then do the normal. Do you know if there is a way to change the RGB value of the tooltip from ItemTooltipEvent?
-
What I want to do is make the tooltip color of a certain item continually change. I know I can use ItemTooltipEvent and put a random EnumChatFormatting at the front of the tooltip, but I want the color to shift from one to the next, not just abruptly change from one to another. Is there another way to do this than replacing code?
-
I need to replace line 215 in GuiScreen with custom code. How can I do this?
-
Ok so what I'm doing is fine. I just thought there might be a more efficient way.
-
Ok so what I'm doing is fine. I just thought there might be a more efficient way.
-
Well thats the problem. I want to check any type of item, not just my own.
-
Well thats the problem. I want to check any type of item, not just my own.
-
I am tring to make it where if an item has a certain NBT tag and is not in the players hand, then delete it. Currently every tick I am iterating though all the items in the players inventory and checking if they have the NBT tag and is not in the main hand. Is there a better way to do this?
-
I am tring to make it where if an item has a certain NBT tag and is not in the players hand, then delete it. Currently every tick I am iterating though all the items in the players inventory and checking if they have the NBT tag and is not in the main hand. Is there a better way to do this?
-
Post your code.
-
I'm trying to make my mod show my optifine cape to people who don't have optifine. However I have this problem: Heres my code: CapeHandler: public class CapeHandler { private static ResourceLocation location = new ResourceLocation("DimCore:cape/Cape"); public static void registerCapeTexture() { URL url = null; try { url = new URL("https://optifine.net/capes/_RadiusOfRift_.png"); } catch (MalformedURLException e) { e.printStackTrace(); } Minecraft.getMinecraft().renderEngine.loadTexture(location, new ThreadDownloadImageData(null, url.toString(), null, new CapeBuffer())); } @SubscribeEvent public void handlerCape(RenderPlayerEvent.Specials.Pre event) { if (event.entityPlayer.getUniqueID().equals(new UUID(you don't need to know my UUID))) { registerCapeTexture(); ((AbstractClientPlayer)event.entityPlayer).func_152121_a(MinecraftProfileTexture.Type.CAPE, location); } } } CapeBuffer: @SideOnly(Side.CLIENT) public class CapeBuffer implements IImageBuffer { @Override public BufferedImage parseUserSkin(BufferedImage texture) { if (texture == null) return null; int imageWidth = texture.getWidth(null) <= 64 ? 64 : texture.getWidth(null); int imageHeight = texture.getHeight(null) <= 32 ? 32 : texture.getHeight(null); BufferedImage capeImage = new BufferedImage(imageWidth, imageHeight, 2); Graphics graphics = capeImage.getGraphics(); graphics.drawImage(texture, 0, 0, null); graphics.dispose(); return capeImage; } @Override public void func_152634_a() {} } Why is my cape white?
-
I think the only thing that changed is you use WorldRender instead of Tessellator. But if your using a model that doesn't change based on tile entity data, then I suggest you use JSON.
-
I have a mod that turns on keepInventory and turns off mobGriefing when you start a world. It works fine, but when my friend(who has vanilla minecraft) tried to join my world he was kicked out with the message 'client brand fml-forge is required'. Why is this happening? Heres my event code: @SubscribeEvent public void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent event) { GameRules gameRules = MinecraftServer.getServer().worldServerForDimension(0).getGameRules(); if (ConfigHandler.KeepInventory == true) { gameRules.setOrCreateGameRule("keepInventory", "true"); event.player.addChatMessage(new ChatComponentTranslation("[KeepingInventory] " + EnumChatFormatting.BLUE + "Your inventory will be kept on death.")); } else if (ConfigHandler.KeepInventory == false) { gameRules.setOrCreateGameRule("keepInventory", "false"); event.player.addChatMessage(new ChatComponentTranslation("[KeepingInventory] " + EnumChatFormatting.BLUE + "Your inventory will not be kept on death.")); } if (ConfigHandler.CreeperExplosions == true) { gameRules.setOrCreateGameRule("mobGriefing", "true"); event.player.addChatMessage(new ChatComponentTranslation("[KeepingInventory] " + EnumChatFormatting.BLUE + "Creepers will destroy blocks.")); } else if (ConfigHandler.CreeperExplosions == false) { gameRules.setOrCreateGameRule("mobGriefing", "false"); event.player.addChatMessage(new ChatComponentTranslation("[KeepingInventory] " + EnumChatFormatting.BLUE + "Creepers will not destroy blocks.")); } }
-
Don't try to make cables. Trust me, they're are really complicated. But if you want to make your brain hurt, then I suggest you can go look at buildcraft or ender io's source code.
-
Try replacing your entityUpdate with this @Override public void updateEntity() { if(this.worldObj.isDaytime()) if(this.worldObj.canBlockSeeTheSky(this.xCoord, this.yCoord + 1, this.zCoord)){ this.storage.receiveEnergy(2, false); this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); } if ((storage.getEnergyStored() > 0)) { for (int i = 0; i < 6; i++){ TileEntity tile = worldObj.getTileEntity(xCoord + ForgeDirection.getOrientation(i).offsetX, yCoord + ForgeDirection.getOrientation(i).offsetY, zCoord + ForgeDirection.getOrientation(i).offsetZ); if (tile != null && tile instanceof IEnergyReceiver) { storage.extractEnergy(((IEnergyReceiver)tile).receiveEnergy(ForgeDirection.getOrientation(i).getOpposite(), storage.extractEnergy(storage.getMaxExtract(), true), false), false); } } } }
-
I think it is producing RF it's just not outputting it. Try adding this to your entityUpdate() method: if ((storage.getEnergyStored() > 0)) { for (int i = 0; i < 6; i++){ TileEntity tile = worldObj.getTileEntity(xCoord + ForgeDirection.getOrientation(i).offsetX, yCoord + ForgeDirection.getOrientation(i).offsetY, zCoord + ForgeDirection.getOrientation(i).offsetZ); if (tile != null && tile instanceof IEnergyReceiver) { storage.extractEnergy(((IEnergyReceiver)tile).receiveEnergy(ForgeDirection.getOrientation(i).getOpposite(), storage.extractEnergy(storage.getMaxExtract(), true), false), false); } } } And adding this to your class: @Override public Packet getDescriptionPacket() { NBTTagCompound tagCompound = new NBTTagCompound(); writeToNBT(tagCompound); return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, tagCompound); } @Override public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { readFromNBT(pkt.func_148857_g()); }
-
What do you mean by 'it doesn't work'?
-
Sorry I was thinking of the RF item class. What you had before is fine.
-
The reason that the constructor didn't work is because you didn't make it extend TileEnergyHandler. Replace your entire class with the code I gave you and then add the inventory stuff.
-
Use this: public class TESolar extends TileEnergyHandler implements IInventory { public TESolar() { super(16, 2, 4); } @Override public boolean canConnectEnergy(ForgeDirection from) { return from != ForgeDirection.UP; } @Override public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) { return 0; } @Override public void updateEntity() { if(this.worldObj.isDaytime()) if(this.worldObj.canBlockSeeTheSky(this.xCoord, this.yCoord + 1, this.zCoord)){ this.receiveEnergy(2, false); } } } You can add the inventory stuff.
-
USE TILENERGYHANDLER AND FORGET THIS MESS! It already has all the methods fill out, so all you need to do is make it add energy if it can see the sky.
-
Ok, how do I load a wavefront model using json? I would prefer not to use a TESR since my block is an ore and I don't lots of tiles making lag.
-
Well it's really not complicated at all. Heres a picture:
-
I have a wavefront(.obj) model that I was using in my mod for 1.7.10. But now I want to update my mod to 1.8.9. Is there a good reliable way to convert wavefront into json?
-
Make it extend TileEnergyHandler not IEnergyHandler. Then in updateEntity() check if it can see the sky, if true, then receiveEnergy.