Jump to content

Recommended Posts

Posted

When i running a server a got this error:

 

Failed to start the minecraft server
net.minecraftforge.fml.LoadingFailedException: Loading errors encountered: [
        Cave (cave) has failed to load correctly
§7Attempted to load class net/minecraft/client/world/ClientWorld for invalid dist DEDICATED_SERVER
]
        at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:218) ~[?:?] {re:classloading}
        at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:200) ~[?:?] {re:classloading}
        at net.minecraftforge.fml.server.ServerModLoader.load(ServerModLoader.java:49) ~[?:?] {re:classloading}
        at net.minecraft.server.Main.main(Main.java:95) ~[?:?] {re:classloading}
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_271] {}
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_271] {}
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_271] {}
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_271] {}
        at net.minecraftforge.fml.loading.FMLServerLaunchProvider.lambda$launchService$0(FMLServerLaunchProvider.java:51) ~[forge.jar:32.0] {}
        at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-6.1.1.jar:?] {}
        at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-6.1.1.jar:?] {}
        at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-6.1.1.jar:?] {}
        at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-6.1.1.jar:?] {}
        at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-6.1.1.jar:?] {}
        at net.minecraftforge.server.ServerMain$Runner.runLauncher(ServerMain.java:63) [forge.jar:?] {}
        at net.minecraftforge.server.ServerMain$Runner.access$100(ServerMain.java:60) [forge.jar:?] {}
        at net.minecraftforge.server.ServerMain.main(ServerMain.java:57) [forge.jar:?] {}

 

Posted
package net.luis.cave;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import net.luis.cave.init.CaveArmor;
import net.luis.cave.init.CaveBlockItems;
import net.luis.cave.init.CaveBlocks;
import net.luis.cave.init.CaveEnchantment;
import net.luis.cave.init.CaveItems;
import net.luis.cave.init.CaveTools;
import net.minecraft.block.Blocks;
import net.minecraft.item.CrossbowItem;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;

@Mod("cave")
public class Cave {

    public static final Logger LOGGER = LogManager.getLogger();
    public static final String Mod_Id = "cave";
    public static final String Minecraft_Id = "minecraft";

    public Cave() {

    	FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff);
        
