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

Tut

Members
  • Content Count

    22
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Tut

  • Rank
    Tree Puncher

Converted

  • Gender
    Undisclosed
  • Personal Text
    Idiot; but only most of the time
  1. Slight update - I had a bug in my code that caused minecraft to hang. Pretty sure directly registering it with Registry.register would have worked; but my question of how to do it the "right" way still stands. Right now the access transformer works as intended.
  2. I see now Astral is able to do that since they use an access transformer for that function. https://github.com/HellFirePvP/AstralSorcery/blob/e8434f1a09356632babefee1925626dc3deefb2a/src/main/resources/META-INF/accesstransformer.cfg#L12 Is that the only way to do this?
  3. Hi, I'm trying to register a new LootFunction to use in my loot table data generator. I was loosely basing it off of Astral Sorcery's loot table data generators, since I'm trying to achieve a similar effect. Here's my loot table provider: package org.tutmods.shungite.data; import com.google.common.collect.ImmutableList; import com.mojang.datafixers.util.Pair; import net.minecraft.block.Block; import net.minecraft.block.Blocks; import net.minecraft.data.DataGenerator; import net.minecraft.data.LootTableProvider; import net.minecraft.data.loot.BlockLootTables; import net.minecraft.enc
  4. I guess I was just confused as to how things were getting handled when something is updated on the server. Not sure how I didn't see it before, thanks all.
  5. I see the issue. But I'm not sure why being on the server means the client isn't being updated, if the setBlock event should update the client?
  6. Here's the whole class. public class ShungiteDowsingRod extends Item implements IForgeItem { public ShungiteDowsingRod(Properties properties) { super(properties); } @Override public ActionResultType useOn(ItemUseContext itemUseContext) { final World world = itemUseContext.getLevel(); if (!world.isClientSide()) { final Stream<BlockPos> blocksBetweenPlayerLookingAndDowsingEffect = BlockPos.betweenClosedStream( WorldHelper.getAABBInDirectionWithOffset( itemUseContext.getClickedPos(),
  7. Thank you for letting me know! Unfortunately still having issues. I'm not sure why this code isn't working.. blocksBetweenPlayerLookingAndDowsingEffect.forEach( blockPos -> { world.setBlock(blockPos, Blocks.CYAN_WOOL.defaultBlockState(), ( Constants.BlockFlags.DEFAULT_AND_RERENDER ) ); }); Here's an example of the behavior I'm experiencing.. https://files.catbox.moe/z4ov1m.m4v
  8. setBlockAndUpdate uses flag 3, but I've tried 1, 2, and 4 with no success. Is there any documentation on what these flags do? I found this thread but since I'm using the mojang mappings I don't think I have the same javadocs.
  9. Hi, I have an AABB that I want to set all of the blocks in to a different block. final Stream<BlockPos> blocksBetweenPlayerLookingAndDowsingEffect = BlockPos.betweenClosedStream( WorldHelper.getAABBInDirectionWithOffset( itemUseContext.getClickedPos(), itemUseContext.getClickedFace(), 0, 1, 1 ) ); blocksBetweenPlayerLookingAndDowsingEffect.forEach( blockPos -> { world.setBlockAndUpdate(blockPos, Blocks.CYAN_WOOL.defaultBlockState()); }); I think there were different names for b
  10. Alright, one more question now that I've realized my issues. If I want to set the inventory of any TileEntity, I can do it straight from HuskItem's method? Are there any examples I can look at where syncing the inventory between client and server is necessary then? I think I'm just confused about when and where to use packets, I guess.
  11. Holy shit I'm dumb. This is what I get for copy/pasting. Edit: Will do what you said as well. I can't believe that I haven't seen that though.
  12. Alright, rebuilt how the item works now. I think it's much better this time around, but I'm having a strange crash. Is there some sort of limit on what I can write / read from the buffer? Or am I still doing something wrong and dumb? The code in the main post has been updated to the newest version. Crash log:
  13. Ah. I'm really dumb. Got logical and physical confused. Thanks for making me not dumb.
  14. Ok, I understand the last two points. However, I'm not sure how I would be on the server when I send the packet. I could be thinking about it all wrong, but from what I understand I am sending the packet on line 103 of the HuskItem class. How could I be on the server when I send the packet? Once again, I'm probably wrong here but FMLCommonHandler.getSide() returns that (when I'm sending the packet) I'm calling it from the client. Am I seeing something the wrong way?
  15. I just don't know why it's null. Is there something within Java that I just don't understand here? Edit: I think I got it. Trying some stuff now.
×
×
  • Create New...

Important Information

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