deerangle
Members-
Posts
259 -
Joined
-
Last visited
-
Days Won
1
Everything posted by deerangle
-
[1.12.2] Getting Loaded Chunks from Client Side
deerangle replied to unassigned's topic in Modder Support
I solved this problem before. This was my code: Long2ObjectMap<Chunk> map; try { Field chunkMapping = ChunkProviderClient.class.getDeclaredField("chunkMapping"); chunkMapping.setAccessible(true); map = (Long2ObjectMap<Chunk>) chunkMapping.get(world.getChunkProvider()); } catch(Exception e) { return; } -
Okay, so i've got pretty much everything working, but I realized that the block state isn't loaded properly when opening the world. The TileEntity works fine, but the blockstate is incorrect until i break and replace the block. How can i use NBT-Stored data to change the blockstate accordingly when the world loads?
-
This has definately helped me, but I am wondering: Is there a way to change the particle texture dynamically according to properties of the TileEntity? I have a sort of meta-block, but I store the "meta" inside the tileentity, because it doesn't fit into 4 bits. Can I use this "meta" stored in the TileEntity to dynamically display particles on break?
-
I have made a TESR, because my block is a chest which has moving parts (the lid). How can i change the block particle texture, so that it is not pink and black?
-
ChunkLoader.getLoadedChunkData(c).thenAccept(data -> Minecraft.getMinecraft().addScheduledTask(() -> ChunkLoader.putChunk(new LoadedChunk(c.x, c.z, c.getWorld(), data)))); So this would work?
-
What do you mean by generating chunks without the player TP-ing? Is there any other cause of chunk generation?
-
I keep getting this error: With a little bit of Googling I found that it is caused by calling world methods asynchronously. But sadly I cannot fix my issue without knowing which method is causing this, because removing asynchrony from my code would cause tremendous performance problems. I was using world methods asynchronously before and didn't get this error.
-
That is it. Thank you.
-
Of course nothing changed. I'm now using a bitshift instead of multiply and getting the Field only once using a helper class instead of getting it several times not using the helper class. What difference did you expect? And here the entire debug log:
-
I fixed these minor things as suggested, but the Error is still not fixed.
-
https://github.com/RIS-Mods/RIS-Minimap/blob/master/src/main/java/com/deerangle/render/MinimapColors.java The getMapColor method is the one that accesses the world and creates the stackoverflow. The entire thing get's called by MinimapEventHandler#loadChunk.
-
Well, It seems getting the BlockState loads the chunk, which Invokes the event and thus starts a loop. Here is the relevant part of the StackTrace: com.deerangle.render.MinimapEventHandler.loadChunk(MinimapEventHandler.java:40) //calling self again net.minecraftforge.fml.common.eventhandler.ASMEventHandler_11_MinimapEventHandler_loadChunk_Load.invoke(.dynamic) net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) net.minecraft.world.chunk.Chunk.onLoad(Chunk.java:920) net.minecraftforge.common.chunkio.ChunkIOProvider.syncCallback(ChunkIOProvider.java:105) net.minecraftforge.common.chunkio.ChunkIOExecutor.syncChunkLoad(ChunkIOExecutor.java:94) net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:130) net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:101) net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:147) net.minecraft.world.World.getChunkFromChunkCoords(World.java:361) net.minecraft.world.World.getChunkFromBlockCoords(World.java:353) net.minecraft.world.World.getBlockState(World.java:994) com.deerangle.render.MinimapColors.getOpacity(MinimapColors.java:197) com.deerangle.render.MinimapColors.getBrightness(MinimapColors.java:190) com.deerangle.render.MinimapColors.getMapColor(MinimapColors.java:126) com.deerangle.render.MinimapCacher.getMapPixelColor(MinimapCacher.java:131) com.deerangle.render.MinimapCacher.loadChunk(MinimapCacher.java:107) com.deerangle.render.MinimapCacher.cacheChunk(MinimapCacher.java:91) com.deerangle.render.MinimapEventHandler.loadChunk(MinimapEventHandler.java:40) //initial call when chunk is loaded
-
Another small problem now is, that when loading the map data, the ChunkEvent.Load event is invoked, which loads the map, which invokes the Event... Therefore, stackoverflowexception. Is there a way I can prevent that?
-
I am making a MiniMap mod that needs to load a chunk into the map texture as soon as the chunk is done loading.
-
Please clarify: What exactly are you trying to acheive. What do you mean by "move an item in inventory". Are you making a custom inventory, an addon for inventory tweaks or perhaps even something totally different?
-
Is there some event or something I can use to call come code as soon as a chunk finishes loading? I know there is ChunkEvent.Load, but that gives me the chunk before it is loaded, not after.
-
[Solved] Texture Atlas Sprite for water is missing texture
deerangle replied to deerangle's topic in Modder Support
@V0idWa1k3r That solution works perfectly! Thank you so much! -
I am getting the TextureAtlasSprite for the Water block in PostInit, because I need the average color value of water in order to draw a minimap. Somehow though, the code is returning the missing texture sprite instead of the water texture sprite. It works for all blocks in the game except for water and lava... This is the code used to get the sprite: IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState(state); List<BakedQuad> quads = model.getQuads(state, EnumFacing.UP, 0); quads.addAll(model.getQuads(state, null, 0)); if(quads.size() == 0) return null; return quads.get(0).getSprite();
-
When registering your item model you screwed up the model domain (modid). therefore it tries to load things like minecraft:tm#ore_end_copper#inventory which obviously doesn't exist. Try chaning Main.proxy.registerItemRenderer(Item.getItemFromBlock(this), 0, "inventory"); in your BlockBase class to Main.proxy.registerItemRenderer(Item.getItemFromBlock(this), 0, new ModelResourceLocation(new ResourceLocation(Reference.MODID, name), "inventory"));
-
Block hitbox made of several parts possible?
deerangle replied to deerangle's topic in Modder Support
Finally everything is working like a charm. -
Block hitbox made of several parts possible?
deerangle replied to deerangle's topic in Modder Support
So I am now rendering dynamic hitboxes with irregular shapes for my blocks. Now I just need to get the raytrace-selection right. I'm currently trying to figure out how to get the raytrace result of several AxisAlignedBBs and then using that to check if I am selecting my block or not. -
Is it possible to add a Hitbox to my block that consists of several different pieces, so that I could have a fitting hitbox for my cross-shaped block? Other mods like thermal dynamics do it with their pipes too.
-
Is there a way to register only a JSON model, that does not belong to any block, so that I can render it from my TESR? I want to register this model and be able to access it without registering an extra block, in case that is possibile.
-
Is there a way to cover all states in the blockstate.json?
deerangle replied to deerangle's topic in Modder Support
Yes! -
Is there a way to cover all states in the blockstate.json?
deerangle replied to deerangle's topic in Modder Support
Just a block with metadata, nothing else.