        CaveBlocks.BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus());
        CaveBlockItems.ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
        CaveItems.ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
        CaveItems.VANILLA_ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
        CaveTools.ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
        CaveArmor.ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
        CaveEnchantment.ENCHANTMENT.register(FMLJavaModLoadingContext.get().getModEventBus());
        CaveEnchantment.VANILLA_ENCHANTMENT.register(FMLJavaModLoadingContext.get().getModEventBus());

        MinecraftForge.EVENT_BUS.register(this);
     
    }

	private void setup(final FMLCommonSetupEvent event) {
    	
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.IRON_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> {
			
			return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F;
			
		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.GOLDEN_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> {
			
			return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F;
			
		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.DIAMOND_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> {
			
			return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F;
			
		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> {
			
			return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F;
			
		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> {
			
			return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F;
			
		});
		
		
		//Crossbow
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_CROSSBOW.get(), new ResourceLocation("pull"), (p_239427_0_, p_239427_1_, p_239427_2_) -> {
	    	  
			if (p_239427_2_ == null) {
	        	  
				return 0.0F;
	             
			} else {
	        	  
				return CrossbowItem.isCharged(p_239427_0_) ? 0.0F : (float)(p_239427_0_.getUseDuration() 
						- p_239427_2_.getItemInUseCount()) / (float)CrossbowItem.getChargeTime(p_239427_0_);
	             
			}
	          
		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_CROSSBOW.get(), new ResourceLocation("pulling"), (p_239426_0_, p_239426_1_, p_239426_2_) -> {
	    	   
			return p_239426_2_ != null && p_239426_2_.isHandActive() && p_239426_2_.getActiveItemStack() == 
					p_239426_0_ && !CrossbowItem.isCharged(p_239426_0_) ? 1.0F : 0.0F;
	          
		});
	       
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_CROSSBOW.get(), new ResourceLocation("charged"), (p_239425_0_, p_239425_1_, p_239425_2_) -> {
	    	   
			return p_239425_2_ != null && CrossbowItem.isCharged(p_239425_0_) ? 1.0F : 0.0F;
	          
		});
	       
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_CROSSBOW.get(), new ResourceLocation("firework"), (p_239424_0_, p_239424_1_, p_239424_2_) -> {
	    	   
			return p_239424_2_ != null && CrossbowItem.isCharged(p_239424_0_) && CrossbowItem.hasChargedProjectile(p_239424_0_, Items.FIREWORK_ROCKET) ? 1.0F : 0.0F;
	          
		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_CROSSBOW.get(), new ResourceLocation("pull"), (p_239427_0_, p_239427_1_, p_239427_2_) -> {
	    	  
			if (p_239427_2_ == null) {
	        	  
				return 0.0F;
	             
			} else {
	        	  
				return CrossbowItem.isCharged(p_239427_0_) ? 0.0F : (float)(p_239427_0_.getUseDuration() 
						- p_239427_2_.getItemInUseCount()) / (float)CrossbowItem.getChargeTime(p_239427_0_);
	             
			}
	          
		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_CROSSBOW.get(), new ResourceLocation("pulling"), (p_239426_0_, p_239426_1_, p_239426_2_) -> {
	    	   
			return p_239426_2_ != null && p_239426_2_.isHandActive() && p_239426_2_.getActiveItemStack() == 
					p_239426_0_ && !CrossbowItem.isCharged(p_239426_0_) ? 1.0F : 0.0F;
	          
		});
	       
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_CROSSBOW.get(), new ResourceLocation("charged"), (p_239425_0_, p_239425_1_, p_239425_2_) -> {
	    	   
			return p_239425_2_ != null && CrossbowItem.isCharged(p_239425_0_) ? 1.0F : 0.0F;
	          
		});
	       
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_CROSSBOW.get(), new ResourceLocation("firework"), (p_239424_0_, p_239424_1_, p_239424_2_) -> {
	    	   
			return p_239424_2_ != null && CrossbowItem.isCharged(p_239424_0_) && CrossbowItem.hasChargedProjectile(p_239424_0_, Items.FIREWORK_ROCKET) ? 1.0F : 0.0F;
	          
		});
		
		
		//Bow
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_BOW.get(), new ResourceLocation("pulling"), (p_239428_0_, p_239428_1_, p_239428_2_) -> {
			
			return p_239428_2_ != null && p_239428_2_.isHandActive() && p_239428_2_.getActiveItemStack() == p_239428_0_ ? 1.0F : 0.0F;
			
		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_BOW.get(), new ResourceLocation("pull"), (p_239429_0_, p_239429_1_, p_239429_2_) -> {
	
			if (p_239429_2_ == null) {
	
				return 0.0F;

			} else {
	
				return p_239429_2_.getActiveItemStack() != p_239429_0_ ? 0.0F : (float)(p_239429_0_.getUseDuration() - p_239429_2_.getItemInUseCount()) / 20.0F;

			}

		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_BOW.get(), new ResourceLocation("pulling"), (p_239428_0_, p_239428_1_, p_239428_2_) -> {
			
			return p_239428_2_ != null && p_239428_2_.isHandActive() && p_239428_2_.getActiveItemStack() == p_239428_0_ ? 1.0F : 0.0F;
			
		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_BOW.get(), new ResourceLocation("pull"), (p_239429_0_, p_239429_1_, p_239429_2_) -> {
	
			if (p_239429_2_ == null) {
	
				return 0.0F;

			} else {
	
				return p_239429_2_.getActiveItemStack() != p_239429_0_ ? 0.0F : (float)(p_239429_0_.getUseDuration() - p_239429_2_.getItemInUseCount()) / 20.0F;

			}

		});
    	
    }

    private void doClientStuff(FMLClientSetupEvent event) {
    	

    	
    }
    
	public static final ItemGroup BUILDING_BLOCKS = new ItemGroup("blocks") {

		@Override
		public ItemStack createIcon() {
			
			return new ItemStack(Blocks.BRICKS);
			
		}
		
	};
	
	public static final ItemGroup DECORATIONS = new ItemGroup("decorations") {

		@Override
		public ItemStack createIcon() {
			
			return new ItemStack(Blocks.PEONY);
			
		}
		
	};
	
	public static final ItemGroup MISC = new ItemGroup("misc") {

		@Override
		public ItemStack createIcon() {
			
			return new ItemStack(Items.LAVA_BUCKET);
			
		}
		
	};
	
	public static final ItemGroup FOOD = new ItemGroup("food") {

		@Override
		public ItemStack createIcon() {
			
			return new ItemStack(Items.APPLE);
			
		}
		
	};
	
	public static final ItemGroup TOOLS = new ItemGroup("tools") {

		@Override
		public ItemStack createIcon() {
			
			return new ItemStack(Items.IRON_AXE);
			
		}
		
	};
	
	public static final ItemGroup Armor = new ItemGroup("armor") {

		@Override
		public ItemStack createIcon() {
			
			return new ItemStack(Items.CHAINMAIL_CHESTPLATE);
			
		}
		
	};
	
	public static final ItemGroup WEAPONS = new ItemGroup("weapons") {

		@Override
		public ItemStack createIcon() {
			
			return new ItemStack(Items.GOLDEN_SWORD);
			
		}
		
	};

}

 

Posted
8 minutes ago, diesieben07 said:

ItemModelsProperties is a client-only class (indicated by @OnlyIn(CLIENT) on the class). You cannot use it from common code.

okay but now i get this error:

Attempted to load class net/minecraft/client/world/ClientWorld for invalid dist DEDICATED_SERVER
←[m←[1;31m[21:49:17] [modloading-worker-4/ERROR] [ne.mi.fm.ja.FMLModContainer/LOADING]: Failed to create mod instance. ModID: cave, class net.luis.cave.Cave
java.lang.RuntimeException: Attempted to load class net/minecraft/client/world/ClientWorld for invalid dist DEDICATED_SERVER
        at net.minecraftforge.fml.loading.RuntimeDistCleaner.processClassWithFlags(RuntimeDistCleaner.java:71) ~[forge.jar:32.0] {}
        at cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:82) ~[modlauncher-6.1.1.jar:?] {}
        at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:118) ~[modlauncher-6.1.1.jar:?] {}
        at cpw.mods.modlauncher.TransformingClassLoader$DelegatedClassLoader.findClass(TransformingClassLoader.java:247) ~[modlauncher-6.1.1.jar:?] {}
        at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:134) ~[modlauncher-6.1.1.jar:?] {re:classloading}
        at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:96) ~[modlauncher-6.1.1.jar:?] {re:classloading}
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_271] {}
        at java.lang.Class.getDeclaredMethods0(Native Method) ~[?:1.8.0_271] {}
        at java.lang.Class.privateGetDeclaredMethods(Unknown Source) ~[?:1.8.0_271] {}
        at java.lang.Class.getDeclaredMethod(Unknown Source) ~[?:1.8.0_271] {}
        at net.minecraftforge.eventbus.EventBus.getDeclMethod(EventBus.java:83) ~[eventbus-3.0.3-service.jar:?] {}
        at net.minecraftforge.eventbus.EventBus.lambda$null$4(EventBus.java:95) ~[eventbus-3.0.3-service.jar:?] {}
        at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) ~[?:1.8.0_271] {}
        at java.util.HashMap$KeySpliterator.tryAdvance(Unknown Source) ~[?:1.8.0_271] {}
        at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) ~[?:1.8.0_271] {}
        at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) ~[?:1.8.0_271] {}
        at java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[?:1.8.0_271] {}
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[?:1.8.0_271] {}
        at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source) ~[?:1.8.0_271] {}
        at java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[?:1.8.0_271] {}
        at java.util.stream.ReferencePipeline.findFirst(Unknown Source) ~[?:1.8.0_271] {}
        at net.minecraftforge.eventbus.EventBus.lambda$registerObject$7(EventBus.java:97) ~[eventbus-3.0.3-service.jar:?] {}
        at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) ~[?:1.8.0_271] {}
        at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) ~[?:1.8.0_271] {}
        at java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown Source) ~[?:1.8.0_271] {}
        at java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[?:1.8.0_271] {}
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[?:1.8.0_271] {}
        at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source) ~[?:1.8.0_271] {}
        at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source) ~[?:1.8.0_271] {}
        at java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[?:1.8.0_271] {}
        at java.util.stream.ReferencePipeline.forEach(Unknown Source) ~[?:1.8.0_271] {}
        at net.minecraftforge.eventbus.EventBus.registerObject(EventBus.java:94) ~[eventbus-3.0.3-service.jar:?] {}
        at net.minecraftforge.eventbus.EventBus.register(EventBus.java:120) ~[eventbus-3.0.3-service.jar:?] {}
        at net.luis.cave.Cave.<init>(Cave.java:45) ~[?:1.0] {re:classloading}
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_271] {}
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_271] {}
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_271] {}
        at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_271] {}
        at java.lang.Class.newInstance(Unknown Source) ~[?:1.8.0_271] {}
        at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:136) ~[?:32.0] {re:classloading}
        at net.minecraftforge.fml.javafmlmod.FMLModContainer$ErroringConsumer.accept(FMLModContainer.java:190) ~[?:32.0] {re:classloading}
        at net.minecraftforge.fml.ModContainer.transitionState(ModContainer.java:113) ~[?:?] {re:classloading}
        at net.minecraftforge.fml.ModList.lambda$null$11(ModList.java:135) ~[?:?] {re:classloading}
        at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) [?:1.8.0_271] {}
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source) [?:1.8.0_271] {}
        at java.util.stream.AbstractPipeline.copyInto(Unknown Source) [?:1.8.0_271] {}
        at java.util.stream.ForEachOps$ForEachTask.compute(Unknown Source) [?:1.8.0_271] {}
        at java.util.concurrent.CountedCompleter.exec(Unknown Source) [?:1.8.0_271] {}
        at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) [?:1.8.0_271] {}
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source) [?:1.8.0_271] {}
        at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) [?:1.8.0_271] {}
        at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) [?:1.8.0_271] {}
