Jump to content

Haydenman2

Members
  • Posts

    39
  • Joined

  • Last visited

Everything posted by Haydenman2

  1. So something along the lines of forge:fluids/oil may be considered appropriate as I would want my oil to be interoperable?
  2. Thank you for pushing me in the right direction. Now I more understand how to manage and utilize fluid tags. Now, one more question, is it proper/typical to tag the fluid under Minecraft, Forge, or my mod's namespace?
  3. In that case, removing the fluid from the water (or lava) tag also removes the physics and allows me to walk freely through the fluid. The water tag is the only way I have found to make the fluid act as a disruptor to player movement.
  4. Hello, I have created a handful of fluids for my mod, and I got to the functionality and physics of a fluid by adding it to the minecraft:fluid/water tag. The issue is, this causes the fluid to work in various machines I do not want it working in, not to mention the water bubbles and other undesired results of tagging it as water. Is there a way to have it physically behave the same as water without any of the side effects of being water internally? Fluid Class Registry Any help would be appreciated. I have tried copying logic from Entity/LivingEntity to no avail.
  5. Thank you! Thank you very much. I appreciate your advice and using it I can now diagnose myself using the stack trace. Thank you again.
  6. This is what I did, so I might have done it wrong. Debug Log
  7. I confirmed that this log provides the same info when it matters, upon player join. Nothing additional could be learned from adding this. The paste is too large to post.
  8. Hi y'all, I'm reaching out because I'm truly at a loss on why this isn't working. I just built my mod on 1.16.1 for the first time to test with my friend, but neither of us can connect, getting booted on join. I have narrowed it down to being an issue with my mod, as we can join a Forge server with no mods on it. The connection in-game shows: Internal Exception: io.netty.handler.codec.DecoderException: io.netty.handler.codec.EncoderException: java.io.UTFDataFormatException: malformed input around byte 83 However I cannot find this in either server or client log at all. Any advice on this issue? Server Log Client Log GitHub
  9. Howdy y'all, I'm trying to use GL scaling to render small versions of text on a custom-rendered ItemStack, however, this is not working nearly how I want it to. It's very close, however, the text is appearing behind the stack. Any idea why? @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { super.drawGuiContainerForegroundLayer(mouseX, mouseY); if(tsfm.storedItem == null) { this.font.drawString("Empty", 52, 13, 0xffffff); }else { this.font.drawString(tsfm.storedItem.getName().getFormattedText(), 52, 13, 0xffffff); if(tsfm.internalStored < 10_000_000) { this.font.drawString("Stored: " + Formatting.GENERAL_FORMAT.format(tsfm.internalStored), 52, 25, 0xd4d4d4); }else { this.font.drawString("Stored: " + SCINOT.format(tsfm.internalStored), 52, 25, 0xd4d4d4); } RenderSystem.pushMatrix(); RenderSystem.scalef(0.5f, 0.5f, 0.5f); this.itemRenderer.renderItemOverlayIntoGUI(this.font, tsfm.storedItem.getDefaultInstance(), (25)*2, (68)*2, "Hello!"); RenderSystem.popMatrix(); } } @Override protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { super.drawGuiContainerBackgroundLayer(partialTicks, mouseX, mouseY); int x = (this.width - this.xSize) / 2; int y = (this.height - this.ySize) / 2; if(tsfm.storedItem != null) { this.itemRenderer.renderItemIntoGUI(tsfm.storedItem.getDefaultInstance(), (x+17), (y+60)); } } I have tested it, and rendering ItemOverlayIntoGUI works correctly and places on top of the item as proper when scaling is not involved. EDIT: I actually got it all worked out. Thank you.
  10. Hi all, I've been piecing through the 1.16 update and all is well so far, however I have not been able to find a replacement for these two fields on the Block.Properties options. Any advice?
  11. My advice is to start by reading through the Getting Started, Concepts, and Blocks on the Forge docs to get to the point in which you will be able to put in a custom block. https://mcforge.readthedocs.io/en/1.15.x/blocks/blocks/ Edit: My bad. Accidentally linked the 1.14 docs.
  12. What point are you up to? Have you only made the model? Do you have anything set up in a dev workspace?
  13. Override Item#initCapabilities. In there, return a new ICapabilityProvider, essentially a wrapper for the getCapability method. Then, perform ItemStack#getCapability to query the ICapabilityProvider from the Item class. Here's an example from my code. @Override public ICapabilityProvider initCapabilities(ItemStack stack, CompoundNBT nbt) { return new ICapabilityProvider() { protected IEnergyStorage energy = new IEnergyStorage() { @Override public int receiveEnergy(int maxReceive, boolean simulate) { if (getMaxPower() < maxReceive + getCurrentPower(stack)) { maxReceive = getMaxPower() - getCurrentPower(stack); } if (simulate == false) { setCurrentPower(stack, getCurrentPower(stack) + maxReceive); } return maxReceive; } @Override public int getMaxEnergyStored() { return getMaxPower(); } @Override public int getEnergyStored() { return getCurrentPower(stack); } @Override public int extractEnergy(int maxExtract, boolean simulate) { return 0; } @Override public boolean canReceive() { return true; } @Override public boolean canExtract() { return false; } }; protected LazyOptional<IEnergyStorage> energyHandler = LazyOptional.of(() -> energy); @Override public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) { return this.getCapability(cap); } @Override public <T> LazyOptional<T> getCapability(Capability<T> cap) { if (cap == CapabilityEnergy.ENERGY) { return energyHandler.cast(); } return LazyOptional.empty(); } }; }
  14. I've tried fiddling with filtering through each quad, and no luck sadly with anything. I ended up just simplifying the model significantly. Thank you for the advice.
  15. Hello, I am trying to finish the model for a basic tank block, however despite my best efforts the tanks have very odd shadows being cast. I have tried everything I can think of to get this gone however nothing is working. Any advice for any way I might be able to overcome the strange shading? private static final VoxelShape SHAPE = Stream.of(Block.makeCuboidShape(0, 0, 0, 16, 1, 16), Block.makeCuboidShape(0, 1, 15, 1, 15, 16), Block.makeCuboidShape(15, 1, 15, 16, 15, 16), Block.makeCuboidShape(0, 1, 0, 1, 15, 1), Block.makeCuboidShape(15, 1, 0, 16, 15, 1), Block.makeCuboidShape(0, 15, 0, 16, 16, 16), Block.makeCuboidShape(1, 1, 0, 15, 15, 1), Block.makeCuboidShape(1, 1, 15, 15, 15, 16), Block.makeCuboidShape(1, 1, 1, 15, 15, 15), Block.makeCuboidShape(0, 1, 1, 1, 15, 15), Block.makeCuboidShape(15, 1, 1, 16, 15, 15)).reduce((v1, v2) -> { return VoxelShapes.combineAndSimplify(v1, v2, IBooleanFunction.OR); }).get(); private static final DecimalFormat FORMAT = new DecimalFormat("###,###,###"); private final int _capacity; private final TemperatureResistance _tempres; public BlockFluidTank(int capacity, TemperatureResistance resist) { super(Block.Properties.create(Material.GLASS).notSolid().hardnessAndResistance(4f, 15f).harvestLevel(0) .harvestTool(ToolType.PICKAXE).sound(SoundType.GLASS).variableOpacity()); _capacity = capacity; _tempres = resist; this.setDefaultState(this.stateContainer.getBaseState().with(StateProperties.FLUID, DisplayFluids.NONE)); } @Override public void onReplaced(BlockState state, World worldIn, BlockPos pos, BlockState newState, boolean isMoving) { if (state.getBlock() != newState.getBlock()) { if (worldIn.getTileEntity(pos) instanceof TEFluidTank) { worldIn.removeTileEntity(pos); } } } @Override public boolean isNormalCube(BlockState state, IBlockReader worldIn, BlockPos pos) { return false; } RenderTypeLookup.setRenderLayer(getBlock("steel_fluid_tank"), RenderType.getCutout()); RenderTypeLookup.setRenderLayer(getBlock("wooden_fluid_tank"), RenderType.getCutout()); { "parent": "block/cube", "textures": { "0": "block/oak_log", "1": "block/oak_log", "2": "block/glass", "particle": "block/oak_log" }, "elements": [ "elements": [ { "from": [0, 0, 0], "to": [16, 1, 16], "faces": { "north": {"uv": [0, 0, 16, 1], "texture": "#1"}, "east": {"uv": [0, 0, 16, 1], "texture": "#1"}, "south": {"uv": [0, 0, 16, 1], "texture": "#1"}, "west": {"uv": [0, 0, 16, 1], "texture": "#1"}, "up": {"uv": [0, 0, 16, 16], "texture": "#1"}, "down": {"uv": [0, 0, 16, 16], "texture": "#1"} } }, { "from": [0, 15, 0], "to": [16, 16, 16], "rotation": {"angle": 0, "axis": "y", "origin": [8, 23, 8]}, "faces": { "north": {"uv": [0, 0, 16, 1], "texture": "#1"}, "east": {"uv": [0, 0, 16, 1], "texture": "#1"}, "south": {"uv": [0, 0, 16, 1], "texture": "#1"}, "west": {"uv": [0, 0, 16, 1], "texture": "#1"}, "up": {"uv": [0, 0, 16, 16], "texture": "#1"}, "down": {"uv": [0, 0, 16, 16], "texture": "#1"} } }, { "from": [0, 1, 15], "to": [1, 15, 16], "rotation": {"angle": 0, "axis": "y", "origin": [8, 9, 23]}, "faces": { "north": {"uv": [0, 0, 1, 15], "texture": "#0"}, "east": {"uv": [0, 0, 1, 15], "texture": "#0"}, "south": {"uv": [0, 0, 1, 15], "texture": "#0"}, "west": {"uv": [0, 0, 1, 15], "texture": "#0"}, "up": {"uv": [0, 0, 1, 15], "texture": "#0"}, "down": {"uv": [0, 0, 1, 15], "texture": "#0"} } }, { "from": [15, 1, 15], "to": [16, 15, 16], "rotation": {"angle": 0, "axis": "y", "origin": [23, 9, 23]}, "faces": { "north": {"uv": [0, 0, 1, 15], "texture": "#0"}, "east": {"uv": [0, 0, 1, 15], "texture": "#0"}, "south": {"uv": [0, 0, 1, 15], "texture": "#0"}, "west": {"uv": [0, 0, 1, 15], "texture": "#0"}, "up": {"uv": [0, 0, 1, 15], "texture": "#0"}, "down": {"uv": [0, 0, 1, 15], "texture": "#0"} } }, { "from": [0, 1, 0], "to": [1, 15, 1], "rotation": {"angle": 0, "axis": "y", "origin": [9, 9, 8]}, "faces": { "north": {"uv": [0, 0, 1, 15], "texture": "#0"}, "east": {"uv": [0, 0, 1, 15], "texture": "#0"}, "south": {"uv": [0, 0, 1, 15], "texture": "#0"}, "west": {"uv": [0, 0, 1, 15], "texture": "#0"}, "up": {"uv": [0, 0, 1, 15], "texture": "#0"}, "down": {"uv": [0, 0, 1, 15], "texture": "#0"} } }, { "from": [15, 1, 0], "to": [16, 15, 1], "rotation": {"angle": 0, "axis": "y", "origin": [23, 9, 8]}, "faces": { "north": {"uv": [0, 0, 1, 15], "texture": "#0"}, "east": {"uv": [0, 0, 1, 15], "texture": "#0"}, "south": {"uv": [0, 0, 1, 15], "texture": "#0"}, "west": {"uv": [0, 0, 1, 15], "texture": "#0"}, "up": {"uv": [0, 0, 1, 15], "texture": "#0"}, "down": {"uv": [0, 0, 1, 15], "texture": "#0"} } }, { "from": [1, 1, 0], "to": [15, 15, 1], "rotation": {"angle": 0, "axis": "y", "origin": [9, 9, 8]}, "faces": { "north": {"uv": [0, 0, 16, 16], "texture": "#2"}, "east": {"uv": [0, 0, 16, 16], "texture": "#2"}, "south": {"uv": [0, 0, 16, 16], "texture": "#2"}, "west": {"uv": [0, 0, 16, 16], "texture": "#2"}, "up": {"uv": [0, 0, 16, 16], "texture": "#2"}, "down": {"uv": [0, 0, 16, 16], "texture": "#2"} } }, { "from": [1, 1, 15], "to": [15, 15, 16], "rotation": {"angle": 0, "axis": "y", "origin": [9, 9, 23]}, "faces": { "north": {"uv": [0, 0, 16, 16], "texture": "#2"}, "east": {"uv": [0, 0, 16, 16], "texture": "#2"}, "south": {"uv": [0, 0, 16, 16], "texture": "#2"}, "west": {"uv": [0, 0, 16, 16], "texture": "#2"}, "up": {"uv": [0, 0, 16, 16], "texture": "#2"}, "down": {"uv": [0, 0, 16, 16], "texture": "#2"} } }, { "from": [0, 1, 1], "to": [1, 15, 15], "rotation": {"angle": 0, "axis": "y", "origin": [8, 9, 9]}, "faces": { "north": {"uv": [0, 0, 14, 14], "texture": "#2"}, "east": {"uv": [0, 0, 16, 16], "texture": "#2"}, "south": {"uv": [0, 0, 14, 14], "texture": "#2"}, "west": {"uv": [0, 0, 16, 16], "texture": "#2"}, "up": {"uv": [0, 0, 14, 14], "texture": "#2"}, "down": {"uv": [0, 0, 14, 14], "texture": "#2"} } }, { "from": [15, 1, 1], "to": [16, 15, 15], "rotation": {"angle": 0, "axis": "y", "origin": [23, 9, 18]}, "faces": { "north": {"uv": [0, 0, 16, 16], "texture": "#2"}, "east": {"uv": [0, 0, 16, 16], "texture": "#2"}, "south": {"uv": [0, 0, 16, 16], "texture": "#2"}, "west": {"uv": [0, 0, 16, 16], "texture": "#2"}, "up": {"uv": [0, 0, 16, 16], "texture": "#2"}, "down": {"uv": [0, 0, 16, 16], "texture": "#2"} } } ], "groups": [ { "name": "VoxelShapes", "origin": [8, 8, 8], "children": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] } ] }
  16. It looks to me like you can override Biome#getGrassColor, passing in an int color, keeping in mind that it is client-side only. EDIT: Override Biome#getFoliageColor as well.
  17. Hi! I'm trying to store an int amount of specific fluids into the chunk data, and I believe the chunk is being saved correctly (using ChunkDataEvent.Save), however it is not present when trying to load NBT from ChunkDataEvent.Load. Any push in the right direction would be wonderful. @SubscribeEvent public static void chunkLoad(ChunkDataEvent.Load event) { if(event.getWorld() != null && !event.getWorld().isRemote()) { FluidLevelManager.readData(event.getChunk().getPos(), event.getWorld(), event.getData()); } } @SubscribeEvent public static void chunkSave(ChunkDataEvent.Save event) { if(event.getWorld() != null && !event.getWorld().isRemote()) { FluidLevelManager.writeData(event.getChunk(), event.getWorld(), event.getData()); } } @SubscribeEvent public static void chunkUnload(ChunkEvent.Unload event) { if(event.getWorld() != null && !event.getWorld().isRemote()) { FluidLevelManager.clearData(event.getWorld(), event.getChunk().getPos()); } } public class FluidLevelManager { public static final ConcurrentHashMap<ChunkCoords, FluidStack> CHUNK_FLUIDS = new ConcurrentHashMap<>(); private static final Random RAND = new Random(); public static void readData(ChunkPos pos, IWorld world, CompoundNBT nbt) { ChunkCoords cc = new ChunkCoords(world.getDimension().getType().getId(), pos.x, pos.z); if(nbt.contains("assemblylinemachines:chunkfluid")) { CHUNK_FLUIDS.put(cc, FluidStack.loadFluidStackFromNBT(nbt.getCompound("assemblylinemachines:chunkfluid"))); }else { int val = RAND.nextInt(40); if(world.getDimension().getType() == DimensionType.OVERWORLD) { if(val == 0) { CHUNK_FLUIDS.put(cc, new FluidStack(Registry.getFluid("oil"), (RAND.nextInt(4000) + 1001) * 1000)); }else if(val < 4) { CHUNK_FLUIDS.put(cc, new FluidStack(Fluids.LAVA, (RAND.nextInt(11500) + 1001) * 1000)); }else { CHUNK_FLUIDS.put(cc, FluidStack.EMPTY); } }else if(world.getDimension().getType() == DimensionType.THE_NETHER) { if(val < 7) { CHUNK_FLUIDS.put(cc, new FluidStack(Fluids.LAVA, (RAND.nextInt(29000) + 1001) * 1000)); }else { CHUNK_FLUIDS.put(cc, FluidStack.EMPTY); } } } } public static void writeData(IChunk chunk, IWorld world, CompoundNBT nbt) { ChunkCoords cc = new ChunkCoords(world.getDimension().getType().getId(), chunk.getPos().x, chunk.getPos().z); if(CHUNK_FLUIDS.containsKey(cc)) { CompoundNBT sub = new CompoundNBT(); CHUNK_FLUIDS.get(cc).writeToNBT(sub); nbt.put("assemblylinemachines:chunkfluid", sub); } } public static void clearData(IWorld world, ChunkPos pos) { int dimid = world.getDimension().getType().getId(); CHUNK_FLUIDS.remove(new ChunkCoords(dimid, pos.x, pos.z)); } } No matter what, the two prints at the top of readData always output 0 and an empty string.
  18. Considering readString() legitimately passes to readString(32767), that is a very... peculiar sided restriction. Thank you very much for helping me figure it out!
  19. So is maxLength the length of the String being packet-ified?
  20. Hello! I'm trying to set up a GUI with buttons, and to communicate button changes, I'm using a SimpleChannel. This works flawlessly on client, however, on server, I experience a crash on the server related to missing classes. I assume this is due to referencing a class only present in Client, however I do not know where I do this. Class for handling packets. https://github.com/HaydenBelanger/assembly_line_machines/blob/development/src/main/java/me/haydenb/assemblylinemachines/packets/HashPacketImpl.java Method for sending the packet to the channel. https://github.com/HaydenBelanger/assembly_line_machines/blob/development/src/main/java/me/haydenb/assemblylinemachines/block/energy/BlockBasicBatteryCell.java#L327-L341 Registering the channels. https://github.com/HaydenBelanger/assembly_line_machines/blob/development/src/main/java/me/haydenb/assemblylinemachines/registry/Registry.java#L290-L294 java.lang.NoSuchMethodError: net.minecraft.network.PacketBuffer.readString()Ljava/lang/String; at me.haydenb.assemblylinemachines.packets.HashPacketImpl$DecoderConsumer.apply(HashPacketImpl.java:83) ~[main/:?] {re:classloading} at me.haydenb.assemblylinemachines.packets.HashPacketImpl$DecoderConsumer.apply(HashPacketImpl.java:1) ~[main/:?] {re:classloading} at net.minecraftforge.fml.network.simple.IndexedMessageCodec.lambda$tryDecode$0(IndexedMessageCodec.java:116) ~[forge-1.15.2-31.1.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading} at java.util.Optional.map(Optional.java:215) ~[?:1.8.0_181] {} at net.minecraftforge.fml.network.simple.IndexedMessageCodec.tryDecode(IndexedMessageCodec.java:116) ~[forge-1.15.2-31.1.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading} at net.minecraftforge.fml.network.simple.IndexedMessageCodec.consume(IndexedMessageCodec.java:157) ~[forge-1.15.2-31.1.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading} at net.minecraftforge.fml.network.simple.SimpleChannel.networkEventListener(SimpleChannel.java:79) ~[forge-1.15.2-31.1.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading} at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:212) ~[eventbus-2.0.0-milestone.1-service.jar:?] {} at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:204) ~[eventbus-2.0.0-milestone.1-service.jar:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:258) ~[eventbus-2.0.0-milestone.1-service.jar:?] {} at net.minecraftforge.fml.network.NetworkInstance.dispatch(NetworkInstance.java:84) ~[?:?] {re:classloading} at net.minecraftforge.fml.network.NetworkHooks.lambda$onCustomPayload$0(NetworkHooks.java:74) ~[?:?] {re:classloading} at java.util.Optional.map(Optional.java:215) ~[?:1.8.0_181] {} at net.minecraftforge.fml.network.NetworkHooks.onCustomPayload(NetworkHooks.java:74) ~[?:?] {re:classloading} at net.minecraft.network.play.ServerPlayNetHandler.processCustomPayload(ServerPlayNetHandler.java:1366) ~[?:?] {re:classloading} at net.minecraft.network.play.client.CCustomPayloadPacket.processPacket(CCustomPayloadPacket.java:51) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.network.play.client.CCustomPayloadPacket.processPacket(CCustomPayloadPacket.java:12) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.network.PacketThreadUtil.lambda$checkThreadAndEnqueue$0(PacketThreadUtil.java:19) ~[?:?] {re:classloading} at net.minecraft.util.concurrent.TickDelayedTask.run(TickDelayedTask.java:20) ~[?:?] {re:classloading} at net.minecraft.util.concurrent.ThreadTaskExecutor.run(ThreadTaskExecutor.java:140) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.util.concurrent.RecursiveEventLoop.run(RecursiveEventLoop.java:22) ~[?:?] {re:classloading} at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:757) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:141) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.util.concurrent.ThreadTaskExecutor.driveOne(ThreadTaskExecutor.java:110) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.driveOneInternal(MinecraftServer.java:740) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.driveOne(MinecraftServer.java:734) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.util.concurrent.ThreadTaskExecutor.driveUntil(ThreadTaskExecutor.java:123) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.runScheduledTasks(MinecraftServer.java:720) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:664) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} I would love a point in the right direction as I don't see what could be the problem with this.
  21. I've confirmed the client is receiving the data packet containing the color code as expected and at the correct time, however it is not being translated to the color of the water in the basin. @Override public void onDataPacket(NetworkManager net, SUpdateTileEntityPacket pkt) { super.onDataPacket(net, pkt); System.out.println("[DEBUG] Received data packet: " + pkt.getNbtCompound().getInt("assemblylinemachines:fluidcolor")); handleUpdateTag(pkt.getNbtCompound()); } [m[32m[20:59:08] [Render thread/INFO] [STDOUT/]: [me.haydenb.assemblylinemachines.block.BlockFluidBath$TEFluidBath:onDataPacket:300]: [DEBUG] Received data packet: 11597296
  22. Hello. I have a basin TileEntity that stores a liquid, and when two items from a crafting recipe are placed in the block, the block changes states to allow the fluid to tint according to the recipe JSON as specified. This tint is working appropriately and the state is updating immediately (as seen in F3) however the actual visual tint won't take effect until a block near the basin is broken. Any advice on how to force the client to update their IBlockColor? entity.output = crafting.getRecipeOutput().copy(); entity.stirsRemaining = crafting.getStirs(); entity.fluidColor = crafting.getColor(); world.setBlockState(pos, state.with(STATUS, BathStatus.success), 3); entity.sendUpdates(); public TileEntityALMBase(TileEntityType<?> tileEntityTypeIn) { super(tileEntityTypeIn); } @Override public SUpdateTileEntityPacket getUpdatePacket() { return new SUpdateTileEntityPacket(this.pos, -1, this.getUpdateTag()); } @Override public CompoundNBT getUpdateTag() { return write(new CompoundNBT()); } @Override public void onDataPacket(NetworkManager net, SUpdateTileEntityPacket pkt) { super.onDataPacket(net, pkt); handleUpdateTag(pkt.getNbtCompound()); } public void sendUpdates() { world.markBlockRangeForRenderUpdate(pos, getBlockState(), getBlockState()); world.notifyBlockUpdate(pos, getBlockState(), getBlockState(), 2); markDirty(); } event.getBlockColors().register(new IBlockColor() { @Override public int getColor(BlockState state, ILightReader reader, BlockPos pos, int tint) { if(reader != null && pos != null) { if(state.get(BlockFluidBath.STATUS) == BathStatus.success) { TileEntity te = reader.getTileEntity(pos); if(te != null && te instanceof TEFluidBath) { TEFluidBath tef = (TEFluidBath) te; return tef.getFluidColor(); } }else { if(state.get(BlockFluidBath.FLUID) == BathFluid.lava) { return 0xcb3d07; }else { return BiomeColors.getWaterColor(reader, pos); } } } return 0xffffff; } }, getBlock("fluid_bath"));
  23. I'm trying to create a jar of sorts with one section being translucent and another part being opaque. The translucent part works fine, but from some angles the opaque section disappears. Any tips? Class Model
  24. As Draco said it doesn't get called unless it is equiped, solution subscribe to PlayerTickEvent in an EventHandler. Clever method, will do. Thanks you two
×
×
  • Create New...

Important Information

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