Jump to content

Legenes

Members
  • Posts

    139
  • Joined

  • Last visited

Everything posted by Legenes

  1. I think he's trying to say that: "My Entity is keeping the chunk loaded, and I don't want it to do that. How can I make it to be loaded only, if the player is within X chunks?"
  2. I tried to make another mod, following the same steps that I done, but when I came to the point, where I need to make the proxies... it just isn't working. My main class: package com.betternether.mod; import com.betternether.mod.proxy.CommonProxy; 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.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @Mod(modid = BetterNether.modId, name = BetterNether.name, version = BetterNether.version, acceptedMinecraftVersions = "[1.12.2]") public class BetterNether { public static final String modId = "bn"; public static final String name = "Better Nether Mod"; public static final String version = "1.0.0"; @SidedProxy(serverSide = "com.betternether.mod.proxy.CommonProxy", clientSide = "com.betternether.mod.proxy.ClientProxy") public static CommonProxy proxy; @Mod.EventBusSubscriber public static class RegistrationHandler { @SubscribeEvent public static void registerItems(RegistryEvent.Register<Item> event) { ModItems.register(event.getRegistry()); } @SubscribeEvent public static void registerItems(ModelRegistryEvent event) { ModItems.registerModels(); } } @Mod.Instance(modId) public static BetterNether instance; @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { System.out.println(name + " is loading!"); } @Mod.EventHandler public void init(FMLInitializationEvent event) { } @Mod.EventHandler public void postInit(FMLPostInitializationEvent event) { } } My ClientProxy: package com.betternether.mod.proxy; public class ClientProxy { } My CommonProxy: package com.betternether.mod.proxy; import com.betternether.mod.BetterNether; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraftforge.client.model.ModelLoader; public class CommonProxy { public void registerItemRenderer(Item item, int meta, String id) { ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(BetterNether.modId + ":" + id, "inventory")); } } The error: [16:36:01] [main/FATAL] [FML]: Attempted to load a proxy type com.betternether.mod.proxy.ClientProxy into com.betternether.mod.BetterNether.proxy, but the types don't match [16:36:01] [main/ERROR] [FML]: An error occurred trying to load a proxy into proxy.net.minecraftforge.fml.common.LoaderException: Attempted to load a proxy type com.betternether.mod.proxy.ClientProxy into com.betternether.mod.BetterNether.proxy, but the types don't match [16:36:01] [main/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:629]: ---- Minecraft Crash Report ---- // I let you down. Sorry :( Time: 7/15/18 4:36 PM Description: There was a severe problem during mod loading that has caused the game to fail net.minecraftforge.fml.common.LoaderException: net.minecraftforge.fml.common.LoaderException: Attempted to load a proxy type com.betternether.mod.proxy.ClientProxy into com.betternether.mod.BetterNether.proxy, but the types don't match at net.minecraftforge.fml.common.ProxyInjector.inject(ProxyInjector.java:102) at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:603) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:218) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:196) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:135) at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:593) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:226) at net.minecraft.client.Minecraft.init(Minecraft.java:513) at net.minecraft.client.Minecraft.run(Minecraft.java:421) at net.minecraft.client.main.Main.main(Main.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:25) Caused by: net.minecraftforge.fml.common.LoaderException: Attempted to load a proxy type com.betternether.mod.proxy.ClientProxy into com.betternether.mod.BetterNether.proxy, but the types don't match at net.minecraftforge.fml.common.ProxyInjector.inject(ProxyInjector.java:95) ... 43 more And I was thinking... where did "com.betternether.mod.BetterNether.proxy" came from, if I used "com.betternether.mod.proxy.ClientProxy" and "com.betternether.mod.proxy.CommonProxy"? Thanks for helping!
  3. I made a tileEntity, a container, a guiHandler, everything needed but the Gui just glitches. I can't see the text box when my mouse is over the items, and there's no darker background when opened. Can somebody tell me, what's the problem? Here's my code: package net.gml.mod.block.specific_blocks.assembler; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.util.ResourceLocation; import net.gml.mod.gmlMod; import net.gml.mod.block.ModBlocks; public class GuiAssembler extends GuiContainer { private static final ResourceLocation BG_TEXTURE = new ResourceLocation(gmlMod.modId, "textures/gui/assembler.png"); private InventoryPlayer playerInv; public GuiAssembler(Container container, InventoryPlayer playerInv) { super(container); this.playerInv = playerInv; } @Override protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { GlStateManager.color(1, 1, 1, 1); mc.getTextureManager().bindTexture(BG_TEXTURE); int x = (width - xSize) / 2; int y = (height - ySize) / 2; drawTexturedModalRect(x, y, 0, 0, xSize, ySize); } @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { String name = I18n.format(ModBlocks.assembler.getUnlocalizedName() + ".name"); fontRenderer.drawString(name, xSize / 2 - fontRenderer.getStringWidth(name) / 2, 6, 0x404040); fontRenderer.drawString(playerInv.getDisplayName().getUnformattedText(), 8, ySize - 94, 0x404040); } }
  4. I think I got closer with it, thanks. (Now I don't have an error, and I loaded something, but not the final object)
  5. I want to set it to like "mymod:assets/mymod/recipes/customblock/recipe.json"
  6. Yes, but the guide made for normal java, and not for forge. I just don't get it, how can I set this to a location in "minecraft" and this isn't says anything about file location, or path, etc. .
  7. I deleted them but I remeber that: - I made a gson named json. - I tried to read from it, but I didn't know, how to set the file, what I want to use... So I became angry after 1 hour of trying, and I deleted that java file.
  8. Hmm... I tried to do it by tutorials on the internet, but I just can't figure it out. Can somebody send an example?
  9. Hi all! I want to make a block, that loads it's own recipes from a json file. I made the management of recipes, it detects it, and gives me the result, but I don't know how to even open a json from code. If someone tell me how to, then I just need to modify my code a little bit... so how do I load info from a JSON? Thanks! (Sorry for bad English, I'm Hungarian)
  10. I just don't know how to detect, if an itemStack from inventory. getStackFromSlot is equals to an already defined, original minecraft item... and I don't know how to get the original items. Anybody can help? (Sorry for bad English, I'm Hungarian)
×
×
  • Create New...

Important Information

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