←[m←[1;31m[21:49:17] [modloading-worker-4/ERROR] [ne.mi.fm.ja.FMLModContainer/LOADING]: An error occurred while dispatching event CONSTRUCT to cave
←[m←[1;31m[21:49:17] [modloading-worker-4/FATAL] [ne.mi.ev.EventBus/EVENTBUS]: EventBus 7 shutting down - future events will not be posted.
java.lang.Exception: stacktrace
        at net.minecraftforge.eventbus.EventBus.shutdown(EventBus.java:317) ~[eventbus-3.0.3-service.jar:?] {}
        at net.minecraftforge.fml.javafmlmod.FMLModContainer.afterEvent(FMLModContainer.java:123) ~[?:32.0] {re:classloading}
        at net.minecraftforge.fml.javafmlmod.FMLModContainer$ErroringConsumer.accept(FMLModContainer.java:190) ~[?:32.0] {re:classloading}
        at net.minecraftforge.fml.ModContainer.transitionState(ModContainer.java:113) ~[?:?] {re:classloading}
        at net.minecraftforge.fml.ModList.lambda$null$11(ModList.java:135) ~[?:?] {re:classloading}
        at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) [?:1.8.0_271] {}
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source) [?:1.8.0_271] {}
        at java.util.stream.AbstractPipeline.copyInto(Unknown Source) [?:1.8.0_271] {}
        at java.util.stream.ForEachOps$ForEachTask.compute(Unknown Source) [?:1.8.0_271] {}
        at java.util.concurrent.CountedCompleter.exec(Unknown Source) [?:1.8.0_271] {}
        at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) [?:1.8.0_271] {}
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source) [?:1.8.0_271] {}
        at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) [?:1.8.0_271] {}
        at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) [?:1.8.0_271] {}
