Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Mods working with singleplayer, not with multiplayer


kyokyo866
 Share

Recommended Posts

I know this is a pretty common problem but it is one hell of a bugger to get rid of. 

 

I have version 1.12 and all of my mods are also 1.12 and they all work great on singleplayer (namely Lucky Box, Aether Legacy and Biomes o plenty is all I have) but when it comes to multiplayer, nothing happens other than being placed on the ground for a split second and then vanishing

 

I have my own server folder for it and everything, I've followed countless tutorials and other threads for hours and yet nothing seems to work. My only lead is this bit of code

 

[21:26:37] [Server thread/INFO] [FML]: Searching C:\Users\Kyokyo\Desktop\Forge Server\.\mods for mods
[21:26:39] [Server thread/INFO] [FML]: Forge Mod Loader has identified 8 mods to load
[21:26:39] [Server thread/WARN] [FML]: Missing English translation for FML: assets/fml/lang/en_us.lang
[21:26:40] [Server thread/WARN] [FML]: Missing English translation for orbis_api: assets/orbis_api/lang/en_us.lang
[21:26:40] [Server thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, aether_legacy, biomesoplenty, lucky, orbis_api] at CLIENT
[21:26:40] [Server thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, aether_legacy, biomesoplenty, lucky, orbis_api] at SERVER
[21:26:45] [Server thread/INFO] [FML]: Processing ObjectHolder annotations
[21:26:45] [Server thread/INFO] [FML]: Found 1169 ObjectHolder annotations
[21:26:45] [Server thread/INFO] [FML]: Identifying ItemStackHolder annotations
[21:26:45] [Server thread/INFO] [FML]: Found 0 ItemStackHolder annotations
[21:26:46] [Server thread/INFO] [FML]: Configured a dormant chunk cache size of 0
[21:26:46] [Forge Version Check/INFO] [forge.VersionCheck]: [forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
[21:26:47] [Forge Version Check/INFO] [forge.VersionCheck]: [forge] Found status: AHEAD Target: null

 

and also

 

[21:27:01] [Server thread/WARN] [FML]: No types have been added to Biome aether_legacy:aether_highlands, types have been assigned on a best-effort guess: [DRY, PLAINS]
[21:27:01] [Server thread/INFO] [FML]: Forge Mod Loader has successfully loaded 8 mods
[21:27:01] [Server thread/INFO] [minecraft/DedicatedServer]: Preparing level "world"
[21:27:01] [Server thread/INFO] [FML]: Injecting existing registry data into this server instance
[21:27:03] [Server thread/INFO] [FML]: Applying holder lookups
[21:27:03] [Server thread/INFO] [FML]: Holder lookups applied
[21:27:04] [Server thread/INFO] [FML]: Loading dimension 0 (world) (net.minecraft.server.dedicated.DedicatedServer@2a0d399e)
[21:27:06] [Server thread/INFO] [minecraft/AdvancementList]: Loaded 795 advancements
[21:27:07] [Server thread/INFO] [FML]: Loading dimension 1 (world) (net.minecraft.server.dedicated.DedicatedServer@2a0d399e)
[21:27:07] [Server thread/INFO] [STDOUT]: [biomesoplenty.common.world.BiomeProviderBOPHell:<init>:32]: settings for hell world: 
[21:27:07] [Server thread/INFO] [FML]: Loading dimension -1 (world) (net.minecraft.server.dedicated.DedicatedServer@2a0d399e)
[21:27:08] [Server thread/INFO] [FML]: Loading dimension 4 (world) (net.minecraft.server.dedicated.DedicatedServer@2a0d399e)
[21:27:08] [Server thread/INFO] [minecraft/MinecraftServer]: Preparing start region for level 0
[21:27:10] [Server thread/INFO] [minecraft/MinecraftServer]: Preparing spawn area: 0%
[21:27:11] [Server thread/INFO] [minecraft/MinecraftServer]: Preparing spawn area: 4%
[21:27:12] [Server thread/INFO] [minecraft/MinecraftServer]: Preparing spawn area: 20%
[21:27:13] [Server thread/INFO] [minecraft/MinecraftServer]: Preparing spawn area: 40%
[21:27:14] [Server thread/INFO] [minecraft/MinecraftServer]: Preparing spawn area: 56%
[21:27:15] [Server thread/INFO] [minecraft/MinecraftServer]: Preparing spawn area: 65%
[21:27:16] [Server thread/INFO] [minecraft/MinecraftServer]: Preparing spawn area: 72%
[21:27:17] [Server thread/INFO] [minecraft/DedicatedServer]: Done (15.533s)! For help, type "help" or "?"
[21:27:19] [Server thread/INFO] [OrbisAPI]: Creating file-backed world storage at C:\Users\Kyokyo\Desktop\Forge Server\.\world\DIM1\data\orbis\flat
[21:27:19] [Server thread/INFO] [FML]: Unloading dimension 1
[21:27:19] [Server thread/INFO] [OrbisAPI]: Creating file-backed world storage at C:\Users\Kyokyo\Desktop\Forge Server\.\world\DIM-1\data\orbis\flat
[21:27:19] [Server thread/INFO] [FML]: Unloading dimension -1
[21:27:19] [Server thread/INFO] [OrbisAPI]: Creating file-backed world storage at C:\Users\Kyokyo\Desktop\Forge Server\.\world\Dim-Aether\data\orbis\flat
[21:27:19] [Server thread/INFO] [FML]: Unloading dimension 4
[21:27:20] [Server thread/WARN] [minecraft/MinecraftServer]: Can't keep up! Did the system time change, or is the server overloaded? Running 2831ms behind, skipping 56 tick(s)
[21:28:03] [Server thread/INFO] [OrbisAPI]: Creating file-backed world storage at C:\Users\Kyokyo\Desktop\Forge Server\.\world\data\orbis\flat
 

 

To which I can't make a folder called . trust me I tried, and nothing I can do can make it see otherwise even though theres a normal mods folder right there with everything else

 

Please, is there any ideas to fix this?

Link to comment
Share on other sites

45 minutes ago, kyokyo866 said:

Please, is there any ideas to fix this?

 

46 minutes ago, kyokyo866 said:

[21:26:40] [Server thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, aether_legacy, biomesoplenty, lucky, orbis_api] at CLIENT
[21:26:40] [Server thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, aether_legacy, biomesoplenty, lucky, orbis_api] at SERVER

Either the server doesn't have the mods or you don't have the mods, are the mods in both mods folders?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Gotta love this, Random Loots was doing this earlier but I gotten "blessed" with a crash to refers off of.  

 

However you will has to likely do the "split half of the mods and load each group separately, and then the problem causing group to be split again and rinse and repeat until a mod is singled out" method. :( 

 

So with 8 mods you would do... 

1. Load 4 of them and see if the problem still exists if so split that into 2x2 mods otherwise...  

2. Split the other 4 batch into 2x2 mods then find the problem "batch" then split THAT batch once more 

3. You will then be left with the "problem" mod one way or another (crashing/it not working or the problem free final mod obviously pointing to the FINAL mod).  

 

 

Link to comment
Share on other sites

3 minutes ago, Animefan8888 said:

 

Either the server doesn't have the mods or you don't have the mods, are the mods in both mods folders?

Yup I have them in both the client and server

 

5 minutes ago, FriendlySurvival said:

Gotta love this, Random Loots was doing this earlier but I gotten "blessed" with a crash to refers off of.  

 

However you will has to likely do the "split half of the mods and load each group separately, and then the problem causing group to be split again and rinse and repeat until a mod is singled out" method. :( 

 

So with 8 mods you would do... 

1. Load 4 of them and see if the problem still exists if so split that into 2x2 mods otherwise...  

2. Split the other 4 batch into 2x2 mods then find the problem "batch" then split THAT batch once more 

3. You will then be left with the "problem" mod one way or another (crashing/it not working or the problem free final mod obviously pointing to the FINAL mod).  

Hm, considering 4 of the 8 were just defaults that came with the program i'll try to get rid of most of them to see what happens, which is still strange on that they all work on single player and youd think itd say it wasnt multiplayer compitable before hand? idk

Link to comment
Share on other sites

1 minute ago, kyokyo866 said:

Yup I have them in both the client and server

How are you running the server?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

I believe your server installation is in the wrong place. Can you show a screenshot of the file browser with a clear path like this?
 

Spoiler

image.png.bcde0b4e310e7852f47c078296b947be.png

 
 

 

Also, I believe that this is an incorrect category for your problem.

Edited by Belial
Wrong image.
Link to comment
Share on other sites

2 minutes ago, Belial said:

I believe your server installation is in the wrong place. Can you show a screenshot of the file browser with a clear path like this?
 

  Hide contents

image.png.6aaf7bc87fcc5ac388fda8da94d7a38d.png

 

Also, I believe that this is an incorrect category for your problem.

If it is I apologize, I saw some other people post in this subject for it so I assumed that was the one to go with

image.thumb.png.f84201c40c2e237a3615eb98058514ea.png

and this is what my main folder of it looks like

 

4 minutes ago, Animefan8888 said:

How are you running the server?

I run it via clicking on the minecraft_server1.1.12.2 jar then clicking on the main launch for forge to launch minecraft in the first place

Link to comment
Share on other sites

1 minute ago, kyokyo866 said:

I run it via clicking on the minecraft_server1.1.12.2 jar then clicking on the main launch for forge to launch minecraft in the first place

I believe you need to run the forge-1.12.2-(numbers)universal.jar

  • Like 1

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

4 minutes ago, kyokyo866 said:

it just ran a diagnostic then exited itself out, its where i got the code from the first post

 

Create a .txt (text) file, then paste this on that file:
 

@echo off
java -jar forge-1.12.2-14.23.4.2759-universal.jar nogui
pause


then "save as" it and name it "run.bat". Then, run that file to open the server.

Edited by Belial
Link to comment
Share on other sites

3 minutes ago, Belial said:


Create a .txt (text) file, then paste this on that file:

 


@echo off
java -jar forge-1.12.2-14.23.4.2759-universal.jar nogui
pause


then "save as" it and name it "run.bat". Then, run that file to open the server.

Did it but

 

image.png.53ea0cc9979392fcde6a9a7f27cb0eba.png

it still thinks its missing and trying to find a . folder

Link to comment
Share on other sites

3 minutes ago, kyokyo866 said:

it still thinks its missing and trying to find a . folder

My bad, I thought the server doesn't start when you run "universal.jar". As I checked out, it does.

I'm thinking about why it would check "." folder. I will reply if I can find anything.

Edited by Belial
Link to comment
Share on other sites

10 minutes ago, Belial said:

@kyokyo866 I suppose you did install it inside your minecraft folder, right?

Server file shouldn't generate versions as I know. Still, this isn't the issue as I recently checked out.

Nah theyre seperate, I just didnt know if it was the missing folders that was making it not work, that wasnt the case though

Link to comment
Share on other sites

Just now, kyokyo866 said:

Nah theyre seperate, I just didnt know if it was the missing folders that was making it not work, that wasnt the case though

 "C:\Users\Kyokyo\Desktop\Forge Server\.\mods" is equal to  "C:\Users\Kyokyo\Desktop\Forge Server\mods" btw. "." just stands for the current folder.

 

[21:26:40] [Server thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, aether_legacy, biomesoplenty, lucky, orbis_api] at CLIENT
[21:26:40] [Server thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, aether_legacy, biomesoplenty, lucky, orbis_api] at SERVER


is kinda self-handsake, it seems. I don't know purpose of it, but it occurs while server is starting, not joining. If your client doesn't have required mods, server wouldn't let client join.

What block and which mod's block was that you were trying to place?

Link to comment
Share on other sites

10 minutes ago, Belial said:

"C:\Users\Kyokyo\Desktop\Forge Server\.\mods" is equal to  "C:\Users\Kyokyo\Desktop\Forge Server\mods" btw. "." just stands for the current folder.

Well if the case then a move may resolve the problem by explicitly specing a non "." path like username/server for example? 

 

It's stupid but it may be simpler  and it comes in a "can" so why not just move it?

 

 

Link to comment
Share on other sites

2 minutes ago, FriendlySurvival said:

Well if the case then a move may resolve the problem by explicitly specing a non "." path like username/server for example? 

 

It's stupid but it may be simpler  and it comes in a "can" so why not just move it?

I was mistaken at first. Server clearly loads all the mods as you can see here:
 

[21:26:40] [Server thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, aether_legacy, biomesoplenty, lucky, orbis_api] at CLIENT
[21:26:40] [Server thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, aether_legacy, biomesoplenty, lucky, orbis_api] at SERVER

 

  • Thanks 1
Link to comment
Share on other sites

Since its been a while I checked again and it's come to just this, which really hasnt really changed anything

 

[23:51:30] [Server thread/INFO] [FML]: Searching C:\Users\Kyokyo\Desktop\Forge Server\.\mods for mods
[23:51:32] [Server thread/INFO] [FML]: Forge Mod Loader has identified 5 mods to load
[23:51:32] [Server thread/WARN] [FML]: Missing English translation for FML: assets/fml/lang/en_us.lang
[23:51:33] [Server thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, lucky] at CLIENT
[23:51:33] [Server thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, lucky] at SERVER
[23:51:38] [Server thread/INFO] [FML]: Processing ObjectHolder annotations

 

Even if it was a 'make it look at another folder' problem I wouldnt know how to tell it to do so.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
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.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Hello everyone, like the title suggest, I've a problem running dedicated server for my mod "emomod, Emotion's Mod", I understand that the problem is caused by my containers because of invalid dist and I understand the concept of side but I really struggle to fix it, for the lore I'm developing this mod since 5 or 6 years from now so it's a huge one, I have like 281 block textures, 167 item textures, biomes, game mechanics, dimensions, entities etc.. I love it but I kept it private for the moment (I may send it public soon) and I use to get back on it sometimes when I want to update the version (I also rewrite everything once because I suck to do so for the version 1.8 to 1.12 / 1.14) or add stuff for example, here is the log of the server :   I'm registering Biome, Block, ContainerType, TileEntityType etc.. In differents class that I'm calling in my main one called "MainRegistry" with the method init().   Firstly, the classe where I'm registering ContainerType is modestly named "ContainerTypeRegistry" (this is my convention), I've currently three type of container, "CRAFTER" wich is a complex automatic crafting machine, "BAG" is a bag item storing stuff using "ItemStackHandler" and finally Nightstand is a basic chest with less slots (4) using different color GUIs based on the wood used to craft, here is the code :   @Mod.EventBusSubscriber(modid = MainRegistry.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) public class ContainerTypeRegistry { private static final List<ContainerType<?>> containerTypeList = new ArrayList<ContainerType<?>>(); public static final ContainerType<CrafterContainer> CRAFTER = IForgeContainerType.create((windowId, inv, data) -> { BlockPos pos = data.readBlockPos(); return new CrafterContainer(windowId, MainRegistry.proxy.getClientWorld(), pos, MainRegistry.proxy.getClientPlayer()); }); public static final ContainerType<BagContainer> BAG = IForgeContainerType.create((windowId, inv, data) -> { return new BagContainer(windowId, inv); }); public static final ContainerType<NightstandContainer> NIGHTSTAND = IForgeContainerType.create((windowId, inv, data) -> { BlockPos pos = data.readBlockPos(); return new NightstandContainer(windowId, inv.player.getEntityWorld(), pos, inv); }); public static void init() { addContainerType(CRAFTER, "crafter"); addContainerType(BAG, "bag"); addContainerType(NIGHTSTAND, "nightstand"); } public static void addContainerType(ContainerType<?> tet, String name) { containerTypeList.add(tet.setRegistryName(name)); } @SubscribeEvent public static void registerContainerType(final RegistryEvent.Register<ContainerType<?>> e) { for (ContainerType<?> tet : containerTypeList) { e.getRegistry().register(tet); } } } Secondly, I'm using the same technique to register TileEntityType and I'm calling all those init methods but also ScreenManager.registerFactory() like I said in the main class just here :   @Mod(MainRegistry.MOD_ID) public class MainRegistry { public static final String MOD_ID = "emomod"; public static final Logger LOGGER = LogManager.getLogger(MOD_ID); public static IProxy proxy = DistExecutor.runForDist(() -> () -> new ClientProxy(), () -> () -> new ServerProxy()); public static MainRegistry instance; public static WorldType PARCEL_TYPE = new ParcelWorldType(); public static WorldType DREAM_TYPE = new DreamWorldType(); public MainRegistry() { ItemRegistry.init(); BlockRegistry.init(); TileEntityTypeRegistry.init(); EntityTypeRegistry.init(); SurfaceBuilderRegistry.init(); PlacementRegistry.init(); FeatureRegistry.init(); FluidRegistry.init(); ContainerTypeRegistry.init(); DispenserBlock.registerDispenseBehavior(PotionUtils.addPotionToItemStack(new ItemStack(Items.POTION), Potions.WATER).getItem(), new IInteractBehavior()); DispenserBlock.registerDispenseBehavior(Items.WHEAT_SEEDS, new IPlaceBehavior(Blocks.WHEAT, Blocks.FARMLAND)); DispenserBlock.registerDispenseBehavior(Items.PUMPKIN_SEEDS, new IPlaceBehavior(Blocks.PUMPKIN_STEM, Blocks.FARMLAND)); DispenserBlock.registerDispenseBehavior(Items.MELON_SEEDS, new IPlaceBehavior(Blocks.MELON_STEM, Blocks.FARMLAND)); DispenserBlock.registerDispenseBehavior(Items.BEETROOT_SEEDS, new IPlaceBehavior(Blocks.BEETROOTS, Blocks.FARMLAND)); DispenserBlock.registerDispenseBehavior(Items.CARROT, new IPlaceBehavior(Blocks.CARROTS, Blocks.FARMLAND)); DispenserBlock.registerDispenseBehavior(Items.POTATO, new IPlaceBehavior(Blocks.POTATOES, Blocks.FARMLAND)); DispenserBlock.registerDispenseBehavior(Items.OAK_SAPLING, new IPlaceBehavior(Blocks.OAK_SAPLING, Blocks.GRASS_BLOCK, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.PODZOL)); DispenserBlock.registerDispenseBehavior(Items.ACACIA_SAPLING, new IPlaceBehavior(Blocks.ACACIA_SAPLING, Blocks.GRASS_BLOCK, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.PODZOL)); DispenserBlock.registerDispenseBehavior(Items.BIRCH_SAPLING, new IPlaceBehavior(Blocks.BIRCH_SAPLING, Blocks.GRASS_BLOCK, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.PODZOL)); DispenserBlock.registerDispenseBehavior(Items.DARK_OAK_SAPLING, new IPlaceBehavior(Blocks.DARK_OAK_SAPLING, Blocks.GRASS_BLOCK, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.PODZOL)); DispenserBlock.registerDispenseBehavior(Items.JUNGLE_SAPLING, new IPlaceBehavior(Blocks.JUNGLE_SAPLING, Blocks.GRASS_BLOCK, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.PODZOL)); DispenserBlock.registerDispenseBehavior(Items.SPRUCE_SAPLING, new IPlaceBehavior(Blocks.SPRUCE_SAPLING, Blocks.GRASS_BLOCK, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.PODZOL)); DispenserBlock.registerDispenseBehavior(Items.BAMBOO, new IPlaceBehavior(Blocks.BAMBOO_SAPLING, Blocks.GRASS_BLOCK, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.PODZOL)); DispenserBlock.registerDispenseBehavior(Items.NETHER_WART, new IPlaceBehavior(Blocks.NETHER_WART, Blocks.SOUL_SAND, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.PODZOL)); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientSetup); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::serverSetup); MinecraftForge.EVENT_BUS.register(new EmotionOverlayEvent()); MinecraftForge.EVENT_BUS.register(new EmotionLivingEvent()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySign.class, new TileEntitySignRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCrafter.class, new TileEntityCrafterRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPot.class, new TileEntityPotRenderer()); LootConditionManager.registerCondition(new HarvestLevelCondition.Serializer()); EmomodPacketHandler.registerMessages(); } private void setup(final FMLCommonSetupEvent e) { proxy.init(); RenderingRegistry.registerEntityRenderingHandler(OrbSpellEntity.class, render -> new SpriteRenderer<OrbSpellEntity>(render, Minecraft.getInstance().getItemRenderer())); RenderingRegistry.registerEntityRenderingHandler(EntityButterfly.class, render -> new RendererButterfly(render)); RenderingRegistry.registerEntityRenderingHandler(EntityBeetle.class, render -> new RendererBasic<EntityBeetle, ModelBeetle>(render, new ModelBeetle(), 0.175f, new ResourceLocation(MainRegistry.MOD_ID, "textures/entity/beetle.png"))); RenderingRegistry.registerEntityRenderingHandler(EntityLightningBug.class, render -> new RendererBasic<EntityLightningBug, ModelLightningBug>(render, new ModelLightningBug(), 0.0f, new ResourceLocation(MainRegistry.MOD_ID, "textures/entity/lightning_bug.png"))); RenderingRegistry.registerEntityRenderingHandler(EntityBoat.class, RendererBoat::new); RenderingRegistry.registerEntityRenderingHandler(EntityChubby.class, render -> new RendererBasic<EntityChubby, ModelChubby>(render, new ModelChubby(), .2f, new ResourceLocation(MainRegistry.MOD_ID, "textures/entity/chubby.png"))); RenderingRegistry.registerEntityRenderingHandler(EntityMouse.class, render -> new RendererMouse(render, new ModelMouse(), 0.1f)); RenderingRegistry.registerEntityRenderingHandler(EntityOrchardSpider.class, render -> new RendererOrchardSpider<EntityOrchardSpider>(render)); EmoOreGeneration.setupOreGeneration(); // RecipeRegistry.init(); } private void clientSetup(final FMLClientSetupEvent e) { EmoStaff staff = (EmoStaff) ItemRegistry.PURPURA_STAFF; Minecraft.getInstance().getItemColors().register((item, tintIndex) -> { return staff.getColor(new ItemStack(staff), tintIndex); }, staff); Minecraft.getInstance().getItemColors().register((item, tintIndex) -> { return GrassColors.get(0.5D, 1.0D); }, BlockRegistry.FLOWER_TALLGRASS); Minecraft.getInstance().getItemColors().register((item, tintIndex) -> { BlockState blockstate = ((BlockItem) item.getItem()).getBlock().getDefaultState(); return Minecraft.getInstance().getBlockColors().getColor(blockstate, (IEnviromentBlockReader) null, (BlockPos) null, tintIndex); }, BlockRegistry.LEAVES_CHERRY, BlockRegistry.LEAVES_PEAR, BlockRegistry.LEAVES_ORANGE, BlockRegistry.LEAVES_ATLAS, BlockRegistry.LEAVES_PINE, BlockRegistry.LEAVES_COCO, BlockRegistry.LEAVES_DREAM); Minecraft.getInstance().getBlockColors().register((state, reader, pos, color) -> { return reader != null && pos != null ? BiomeColors.getGrassColor(reader, pos) : GrassColors.get(0.5D, 1.0D); }, BlockRegistry.FLOWER_TALLGRASS); Minecraft.getInstance().getBlockColors().register((state, reader, pos, color) -> { return reader != null && pos != null ? BiomeColors.getFoliageColor(reader, pos) : FoliageColors.getDefault(); }, BlockRegistry.LEAVES_PINE, BlockRegistry.LEAVES_COCO, BlockRegistry.LEAVES_DREAM); Minecraft.getInstance().getBlockColors().register((state, reader, pos, color) -> { return 0xac73af; }, BlockRegistry.LEAVES_CHERRY); Minecraft.getInstance().getBlockColors().register((state, reader, pos, color) -> { return 0x487748; }, BlockRegistry.LEAVES_PEAR); Minecraft.getInstance().getBlockColors().register((state, reader, pos, color) -> { return 0x45a14a; }, BlockRegistry.LEAVES_ORANGE); Minecraft.getInstance().getBlockColors().register((state, reader, pos, color) -> { return 0x4496c4; }, BlockRegistry.LEAVES_ATLAS); ScreenManager.<CrafterContainer, CrafterScreen>registerFactory(ContainerTypeRegistry.CRAFTER, (container, playerInventory, title) -> { return new CrafterScreen(container, playerInventory, title); }); ScreenManager.<BagContainer, BagScreen>registerFactory(ContainerTypeRegistry.BAG, (container, playerInventory, title) -> { return new BagScreen(container, playerInventory, title); }); ScreenManager.<NightstandContainer, NightstandScreen>registerFactory(ContainerTypeRegistry.NIGHTSTAND, (container, playerInventory, title) -> { return new NightstandScreen(container, playerInventory, title, container.getTileEntity().getColor()); }); } private void serverSetup(final FMLDedicatedServerSetupEvent e) { } } Finally for the specific class I'm only gonna send the Nightstand one in random way :   - Block class :   public class EmoNightstand extends Block { private static final DirectionProperty FACING = HorizontalBlock.HORIZONTAL_FACING; private static final VoxelShape NIGHTSTAND_SHAPE = Block.makeCuboidShape(1.0D, 0.0D, 1.0D, 15.0D, 15.0D, 15.0D); private float[] color; public EmoNightstand(Properties properties, float[] color) { super(properties); this.getDefaultState().with(FACING, Direction.NORTH); this.color = color; } @Override public VoxelShape getCollisionShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { return NIGHTSTAND_SHAPE; } @Override public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { return NIGHTSTAND_SHAPE; } @Override public boolean onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { if (!worldIn.isRemote) { TileEntity tileEntity = worldIn.getTileEntity(pos); if (tileEntity instanceof INamedContainerProvider) { NetworkHooks.openGui((ServerPlayerEntity) player, (INamedContainerProvider) tileEntity, tileEntity.getPos()); } } return true; } public BlockState getStateForPlacement(BlockItemUseContext context) { return this.getDefaultState().with(FACING, context.getPlacementHorizontalFacing().getOpposite()); } protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) { builder.add(FACING); } @Override public boolean hasTileEntity(BlockState state) { return true; } @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { return new TileEntityNightstand(this.color); } } - The ContainerScreen class :   public class NightstandScreen extends ContainerScreen<NightstandContainer> { private static final ResourceLocation NIGHTSTAND_GUI_SCREEN = new ResourceLocation(MainRegistry.MOD_ID, "textures/gui/container/nightstand.png"); private float[] color; public NightstandScreen(NightstandContainer screenContainer, PlayerInventory playerInventory, ITextComponent titleIn, float[] color) { super(screenContainer, playerInventory, titleIn); this.xSize = 176; this.ySize = 127; this.color = color; } protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { this.font.drawString(this.getTitle().getFormattedText(), 8, 4, 0); this.font.drawString(this.playerInventory.getDisplayName().getFormattedText(), 8.0F, (float) (this.ySize - 96 + 2), 0); } @Override protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { int xPos = (this.width - this.xSize) / 2; int yPos = (this.height - this.ySize) / 2; GlStateManager.color4f(1.0f, 1.0f, 1.0f, 1.0f); this.minecraft.getTextureManager().bindTexture(NIGHTSTAND_GUI_SCREEN); this.blit(xPos, yPos, 0, 0, this.xSize, this.ySize); GlStateManager.color4f(color[0] / 255, color[1] / 255, color[2] / 255, 1.0f); this.blit(xPos, yPos, 0, 0, this.xSize, this.ySize); GlStateManager.disableTexture(); GlStateManager.enableBlend(); GlStateManager.disableAlphaTest(); GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); GlStateManager.shadeModel(7425); Tessellator tessellator = Tessellator.getInstance(); BufferBuilder bufferbuilder = tessellator.getBuffer(); bufferbuilder.begin(7, DefaultVertexFormats.POSITION_COLOR); bufferbuilder.pos((double) xPos + this.xSize, (double) yPos, (double) this.blitOffset).color(0, 0, 0, 0).endVertex(); bufferbuilder.pos((double) xPos, (double) yPos, (double) this.blitOffset).color(0, 0, 0, 0).endVertex(); bufferbuilder.pos((double) xPos, (double) yPos + this.ySize, (double) this.blitOffset).color(0, 0, 0, 255 / 2).endVertex(); bufferbuilder.pos((double) xPos + this.xSize, (double) yPos + this.ySize, (double) this.blitOffset).color(0, 0, 0, 255 / 2).endVertex(); tessellator.draw(); GlStateManager.shadeModel(7424); GlStateManager.disableBlend(); GlStateManager.enableAlphaTest(); GlStateManager.enableTexture(); } } The Container class :   public class NightstandContainer extends Container { private TileEntity tileEntity; private int containerSlots = 0; public NightstandContainer(int id, World world, BlockPos pos, PlayerInventory playerInventory) { super(ContainerTypeRegistry.NIGHTSTAND, id); this.tileEntity = world.getTileEntity(pos); tileEntity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).ifPresent(h -> { containerSlots = h.getSlots(); for (int i = 0; i < h.getSlots(); i++) { addSlot(new SlotItemHandler(h, i, 44 + (i * 18) + (i > 1 ? 18 : 0), 14)); } }); for (int y = 0; y < 3; ++y) { for (int x = 0; x < 9; ++x) { this.addSlot(new Slot(playerInventory, x + y * 9 + 9, 8 + (x * 18), 45 + (y * 18))); } } for (int k = 0; k < 9; ++k) { this.addSlot(new Slot(playerInventory, k, 8 + k * 18, 103)); } } @Override public ItemStack transferStackInSlot(PlayerEntity playerIn, int index) { Slot slot = this.getSlot(index); if (!slot.canTakeStack(playerIn)) return slot.getStack(); if (!slot.getHasStack()) return ItemStack.EMPTY; ItemStack stack = slot.getStack(); ItemStack newStack = stack.copy(); if (index < containerSlots) { if (!this.mergeItemStack(stack, containerSlots, this.inventorySlots.size(), true)) return ItemStack.EMPTY; slot.onSlotChanged(); } else if (!this.mergeItemStack(stack, 0, containerSlots, false)) return ItemStack.EMPTY; if (stack.isEmpty()) slot.putStack(ItemStack.EMPTY); else slot.onSlotChanged(); return slot.onTake(playerIn, newStack); } @Override public boolean canInteractWith(PlayerEntity playerIn) { return this.isUsable(playerIn); } protected boolean isUsable(PlayerEntity playerIn) { return IWorldPosCallable.of(tileEntity.getWorld(), tileEntity.getPos()).applyOrElse((block, pos) -> { return !(block.getBlockState(pos).getBlock() instanceof EmoNightstand) ? false : playerIn.getDistanceSq((double) pos.getX() + 0.5D, (double) pos.getY() + 0.5D, (double) pos.getZ() + 0.5D) <= 64.0D; }, true); } @Nullable public TileEntityNightstand getTileEntity() { if (this.tileEntity instanceof TileEntityNightstand) return (TileEntityNightstand) this.tileEntity; else return null; } } The TileEntity class :   public class TileEntityNightstand extends TileEntity implements INamedContainerProvider { private LazyOptional<IItemHandler> handler = LazyOptional.of(this::createHandler); private float[] color = new float[] { 0.0f, 255.0f, 0.0f}; public TileEntityNightstand(float[] color) { this(); this.color = color; } public TileEntityNightstand() { super(TileEntityTypeRegistry.NIGHTSTAND); } @SuppressWarnings("unchecked") @Override public void read(CompoundNBT compound) { CompoundNBT inventory = compound.getCompound("Inventory"); handler.ifPresent(h -> ((INBTSerializable<CompoundNBT>) h).deserializeNBT(inventory)); super.read(compound); } @SuppressWarnings("unchecked") @Override public CompoundNBT write(CompoundNBT compound) { handler.ifPresent(h -> { CompoundNBT nbt = ((INBTSerializable<CompoundNBT>) h).serializeNBT(); compound.put("Inventory", nbt); }); return super.write(compound); } private IItemHandler createHandler() { return new ItemStackHandler(4) { @Override protected void onContentsChanged(int slot) { markDirty(); } }; } @Override public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) { if (cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) return handler.cast(); return super.getCapability(cap, side); } @Override public ITextComponent getDisplayName() { return new TranslationTextComponent("container.emomod.nightstand"); } @Override public Container createMenu(int windowId, PlayerInventory playerInventory, PlayerEntity player) { return new NightstandContainer(windowId, this.getWorld(), this.getPos(), playerInventory); } public float[] getColor() { return this.color; } } And voilà, I think that everything is here and I will really appreciate some help, this mod is very important for me and I've put so many efforts in it, I've to update it soon to the latest version (I may also want some paid help for that if I can apply some sort of dev recrutment on this forum) and I will stop adding stuff but polish everything up to finally set it public. Thanks again for giving me some of your time, I can send the WIP version of the mod jar as demo when this will be fixed if some of you want it, and also if I find a way to protect my textures from being copied / reused or modified.
    • https://mcforge.readthedocs.io/en/latest/concepts/sides/#writing-one-sided-mods
    • What?! Just use RegisterCommandsEvent. FMLServerStartingEvent is not involved with registering commands at all.
    • Only ModelRegistryEvent is necessary. Call ModelLoader.addSpecialModel in there and the model will be baked as normal.
    • Really old Minecraft versions are no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.