Jump to content

RileyTheFox

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by RileyTheFox

  1. I apologize for trying to bump my own thread. I just haven't heard back this weekend and assumed it got missed. Could really still use the help here as I'm still rattling my brain on it trying to edit the jsons and whatnot but nothing is working.
  2. I've tried looking around through Google and various threads on here but it always seems to be the opposite to the problem I'm having. I made my own glass-like block and everything works correctly besides the rendering when it's in a player's hand. The block itself works fine and I like how it looks but in the hand it's acting like the texture is completely opaque. I tried looking at similar blocks like stained glass but I can't seem to figure out what the issue is. I'm probably missing something totally obvious but that's why I wanted to ask here to see where I'm being dumb. So this is how it looks in game: And I'm getting this weird effect when in third person with the block like it's trying to render it translucent but it's not quite there: Lastly here's my .json files for the block and item models. If I need to post the code, let me know. I just didn't know if I did. Here's the block model .json: { "parent": "block/cube_all", "textures": { "all": "fallenstars:blocks/shimmer_glass_red" } } And here's the item model .json: { "parent": "block/cube_all", "textures": { "all": "fallenstars:blocks/shimmer_glass_red" } } Sorry ahead of time if I'm just being dumb with something obvious. It's been awhile since I've coded and I'm trying to reacquaint myself to it but I've run into this dilemma along the way. Thanks so much in advance for any help.
  3. Yes! I looked up the issue I'm having now and stupid me, I had my CommonProxy abstract by mistake! It's working perfectly now. Thank you so much for explaining it to me Draco. It was probably a stupid error on my part but it really was a lot of help.
  4. I'm very sorry for the double post. I tried fixing the issue by calling it from my ClientProxy instead though now I am met with this crash: https://pastebin.com/bnfCpfNj My client proxy looks like this now: package riley.fallenstars.proxy; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraftforge.client.model.ModelLoader; import riley.fallenstars.utils.handlers.RenderHandler; public class ClientProxy implements CommonProxy { @Override public void registerItemRenderer(Item item, int meta, String id) { ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item.getRegistryName(), id)); } @Override public void init() { RenderHandler.registerEntityRenders(); } } I moved the RenderHandler.registerEntityRenders() from the RegistryHandler (which from what I understand from your response was being called to the common rather than to the client) to the ClientProxy instead. I'm still unsure and am baffled as to what I'm doing wrong as I referenced my old code from 1.10 this time just to try and get an idea. I feel like that idea is wrong, unless I'm getting closer? I really can't tell at this point. Again, apologies for double-posting. Just wanted to update on what I did/tried.
  5. Alright, thank you so much. That actually helps me understand it a whole lot better than I was. So to fix it, would I have to change the fact that in the main class it's calling for common proxy? Or is there a better solution to this?
  6. Apologies. I call the RenderHandler from my Registry Handler here: package riley.fallenstars.utils.handlers; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraftforge.client.event.ModelRegistryEvent; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import riley.fallenstars.init.FallenStarsBlocks; import riley.fallenstars.init.FallenStarsEntities; import riley.fallenstars.init.FallenStarsItems; import riley.fallenstars.utils.IHasModel; @Mod.EventBusSubscriber public class RegistryHandler { @SubscribeEvent public static void onItemRegister(RegistryEvent.Register<Item> event) { event.getRegistry().registerAll(FallenStarsItems.ITEMS.toArray(new Item[0])); } @SubscribeEvent public static void onBlockRegister(RegistryEvent.Register<Block> event) { event.getRegistry().registerAll(FallenStarsBlocks.BLOCKS.toArray(new Block[0])); } @SubscribeEvent public static void onModelRegister(ModelRegistryEvent event) { for (Item item : FallenStarsItems.ITEMS) { if (item instanceof IHasModel) { ((IHasModel)item).registerModels(); } } for (Block block : FallenStarsBlocks.BLOCKS) { if (block instanceof IHasModel) { ((IHasModel)block).registerModels();; } } } public static void preInitRegistries() { FallenStarsEntities.registerEntities(); RenderHandler.registerEntityRenders(); } public static void initRegistries() { SoundsHandler.registerSounds(); } } Which the "preInitRegistries()" method is then called from my main class under it's preInit. Here's the main class as well, just in case: package riley.fallenstars; import net.minecraft.creativetab.CreativeTabs; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import riley.fallenstars.init.FallenStarsTab; import riley.fallenstars.proxy.CommonProxy; import riley.fallenstars.utils.Reference; import riley.fallenstars.utils.handlers.RegistryHandler; @Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION) public class FallenStars { @Mod.Instance public static FallenStars instance; public static final CreativeTabs fallenstarstab = new FallenStarsTab("fallenstarstab"); @SidedProxy(clientSide = Reference.CLIENT, serverSide = Reference.COMMON) public static CommonProxy proxy; @Mod.EventHandler public static void preInit(FMLPreInitializationEvent event) { RegistryHandler.preInitRegistries(); } @Mod.EventHandler public static void init(FMLInitializationEvent event) { RegistryHandler.initRegistries(); } @Mod.EventHandler public static void postInit(FMLPostInitializationEvent event) {} } I've been following some videos to somewhat refresh myself and to learn the changes in forge different from 1.10.2. So apologies if it's at all wrong. That's why I'm here to see, I assume I did something wrong here and I kinda understand what I did wrong but am unsure how to fix it.
  7. Hello there! It's been a decent time since I've worked on my mod, seeing as the changes in 1.12 broke almost everything in it. At this point, I was ecstatic as it seemed I had gotten it running again! However, I've been encountering a game-breaking issue that I can't wrap my head around enough to solve. Whenever I start my mod within a server- even a server with only my mod- it crashes with a java.lang.NoClassDefFoundError. From what I have seen in the crash report (https://pastebin.com/ru6U5zhH) and from what I have seen browsing for an answer here on the Forge Forums, it seems as though I have made a mistake by rendering my entities server-side rather than client-side. Though I've seen that I need to render my own entities through the client proxy, I can't seem to find out exactly how I am supposed to do so due to the changes to coding in 1.12 and my own taking a break which has made me rusty. All I am asking for is some advice on what I am doing wrong, or what I should do. I am by no means "new" to coding, and I've coded this mod much further before, but I am terribly rusty and need help trying to figure out this error. The class that's giving the error according to the log is as follows. package riley.fallenstars.utils.handlers; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraftforge.fml.client.registry.IRenderFactory; import net.minecraftforge.fml.client.registry.RenderingRegistry; import riley.fallenstars.entities.EntityChinchilla; import riley.fallenstars.entities.EntityFox; import riley.fallenstars.entities.EntityShepherd; import riley.fallenstars.entities.render.RenderChinchilla; import riley.fallenstars.entities.render.RenderFox; import riley.fallenstars.entities.render.RenderShepherd; public class RenderHandler { public static void registerEntityRenders() { RenderingRegistry.registerEntityRenderingHandler(EntityFox.class, new IRenderFactory<EntityFox>() { @Override public Render<? super EntityFox> createRenderFor(RenderManager renderManager) { return new RenderFox(renderManager); } }); RenderingRegistry.registerEntityRenderingHandler(EntityChinchilla.class, new IRenderFactory<EntityChinchilla>() { @Override public Render<? super EntityChinchilla> createRenderFor(RenderManager renderManager) { return new RenderChinchilla(renderManager); } }); RenderingRegistry.registerEntityRenderingHandler(EntityShepherd.class, new IRenderFactory<EntityShepherd>() { @Override public Render<? super EntityShepherd> createRenderFor(RenderManager renderManager) { return new RenderShepherd(renderManager); } }); } } If there is anything else I should link according to the crash report or other needed info; I am more than willing to do so. A huge thank you for any help in advance, and I look forward to finding an answer so that I may finally work on restoring my little mod to it's former state.
  8. Thank you so much. That was quite silly of me actually. I know a fair bit of coding so far but I'm still learning so thank you for pointing that out for me. It's working fine now.
  9. I'm having an issue that I was hoping I could get a hand with. What I'm trying to do is get an item to summon an entity on right-click. Simple enough, I know, but it's giving me a bit of trouble. You see, I can get the entity to summon just fine, but for some reason it always spawns without an AI. I've tried tinkering around with things as best I can, but I just can't figure out how to get it to summon whilst retaining its AI whatsoever. I'll make sure to post the code to make things easier, and any help I can get would really be appreciated. Thanks in advance for your time. public class ScourgeSword extends ItemSword { public ScourgeSword(ToolMaterial material) { super(material); setUnlocalizedName(Reference.FallenStarsTools.DARKSWORD.getUnlocalizedName()); setRegistryName(Reference.FallenStarsTools.DARKSWORD.getRegistryName()); setCreativeTab(FallenStars.CREATIVE_TAB); } public boolean getIsRepairable(ItemStack toRepair, ItemStack repair) { return repair.getItem() == FallenStarsItems.scourgeingot; } @Override public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand) { if (worldIn.isRemote) { EntityCreeper creeper = new EntityCreeper(worldIn); creeper.setPosition(playerIn.posX, playerIn.posY, playerIn.posZ); worldIn.spawnEntityInWorld(creeper); } return super.onItemRightClick(itemStackIn, worldIn, playerIn, hand); }
×
×
  • Create New...

Important Information

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