Jump to content

Tschipp

Forge Modder
  • Posts

    307
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • Personal Text
    I am new!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Tschipp's Achievements

Diamond Finder

Diamond Finder (5/8)

3

Reputation

  1. I'm trying to add my own "data type" to datapacks. The data is a simple json file that I use for various things. Since datapacks were introduced and they can sync from the server to the client, I would like to leverage that system for my purposes. Is such a thing possible? I used to just have a folder in the minecraft root directory and read my files from there, but obviously that caused issues when playing on a server without/with different files.
  2. Oh crap, this is gonna get locked because 1.12 isn't supported, isn't it? Well, if anyone sees this and knows the answer, I'd also appreciate a PM
  3. I feel like an idiot asking such a mundane question, especially since I've done it countless times before, but maybe I'm just blind and someone here can help me out. I made and registred models (and textures) for my items, but only one texture shows up on one item, and it's even the wrong texture: The items are all new instances of the same Class, but I don't see how that would cause a problem. The Item registration: public static Item tier1; public static Item tier2; public static Item tier3; public static Item tier4; public static Item tier5; private static List<Item> items = new ArrayList<Item>(); public static void registerItems() { items.add(tier1 = new BuildersBagItem(1, "one")); items.add(tier2 = new BuildersBagItem(2, "two")); items.add(tier3 = new BuildersBagItem(3, "three")); items.add(tier4 = new BuildersBagItem(4, "four")); items.add(tier5 = new BuildersBagItem(5, "five")); } I call registerItems during preInit, as you'd expect. Then I call this from my client side, also during preInit, after Item registration: public static void regItemRenders() { register(RegistryHandler.tier1); register(RegistryHandler.tier2); register(RegistryHandler.tier3); register(RegistryHandler.tier4); register(RegistryHandler.tier5); } public static void register(Item item) { System.out.println("Registering model for " + item.getRegistryName()); ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory")); } The debug output gets printed, I've checked. Also there are no model errors being printed. My model folder looks like this: Now, what's interesting is: Only the first item gets a texture ingame. Interestingly enough, it is the texture of the tier 5 item, not the tier 1 (as it should be). If I uncomment the registration of the tier 5 item, it gets the texture of the tier 4 item instead. Only the first uncommented item gets a texture. The others don't even get the "missing model" model (the one with the registred name as text). It's almost as if the texture gets overwritten and only applied on the first item. I am utterly confused, I have never encountered this. Can someone help me with this situation?
  4. Yeah, after a few hours of stepping through the debugger I noticed that too... How does the client then acquire an updated version of entities from the server? Is it a packet? (Probably) Do you see any other solution for my problem?
  5. I have a contraption that renders static entities, meaning the entities don't exist in the world. The entity NBT must be read before the render to conserve information such as sheep color or entity age. This used to work fine for all cases in 1.12, but I'm having trouble with Villagers and Foxes. I'll illustrate my issue for foxes: First, I call IForgeEntity#deserializeNBT. That then calls Entity#read, which eventually calls Entity#readAdditional. For foxes, that method then calls a method of FoxEntity called "func_213501_ej". That function adds attack goals to the fox. Problem is, that those attack goals haven't been initialized yet and are null, causing a NPE further down the line in the TargetSelector class. One potential solution that I see for this is that I call MobEntity#registerGoals before the NBT read. However, I would need to use reflection for that. MobEntity#registerGoals is usually called from the MobEntity constructor but registerGoals only gets executed when the world is not remote. But I wonder, how does vanilla do it? I mean the game reads the NBT on the client at some point, but doesn't get any crashes from uninitialized AI Goals... Am I calling the wrong serialize/deserialize functions?
  6. Minuthemodder was actually right, the reason it was dark was that the block was set to not opaque. Thanks!
  7. I'm trying to render a regular block model inside a TESR. This is my code: @Override public void render(TileEntityRegeneratingOre te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) { IBlockState ore = te.getOre(); Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); BlockRendererDispatcher renderer = Minecraft.getMinecraft().getBlockRendererDispatcher(); GlStateManager.pushMatrix(); GlStateManager.translate(x, y, z); GlStateManager.rotate(-90, 0, 1, 0); renderer.renderBlockBrightness(te.getOre(), te.getWorld().getCombinedLight(new BlockPos(x, y, z), 0)); GlStateManager.popMatrix(); } However, this produces a very dark block: What can I do to fix this issue? Also, how do I add the breaking animation and correct break particles? I tried looking at any of the vanilla TESR but didn't really get smarter from that...
  8. I'm updating my mod to 1.14 and I noticed that all events that subscribe to PlayerInteractEvent.RightClickBlock don't fire anymore. They are registred correctly, other events in the class also fire. When looking at the call hierarchy of ForgeHooks.onRightClickBlock, I saw that it wasn't being called anywhere within the game code. What am I missing?
  9. When I was updating to 1.14.4, I noticed that when I render something relative to the player using GL, it seems that the renderer is no longer positioned on the player by default, but on the camera. This is especially obvious when switching to f5, as I can then see the things that are normally being rendered relative to the player being rendered relative to the camera. Has anyone else experienced this? Is there a way to get the camera position?
  10. I noticed OpenGlHelper was removed in 1.14.4. Does anyone know what it was replaced with/renamed to?
  11. Ah yes, didn't see that because I went off a LivingEntity and not MobEntity
×
×
  • Create New...

Important Information

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