Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/13/20 in all areas

  1. Howdy I think capability is great for items, entities, etc where 1) you're attaching the same general capability to a variety of different object types or a variety of different capabilities that you're adding to multiple objects ("composition" instead of inheritance/interfaces); or 2) you want vanilla or other mods to be able to interact with your objects in a general way; or 3) you want to attach information to vanilla objects For example - the capability to store items CapabilityItemHandler.ITEM_HANDLER_CAPABILITY is very useful because other mods and vanilla objects can automatically interact with your object to add or remove items. You don't need to tell them anything except that your object provides the capability interface. Or if you wanted to model a radioactive wasteland you could attach a RadiationSickness capability to each entity, including vanilla, to store the amount of radiation damage that has been suffered by each entity. In contrast, if you're just storing information (in your item) that's of no particular interest to other items, blocks, or entities, then you're probably better off with just "private" NBT information. -TGG If you're interested in general information on the pros and cons of this coding technique, these links might be interesting https://www.baeldung.com/java-decorator-pattern https://www.geeksforgeeks.org/decorator-pattern/?ref=lbp
    2 points
  2. williewillus has an explanation of the changes in 1.13/1.14 here and 1.15 here.
    1 point
  3. Howdy The problem is here; you mixed up short (2 bytes long) and float(4 bytes long) so your UV was overwriting dud values into the baked skylight+blocklight. private void putVertex(BakedQuadBuilder builder, Vec3d normal, double x, double y, double z, float u, float v, TextureAtlasSprite sprite, float r, float g, float b) { //ImmutableList<VertexFormatElement> elements = builder.getVertexFormat().getElements().asList(); ImmutableList<VertexFormatElement> elements = SLAB_BLOCK.getElements().asList(); for (int j = 0 ; j < elements.size() ; j++) { VertexFormatElement e = elements.get(j); switch (e.getUsage()) { case POSITION: builder.put(j, (float) x, (float) y, (float) z, 1.0f); break; case COLOR: builder.put(j, r, g, b, 1.0f); break; case UV: switch (e.getIndex()) { case 0: float iu = sprite.getInterpolatedU(u); float iv = sprite.getInterpolatedV(v); builder.put(j, iu, iv); break; case 2: builder.put(j, (short)0, (short)0); // error is here break; default: builder.put(j); break; } break; case NORMAL: builder.put(j, (float) normal.x, (float) normal.y, (float) normal.z); break; default: builder.put(j); break; } } builder.setApplyDiffuseLighting(true); } Due to non-defensive coding assumptions in IForgeVertexBuilder, it was taking your incorrect slBaked value (2047 instead of 0), overwriting the skylight (15), leaving a packed texture coordinate with zeros in the least significant bits, i.e. effectively 0 skylight = dark. default int applyBakedLighting(int lightmapCoord, ByteBuffer data) { int bl = LightTexture.getLightBlock(lightmapCoord); int sl = LightTexture.getLightSky(lightmapCoord); int offset = LightUtil.getLightOffset(0) * 4; // int offset for vertex 0 * 4 bytes per int int blBaked = Short.toUnsignedInt(data.getShort(offset)) >> 4; int slBaked = Short.toUnsignedInt(data.getShort(offset + 2)) >> 4; bl = Math.max(bl, blBaked); sl = Math.max(sl, slBaked); return LightTexture.packLight(bl, sl); } It works fine now... -TGG
    1 point
  4. Howdy I'm assuming that you don't want to add your custom fluid to the vanilla "water" Tag, then? (i.e. like this https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe35_recipes) If not - I don't think there is an easy way, no. I don't have experience with this recently but the two key words that might be worth searching for are "coremod" and "asm" They will let you overwrite parts of the vanilla Entity::handleWaterMovement code. It's a bit arcane and can be rather brittle but might be your only choice. Cheers TGG
    1 point
  5. Howdy You might find this working example of nbt storage in items useful https://github.com/TheGreyGhost/MinecraftByExample see mbe12 You could use capabilities, but that is probably unnecessarily complicated for what you want to do, by the sound of it -TGG
    1 point
  6. Note that the method only has to be static if you are registering the event subscriber class with @EventBusSubscriber. It should be non-static if an instance of the event subscriber class is constructed and registered via the event bus' register method.
    1 point
  7. Create a new loot table. Give it the same name as the vanilla one you want to override Place it in the same directory under assets as the vanilla one has (so for example, data/minecraft/loot_tables/blocks/gold_ore.json) Fucking magic.
    1 point
  8. Update Regarding LTS System: Please read The Big Forge Update Earlier this year, 1.13 was announced and the snapshots started coming out, the update was relatively small, but enough to be a hurdle for mod developers. This combined with 1.12 stabilizing, and a few fundamental Java changes that broke modding in general, made the Forge team decide to use this opportunity and work on cleaning the years of technical debt that Forge had accrued. During this time, it was discovered that a lot of things needed updating. In fact, well, everything did. And so, it was done, a full rewrite of practically everything Forge related. This took a long time, longer than originally anticipated. But what’s the outcome of this you might ask? A lot. cpw’s mod launching system (ModLauncher) allows for parallel mod loading and support for more modern Java versions. (Considering the original was written to target Java 6). The Forge installer now runs tasks at install time once, rather than doing it every time you run the game. These alone provide dramatic reduction in launch times. ForgeGradle, the “devkit” for creating mods, has been rewritten and is faster at, well, everything. It also integrates much better with IDEs. What does that mean, you ask? Simple. Mods are nicer to make. (Also 100% less setupDecompWorkspace.) MCPConfig allows for much easier MCP updates, and is public source too, so people can see exactly what's going on between updates. In short: There was a lot of work to do. And now that it's done, future updates will be much, much smoother. 1.14 and 1.15 The 1.14 release came around, just in time for the rewrite to be finished, so it was time to get the ball rolling again. The bulk of the restructure work was done through 1.13's life, so all that remained was actually seeing how it was to update all of it, and it went pretty well. A lot of improved systems exist now that make developing for these modern versions far easier and just better in general. The 1.15 release was relatively simple, even if Mojang decided to restructure everything and make changes to how the rendering works. (Taking some of our systems in the process, don't worry, this is a good thing.) 1.15's rendering changes were mostly a refactor, and we expect 1.16 to be a large update to rendering. This plus 1.14 seeing growth is why we chose 1.14 to be a candidate for LTS. (More on that further down.) Hopefully this kind of restructure from them is a rare thing in the future, but we welcome the change, since it often brings improvement. Although the rendering changes may pose a tough hurdle for some, the update for most should be relatively straight-forward. Forge support and LTS Forge's support for Minecraft versions will try to follow a predictable cycle, assuming Mojang also follows a predictable cycle. We will always actively target the latest Minecraft version, as ever. We will now also deem a previous major Minecraft version as "LTS" (Long Term Support). The LTS version will receive support for modders and players alike, however all new features must target the latest version first, and then may be backported. An LTS version differs slightly from the latest version, in that any new features you may want to add to it, must target the latest version, only once it has been merged in, can it be backported. (The exception to this is if the feature is non-applicable to the latest version.) The Forge Team will also mostly be focusing on the latest. This is so the community has time to stabilize a bit and gives modpack developers some time to create something special. But still have Forge running full steam ahead. Late last year (Happy 2020!) a vote was held privately with many developers of various Minecraft projects to determine which version will be LTS: Should 1.12 remain LTS or should 1.14? A vast majority chose 1.14, and so, from now on we are dropping 1.12 from support, and 1.14 is now LTS. What does this mean? 1.15 is latest. It will get full support. 1.14 is LTS. It will also get support, and new features, but new features must be made for 1.15 first. 1.12 is no longer supported on this forum, no new features, and no more bugfixes. All other versions are not supported. This means if you come to us for help with those, we will ask you to update. This includes crashes/bugs. To keep with Mojang's history of releases, we expect 1.14 to stay LTS for 12-18 months, giving plenty of time for modders and pack developers alike. However, this may change depending on what surprises Mojang has in store for us. Finally… Thank you. Thank you to all the modders/developers, all the players, and especially to all the contributors. The Minecraft modding community would not be what it is without you. You are responsible for the striving ecosystem we have today. We hope this new year brings you all you desire, and we look forward to seeing what you create. And now time for some shameless plugging, if you like Forge, please consider supporting us. http://www.patreon.com/lexmanos - The Forge Team.
    1 point
  9. 0 points
×
×
  • Create New...

Important Information

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