Jump to content

Recommended Posts

Posted

Let's face it; Forge is destined to become something great, and big. We already 'absorbed' Modloader/(MP). I suggest talking with the makers of MCPatcher and Optifine to include their features in Forge, which are, in all:

 

HD Fixes up to 512x

HD Fonts

Random Mobs

Connected Textures

Random Textures

Custom Colors

Custom Sky

Major performance fixes

Patcher interface

 

A lot of these fixes are essential to texture pack makers, especially one I work for, Soartex Fanver (soartex.net). Including these would majorly help them have special feature in the packs without having user install 'ANOTHER' thing. Also, so much work has been put into implementing these features, just adding a simple HD Fix would make all their work obsolete. The MCPatcher interface could be combined with Forge to make an easy install interface, which could even detect if the jar was a server jar or client, and install the appropriate Forge version (This could make for only one file to download on the user part). Another feature I thought of was detecting if mods modified base classes, warn the user if it did, and just copy the zip in the mods folder if it didn't. It could even fetch the newest version of Forge for a one-time download, and update the install program itself.

 

Detail of patcher features:

 

Install and update Forge, whether for client or server, always gets newest version of Forge if connected to the internet. (Texture pack and optimization stuff will be included in Forge) ((Forge will be an un-uncheck-able item on the list))

 

Install other mods, same way as before, except that it will warn you if the mod modifies base classes, and only copy the zip if it doesn't.

 

Update itself.

 

This would be a major break-thru for Forge, the incorporation of these wildly used mods would be easier on the user part (One thing to download, and once. Easy install interface for Forge and other mods), the modder part, giving him access to the MCPatcher/Optifine code in the forge source package, and the texture pack maker's part, making it easy to use these special features.

 

Posted

I have no plans on taking over Optifine, as he does his job well and compatibility really isn't an issue because he is willing to work with us.

However, you should just kill MCPatcher and never use it.

I really dont like a lot of the things that MCPatcher does and don't plan on incoperating anything that it does.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

Why don't you like? MCPatcher has some very nice features that are crucial to texture packs, for instance, the upcoming custom sky.

 

EDIT: And about optifine, the idea is to have people install less and get more, this will make it easier to take ALL these features together if Mojang will ever incorporate it.

Posted

Most, if not all of those featureas are in Optifine.

Forge/FML isnt designed to be a complete rendering overhaul, it just fixes some bugs with the vanilla code.

 

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

Kahr is the one who creates all these features, Optifine just copies them over.

 

It could be. There is much potential. You already have a basic HD fix.

 

And the patcher interface will make it alot more user friendly.

Posted

LexManos, not that I have a problem with Forge just being about bug fixes, but that doesn't seem to be true. I am hearing Eloraam re-wrote the lighting engine for colored lights, is that not a new feature? Given the growing popularity Forge has, the HD features MCPatcher adds may no longer be supported by most clients.

 

Also, consider MCPatcher this way. MCPatcher is the API for texture pack artists. It allows TP artists to edit the look of the game far beyond what was originally available, just like how Forge allows modders access to base classes via hooks.

 

I know most of the people here consider texture packs curtains, but texture packs have a very large appeal in the community. Neglecting full support for them because you don't like MCPatcher would just not be right. Please consider including a kind of equivalent API for texture packs, not just mods.

 

Disclaimer here, I love Forge and respect you, Eloraam and the other modders for the fine work you guys have done. I came here and wrote this to raise awareness that Forge could bring problems to the texture pack community.

Posted

I think that Forge has a lot of potential and with each update comes much better stuff. However, I do think that Forge should try to include some of the same features as OptiFine and MCPatcher to make it easier for the end user and the modders ;) I don't think that Forge should absorb them, but just try to include the same features, like Forge's new ModLoader :) I really love that ModLoader by the way, great job LexManos! My favorite API is Forge and probably will always be, but I think that there is a lot of stuff that can be added to make it tons better  8)

Posted
I am hearing Eloraam re-wrote the lighting engine for colored lights, is that not a new feature?

You've heard wrong.

 

Given the growing popularity Forge has, the HD features MCPatcher adds may no longer be supported by most clients.
Then those clients should be installing Optfine.

 