←[m←[1;31m[21:49:17] [main/FATAL] [ne.mi.fm.ModLoader/LOADING]: Failed to complete lifecycle event CONSTRUCT, 1 errors found
←[m←[1;31m[21:49:17] [main/FATAL] [minecraft/Main]: Failed to start the minecraft server
net.minecraftforge.fml.LoadingFailedException: Loading errors encountered: [
        Cave (cave) has failed to load correctly
§7Attempted to load class net/minecraft/client/world/ClientWorld for invalid dist DEDICATED_SERVER
]
        at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:218) ~[?:?] {re:classloading}
        at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:200) ~[?:?] {re:classloading}
        at net.minecraftforge.fml.server.ServerModLoader.load(ServerModLoader.java:49) ~[?:?] {re:classloading}
        at net.minecraft.server.Main.main(Main.java:95) ~[?:?] {re:classloading}
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_271] {}
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_271] {}
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_271] {}
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_271] {}
        at net.minecraftforge.fml.loading.FMLServerLaunchProvider.lambda$launchService$0(FMLServerLaunchProvider.java:51) ~[forge.jar:32.0] {}
        at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-6.1.1.jar:?] {}
        at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-6.1.1.jar:?] {}
        at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-6.1.1.jar:?] {}
        at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-6.1.1.jar:?] {}
        at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-6.1.1.jar:?] {}
        at net.minecraftforge.server.ServerMain$Runner.runLauncher(ServerMain.java:63) [forge.jar:?] {}
        at net.minecraftforge.server.ServerMain$Runner.access$100(ServerMain.java:60) [forge.jar:?] {}
        at net.minecraftforge.server.ServerMain.main(ServerMain.java:57) [forge.jar:?] {}

 

