Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/19/20 in all areas

  1. I managed to figure it out. I had my @EventBusSubscriber wrong (had to subscribe to the client-specific bus for the FMLCommonSetupEvent). Because of that, the event handler wasn't firing, so the instance of the capability was never being injected with a value, so it was still null when I tried to use it. @Draco18s also, you were right. I was just passing an instance of my ILifeForce, when I needed to pass it a supplier. I ended up using a lambda supplier: @SubscribeEvent public static void onCommonSetupEvent(FMLCommonSetupEvent event) { CapabilityManager.INSTANCE.register(ILifeForce.class, new LifeForceStorage(), () -> new LifeForce()); }
    1 point
  2. https://github.com/MinecraftForge/MinecraftForge/pull/6455
    1 point
  3. The basic entity size (width and height) is defined when you create the EntityType registry object (example). This was also the case in 1.12.2, and hasn't really changed. This width & height is used to set up the entity's bounding box in Entity#setPosition(), which is used for the vast majority of entities (other than paintings, picture frames, leash knots and shulkers, which have their own setPosition() implementations). This bounding box is centred on the entity's X/Z position, with the Y position at the bottom of the bounding box (e.g. your player bounding box is centered horizontally at your feet, on the ground).
    1 point
  4. Update Regarding LTS System: Please read The Big Forge Update Earlier this year, 1.13 was announced and the snapshots started coming out, the update was relatively small, but enough to be a hurdle for mod developers. This combined with 1.12 stabilizing, and a few fundamental Java changes that broke modding in general, made the Forge team decide to use this opportunity and work on cleaning the years of technical debt that Forge had accrued. During this time, it was discovered that a lot of things needed updating. In fact, well, everything did. And so, it was done, a full rewrite of practically everything Forge related. This took a long time, longer than originally anticipated. But what’s the outcome of this you might ask? A lot. cpw’s mod launching system (ModLauncher) allows for parallel mod loading and support for more modern Java versions. (Considering the original was written to target Java 6). The Forge installer now runs tasks at install time once, rather than doing it every time you run the game. These alone provide dramatic reduction in launch times. ForgeGradle, the “devkit” for creating mods, has been rewritten and is faster at, well, everything. It also integrates much better with IDEs. What does that mean, you ask? Simple. Mods are nicer to make. (Also 100% less setupDecompWorkspace.) MCPConfig allows for much easier MCP updates, and is public source too, so people can see exactly what's going on between updates. In short: There was a lot of work to do. And now that it's done, future updates will be much, much smoother. 1.14 and 1.15 The 1.14 release came around, just in time for the rewrite to be finished, so it was time to get the ball rolling again. The bulk of the restructure work was done through 1.13's life, so all that remained was actually seeing how it was to update all of it, and it went pretty well. A lot of improved systems exist now that make developing for these modern versions far easier and just better in general. The 1.15 release was relatively simple, even if Mojang decided to restructure everything and make changes to how the rendering works. (Taking some of our systems in the process, don't worry, this is a good thing.) 1.15's rendering changes were mostly a refactor, and we expect 1.16 to be a large update to rendering. This plus 1.14 seeing growth is why we chose 1.14 to be a candidate for LTS. (More on that further down.) Hopefully this kind of restructure from them is a rare thing in the future, but we welcome the change, since it often brings improvement. Although the rendering changes may pose a tough hurdle for some, the update for most should be relatively straight-forward. Forge support and LTS Forge's support for Minecraft versions will try to follow a predictable cycle, assuming Mojang also follows a predictable cycle. We will always actively target the latest Minecraft version, as ever. We will now also deem a previous major Minecraft version as "LTS" (Long Term Support). The LTS version will receive support for modders and players alike, however all new features must target the latest version first, and then may be backported. An LTS version differs slightly from the latest version, in that any new features you may want to add to it, must target the latest version, only once it has been merged in, can it be backported. (The exception to this is if the feature is non-applicable to the latest version.) The Forge Team will also mostly be focusing on the latest. This is so the community has time to stabilize a bit and gives modpack developers some time to create something special. But still have Forge running full steam ahead. Late last year (Happy 2020!) a vote was held privately with many developers of various Minecraft projects to determine which version will be LTS: Should 1.12 remain LTS or should 1.14? A vast majority chose 1.14, and so, from now on we are dropping 1.12 from support, and 1.14 is now LTS. What does this mean? 1.15 is latest. It will get full support. 1.14 is LTS. It will also get support, and new features, but new features must be made for 1.15 first. 1.12 is no longer supported on this forum, no new features, and no more bugfixes. All other versions are not supported. This means if you come to us for help with those, we will ask you to update. This includes crashes/bugs. To keep with Mojang's history of releases, we expect 1.14 to stay LTS for 12-18 months, giving plenty of time for modders and pack developers alike. However, this may change depending on what surprises Mojang has in store for us. Finally… Thank you. Thank you to all the modders/developers, all the players, and especially to all the contributors. The Minecraft modding community would not be what it is without you. You are responsible for the striving ecosystem we have today. We hope this new year brings you all you desire, and we look forward to seeing what you create. And now time for some shameless plugging, if you like Forge, please consider supporting us. http://www.patreon.com/lexmanos - The Forge Team.
    1 point
  5. Scroll up. Also I don’t understand why me literally offering helpful advice to other people coming across this is met with “that’s a shit method” and “don’t mess with it at all”. Like geez, if you know a better way then feel free to contribute, but simply getting complaining isn’t contributing anything.
    1 point
  6. I’d welcome any examples of a better way to do this?
    1 point
  7. For anyone else looking for this in the future, create mixins for net.minecraft.network.NetworkManager like so: @Inject(method = "sendPacket(Lnet/minecraft/network/Packet;)V", at = @At("HEAD"), cancellable = true) private void onSendPacket(Packet<?> packet, CallbackInfo callbackInfo) { //System.out.println("Packet Sent: " + packet.toString()); PacketSent event = new PacketSent(packet); MinecraftForge.EVENT_BUS.post(event); if (event.isCanceled() && callbackInfo.isCancellable()) { callbackInfo.cancel(); } packet = event.packet; } @Inject(method = "channelRead0", at = @At("HEAD"), cancellable = true) private void onChannelRead(ChannelHandlerContext context, Packet<?> packet, CallbackInfo callbackInfo) { //System.out.println("Packet Recieved: " + packet.toString()); PacketRecieved event = new PacketRecieved(packet); MinecraftForge.EVENT_BUS.post(event); if (event.isCanceled() && callbackInfo.isCancellable()) { callbackInfo.cancel(); } packet = event.packet; } PacketSent and PacketRecieved are custom events that you can make yourself by making a class that extends Event.
    1 point
×
×
  • Create New...

Important Information

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