Also, consider MCPatcher this way. MCPatcher is the API for texture pack artists. It allows TP artists to edit the look of the game far beyond what was originally available, just like how Forge allows modders access to base classes via hooks.
Once again, Optifine allows you to do that as well.

 

I know most of the people here consider texture packs curtains, but texture packs have a very large appeal in the community. Neglecting full support for them because you don't like MCPatcher would just not be right. Please consider including a kind of equivalent API for texture packs, not just mods.
Once again, Optifine does everything you want and more.

The ONLY thing Optifine doesn't do is do bytecode injection, which is not the domain of texture packs. So it shouldn't be done.

 

Point being, with FML, we support texture packs to the basic extent, if you want anything fancy, go talk to Optifine.

We are not a one stop shop for all things. There are reasons why we haven't implemented shit like this. We are not trying to take over the world.

Optifine and Forge live together quite easily, there is no reason for me to start doing everything Optifine does.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

Point being, with FML, we support texture packs to the basic extent, if you want anything fancy, go talk to Optifine.

We are not a one stop shop for all things. There are reasons why we haven't implemented shit like this. We are not trying to take over the world.

Optifine and Forge live together quite easily, there is no reason for me to start doing everything Optifine does.

Whoa, I was not looking for a fight, nor was I implying you are trying to take everything over. I only wanted to express my concerns about Forge's HD texture pack support. No harm intended.

Posted

Point being, with FML, we support texture packs to the basic extent, if you want anything fancy, go talk to Optifine.

We are not a one stop shop for all things. There are reasons why we haven't implemented shit like this. We are not trying to take over the world.

Optifine and Forge live together quite easily, there is no reason for me to start doing everything Optifine does.

Whoa, I was not looking for a fight, nor was I implying you are trying to take everything over. I only wanted to express my concerns about Forge's HD texture pack support. No harm intended.

 

I must concur, this isn't about 'taking over the world', neither were we looking for a fight; it's just saving these features in case users don't feel like installing something else, especially since you just included a rudimentary HD fix. These are crucial for texture packs, having them go away takes away the pizazz they need. Of course, 'optifine', WE know to install it, but other people might not want to. There is no reason (well if there is say it) you can the come 'the ultimate API', it's better for everybody.

 

And about byte code injection, it is the epitome of user-friendliness. You wouldn't even need to absorb any of MCPatcher's texture related features, just the neat patcher software. It wouldn't even be part of forge, it would only carry it. Here is what I meant in absolute depth:

 

A user, told by a mod that they need Minecraft Forge, goes to the main download page. (Note: Lets say this is by 1.3, SSP and SMP are the same.) He/She hits download button, gets an .exe or .jar if on  Mac or Linux (Note: This is NOT Forge, only SLIGHTLY modified MCPatcher code). This .exe would come with Forge, but on run-time can check if it has the latest version. Functionality would be identical to the existing patcher, except you wouldn't be able to uncheck Forge from the mod list, it would work on client or server jars, and mods editing base classes would get a warning, editing Forge classes would get an even bigger warning, and mods not editing any classes would just get copied into the mods folder.

 

This would severely increase user friendliness, making Forge the epitome of easiness.

 

I know, this argument is probably getting annoying for you now, but could we get other people into the discussion, see what they think? Perhaps you could message Eloraam and ask her to come and post her opinion? I message Misa, the maker of one of the most popular texture packs ever, and Kahr, maker of MCPatcher. I would like to see a colorful discussion instead of just 2 people arguing.

 

And one last thing, Optifine is not the answer. It only copies code from MCPatcher and claims as being better and original, even though it is half-heatedly put together and sloppy, many of the features containing many bugs. Kahr (maker of MCPatcher) works directly with texture pack artist to get useful and creative features into his mod. Combining it / working with him would really make a difference concerning textures, Optifine doesn't actually create.

Posted

*OptiFine doesn't work.

 

-Custom connected textures are not supported

-Randomized textures don't work

-Custom Colors is missing its teeth, many of its applications do not work

-Animations weren't working correctly last time I checked

-Better skies is not going to be implemented for a long time

-Overall, buggy and unreliable

 