Posted
1 minute ago, diesieben07 said:

I am not sure how you expect us to diagnose the new problem without posting the new code.

package net.luis.cave;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import net.luis.cave.init.CaveArmor;
import net.luis.cave.init.CaveBlockItems;
import net.luis.cave.init.CaveBlocks;
import net.luis.cave.init.CaveEnchantment;
import net.luis.cave.init.CaveItems;
import net.luis.cave.init.CaveTools;
import net.minecraft.block.Blocks;
import net.minecraft.item.CrossbowItem;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;

@Mod("cave")
public class Cave {

    public static final Logger LOGGER = LogManager.getLogger();
    public static final String Mod_Id = "cave";
    public static final String Minecraft_Id = "minecraft";

    public Cave() {

    	FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff);
        
        CaveBlocks.BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus());
        CaveBlockItems.ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
        CaveItems.ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
        CaveItems.VANILLA_ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
        CaveTools.ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
        CaveArmor.ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
        CaveEnchantment.ENCHANTMENT.register(FMLJavaModLoadingContext.get().getModEventBus());
        CaveEnchantment.VANILLA_ENCHANTMENT.register(FMLJavaModLoadingContext.get().getModEventBus());

        MinecraftForge.EVENT_BUS.register(this);
     
    }

	private void setup(final FMLCommonSetupEvent event) {
    	
		
    	
    }

    private void doClientStuff(FMLClientSetupEvent event) {
    	
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.IRON_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> {
			
			return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F;
			
		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.GOLDEN_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> {
			
			return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F;
			
		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.DIAMOND_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> {
			
			return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F;
			
		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> {
			
			return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F;
			
		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> {
			
			return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F;
			
		});
		
		
		//Crossbow
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_CROSSBOW.get(), new ResourceLocation("pull"), (p_239427_0_, p_239427_1_, p_239427_2_) -> {
	    	  
			if (p_239427_2_ == null) {
	        	  
				return 0.0F;
	             
			} else {
	        	  
				return CrossbowItem.isCharged(p_239427_0_) ? 0.0F : (float)(p_239427_0_.getUseDuration() 
						- p_239427_2_.getItemInUseCount()) / (float)CrossbowItem.getChargeTime(p_239427_0_);
	             
			}
	          
		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_CROSSBOW.get(), new ResourceLocation("pulling"), (p_239426_0_, p_239426_1_, p_239426_2_) -> {
	    	   
			return p_239426_2_ != null && p_239426_2_.isHandActive() && p_239426_2_.getActiveItemStack() == 
					p_239426_0_ && !CrossbowItem.isCharged(p_239426_0_) ? 1.0F : 0.0F;
	          
		});
	       
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_CROSSBOW.get(), new ResourceLocation("charged"), (p_239425_0_, p_239425_1_, p_239425_2_) -> {
	    	   
			return p_239425_2_ != null && CrossbowItem.isCharged(p_239425_0_) ? 1.0F : 0.0F;
	          
		});
	       
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_CROSSBOW.get(), new ResourceLocation("firework"), (p_239424_0_, p_239424_1_, p_239424_2_) -> {
	    	   
			return p_239424_2_ != null && CrossbowItem.isCharged(p_239424_0_) && CrossbowItem.hasChargedProjectile(p_239424_0_, Items.FIREWORK_ROCKET) ? 1.0F : 0.0F;
	          
		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_CROSSBOW.get(), new ResourceLocation("pull"), (p_239427_0_, p_239427_1_, p_239427_2_) -> {
	    	  
			if (p_239427_2_ == null) {
	        	  
				return 0.0F;
	             
			} else {
	        	  
				return CrossbowItem.isCharged(p_239427_0_) ? 0.0F : (float)(p_239427_0_.getUseDuration() 
						- p_239427_2_.getItemInUseCount()) / (float)CrossbowItem.getChargeTime(p_239427_0_);
	             
			}
	          
		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_CROSSBOW.get(), new ResourceLocation("pulling"), (p_239426_0_, p_239426_1_, p_239426_2_) -> {
	    	   
			return p_239426_2_ != null && p_239426_2_.isHandActive() && p_239426_2_.getActiveItemStack() == 
					p_239426_0_ && !CrossbowItem.isCharged(p_239426_0_) ? 1.0F : 0.0F;
	          
		});
	       
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_CROSSBOW.get(), new ResourceLocation("charged"), (p_239425_0_, p_239425_1_, p_239425_2_) -> {
	    	   
			return p_239425_2_ != null && CrossbowItem.isCharged(p_239425_0_) ? 1.0F : 0.0F;
	          
		});
	       
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_CROSSBOW.get(), new ResourceLocation("firework"), (p_239424_0_, p_239424_1_, p_239424_2_) -> {
	    	   
			return p_239424_2_ != null && CrossbowItem.isCharged(p_239424_0_) && CrossbowItem.hasChargedProjectile(p_239424_0_, Items.FIREWORK_ROCKET) ? 1.0F : 0.0F;
	          
		});
		
		
		//Bow
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_BOW.get(), new ResourceLocation("pulling"), (p_239428_0_, p_239428_1_, p_239428_2_) -> {
			
			return p_239428_2_ != null && p_239428_2_.isHandActive() && p_239428_2_.getActiveItemStack() == p_239428_0_ ? 1.0F : 0.0F;
			
		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_BOW.get(), new ResourceLocation("pull"), (p_239429_0_, p_239429_1_, p_239429_2_) -> {
	
			if (p_239429_2_ == null) {
	
				return 0.0F;

			} else {
	
				return p_239429_2_.getActiveItemStack() != p_239429_0_ ? 0.0F : (float)(p_239429_0_.getUseDuration() - p_239429_2_.getItemInUseCount()) / 20.0F;

			}

		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_BOW.get(), new ResourceLocation("pulling"), (p_239428_0_, p_239428_1_, p_239428_2_) -> {
			
			return p_239428_2_ != null && p_239428_2_.isHandActive() && p_239428_2_.getActiveItemStack() == p_239428_0_ ? 1.0F : 0.0F;
			
		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_BOW.get(), new ResourceLocation("pull"), (p_239429_0_, p_239429_1_, p_239429_2_) -> {
	
			if (p_239429_2_ == null) {
	
				return 0.0F;

			} else {
	
				return p_239429_2_.getActiveItemStack() != p_239429_0_ ? 0.0F : (float)(p_239429_0_.getUseDuration() - p_239429_2_.getItemInUseCount()) / 20.0F;

			}

		});
    	
    }
    
	public static final ItemGroup BUILDING_BLOCKS = new ItemGroup("blocks") {

		@Override
		public ItemStack createIcon() {
			
			return new ItemStack(Blocks.BRICKS);
			
		}
		
	};
	
	public static final ItemGroup DECORATIONS = new ItemGroup("decorations") {

		@Override
		public ItemStack createIcon() {
			
			return new ItemStack(Blocks.PEONY);
			
		}
		
	};
	
	public static final ItemGroup MISC = new ItemGroup("misc") {

		@Override
		public ItemStack createIcon() {
			
			return new ItemStack(Items.LAVA_BUCKET);
			
		}
		
	};
	
	public static final ItemGroup FOOD = new ItemGroup("food") {

		@Override
		public ItemStack createIcon() {
			
			return new ItemStack(Items.APPLE);
			
		}
		
	};
	
	public static final ItemGroup TOOLS = new ItemGroup("tools") {

		@Override
		public ItemStack createIcon() {
			
			return new ItemStack(Items.IRON_AXE);
			
		}
		
	};
	
	public static final ItemGroup Armor = new ItemGroup("armor") {

		@Override
		public ItemStack createIcon() {
			
			return new ItemStack(Items.CHAINMAIL_CHESTPLATE);
			
		}
		
	};
	
	public static final ItemGroup WEAPONS = new ItemGroup("weapons") {

		@Override
		public ItemStack createIcon() {
			
			return new ItemStack(Items.GOLDEN_SWORD);
			
		}
		
	};

}

 

Posted
4 minutes ago, diesieben07 said:

Yup, like I suspected... The new fancy side-only detection methods do not bloody work.

Use @EventBusSubscriber on a separate class with Dist.CLIENT (NOT @OnlyIn!) for your FMLClientSetupEvent subscription.

okay now i creat this class but need i this:

 

@OnlyIn(Dist.CLIENT)

 

package net.luis.cave.procedure;

import net.luis.cave.Cave;
import net.luis.cave.init.CaveTools;
import net.minecraft.item.CrossbowItem;
import net.minecraft.item.Items;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;

@Mod.EventBusSubscriber(modid=Cave.Mod_Id, bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT)
public class CaveItemModelsProperties {
	
	@SubscribeEvent
	public static void doClientStuff(FMLClientSetupEvent event) {
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.IRON_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> {
			
			return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F;
			
		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.GOLDEN_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> {
			
			return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F;
			
		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.DIAMOND_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> {
			
			return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F;
			
		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> {
			
			return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F;
			
		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_SHIELD.get(), new ResourceLocation("blocking"), (p_239421_0_, p_239421_1_, p_239421_2_) -> {
			
			return p_239421_2_ != null && p_239421_2_.isHandActive() && p_239421_2_.getActiveItemStack() == p_239421_0_ ? 1.0F : 0.0F;
			
		});
		
		
		//Crossbow
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_CROSSBOW.get(), new ResourceLocation("pull"), (p_239427_0_, p_239427_1_, p_239427_2_) -> {
	    	  
			if (p_239427_2_ == null) {
	        	  
				return 0.0F;
	             
			} else {
	        	  
				return CrossbowItem.isCharged(p_239427_0_) ? 0.0F : (float)(p_239427_0_.getUseDuration() 
						- p_239427_2_.getItemInUseCount()) / (float)CrossbowItem.getChargeTime(p_239427_0_);
	             
			}
	          
		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_CROSSBOW.get(), new ResourceLocation("pulling"), (p_239426_0_, p_239426_1_, p_239426_2_) -> {
	    	   
			return p_239426_2_ != null && p_239426_2_.isHandActive() && p_239426_2_.getActiveItemStack() == 
					p_239426_0_ && !CrossbowItem.isCharged(p_239426_0_) ? 1.0F : 0.0F;
	          
		});
	       
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_CROSSBOW.get(), new ResourceLocation("charged"), (p_239425_0_, p_239425_1_, p_239425_2_) -> {
	    	   
			return p_239425_2_ != null && CrossbowItem.isCharged(p_239425_0_) ? 1.0F : 0.0F;
	          
		});
	       
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_CROSSBOW.get(), new ResourceLocation("firework"), (p_239424_0_, p_239424_1_, p_239424_2_) -> {
	    	   
			return p_239424_2_ != null && CrossbowItem.isCharged(p_239424_0_) && CrossbowItem.hasChargedProjectile(p_239424_0_, Items.FIREWORK_ROCKET) ? 1.0F : 0.0F;
	          
		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_CROSSBOW.get(), new ResourceLocation("pull"), (p_239427_0_, p_239427_1_, p_239427_2_) -> {
	    	  
			if (p_239427_2_ == null) {
	        	  
				return 0.0F;
	             
			} else {
	        	  
				return CrossbowItem.isCharged(p_239427_0_) ? 0.0F : (float)(p_239427_0_.getUseDuration() 
						- p_239427_2_.getItemInUseCount()) / (float)CrossbowItem.getChargeTime(p_239427_0_);
	             
			}
	          
		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_CROSSBOW.get(), new ResourceLocation("pulling"), (p_239426_0_, p_239426_1_, p_239426_2_) -> {
	    	   
			return p_239426_2_ != null && p_239426_2_.isHandActive() && p_239426_2_.getActiveItemStack() == 
					p_239426_0_ && !CrossbowItem.isCharged(p_239426_0_) ? 1.0F : 0.0F;
	          
		});
	       
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_CROSSBOW.get(), new ResourceLocation("charged"), (p_239425_0_, p_239425_1_, p_239425_2_) -> {
	    	   
			return p_239425_2_ != null && CrossbowItem.isCharged(p_239425_0_) ? 1.0F : 0.0F;
	          
		});
	       
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_CROSSBOW.get(), new ResourceLocation("firework"), (p_239424_0_, p_239424_1_, p_239424_2_) -> {
	    	   
			return p_239424_2_ != null && CrossbowItem.isCharged(p_239424_0_) && CrossbowItem.hasChargedProjectile(p_239424_0_, Items.FIREWORK_ROCKET) ? 1.0F : 0.0F;
	          
		});
		
		
		//Bow
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_BOW.get(), new ResourceLocation("pulling"), (p_239428_0_, p_239428_1_, p_239428_2_) -> {
			
			return p_239428_2_ != null && p_239428_2_.isHandActive() && p_239428_2_.getActiveItemStack() == p_239428_0_ ? 1.0F : 0.0F;
			
		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.ENDERITE_BOW.get(), new ResourceLocation("pull"), (p_239429_0_, p_239429_1_, p_239429_2_) -> {
	
			if (p_239429_2_ == null) {
	
				return 0.0F;

			} else {
	
				return p_239429_2_.getActiveItemStack() != p_239429_0_ ? 0.0F : (float)(p_239429_0_.getUseDuration() - p_239429_2_.getItemInUseCount()) / 20.0F;

			}

		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_BOW.get(), new ResourceLocation("pulling"), (p_239428_0_, p_239428_1_, p_239428_2_) -> {
			
			return p_239428_2_ != null && p_239428_2_.isHandActive() && p_239428_2_.getActiveItemStack() == p_239428_0_ ? 1.0F : 0.0F;
			
		});
		
    	net.minecraft.item.ItemModelsProperties.func_239418_a_(CaveTools.NETHERITE_BOW.get(), new ResourceLocation("pull"), (p_239429_0_, p_239429_1_, p_239429_2_) -> {
	
			if (p_239429_2_ == null) {
	
				return 0.0F;

			} else {
	
				return p_239429_2_.getActiveItemStack() != p_239429_0_ ? 0.0F : (float)(p_239429_0_.getUseDuration() - p_239429_2_.getItemInUseCount()) / 20.0F;

			}

		});
		
	}

}

 

Posted
5 minutes ago, diesieben07 said:

This is the wrong bus for this event.

 

I have no idea why you came to the conclusion that @OnlyIn would fix this.

okay thanks for help the server will now starts without an error

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



×
×
  • Create New...

Important Information

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