Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

kandivia

Members
  • Joined

  • Last visited

Everything posted by kandivia

  1. Well let's say i set a player's(default 20/20 Health) maxHealth to 30. It would then become 20/30. If I do the check here, health would be below the max value and left alone. I'll look into NBT to see if I can just use a NBT boolean tag to indicate whether that particular entity has had its health set before or not.
  2. Hello, I'm trying to set the Player's and Mob's Max Health to a custom value via a config file. I need to be able to run both setBaseValue() and setHealth() to implement this properly. I've tried using the EntityJoinWorldEvent & LivingSpawnEvent to do so. EntityJoinWorldEvent, though, fires every time the Entity would reenter the world and thus would "heal"[setHealth()] an entity every time you close and reopen the world. LivingSpawnEvent plain doesn't work. Perhaps it happens to early and gets overridden by the vanilla code? Is there an event I'm not seeing I could use, or would I have to re-implement this in another way?
  3. Yuup that'll do it, fixed and fixed. Thanks.
  4. Narrowed the problem down futher today. Seems like i can't reference testitem after preInit? Will Crash: public static void registerRender(Item item){ String name = item.getUnlocalizedName().substring(5); } No Crash: public static void registerRender(Item item){ String name = "testmod:testitem"; } Will Crash: public static void registerRender(Item item){ ModelResourceLocation loc = new ModelResourceLocation("testmod:testitem", "inventory"); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, loc); // Crash on this line }
  5. item.getUnlocalizedName().substring(5) equates to "testitem" as doubled checked with a simple print statement So it should be the same as: new ModelResourceLocation("testmod:testitem", "inventory"); Running the game is just fine without running the render code. Trying to check for null atm.
  6. Main Class: package com.kandivia.testmod.main; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import com.kandivia.testmod.init.RegisterItems; import com.kandivia.testmod.proxy.CommonProxy; @Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION) public class MainRegistry{ @SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS) public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent preEvent){ RegisterItems.init(); RegisterItems.register(); } @EventHandler public void init(FMLPreInitializationEvent Event){ proxy.registerRenders(); } @EventHandler public void postInit(FMLPreInitializationEvent postEvent){ } } Item Register Class: package com.kandivia.testmod.init; import net.minecraft.client.Minecraft; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraftforge.fml.common.registry.GameRegistry; import com.kandivia.testmod.main.Reference; public class RegisterItems { public static Item test_item; public static void init(){ test_item = new Item().setUnlocalizedName("test_item"); } public static void register(){ GameRegistry.registerItem(test_item, test_item.getUnlocalizedName().substring(5)); } public static void registerRenders(){ registerRender(test_item); } public static void registerRender(Item item){ Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory")); } } Proxy Classes: package com.kandivia.testmod.proxy; import com.kandivia.testmod.init.RegisterItems; public class ClientProxy extends CommonProxy{ @Override public void registerRenders(){ RegisterItems.registerRenders(); } } package com.kandivia.testmod.proxy; public class CommonProxy { public void registerRenders(){ } } Reference Class: package com.kandivia.testmod.main; public class Reference { public static final String MOD_ID = "testmod"; public static final String MOD_NAME = "Test Mod"; public static final String VERSION = "1.0"; public static final String CLIENT_PROXY_CLASS = "com.kandivia.testmod.proxy.ClientProxy"; public static final String SERVER_PROXY_CLASS = "com.kandivia.testmod.proxy.CommonProxy"; } Rendering is in the init method and should run well after Item registers in the preInit method
  7. Hello, I cannot seem to be able to render a simple item/block in forge 1.8-11.14.0.1299 using eclipse I wrote a quick test mod to narrow down the problem. The client crashes at the following method: public static void registerRender(Item item){ Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory")); } with the corresponding crash details: http://pastebin.com/0XSA7642 I have both a model file in "src\main\resources\assets\testmod\models\item" called "test_item.json" and a texture in "src\main\resources\assets\testmod\textures\items" called "test_item.png"
  8. Oh wow! It's always those little things! Works perfectly now. Thanks again!
  9. Here's the error message in the console. [14:18:40] [Client thread/ERROR]: Using missing texture, unable to load minecraft:textures/blocks/obsidianVat.png java.io.FileNotFoundException: minecraft:textures/blocks/obsidianVat.png at net.minecraft.client.resources.FallbackResourceManager.getResource(FallbackResourceManager.java:65) ~[FallbackResourceManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:67) ~[simpleReloadableResourceManager.class:?] at net.minecraft.client.renderer.texture.TextureMap.loadTextureAtlas(TextureMap.java:126) [TextureMap.class:?] at net.minecraft.client.renderer.texture.TextureMap.loadTexture(TextureMap.java:91) [TextureMap.class:?] at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:89) [TextureManager.class:?] at net.minecraft.client.renderer.texture.TextureManager.onResourceManagerReload(TextureManager.java:170) [TextureManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:134) [simpleReloadableResourceManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:118) [simpleReloadableResourceManager.class:?] at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:653) [Minecraft.class:?] at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:303) [FMLClientHandler.class:?] at net.minecraft.client.Minecraft.startGame(Minecraft.java:596) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:941) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_11] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_11] at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_11] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_11] at GradleStart.bounce(GradleStart.java:108) [start/:?] at GradleStart.startClient(GradleStart.java:101) [start/:?] at GradleStart.main(GradleStart.java:56) [start/:?] I'll definitely look into ISBRH, thanks for your guidance : 3
  10. the obsidianVat.png file exists in the proper directory. And yes I'm using TESR to render this model(with the help of techne) as silly as it seems xP I do plan to give it a proper model later, though I'm not quite the artist to do so. At least for now I want to know why using TESR doesn't give me a break texture. Other Classes If Needed: ClientProxy package com.kandivia.syntheticnether.proxy; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.item.Item; import net.minecraftforge.client.MinecraftForgeClient; import com.kandivia.syntheticnether.main.BlockRegister; import com.kandivia.syntheticnether.renderer.ItemRenderObsidianVat; import com.kandivia.syntheticnether.renderer.RenderObsidianVat; import com.kandivia.syntheticnether.tileEntity.TileEntityObsidianVat; import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.client.registry.RenderingRegistry; public class ClientProxy extends ServerProxy { public void registerRenderThings(){ //Obsidian Vat TileEntitySpecialRenderer render = new RenderObsidianVat(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityObsidianVat.class, render); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockRegister.obsidianVat), new ItemRenderObsidianVat(render, new TileEntityObsidianVat())); } public void registerTileEntitySpecialRenderer(){ } } RenderObisidianVat package com.kandivia.syntheticnether.renderer; import org.lwjgl.opengl.GL11; import com.kandivia.syntheticnether.main.MainRegistry; import com.kandivia.syntheticnether.model.ModelObsidianVat; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; public class RenderObsidianVat extends TileEntitySpecialRenderer { private static final ResourceLocation texture = new ResourceLocation(MainRegistry.MODID + ":" + "textures/models/obsidianVat.png"); private ModelObsidianVat model; public RenderObsidianVat(){ this.model = new ModelObsidianVat(); } @Override public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { GL11.glPushMatrix(); GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); GL11.glRotatef(180, 0F, 0F, 1F); this.bindTexture(texture); GL11.glPushMatrix(); this.model.renderModel(0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); } } ItemRenderObsidianVat package com.kandivia.syntheticnether.renderer; import org.lwjgl.opengl.GL11; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.client.IItemRenderer; public class ItemRenderObsidianVat implements IItemRenderer { TileEntitySpecialRenderer render; private TileEntity entity; public ItemRenderObsidianVat(TileEntitySpecialRenderer render, TileEntity entity){ this.entity = entity; this.render = render; } @Override public boolean handleRenderType(ItemStack item, ItemRenderType type){ return true; } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper){ return true; } @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data){ if(type == IItemRenderer.ItemRenderType.ENTITY) GL11.glTranslatef(-0.5F, 0.0F, -0.5F); this.render.renderTileEntityAt(this.entity, 0.0D, 0.0D, 0.0D, 0.0F); } }
  11. Removed the extra IIcon methods, but the original problem is still there as breaking the block gives off a missing texture particle.
  12. I'm adding a custom rendered block. The texture for the block works but when it's broken I get missing texture particles. Adding the IIcon methods in my block class below instead gives me a Lava Texture. Is there something I'm missing here? I'm not quite sure how a custom block gets it's broken texture from. package com.kandivia.syntheticnether.blocks; import com.kandivia.syntheticnether.creativeTabs.CreativeTabInitializer; import com.kandivia.syntheticnether.main.MainRegistry; import com.kandivia.syntheticnether.tileEntity.TileEntityObsidianVat; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; public class ObsidianVat extends BlockContainer{ public ObsidianVat(Material material){ super(material); this.setHardness(50.0F); this.setResistance(2000.0F); this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); this.setBlockName("obsidianVat"); this.setBlockTextureName("obsidianVat"); this.setCreativeTab(CreativeTabInitializer.tabSyntheticNether); } public int getRenderType(){ return -1; } public boolean isOpaqueCube(){ return false; } public boolean renderAsNormalBlock(){ return false; } @Override public TileEntity createNewTileEntity(World var1, int var2){ return new TileEntityObsidianVat(); } @SideOnly(Side.CLIENT) private IIcon obsidianVat; @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister icon){ obsidianVat = icon.registerIcon("syntheticnether:obsidianVat");} @SideOnly(Side.CLIENT) @Override public IIcon getIcon(int side, int meta){ return obsidianVat; } }

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.