Jump to content

Recommended Posts

Posted

I'm trying to render an icon for a custom potion effect. below  is the code i have:

import shadow.fusion.misc.Reference;

public class SunBlock extends Potion {
	
	public static final ResourceLocation RESOURCE_ICON = new ResourceLocation("fusiontweaks:inventory.png");
	
	public SunBlock(int id, boolean bad, int amp) {
		super(id, bad, amp);
		this.setPotionName("Sun Block");
		// TODO Auto-generated constructor stub
		//this.setPotionName("sun_block");
	}
  
	@Override
	public boolean hasStatusIcon() {
		return false;
	}
	
	
	public void renderInventoryEffect(int x, int y, PotionEffect effect, net.minecraft.client.Minecraft mc) { 
		if (effect.getPotionID() == ConfigHandler.potID) {
			//int l = 0;
			System.out.println(RESOURCE_ICON.toString());
			mc.getTextureManager().bindTexture(RESOURCE_ICON);
			//Minecraft.getMinecraft().renderEngine.bindTexture(RESOURCE_ICON);
			mc.ingameGUI.drawTexturedModalRect(x+6, y+7, 0, 198, 18, 18);
			//mc.renderEngine.deleteTexture(RESOURCE_ICON);
			//mc.renderEngine.bindTexture(new ResourceLocation("textures/gui/container/inventory.png"));
			
			
		}
	}
		
}

the file is in main/assets/fusiontweaks/inventory.png

i have also tried to load the resource with the two argument constructor.

the hook to the rendering moment works correctly, i have successfully drawn a coloured square in the correct position with  mc.ingameGUI.drawRect(x+6, y+7, x+24, y+25, -100023234);

 

when i try to use the above code to draw an icon from my assets however, nothing gets drawn.

 

any help with the problem would be appreciated.

S-

 

 

 

 

 

 

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • The server just disconnect me and sent me this error message [01:29:54] [Server thread/ERROR] [minecraft/ServerLoginPacketListenerImpl]: Couldn't place player in world, this is my latest log https://pastebin.com/J300TKP6, I don't know exactly how this started but just yesterday I was playing perfectly.
    • Sorry, didn't work. Still getting the message. Is there anything else I can show you guys that might help more? that Debug Log screen doesn't show much....
    • These 2 mods are the same, remove one of them.
    • I havent played in a while and updated all mod packs and resource packs that required updating, after i updated everything when i would launch the mod it would crash?   [12:20:57] [main/ERROR]:Found duplicate mods: Mod ID: 'rubidium' from mod files: xenon-0.3.31+mc1.20.1.jar, embeddium-0.3.31+mc1.20.1.jar Mod ID: 'embeddium' from mod files: xenon-0.3.31+mc1.20.1.jar, embeddium-0.3.31+mc1.20.1.jar [12:20:57] [main/ERROR]:Failed to build unique mod list after mod discovery. net.minecraftforge.fml.loading.EarlyLoadingException: Duplicate mods found at net.minecraftforge.fml.loading.UniqueModListBuilder.buildUniqueList(UniqueModListBuilder.java:87) ~[fmlloader-1.20.1-47.3.7.jar:1.0] at net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer.discoverMods(ModDiscoverer.java:106) ~[fmlloader-1.20.1-47.3.7.jar:?] at net.minecraftforge.fml.loading.FMLLoader.beginModScan(FMLLoader.java:164) ~[fmlloader-1.20.1-47.3.7.jar:1.0] at net.minecraftforge.fml.loading.FMLServiceProvider.beginScanning(FMLServiceProvider.java:86) ~[fmlloader-1.20.1-47.3.7.jar:1.0] at cpw.mods.modlauncher.TransformationServiceDecorator.runScan(TransformationServiceDecorator.java:112) ~[modlauncher-10.0.9.jar:?] at cpw.mods.modlauncher.TransformationServicesHandler.lambda$runScanningTransformationServices$8(TransformationServicesHandler.java:100) ~[modlauncher-10.0.9.jar:?] at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[?:?] at java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1779) ~[?:?] at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?] at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?] at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575) ~[?:?] at java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260) ~[?:?] at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616) ~[?:?] at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622) ~[?:?] at java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627) ~[?:?] at cpw.mods.modlauncher.TransformationServicesHandler.runScanningTransformationServices(TransformationServicesHandler.java:102) ~[modlauncher-10.0.9.jar:?] at cpw.mods.modlauncher.TransformationServicesHandler.initializeTransformationServices(TransformationServicesHandler.java:55) ~[modlauncher-10.0.9.jar:?] at cpw.mods.modlauncher.Launcher.run(Launcher.java:88) ~[modlauncher-10.0.9.jar:?] at cpw.mods.modlauncher.Launcher.main(Launcher.java:78) ~[modlauncher-10.0.9.jar:?] at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) ~[modlauncher-10.0.9.jar:?] at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) ~[modlauncher-10.0.9.jar:?] at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) ~[bootstraplauncher-1.1.2.jar:?] [12:20:57] [main/ERROR]:Mod Discovery failed. Skipping dependency discovery.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.