OptiFine as a fill for all this texturing support just doesn't cut it.

 

What is it you don't like about MCPatcher?

 

I am not looking for a flame war here.

Posted

I dont like the fact that its poorly coded, and injects itself when it is not needed and you can't disable it.

its the cause of so many issues because people think that it is just a 'mod installer' and then bitch when it crashes cuz its doing stuff its told not to do.

Back in the day I really liked it I even created a few mods that were pure bytecode injection using it.

 

However, I dont intend to ingest it, there are already things in place for a lot of its bytecode related functionality to be supported. We will be shipping ASM with 1.3's Forge.

As for the ease of use for the installer, I am waiting on someone to create a simple open source system that doesn't do the complexities of bytecode patching because its unneeded.

A simple installer similar to the yogsbox from last I saw is all thats needed.

 

If MCPatcher worked like it was supposed to, I would have no issues recommending it along with Optifine

But it doesn't

And it causes a lot of stupid issues

So I dont

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

I have not heard of these 'stupid issues', you can also deselect the features when installing other mods, and why would you need to disable it in-game? MCPatcher works exactly like it supposed to, its Optifine that's buggy and crappy? And besides, the method of functioning doesn't matter, its the features that count. I'm surprised Forge hasn't already functioned by injection already, it makes for easier updating regardless of Minecraft version.

 

When was the last time you actually used MCPatcher? It might have greatly improved since then.

 

If anything, Optifine causes tons of issues; its a whole game rewrite.

Posted

i must say i swear by optifine, simply because of one reason: it plays nice

 

yep, thats all, optifine does not cause any trouble with any of the many MANY mods i tried, where that thrice-damned patcher causes tons of issues

 

 

MCPatcher might (MIGHT!) work better for vanilla content, but it crashes quickly as soon as mods come into play

while the worst i have ever had with optifine is texture errors

 

i'd rather my game has some texture problems if running to long, then that it suddenly goes dead without any visible reason

Being noobish since 96, being dumb since birth!

Posted

Do a search for Colorizer, even when you disable everything that crap gets injected.

And please don't even assume you know anything about how MCPatcher works or bytecode injection, else you wouldn't be so high and mighty.

Bytecode injection is good for SMALL things, I actually have a project for 1.3 that i've been working on that will massivly simplify things. However, its is not a valid solution for large scale things like Optifine or Forge.

 

Yes the functionality of 'put all mods here and click button poof installed' is nice.

And can be done quite easily with a lot of other tools.

 

As for the whole issue of communicating with TexturePack authors, thats Mojangs/Optifines/MCPatchers jobs not forge.

 

I see no legitimate reason to take over there functionality. From every usage case I have found Optifine works perfectly fine. Does everything a TexturePack author needs, and hes open to speaking with people about improvements. Hes not the fastest person on the block but he gets the job done.

 

As I said, the FML HD texture modifications were BUG FIXES. Nothing more.

They fixed the BUGS in Vanilla MC that made the game CRASH and massive visual artifacts while playing.

We never intended to be the one stop shop for all texture related needs, as I said it already exists in Optifine, there is no reason for us to do it.

 

 

 

 

So I ask this, give me a VALID reason that we should absorb MCPatcher.

Bytecode injection is not a valid reason.

Texturepack authors are not valid reason, they already have there solutions.

The ONLY valid reason is for simpler installation for the end user, and there are discussions going on directly for that that have nothing to do with MCPatcher.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

LexManos, there is no need to be hostile.

-----------------------------------------------------

I decompiled MCPatcher's code tonight, and I can see where you are coming from.

 

Most of all, I want universal support for more advanced texture editing. Aesthetics are far too overlooked; I want to fix that. Judging by MCPatcher's use of byte code injection, fluff and crashing issues on a loaded client, Mojang is not going to adopt it. Forge is not going to adopt MCPatcher because Forge is only adding API for mods. Point taken.

 

If more control over texture editing is going to be universal, it would have to be lighter. I have experience with programming and have been looking for a mod to make a worthwhile project out of. I will be making a new HD patch from scratch with cleaner code and fewer features to maintain. I'm thinking something Mojang would be comfortable with adopting. When Mojang does add HD support just like you guys here at Forge did, I'd rather TP artists not lose all their teeth. Grum mentioned plans for HD support in the dev chat a few weeks ago.

 

