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

stepsword

Members
  • Posts

    81
  • Joined

  • Last visited

Recent Profile Visitors

1715 profile views

stepsword's Achievements

Stone Miner

Stone Miner (3/8)

1

Reputation

  1. Think you can do Minecraft.getInstance().getRenderTypeBuffers().getBufferSource()
  2. So, I have some GL code in a custom RenderType, which I'm using as a wrapper for an actual RenderType. My overall goal is to apply clipping to a rendered entity. rendertype1 = new ClipWrappedRenderLayer(yaw, pitch, x,y,z,progress, rendertype1); IVertexBuilder ivertexbuilder = bufferIn.getBuffer(rendertype1); renderModel(modelIn, itemStackIn, combinedLightIn, combinedOverlayIn, matrixStackIn, ivertexbuilder); public ClipWrappedRenderLayer(double pitch, double yaw, double x,double y,double z, double p, RenderType delegate) { super(MahouTsukaiMod.modId + delegate.toString() + "_with_clip", delegate.getVertexFormat(), delegate.getDrawMode(), delegate.getBufferSize(), true, delegate.func_230041_s_(), () -> { DoubleBuffer eqn1 = BufferUtils.createDoubleBuffer(8).put(new double[]{0,1,1,p}); eqn1.flip(); GL11.glClipPlane(GL11.GL_CLIP_PLANE0, eqn1); GL11.glEnable(GL11.GL_CLIP_PLANE0); delegate.setupRenderState(); }, () -> { delegate.clearRenderState(); GL11.glDisable(GL11.GL_CLIP_PLANE0); }); this.delegate = delegate; } While the clipping does happen currently, it slides with the camera as opposed to being a static clip on the entity. Is there a way I can translate/rotate this clip to where the entity will be? Nothing I've tried in the way of translation seems to do anything except clip at a slightly different angle while still following the camera. I'm assuming this setup code is called on the outside of the translation, so alternatively if there were a way to call this code on the inside of the translation, that would be good also, as that is how I did it in 1.12.2.
  3. Thanks. Basically, I have a json model for an item which is similar to the bow model. As in, it reads a property off the item and swaps out a texture based on the property. That part works fine without any java implementation of the model. But I also want to display an openGL rendered animation while using the item, which is fairly complex and involves creating shapes in openGL. Since I have the code for rendering most/all of it from my other (non-item) classes I'd rather not try to turn it into an IModel, and as far as I know the only way to get an OpenGL context on items is to use the TileEntityItemStackRenderer.. So ideally I'd like to just use the JSON model I've written with a minimum implementation of java to enable a TileEntityItemStackRenderer
  4. Is it possible to change the "isBuiltInRenderer" described here https://mcforge.readthedocs.io/en/latest/models/advanced/ibakedmodel/ to true from the JSON model file? I want to use a TileEntityItemStackRenderer but doing "isBuiltInRenderer":true doesn't seem to work from the JSON file. Do I need to create a full IModel implementation just to set that one thing to true? If so, is there a way to load a JSON file as a "default" so I don't have to convert the JSON I've written for the non-custom-rendered bits to java?
  5. Thanks! Got it working after doing this. Had no idea that even existed.
  6. I think it's something with the slot index. Debugging further, on the client it says it's getting slot "5" but on the server it's getting slot "35". In the "slotClick()" method, that is.
  7. I'm trying to attach a 3-slot inventory to an ItemStack for one of the Items in my mod. So far I've got it rendering properly, and hovering over the squares highlights them in the right places and items from the player's inventory show in the right spots. But I can't pick up anything in the inventory - when I click something it gets picked up and placed back down immediately (and also, in the background, the "hitting" animation with the item fires). Here's the code for the Container: Here's the relevant code from the item class: I also register the capability in the attach capability event for ItemStacks. Is there something obvious I'm missing that would prevent me from picking items up? When I followed the "picking up" action in debug mode, it went through Container.slotClick() on both the client and server, and I could see the item being picked up on the client. But on the server it seemed to be picking up air. Also, shift clicking the item does successfully put move the item from the hotbar to the inventory, and then it disappears after I close the inventory, but that's probably a bug for after whatever is stopping me from picking things up in the first place.
  8. As an update this was because I hadn't correctly integrated gradle into IntelliJ. Solution was to find the build.gradle file and right click > Import Gradle project. Then I can run debug on Forge's runClient which allows me to load mods properly
  9. I haven't found anyone with a similar problem - the soft dependencies are there at compile time and the mod actually works both with and without the soft dependencies (after testing on Twitch). The "provided" keyword supposedly makes them optional at runtime. My main issue is that I can't seem to disable them at runtime in the intelliJ debug client (even though there seems to be a specific setting which ignores provided things at runtime). Well, I'll go look more at IntelliJ forums then, I realize this is more of a problem with IntelliJ than anything else but I was wondering if it was something specific to Minecraft since I don't really know at all how IntelliJ interacts with Forge to load mods in a debug environment
  10. As an update, running ".\gradlew idea" after "gradlew setupDecompWorkspace" fixed the bookshelf not loading issue, but I'm still having the "why is this even loading in the first place when it's set as 'provided' issue"
  11. So I have a soft dependency on GameStages where basically I am doing this: @Mod.EventHandler public void postInit(FMLPostInitializationEvent event) { if (Loader.isModLoaded("gamestages")) { gamestages = new GameStagesLoadedProxy(); } else { gamestages = new GameStagesProxy(); } } GameStagesLoadedProxy has references to GameStage's helper class. In my gradle file I've added GameStages as a "provided" dependency, which from the description should just be an optional dependency. When I try to run the debug client in IntelliJ, though, it tries to load GameStages and complains about Bookshelf (a dependency of GameStages) not being loaded. (net.minecraftforge.fml.common.MissingModsException: Mod gamestages (Game Stages) requires [bookshelf@[2.2.458,)]) I added Bookshelf as a provided dependency too, and get the same error. I also restarted IntelliJ and cleared the cache. I don't even know why GameStages is being loaded when I run it in the first place - it's a provided dependency which I thought would mean it doesn't get loaded unless I check the box "Include dependencies with Provided scope" which is not checked. Here is my full build.gradle file. Ideally I'd like to turn on and off whether GameStages runs when I'm debugging, but I'd settle for it both compiling and just not being included.. I just want to make sure I can debug the mod without any dependencies running at all, and can worry about doing it with dependencies from the twitch launcher. Anyone have any experience with this?
  12. Huh so there is. DimensionManager.getNextFreeDimId() Thanks!!
  13. I was hoping to avoid conflicts with other mods by allowing modpack creators to set this. Is that something I don't have to worry about?
  14. Perhaps a better question is - is there an event for when the config gets loaded from the file?Does ConfigChangedEvent.OnConfigChangedEvent cover that? If so I could just update the Config class when the file initially loads? But does dimension registering happen before or after the config is loaded?
  15. I'm a bit confused on syncing annotated config files. Guidance on this forum has generally been to send a packet to the client on PlayerLoggedIn and update a "client" config file. So let's say I have a ServerConfig class and a Config class, where the latter is the client's config that gets updated. If I want to register a dimension using an ID based on the config, I have to register it on both the client and server, right? Using DimensionType.register()? If I put this in my CommonProxy, it'll get called on both. Assuming Config is only updated when a player logs in, I can't use Config on the server. But I also can't use ServerConfig on the client cause the client could have the wrong thing in their config file. Anyone know the right way to do this?
×
×
  • Create New...

Important Information

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