Jump to content

Recommended Posts

Posted

Hey guys,

 

I'm trying to figure a way to allow the removal of biomes via the config file.

My code so far looks like this:

 

 

package mods.B0bGary.Biomes;

import java.io.File;

import mods.B0bGary.Biomes.core.Reference;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.WorldChunkManager;
import net.minecraftforge.common.config.Configuration;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;

@Mod(modid="BiomeRemover", name="B0bGary's Biome Remover!", version=Reference.VERSION_NUMBER)


public class Base{

public static String version = Reference.VERSION_NUMBER;

@Instance("B0bGary's Biome Remover!")
public static Base instance;

public static String modid = "BiomeRemover";

public boolean doesPlainsSpawn;
public boolean doesDesertSpawn;
public boolean doesExtremeHillsSpawn;
public boolean doesForestSpawn;
public boolean doesTaigaSpawn;
public boolean doesSwampSpawn;
public boolean doesRiverSpawn;
public boolean doesFrozenOceanSpawn;
public boolean doesFrozenRiverSpawn;
public boolean doesIcePlainsSpawn;
public boolean doesIceMountainsSpawn;
public boolean doesMushroomSpawn;
public boolean doesMushroomShoreSpawn;
public boolean doesBeachSpawn;
public boolean doesDesertHillsSpawn;
public boolean doesForestHillsSpawn;
public boolean doesTaigaHillsSpawn;
public boolean doesExtremeHillsEdgeSpawn;
public boolean doesJungleSpawn;
public boolean doesJungleHillsSpawn;

public boolean doesOceanSpawn;
public boolean doesJungleEdgeSpawn;
public boolean doesDeepOceanSpawn;
public boolean doesStoneBeachSpawn;
public boolean doesColdBeachSpawn;
public boolean doesBirchForestSpawn;	
public boolean doesBirchForestHillsSpawn;
public boolean doesRoofedForestSpawn;
public boolean doesColdTaigaSpawn;
public boolean doesColdTaigaHillsSpawn;
public boolean doesMegaTaigaSpawn;
public boolean doesMegaTaigaHillsSpawn;
public boolean doesExtremeHillsPlusSpawn;
public boolean doesSavannaSpawn;
public boolean doesSavannaPlateauSpawn;
public boolean doesMesaSpawn;
public boolean doesMesaPlateau_FSpawn;
public boolean doesMesaPlateauSpawn;




public void initConfiguration(FMLInitializationEvent event){
	Configuration config = new Configuration(new File("config/Biome Remover.cfg"));
	config.load();
	doesPlainsSpawn=config.get("Biomes", "Enable Plains Biome?", true).getBoolean(true);
	doesExtremeHillsSpawn=config.get("Biomes", "Enable Extreme Hills Biome?", true).getBoolean(true);
	doesDesertSpawn=config.get("Biomes", "Enable Desert Biome?", true).getBoolean(true);
	doesForestSpawn=config.get("Biomes", "Enable Forest Biome?", true).getBoolean(true);
	doesTaigaSpawn=config.get("Biomes", "Enable Taiga Biome?", true).getBoolean(true);
	doesSwampSpawn=config.get("Biomes", "Enable Swamp Biome?", true).getBoolean(true);
	doesRiverSpawn=config.get("Biomes", "Enable River Biome?", true).getBoolean(true);
	doesFrozenOceanSpawn=config.get("Biomes", "Enable Frozen Ocean Biome?", true).getBoolean(true);
	doesFrozenRiverSpawn=config.get("Biomes", "Enable Frozen River Biome?", true).getBoolean(true);
	doesIcePlainsSpawn=config.get("Biomes", "Enable Ice Plains Biome?", true).getBoolean(true);
	doesIceMountainsSpawn=config.get("Biomes", "Enable Ice Mountains Biome?", true).getBoolean(true);
	doesMushroomSpawn=config.get("Biomes", "Enable Mushroom Island Biome?", true).getBoolean(true);
	doesMushroomShoreSpawn=config.get("Biomes", "Enable Mushroom Island Shore Biome?", true).getBoolean(true);
	doesBeachSpawn=config.get("Biomes", "Enable Beach Biome?", true).getBoolean(true);
	doesDesertHillsSpawn=config.get("Biomes", "Enable Desert Hills Biome?", true).getBoolean(true);
	doesForestHillsSpawn=config.get("Biomes", "Enable Forest Hills Biome?", true).getBoolean(true);
	doesTaigaHillsSpawn=config.get("Biomes", "Enable Taiga Hills Biome?", true).getBoolean(true);
	doesExtremeHillsEdgeSpawn=config.get("Biomes", "Enable Extreme Hills Edge Biome?", true).getBoolean(true);
	doesJungleSpawn=config.get("Biomes", "Enable Jungle Biome?", true).getBoolean(true);
	doesJungleHillsSpawn=config.get("Biomes", "Enable Jungle Hills Biome?", true).getBoolean(true);

	doesOceanSpawn=config.get("Biomes", "Enable Ocean Biome?", true).getBoolean(true);
	doesJungleEdgeSpawn=config.get("Biomes", "Enable Jungle Edge Biome?", true).getBoolean(true);
	doesDeepOceanSpawn=config.get("Biomes", "Enable Deep Ocean Biome?", true).getBoolean(true);
	doesStoneBeachSpawn=config.get("Biomes", "Enable Stone Beach Biome?", true).getBoolean(true);
	doesColdBeachSpawn=config.get("Biomes", "Enable Cold Beach Biome?", true).getBoolean(true);
	doesBirchForestSpawn=config.get("Biomes", "Enable Birch Forest Biome?", true).getBoolean(true);
	doesBirchForestHillsSpawn=config.get("Biomes", "Enable Birch Forest Hills Biome?", true).getBoolean(true);
	doesRoofedForestSpawn=config.get("Biomes", "Enable Roofed Forest Biome?", true).getBoolean(true);
	doesColdTaigaSpawn=config.get("Biomes", "Enable Cold Taiga Biome?", true).getBoolean(true);
	doesColdTaigaHillsSpawn=config.get("Biomes", "Enable Cold Taiga Hills Biome?", true).getBoolean(true);
	doesMegaTaigaSpawn=config.get("Biomes", "Enable Mega Taiga Biome?", true).getBoolean(true);
	doesMegaTaigaHillsSpawn=config.get("Biomes", "Enable Mega Taiga Hills Biome?", true).getBoolean(true);
	doesExtremeHillsPlusSpawn=config.get("Biomes", "Enable Exteme Hills Plus Biome?", true).getBoolean(true);
	doesSavannaSpawn=config.get("Biomes", "Enable Savanna Biome?", true).getBoolean(true);
	doesSavannaPlateauSpawn=config.get("Biomes", "Enable Savanna Plateau Biome?", true).getBoolean(true);
	doesMesaSpawn=config.get("Biomes", "Enable Mesa Biome?", true).getBoolean(true);
	doesMesaPlateau_FSpawn=config.get("Biomes", "Enable Mesa Plateau F Biome?", true).getBoolean(true);
	doesMesaPlateauSpawn=config.get("Biomes", "Enable Mesa Plateau Biome?", true).getBoolean(true);

	config.save();
}

//Init
    @EventHandler
public void preInit(FMLPreInitializationEvent event){
    	
	//biomes();
}
    