I know there is no current need for another HD patch, so I don't really need to worry about compatability. I'll go ahead and edit base files to avoid bytecode injection. TP artists shouldn't worry about cross-compatability, so I'll likely keep it crippled to prevent popular use. Who knows.

 

Regardless, this is going to be fun!  ;)

 

EDIT: You will likely find holes in my plans, would you be kind enough to blast me on them even though this has gone off topic from forge?

Posted

LexManos, there is no need to be hostile.

-----------------------------------------------------

I decompiled MCPatcher's code tonight, and I can see where you are coming from.

 

Most of all, I want universal support for more advanced texture editing. Aesthetics are far too overlooked; I want to fix that. Judging by MCPatcher's use of byte code injection, fluff and crashing issues on a loaded client, Mojang is not going to adopt it. Forge is not going to adopt MCPatcher because Forge is only adding API for mods. Point taken.

 

If more control over texture editing is going to be universal, it would have to be lighter. I have experience with programming and have been looking for a mod to make a worthwhile project out of. I will be making a new HD patch from scratch with cleaner code and fewer features to maintain. I'm thinking something Mojang would be comfortable with adopting. When Mojang does add HD support just like you guys here at Forge did, I'd rather TP artists not lose all their teeth. Grum mentioned plans for HD support in the dev chat a few weeks ago.

 

I know there is no current need for another HD patch, so I don't really need to worry about compatability. I'll go ahead and edit base files to avoid bytecode injection. TP artists shouldn't worry about cross-compatability, so I'll likely keep it crippled to prevent popular use. Who knows.

 

Regardless, this is going to be fun!  ;)

 

EDIT: You will likely find holes in my plans, would you be kind enough to blast me on them even though this has gone off topic from forge?

 

texture pack == no mods in 99/100 cases

 

why? cause mods themselves have 16x16 textures, and almost no texture packs have support for those mods

 

so building something like optifine into forge is like adding a jet-engine to a car, not needed, costs more fuel then is required, and usually ends up with stuff going boom

Being noobish since 96, being dumb since birth!

Posted

Entoarox,

First off, I've been convinced OptiFine and MCPatcher should not be added to Forge and will help kill future repeat suggestions for my penance. ;)

Also, you are right, mod support from TPs is not very common. However, mods are not the application of the additional graphics features.

Posted

the issue though is, that most people who use optifine with forge, actually do so for GFX and FPS improvements, not for texture packs

 

such improvements i'd see as being a "good" idea to have in forge, but as we have a perfectly working forge-compatible optifine available, why bother?

 

note: anyone asking about ML or MLMP should be reminded forge NEEDED those to work, neither forge nor optifine NEED the other to work

Being noobish since 96, being dumb since birth!

Posted

the issue though is, that most people who use optifine with forge, actually do so for GFX and FPS improvements, not for texture packs

 

such improvements i'd see as being a "good" idea to have in forge, but as we have a perfectly working forge-compatible optifine available, why bother?

 

note: anyone asking about ML or MLMP should be reminded forge NEEDED those to work, neither forge nor optifine NEED the other to work

And me, but more like it makes MC actually WORK.

Read the EAQ before posting! OR ELSE!

 

This isn't building better software, its trying to grab a place in the commit list of a highly visible github project.

 

www.forgeessentials.com

 

Don't PM me, I don't check this account unless I have to.

Posted

the issue though is, that most people who use optifine with forge, actually do so for GFX and FPS improvements, not for texture packs

 

such improvements i'd see as being a "good" idea to have in forge, but as we have a perfectly working forge-compatible optifine available, why bother?

 

note: anyone asking about ML or MLMP should be reminded forge NEEDED those to work, neither forge nor optifine NEED the other to work

And me, but more like it makes MC actually WORK.

