Jump to content

TheGreyGhost

Members
  • Posts

    3280
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by TheGreyGhost

  1. Howdy Perhaps you mean like the campfire? If so, look at the vanilla CampfireTileEntityRenderer code -TGG
  2. That is true, but if DrachenBauer wants this then (s)he may need to use an ItemStackTileEntityRenderer. mbe81 uses item json for wavefront rendering (no TER), eg mbe81b_boomerang_registry_name.json { "loader": "forge:obj", "model" : "minecraftbyexample:models/entity/mbe81b_boomerang.obj", "flip-v": true, "detectCullableFaces": false, "diffuseLighting": true, "ambientToFullbright": false, "materialLibraryOverride": "minecraftbyexample:models/entity/mbe81b_boomerang.mtl", "__comment": "flip-v may be required if your texture appears mirrored. See OBJloader::read() for other flags. currently the available options are", "__comment1": "detectCullableFaces (default true) = try to convert faces to Directional Quads (EAST, WEST, etc) instead of just general quads", "__comment2": "diffuseLighting (default false) = attempt to apply the direction-dependent lighting as per vanilla blocks. Currently does nothing.", "__comment3": "flipV (default false) = mirror the texture sheet top-->bottom (if your textures appear upside-down)", "__comment4": "ambientToFullbright (default true) = always render at maximum world illumination (combinedLight) regardless of the actual skylight or blocklight present", "__comment5": "materialLibraryOverrideLocation (default null) = use this path/filename for the material library file .mtl", "display": { "thirdperson_righthand": { "rotation": [ 180, 0, 90 ], "translation": [ 0.00, 3.50, -1.75 ], "scale": [ 0.04, 0.04, 0.04] }, "thirdperson_lefthand": { "rotation": [ 90, 0, 90 ], "translation": [ 0.00, 3.50, -1.75 ], "scale": [ 0.04, 0.04, 0.04] }, "firstperson_righthand": { "rotation": [ 188, 0, 90 ], "translation": [ 0.00, 5.25, -2.25 ], "scale": [ 0.05, 0.05, 0.05] }, "firstperson_lefthand": { "rotation": [ 90, 0, 90 ], "translation": [ 0.00, 5.25, -2.25 ], "scale": [ 0.05, 0.05, 0.05] }, "gui": { "rotation": [ 82, 0, 0 ], "translation": [ 0.75, -1.00, 0.00 ], "scale": [ 0.06, 0.06, 0.06] }, "head": { "rotation": [ 0, 0, 0 ], "translation": [ 0.00, 0.00, 0.00 ], "scale": [ 0.05, 0.05, 0.05] }, "fixed": { "rotation": [ 270, 162, 0 ], "translation": [ 0.00, 0.00, 0.25 ], "scale": [ 0.06, 0.06, 0.06] }, "ground": { "rotation": [ 90, 278, 0 ], "translation": [ 0.00, 9.00, 0.00 ], "scale": [ 0.05, 0.05, 0.05] } } }
  3. Do you mean the server eula.txt? Are you looking in the right place?
  4. Howdy There are some examples of Wavefront in in this tutorial project see mbe21 (tileentity) and mbe81 (entity and item) https://github.com/TheGreyGhost/MinecraftByExample -TGG mbe21: mbe81:
  5. Howdy You might find these working examples useful https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe81_entity_projectile -TGG
  6. Hi public class RangePlacement extends SimplePlacement<TopSolidRangeConfig> { public RangePlacement(Codec<TopSolidRangeConfig> codec) { super(codec); } public Stream<BlockPos> getPositions(Random random, TopSolidRangeConfig config, BlockPos pos) { int i = pos.getX(); int j = pos.getZ(); int k = random.nextInt(config.maximum - config.topOffset) + config.bottomOffset; return Stream.of(new BlockPos(i, k, j)); } } Beats me why they found it necessary to have both config.maximum and config.topOffset in there. Probably it means something, eg maximum is the highest y value of this feature but don't use the topmost topOffset rows. TopSolidRangeConfig(int bottomOffset, int topOffset, int maximum) means (5, 0, 37) gives you nextInt(37 - 0) + 5 = 5 to 41 inclusive and (5,10, 37) gives you nextint(37 - 10) + 5 = 5 to 31 inclusive -TGG
  7. Hi IInventory is the vanilla implementation used for containers IItemHandler is a Forge extension You can use either one, they will both work fine if you implement them correctly: The vanilla IInventory has some extra methods which are used by the slots to communicate with the container, but you can nearly always safely ignore those. IItemHandler is more flexible; you can (for example) use it to implement an inventory on an item. In some ways it is also stylistically preferable ("composition instead of inheritance"). As Kiou said it is more "automation friendly" in some ways. In practice, just pick one and go with it, don't worry too much about which one is "optimum". The users of your mod are highly unlikely to ever notice the difference, and if you do ever need to change it to IItemHandler in the future, it's easy to refactor. Cheers TGG
  8. Howdy Forge Energy is stored using a Capability There are some working examples of Capability in this tutorial project: https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe65_capability and https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe32_inventory_item -TGG
  9. Hi You might find this tutorial example useful when trying to understand how the vanilla inventories work https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe30_inventory_basic It uses IInventory instead of IItemHandlers but the rest is directly relevant. -TGG
  10. Howdy You might find this useful https://github.com/TheGreyGhost/MinecraftByExample See MBE30, MBE31, MB32 These are GUI which are based around containers but the basic principles are still the same even if you don't have a container. It should help you get a start on understanding how the vanilla GUI work. Cheers TGG
  11. Howdy GL11.glEnable(GL11.GL_MAX_LIGHTS) and all those don't work any more, they're incorporated into your RenderTypeBuffer. The reason is that the drawing is no longer done in-line, it is accumulated into the appropriate buffer (eg transparent blocks, entities, lines, etc) and each buffer is then drawn in one shot. If you want to mess with the rendering settings, you need to choose a different RenderTypeBuffer or create your own custom. Some more information here: https://gist.github.com/williewillus/30d7e3f775fe93c503bddf054ef3f93e If you need every face of the entity model to be lit up the same, you can modify your renderer to render all of the faces more brightly? I'm not sure why that's a problem? -TGG
  12. From memory; All the packets that your client could send are named CXXXXXPacket eg CInputPacket IServerPlayNetHandler also lists the interesting ones (that is the class on the server that processes the incoming packets). -TGG
  13. Hello How I find the new name when it has changed version (eg from 1.12 to 1.16): 1) Find the code in 1.12 which calls .isMaterialInBB(); for example EntityLlamaSpit:onUpdate....-> if (!this.world.isMaterialInBB(this.getEntityBoundingBox(), Material.AIR)) { this.setDead(); } else if (this.isInWater()) { this.setDead(); } 2) Look at EntityLlamaSpit in 1.16.4: (LlamaSpitEntity::tick ) if (this.world.func_234853_a_(this.getBoundingBox()).noneMatch(AbstractBlock.AbstractBlockState::isAir)) { this.remove(); } else if (this.isInWaterOrBubbleColumn()) { this.remove(); } else { -TGG
  14. I'm on the same line of thought as DieSieben - or do you mean that your client-side-only mod sends vanilla messages (or "custom" messages that masquerade as vanilla messages)? Could you implement your desired functionality using vanilla packets only? The use-cases you described sound like it might be possible (eg changes to controls, placing blocks, etc) -TGG
  15. Hi Off the top of my head I don't recall, but you might get some way forward looking at this: https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/mbe81_entity_projectile/BoomerangRenderer.java packedlightIn is probably the parameter of interest I think (i.e. in the render method) packedLight is the skylight+blocklight value https://greyminecraftcoder.blogspot.com/2020/04/lighting-1144.html (used to be called "mixedBrightness") -TGG
  16. Hi I haven't tried that before however you might find the easiest way (if combining multiple models together eg pommel, hilt, etc) is to use an ItemStackTileEntityRenderer instead of a json block model, and then rebind the appropriate texture before rendering the object models. see Item.Properties.setISTER Alternatively you could create a new model file for each one, which is identical except for the materialLibrary Override texture; eg and charge_0 for example is { "loader": "forge:obj", "model" : "minecraftbyexample:models/entity/mbe81b_boomerang.obj", "flip-v": true, "detectCullableFaces": false, "diffuseLighting": true, "ambientToFullbright": false, "materialLibraryOverride": "minecraftbyexample:models/entity/mbe81b_boomerang_texture0.mtl", "__comment": "flip-v may be required if your texture appears mirrored. See OBJloader::read() for other flags. currently the available options are", "__comment1": "detectCullableFaces (default true) = try to convert faces to Directional Quads (EAST, WEST, etc) instead of just general quads", "__comment2": "diffuseLighting (default false) = attempt to apply the direction-dependent lighting as per vanilla blocks. Currently does nothing.", "__comment3": "flipV (default false) = mirror the texture sheet top-->bottom (if your textures appear upside-down)", "__comment4": "ambientToFullbright (default true) = always render at maximum world illumination (combinedLight) regardless of the actual skylight or blocklight present", "__comment5": "materialLibraryOverrideLocation (default null) = use this path/filename for the material library file .mtl", The full source code for that example is here, if you want to see the context. https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/resources/assets/minecraftbyexample/models/item Look at the jsons which start with mbe81b Disclaimer: it works fine for the item transforms but I'm not sure it works for the materialLibraryOverride. -TGG
  17. Howdy You might find this working example (tutorial project) useful. It sends a packet from the client to the server. In your case, the server should play a sound in response to the packet. https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe60_network_messages -TGG
  18. Howdy. Is there any reason you can't create your own IInventory? Or a Container to wrap your ItemStackHandler? For example like this: https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/mbe30_inventory_basic/ChestContents.java or this: https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/mbe30_inventory_basic/ContainerBasic.java You might also find it helpful to make a copy of the vanilla code and refactor it (change the obfuscated method and variable names to something meaningful) to help you understand how it works and perhaps find a shortcut if you don't need the full CraftingInventory functionality. -TGG
  19. Howdy To be honest I've never done that. The container method will work but if you want to strip it down, you could try Minecraft::displayGuiScreen on the client only. You could try looking at the code for a Vanilla GUI-only screen and seeing how it works. -TGG
  20. Some of us do. Try this https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/usefultools/debugging/DebugBlockVoxelShapeHighlighter.java You will need to find the srg name for the fields you are interested in. This tool can help you find it: https://mcp.thiakil.com/#/search Some useful background info here too: https://jamieswhiteshirt.github.io/resources/know-your-tools/ -TGG
  21. Hi. The first problem appears to be that you are creating beam segments on the server and then trying to render them on the client without transmitting them from client to server. If they're purely cosmetic then you only need to create them on the client, not the server actually. I changed them to create on the client and your renderer was at least called (it crashed due to index out of bounds) but hopefully that gets you a step further at least. -TGG
  22. Howdy There are a few working examples of GUIs here https://github.com/TheGreyGhost/MinecraftByExample Both of them have containers(i.e. you can store items inside them) but that is optional and the basic concepts are the same. Mbe32 is an item that when you right click it, it opens a GUI. -TGG mbe30 (chest) mbe32 (an item which can contain other items)
  23. You might find this tutorial project useful. It has working examples and some links to other tutorials. https://github.com/TheGreyGhost/MinecraftByExample -TGG
  24. Howdy I'll give it a look tomorrow if I get time, no guarantees, but in the meantime you might find this working example or a TER with custom quad rendering helpful https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe21_tileentityrenderer -TGG
×
×
  • Create New...

Important Information

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