Leaderboard
Popular Content
Showing content with the highest reputation since 01/16/21 in all areas
-
2 pointsWhy the fauk does your renderer change what blocks are in the world? That's not the job of a renderer.
-
1 pointhttps://link.springer.com/referenceworkentry/10.1007%2F978-3-319-08234-9_272-1 It's the architecture, the server does all the logical shenanigans, and the client is only a viewport, an interface to the state that's managed in the server side
-
1 point
-
1 pointgetUseDuration needs to return a value > 0 for setActiveHand to work. By default it returns 0.
-
1 point
-
1 point
-
1 pointSome zip managers like to take control of the .jar file extension away from Java. Make sure you have Java installed and try running Jarfix once, then try the installer again.
-
1 point
-
1 pointYou need to check before casting, like we usually do. https://mcforge.readthedocs.io/en/latest/concepts/sides/#performing-side-specific-operations
-
1 pointsolcarrot-server.toml This value contains invalid values: Invalid value: 165 170
-
1 pointServerChunkProvider#getSavedData and then DimensionSavedDataManager#folder (needs reflection) will get you the data folder. However I would really encourage you to consider not using a custom data format.
-
1 pointAfter you have your crop block, then look into how the lilypad item works.
-
1 pointI don't think this gives you water as a below block but rather a block that is waterlogged. Check how lily pads work.
-
1 point
-
1 pointI seem to recall getting this error myself... I think it had something to do with caps, also I do what GitHub suggests and put those in a gradle.properties in my user folder so they're global and there's no risk of accidentally committing them
-
1 pointYup, thats world gen - i.e. no world access. WorldSavedData cannot be accessed during world gen. You can use IChunk#getBiomes to get biome information.
-
1 point
-
1 pointGatherDataEvent only fires during data runs, not during client or server runs
-
1 pointThe launcher bundles 8 on Windows, which is one reason we can't use features of newer Java versions
-
1 pointNote: I am using registry events instead of deferred registry so if someone chimes in on a difference that works better than listen to them. this method still works so i am yet to be motivated to change. I am able to replace blocks using the RegistryEvent.Register<Block>. I get the old resource location ForgeRegistries.BLOCKS.getKey(oldBlock); and set the custom block with that blocks registry location newBlock.setRegistryName(resourceLocation); ForgeRegistries.BLOCKS.register(newBlock); I also replace the Item (again i dont know if this is still needed as doing so still works so i have yet to change it)
-
1 pointDo not use OnlyIn. Minecraft#player is always the client player. By accessing it on a packet thats sent to the server, you are reaching across logical sides, which will just crash on dedicated servers and cause strange behavior in single player.
-
1 pointYou should never have downloaded them. Use the installer. The universal jars are for download by the installer, you should not be downloading them as a user. They were confusing to people and people downloaded the wrong thing, thats why they are no longer listed.
-
1 pointRead the documentation for invoke.
-
1 pointYou did not pass the instance of the object (zombie).
-
1 pointhttps://paste.gg/p/anonymous/47eb336f970d400bb9f707d7aed7c776#pastefile1-l30 That's not a valid mod ID
-
1 pointhttps://github.com/MinecraftForge/MinecraftForge/pull/7607
-
1 pointSome zip managers like to take control of the .jar file extension away from Java. Make sure you have Java installed and try running Jarfix once, then try the installer again.
-
1 point
-
1 point1.2.5 is no longer supported on this forum. Please update to a modern version of Minecraft for support. edit: i accidentally pressed last page and bumped this
-
1 pointThere is no way to do this. The smithing container is hardcoded to just decrease its inputs and not use the container item (see SmithingTableContainer#func_230301_a_).
-
1 pointI could be wrong, but I think you might need to add this code in the constructor: FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); And you may need to change the setup method to non-static.
-
1 point@EventBusSubscriber subscribes to the forge bus by default, but FMLCommonSetupEvent is fired on the mod bus. Please use the code format when posting code.
-
1 pointI would try increasing the size of the model to around 0.005 compared to a flat plane.
-
1 pointprobably better just to ask in the modder support channels - your chances of getting a quick response are better. I am not the only person who can help If I'm online on discord and see it, I'll reply - otherwise someone else will.
-
1 pointWhy is your server running in offline mode? Client and server log do not match up at all. The server log shows connection attempts at [16Jan2021 20:02:10.516] and then a couple minutes later. The client logs shows one connection at [16Jan2021 18:46:27.912].
-
1 pointThere are several problems which all contribute to the things you are seeing (or rather not seeing): Your event handler for ModelRegistryEvent is not called, because you registered it to the wrong event bus. ModelRegistryEvent is fired on FMLJavaModLoadingContext.get().getModEventBus(), but you used MinecraftForge.EVENT_BUS. You create the RenderMaterial wrongly. Minecraft will use Atlases.getSignMaterial to create the material - which does not match up with what you are doing here. You need to also use that method. This means that the "minecraft" namespace will be used, there is no way around that. Because of this you should prefix the name of your WoodType with your ModID, so "effetewood_effete", to avoid collisions not only with the texture but also the WoodType registry. Then your texture also needs to be in minecraft/textures/entity/signs/effetewood_effete.png naturally. In ModelRegistryEvent you also need to add the RenderMaterial to the set of built-in textures (ModelBakery.LOCATIONS_BUILTIN_TEXTURES) so that Minecraft will actually load the texture and stitch it onto the atlas. Because the field is protected, you can use a little hack to avoid having to use reflection: static class FakeBakery extends ModelBakery { private FakeBakery(IResourceManager resourceManagerIn, BlockColors blockColorsIn, IProfiler profilerIn, int maxMipmapLevel) { super(resourceManagerIn, blockColorsIn, profilerIn, maxMipmapLevel); } static Set<RenderMaterial> getBuiltinTextures() { return ModelBakery.LOCATIONS_BUILTIN_TEXTURES; } } Now you can just call FakeBakery.getBuiltinTextures to get the field and add your RenderMaterial to it. Because you now have your own tile entity type, you need to tell Minecraft to use the SignTileEntityRenderer for it. Use ClientRegistry.bindTileEntityRenderer in FMLClientSetupEvent for that. Registering the wood type in ModelRegistryEvent means it won't be registered on the server. However FMLCommonSetupEvent is too late, so you have to do it in the mod constructor. Unfortunately in this case, mod construction (like many startup events, e.g. FMLCommonSetupEvent) runs in parallel on a threadpool, which means you cannot just register your WoodType there (the underlying data structure ObjectArraySet is not threadsafe). With normal event handlers (like FMLCommonSetupEvent) you can just use enqueueWork on the event to run something synchronously on the main thread. However in this case we are in the mod constructor, which doesn't receive an event instance. There is still a DeferredWorkQueue for us to use though (i.e. call enqueueWork to run something on the main thread): DeferredWorkQueue.lookup(Optional.of(FMLConstructModEvent.class)).get().enqueueWork with a Runnable lambda will do the trick. In there you can then safely register your WoodType. With these fixes the custom sign now works:
-
1 point? Now you are spawning the entity on both client and server. You need to check World#isRemote and only spawn it on the server. @EventBusSubscriber is fine, you just need to user static methods with it.
-
1 pointThis will immediately crash the game, there are not just server side entities. The fact that it doesn't mean your event handler is not even running. It is not running, because @EventBusSubscriber only works with static event handler methods.
-
1 pointNope, you're just registering the item twice. Your block calls this method which creates an item to which you then create another item under the same name.
-
1 pointSet the block's render type to cutout in client setup using RenderTypeLookUp.
-
1 pointApparently its been like that for 4 years. https://github.com/MinecraftForge/Documentation/issues/74
-
1 pointThank you for bumping a year and a half old thread to vouch for one of my moderators who has thousands of posts on this forum and was recommending a tool that is widely known/used in the community to fix jar file associations... I was scared that he was saying something wrong!
-
1 pointI fixed it, I kept following this line of the crash report- net.minecraftforge.fml.config.ConfigFileTypeHandler$ConfigLoadingException: Failed loading config file usefulbackpacks-server.toml of type SERVER for modid usefulbackpacks and just kept deleting every server.toml or config file it said up until i deleted the forge.toml and then it worked.
-
1 pointAh ha! It worked! Thank you everybody for the incredible help! Here is a fairly detailed solution to the problem for anybody's reference: 1) Make your block tex multi-layered. TheGreyGhost has an excellent tutorial of this under mbe05 of Minecraft By Example. Be sure to register one layer as a RenderType.getCutout() and one as a RenderType.getTranslucent(), and to adjust the .json file accordingly. /* In charge of client initialization */ private void onClientSetup(final FMLClientSetupEvent event) { ... // Render type registry for glowing blocks RenderTypeLookup.setRenderLayer(MinenauticaBlocks.WRITHING_WEED, Minenautica::getDoubleLayer); ... } // Double layer render lookup public static boolean getDoubleLayer(RenderType layerToCheck) { return layerToCheck == RenderType.getCutout() || layerToCheck == RenderType.getTranslucent(); } 2) Create and register a custom IBakedModel. We need to register a custom IBakedModel because we will need to manually update the light value of the quads on the translucent layer of the model. Again, Minecraft By Example has an excellent tutorial of this under mbe04. I would use the CamouflageBakedModel as reference, as we will be using the standard model of the block, just with a modification to the quads. 3) Alter the getQuads method. We will be altering this method to check which render layer we are currently on, and then altering the quads on the translucent layer. We are most interested with the vertexData of BakedQuad, which holds the following data, again from Minecraft By Example: // vertexData[i + 0] = Float.floatToRawIntBits(positionIn.getX()); // vertexData[i + 1] = Float.floatToRawIntBits(positionIn.getY()); // vertexData[i + 2] = Float.floatToRawIntBits(positionIn.getZ()); // vertexData[i + 3] = shadeColor; // vertexData[i + 4] = Float.floatToRawIntBits(textureU)); // vertexData[i + 5] = Float.floatToRawIntBits(textureV)); // vertexData[i + 6] = baked lighting (blocklight + skylight) // vertexData[i + 7] = normal; There are four groups of these eight pieces of data, and we are concerned which changing the 7th element in each of these groups that correspond with the baked lighting value. It is critical to note that to account for both the block light and sky light, the value of baked lighting is a 32-bit integer, where the upper 16 bits contain the sky lighting * 16 and the lower 16 bits contain the block lighting * 16. So, for example, the brightest baked lighting value would be 2^16 * 15 * 16 + 15 * 16 = 15728880. We will run through each BakedQuad in the model and set the baked lighting values to this new baked lighting value. For a more detailed explanation, here is a good link. @Override @Nonnull public List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction side, @Nonnull Random rand, @Nonnull IModelData extraData) { List<BakedQuad> quads = this.model.getQuads(state, side, rand); if(MinecraftForgeClient.getRenderLayer() == RenderType.getTranslucent()) { for(int i = 0; i < quads.size(); i++) { BakedQuad quad = quads.get(i); int[] vertexData = quad.getVertexData(); for(int j = 0; j < 4; j++) { vertexData[8 * j + 6] = getLightValue(15, 15); } quads.set(i, new BakedQuad(vertexData, quad.getTintIndex(), quad.getFace(), quad.func_187508_a(), quad.shouldApplyDiffuseLighting())); } } return quads; } /* * Return the light value for a given sky lighting and block lighting * A 32-bit integer, with the upper bits skyLighting*16 and the lower bits blockLighting*16 */ private static final int UPPER_HALF = 65536; // 2^16 private static int getLightValue(int skyLighting, int blockLighting) { return UPPER_HALF * skyLighting * 16 + blockLighting * 16; } And that is it! There are few steps, but in the end we are just registering a translucent layer, and then adjusting the quads of that layer. Thank you everybody for the help, and I am posting pictures of the results below (for more pictures you can visit the mod's website at Minenautica). Light Image: https://ibb.co/djRYL32 Dark Image: https://ibb.co/dQ7TctP
-
1 pointI am having trouble opening opening Forge. It is opening in Internet Explorer instead of Java. It won't open in Java and can't use the "Open As" to open in Java.. What can I do to open in Java?
-
1 pointHowdy Easiest way is just to return full brightness from your particle's method. Particle rendering has changed quite a bit from earlier versions of vanilla and you no longer need to do custom rendering for most particles. eg // can be used to change the skylight+blocklight brightness of the rendered Particle. @Override protected int getBrightnessForRender(float partialTick) { final int BLOCK_LIGHT = 15; // maximum brightness final int SKY_LIGHT = 15; // maximum brightness final int FULL_BRIGHTNESS_VALUE = LightTexture.packLight(BLOCK_LIGHT, SKY_LIGHT); return FULL_BRIGHTNESS_VALUE; // if you want the brightness to be the local illumination (from block light and sky light) you can just use // the Particle.getBrightnessForRender() base method, which contains: // BlockPos blockPos = new BlockPos(this.posX, this.posY, this.posZ); // return this.world.isBlockLoaded(blockPos) ? WorldRenderer.getCombinedLight(this.world, blockPos) : 0; } For a working example, see here https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe50_particle -TGG
-
1 pointHere is a video tutorial on custom structures and chest loot.here and code here
-
1 pointI just found it. @Override public boolean canBeCollidedWith() { return true; } After adding this to the code the entity works fine.
-
0 points1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.