Yep, MC in SP is unplayable for me, the lag spike o' death fix fixes that (I.E. just reducing the save frequency).

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Version 1.19 - Forge 41.0.63 I want to create a wolf entity that I can ride, so far it seems to be working, but the problem is that when I get on the wolf, I can’t control it. I then discovered that the issue is that the server doesn’t detect that I’m riding the wolf, so I’m struggling with synchronization. However, it seems to not be working properly. As I understand it, the server receives the packet but doesn’t register it correctly. I’m a bit new to Java, and I’ll try to provide all the relevant code and prints *The comments and prints are translated by chatgpt since they were originally in Spanish* Thank you very much in advance No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. MountableWolfEntity package com.vals.valscraft.entity; import com.vals.valscraft.network.MountSyncPacket; import com.vals.valscraft.network.NetworkHandler; import net.minecraft.client.Minecraft; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.ai.attributes.AttributeSupplier; import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.animal.Wolf; import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.Entity; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; import net.minecraft.world.phys.Vec3; import net.minecraftforge.event.TickEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.network.PacketDistributor; public class MountableWolfEntity extends Wolf { private boolean hasSaddle; private static final EntityDataAccessor<Byte> DATA_ID_FLAGS = SynchedEntityData.defineId(MountableWolfEntity.class, EntityDataSerializers.BYTE); public MountableWolfEntity(EntityType<? extends Wolf> type, Level level) { super(type, level); this.hasSaddle = false; } @Override protected void defineSynchedData() { super.defineSynchedData(); this.entityData.define(DATA_ID_FLAGS, (byte)0); } public static AttributeSupplier.Builder createAttributes() { return Wolf.createAttributes() .add(Attributes.MAX_HEALTH, 20.0) .add(Attributes.MOVEMENT_SPEED, 0.3); } @Override public InteractionResult mobInteract(Player player, InteractionHand hand) { ItemStack itemstack = player.getItemInHand(hand); if (itemstack.getItem() == Items.SADDLE && !this.hasSaddle()) { if (!player.isCreative()) { itemstack.shrink(1); } this.setSaddle(true); return InteractionResult.SUCCESS; } else if (!level.isClientSide && this.hasSaddle()) { player.startRiding(this); MountSyncPacket packet = new MountSyncPacket(true); // 'true' means the player is mounted NetworkHandler.CHANNEL.sendToServer(packet); // Ensure the server handles the packet return InteractionResult.SUCCESS; } return InteractionResult.PASS; } @Override public void travel(Vec3 travelVector) { if (this.isVehicle() && this.getControllingPassenger() instanceof Player) { System.out.println("The wolf has a passenger."); System.out.println("The passenger is a player."); Player player = (Player) this.getControllingPassenger(); // Ensure the player is the controller this.setYRot(player.getYRot()); this.yRotO = this.getYRot(); this.setXRot(player.getXRot() * 0.5F); this.setRot(this.getYRot(), this.getXRot()); this.yBodyRot = this.getYRot(); this.yHeadRot = this.yBodyRot; float forward = player.zza; float strafe = player.xxa; if (forward <= 0.0F) { forward *= 0.25F; } this.flyingSpeed = this.getSpeed() * 0.1F; this.setSpeed((float) this.getAttributeValue(Attributes.MOVEMENT_SPEED) * 1.5F); this.setDeltaMovement(new Vec3(strafe, travelVector.y, forward).scale(this.getSpeed())); this.calculateEntityAnimation(this, false); } else { // The wolf does not have a passenger or the passenger is not a player System.out.println("No player is mounted, or the passenger is not a player."); super.travel(travelVector); } } public boolean hasSaddle() { return this.hasSaddle; } public void setSaddle(boolean hasSaddle) { this.hasSaddle = hasSaddle; } @Override protected void dropEquipment() { super.dropEquipment(); if (this.hasSaddle()) { this.spawnAtLocation(Items.SADDLE); this.setSaddle(false); } } @SubscribeEvent public static void onServerTick(TickEvent.ServerTickEvent event) { if (event.phase == TickEvent.Phase.START) { MinecraftServer server = net.minecraftforge.server.ServerLifecycleHooks.getCurrentServer(); if (server != null) { for (ServerPlayer player : server.getPlayerList().getPlayers()) { if (player.isPassenger() && player.getVehicle() instanceof MountableWolfEntity) { MountableWolfEntity wolf = (MountableWolfEntity) player.getVehicle(); System.out.println("Tick: " + player.getName().getString() + " is correctly mounted on " + wolf); } } } } } private boolean lastMountedState = false; @Override public void tick() { super.tick(); if (!this.level.isClientSide) { // Only on the server boolean isMounted = this.isVehicle() && this.getControllingPassenger() instanceof Player; // Only print if the state changed if (isMounted != lastMountedState) { if (isMounted) { Player player = (Player) this.getControllingPassenger(); // Verify the passenger is a player System.out.println("Server: Player " + player.getName().getString() + " is now mounted."); } else { System.out.println("Server: The wolf no longer has a passenger."); } lastMountedState = isMounted; } } } @Override public void addPassenger(Entity passenger) { super.addPassenger(passenger); if (passenger instanceof Player) { Player player = (Player) passenger; if (!this.level.isClientSide && player instanceof ServerPlayer) { // Send the packet to the server to indicate the player is mounted NetworkHandler.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer) player), new MountSyncPacket(true)); } } } @Override public void removePassenger(Entity passenger) { super.removePassenger(passenger); if (passenger instanceof Player) { Player player = (Player) passenger; if (!this.level.isClientSide && player instanceof ServerPlayer) { // Send the packet to the server to indicate the player is no longer mounted NetworkHandler.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer) player), new MountSyncPacket(false)); } } } @Override public boolean isControlledByLocalInstance() { Entity entity = this.getControllingPassenger(); return entity instanceof Player; } @Override public void positionRider(Entity passenger) { if (this.hasPassenger(passenger)) { double xOffset = Math.cos(Math.toRadians(this.getYRot() + 90)) * 0.4; double zOffset = Math.sin(Math.toRadians(this.getYRot() + 90)) * 0.4; passenger.setPos(this.getX() + xOffset, this.getY() + this.getPassengersRidingOffset() + passenger.getMyRidingOffset(), this.getZ() + zOffset); } } } MountSyncPacket package com.vals.valscraft.network; import com.vals.valscraft.entity.MountableWolfEntity; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; import net.minecraftforge.network.NetworkEvent; import java.util.function.Supplier; public class MountSyncPacket { private final boolean isMounted; public MountSyncPacket(boolean isMounted) { this.isMounted = isMounted; } public void encode(FriendlyByteBuf buffer) { buffer.writeBoolean(isMounted); } public static MountSyncPacket decode(FriendlyByteBuf buffer) { return new MountSyncPacket(buffer.readBoolean()); } public void handle(NetworkEvent.Context context) { context.enqueueWork(() -> { ServerPlayer player = context.getSender(); // Get the player from the context if (player != null) { // Verifies if the player has dismounted if (!isMounted) { Entity vehicle = player.getVehicle(); if (vehicle instanceof MountableWolfEntity wolf) { // Logic to remove the player as a passenger wolf.removePassenger(player); System.out.println("Server: Player " + player.getName().getString() + " is no longer mounted."); } } } }); context.setPacketHandled(true); // Marks the packet as handled } } networkHandler package com.vals.valscraft.network; import com.vals.valscraft.valscraft; import net.minecraft.resources.ResourceLocation; import net.minecraftforge.network.NetworkRegistry; import net.minecraftforge.network.simple.SimpleChannel; import net.minecraftforge.network.NetworkEvent; import java.util.function.Supplier; public class NetworkHandler { private static final String PROTOCOL_VERSION = "1"; public static final SimpleChannel CHANNEL = NetworkRegistry.newSimpleChannel( new ResourceLocation(valscraft.MODID, "main"), () -> PROTOCOL_VERSION, PROTOCOL_VERSION::equals, PROTOCOL_VERSION::equals ); public static void init() { int packetId = 0; // Register the mount synchronization packet CHANNEL.registerMessage( packetId++, MountSyncPacket.class, MountSyncPacket::encode, MountSyncPacket::decode, (msg, context) -> msg.handle(context.get()) // Get the context with context.get() ); } }  
    • Do you use features of inventory profiles next (ipnext) or is there a change without it?
    • Remove rubidium - you are already using embeddium, which is a fork of rubidium
  • Topics

×
×
  • Create New...

Important Information

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