    @EventHandler
public void load(FMLInitializationEvent event) {
    	this.initConfiguration(event);

		biomes();


}
    @EventHandler
public void postInit(FMLPostInitializationEvent event){
    	//biomes();
}


   

public void biomes(){

	WorldChunkManager.allowedBiomes.clear();


	if(doesPlainsSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.plains);
	}
	if(doesDesertSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.desert);
	}
	if(doesExtremeHillsSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.extremeHills);
	}
	if(doesForestSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.forest);
	}
	if(doesTaigaSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.taiga);
	}
	if(doesSwampSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.swampland);
	}
	if(doesRiverSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.river);
	}
	if(doesFrozenOceanSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.frozenOcean);
	}
	if(doesFrozenRiverSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.frozenRiver);
	}
	if(doesIcePlainsSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.icePlains);
	}
	if(doesIceMountainsSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.iceMountains);
	}
	if(doesMushroomSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.mushroomIsland);
	}
	if(doesMushroomShoreSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.mushroomIslandShore);
	}
	if(doesBeachSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.beach);
	}
	if(doesDesertHillsSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.desertHills);
	}
	if(doesForestHillsSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.forestHills);
	}
	if(doesTaigaHillsSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.taigaHills);
	}
	if(doesExtremeHillsEdgeSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.extremeHillsEdge);
	}
	if(doesJungleSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.jungle);
	}
	if(doesJungleHillsSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.jungleHills);
	}

	if(doesOceanSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.ocean);
	}
	if(doesJungleEdgeSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.jungleEdge);
	}
	if(doesDeepOceanSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.deepOcean);
	}
	if(doesStoneBeachSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.stoneBeach);
	}
	if(doesColdBeachSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.coldBeach);
	}
	if(doesBirchForestSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.birchForest);
	}
	if(doesBirchForestHillsSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.birchForestHills);
	}
	if(doesRoofedForestSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.roofedForest);
	}
	if(doesColdTaigaSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.coldTaiga);
	}
	if(doesColdTaigaHillsSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.coldTaigaHills);
	}
	if(doesMegaTaigaSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.megaTaiga);
	}
	if(doesMegaTaigaHillsSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.megaTaigaHills);
	}
	if(doesExtremeHillsPlusSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.extremeHillsPlus);
	}
	if(doesSavannaSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.savanna);
	}
	if(doesSavannaPlateauSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.savannaPlateau);
	}
	if(doesMesaSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.mesa);
	}
	if(doesMesaPlateau_FSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.mesaPlateau_F);
	}
	if(doesMesaPlateauSpawn){
		WorldChunkManager.allowedBiomes.add(BiomeGenBase.mesaPlateau);
	}



   //  WorldChunkManager.allowedBiomes = new ArrayList<BiomeGenBase>(Arrays.asList(forestHills, _myBiome));
}



     
/*

private static void removeBiome(BiomeGenBase biome){
	List<BiomeEntry> biomesw = BiomeManager.warmBiomes;

	Iterator<BiomeEntry> checkw = biomesw.iterator();


	while (checkw.hasNext()){
		BiomeGenBase checkBiome = checkw.next().biome;
		if (checkBiome == biome){
			checkw.remove();
		}
	}
	List<BiomeEntry> biomesc = BiomeManager.coolBiomes;

	Iterator<BiomeEntry> checkc = biomesc.iterator();


	while (checkc.hasNext()){
		BiomeGenBase checkBiome = checkc.next().biome;
		if (checkBiome == biome){
			checkc.remove();
		}
	}
	List<BiomeEntry> biomesi = BiomeManager.icyBiomes;

	Iterator<BiomeEntry> checki = biomesi.iterator();


	while (checki.hasNext()){
		BiomeGenBase checkBiome = checki.next().biome;
		if (checkBiome == biome){
			checki.remove();
		}
	}
	/*
	List<BiomeEntry> biomesd = BiomeManager.desertBiomes;

			Iterator<BiomeEntry> checkd = biomesd.iterator();


			while (checkd.hasNext()){
				BiomeGenBase checkBiome = checkd.next().biome;
				if (checkBiome == biome){
					checkd.remove();
				}
			}
			*/


}

 

 

 

I've tried several variations, but the biomes still spawn.

Any help is greatly appreciated!

Thanks!

  • 2 weeks later...
Posted

Well, originally I had this:

 

 

private static void removeBiome(BiomeGenBase biome){
	List<BiomeEntry> biomesw = BiomeManager.warmBiomes;

	Iterator<BiomeEntry> checkw = biomesw.iterator();


	while (checkw.hasNext()){
		BiomeGenBase checkBiome = checkw.next().biome;
		if (checkBiome == biome){
			checkw.remove();
		}
	}
	List<BiomeEntry> biomesc = BiomeManager.coolBiomes;

	Iterator<BiomeEntry> checkc = biomesc.iterator();


	while (checkc.hasNext()){
		BiomeGenBase checkBiome = checkc.next().biome;
		if (checkBiome == biome){
			checkc.remove();
		}
	}
	List<BiomeEntry> biomesi = BiomeManager.icyBiomes;

	Iterator<BiomeEntry> checki = biomesi.iterator();


	while (checki.hasNext()){
		BiomeGenBase checkBiome = checki.next().biome;
		if (checkBiome == biome){
			checki.remove();
		}
	}

 

 

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.