Jump to content

squidlex

Members
  • Posts

    183
  • Joined

  • Last visited

Everything posted by squidlex

  1. I'm sorry I couldn't really be of any help
  2. I'm an idiot and forgot it was included, thanks for pointing that out
  3. It's worth familiarising yourself with Java accessors. Research Getters and Setters, some people dislike them but they're quick and easy for accessing a private variable and Minecraft's code is full of them.
  4. You're trying to make it public from inside a private event
  5. No problem, happy coding
  6. Is your lang meant to be called in_us.json or was that a typo? Try en_us.json
  7. Thanks for your help! I now have myMessage.getStyle().setClickEvent() But I don't know how to actually provide a link.
  8. What do you mean by making a class file? Out of interest, are you using DeferredRegisters for this?
  9. Have you downloaded Java 8 specifically? If so was it 64x or 32x? Also do you have any gamepads connected? If so try disconnecting them. Apologies for so many questions haha All I can find online in terms of suggestions is to restart your computer, hope at least something I've said helps!
  10. Removing custom skin manager should (hopefully) fix it, I'd try this first. The mod is trying to access a class that does not exist in your minecraft directory. If nothing happens, uninstall OfflineSkins too, although I can't see how that is effecting it in your crashlog. If that doesn't work, or even if it does, try updating and reinstalling Forge.
  11. No problem, if you need anymore help after this thread is locked PM me.
  12. Make a backup of it first, then navigate to saves/yoursavename/stats Although from looking at your logs further this is a crash from initialising the game, so find what mod adds in the stats the config specifies could be the issue. entity.robot.name
  13. You have a duplicate stat id, I read somewhere that this can be fixed by deleting your stats folder although I'm not sure. Else it could be an issue with whatever mod you have that adds this: 'entity.robot.name' Just a heads up, a moderator will lock this post soon as 1.12 is no longer supported on this forum (for very just reasons).
  14. I'm looking to send this message if a mod is not installed to the chat: 'To use all the features of this item, please install the latest version of 'The Midnight', which can be found here' I've already got everything in place for checking if the mod is installed, but I don't know where to go from here, a code example would be incredibly helpful to me! What I've already got: if(ModList.get().isLoaded("midnight")) { if (worldIn.isRemote) { playerIn.sendMessage(/*a hyperlinked message*/); } } Thank you for your time and help!
  15. Excellent, thanks for all your help!
  16. I see, thank you for your help Is there an easy way to remove them from the creative menu if the mod is not present?
  17. I'm looking to add support for other mods, and I want to only register an item if said mod is present. For example only load a custom sword if cooking for blockheads is installed. It might not be good practice to avoid registering an item for all I know, so if there are any other alternatives I'd love to hear them. Thanks for your time!
  18. Thank you so much for all your help, I finally got it to work and I really appreciate the help given.
  19. Do you have a block item setup? If so is the texture applying to that?
  20. Removing the interface broke the way I was registering it, I rewrote how it's registered and it worked, thanks for making me check
  21. Thanks for pointing that out I removed it, sorry about that I took it from some source code I'd seen. Thanks for your reply, do you know why this isn't working? public class ConditionsMessage { private double dodgePower; public ConditionsMessage() { } public ConditionsMessage(double dodgePower) { this.dodgePower = dodgePower; } public void encode(ConditionsMessage message, PacketBuffer buffer) { buffer.writeDouble(message.dodgePower); } public ConditionsMessage decode(PacketBuffer buffer) { return new ConditionsMessage(buffer.readDouble()); } public void handle(ConditionsMessage message, Supplier<Context> supplier) { supplier.get().enqueueWork(() -> { DodgeEvents.dodgePower = message.dodgePower; }); supplier.get().setPacketHandled(true); } }
  22. Thanks for the help! That's fixed one of my problems now I just need help to sort out what's wrong with my packets.
  23. I have setup a packet handler using Forge's SimpleImpl documentation and by looking at other mods' source code. I want to send a packet containing common config values from the server to the client however my current code isn't working and I don't know what to do with it. I don't know how to send my variables across. ConditionsMessage.java public class ConditionsMessage implements IMessage<ConditionsMessage> { public static double dodgePower; @Override public void encode(ConditionsMessage message, PacketBuffer buffer) { } @Override public ConditionsMessage decode(PacketBuffer buffer) { return new ConditionsMessage(); } @Override public void handle(ConditionsMessage message, Supplier<Context> supplier) { supplier.get().enqueueWork(() -> { // Get dodgePower from ConfigHandler class somehow // originally was dodgePower = ConfigHandler.dodgePower; }); supplier.get().setPacketHandled(true); } } Where I send my packet in my main mod class @SubscribeEvent public void onServerStarting(FMLServerStartedEvent event) { PacketHandler.instance.send(PacketDistributor.ALL.noArg(), new ConditionsMessage()); } PacketHandler.class public class PacketHandler { private static final String PROTOCOL_VERSION = "1"; private static int nextId = 0; public static SimpleChannel instance; public static void init() { instance = NetworkRegistry.ChannelBuilder .named(new ResourceLocation(Dodge.MODID, "network")) .networkProtocolVersion(() -> PROTOCOL_VERSION) .clientAcceptedVersions(PROTOCOL_VERSION::equals) .serverAcceptedVersions(PROTOCOL_VERSION::equals) .simpleChannel(); register(ConditionsMessage.class, new ConditionsMessage()); } private static <T> void register(Class<T> clazz, IMessage<T> message) { instance.registerMessage(nextId++, clazz, message::encode, message::decode, message::handle); } } Init() ran from main mod class public MyMod() { ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, ConfigHandler.COMMON_SPEC); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::onCommonSetup); MinecraftForge.EVENT_BUS.register(this); } private void onCommonSetup(FMLCommonSetupEvent event) { PacketHandler.init(); } I'd really appreciate any help given as I've been suck on this for a while.
  24. Oh I see thanks for explaining that one, what event should I call it in?
  25. I'm looking to get a more in-depth understanding of the two. I know the basics from source code and from the SimpleImpl Forge Documentation and The Capability System but I can't figure out how to achieve what I'm trying to do, which is store a cooldown meter in my player using NBT and send information from the server's common config to the player.
×
×
  • Create New...

Important Information

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