Jump to content

Animefan8888

Forge Modder
  • Posts

    6157
  • Joined

  • Last visited

  • Days Won

    59

Posts posted by Animefan8888

  1. 19 minutes ago, PenWallet said:

    and its super class are protected or private, so I have very little stuff to touch.

    Have you looked for getters?

     

    Also in the case of Screen::font just use Minecraft.getInstance().fontRenderer or use Reflection in order to get it.

    23 minutes ago, PenWallet said:

    And it does move it, but only if it's fullscreen, if it isn't fullscreen, it goes somewhere else, like this:

    Doing raw additions probably isn't the best idea. Things should be based on the Screen's width and height or the window's width and height.

     

    26 minutes ago, PenWallet said:

    It didn't work, so I replaced minecraft's texture with mine in my mod's assets, and it does work, but I'm guessing that's not the way to do it.

    You are correct it is not. I would instead just draw the portion you changed onto the screen not the whole gui.

    28 minutes ago, PenWallet said:

    BackgroundDrawnEvent

    This event is called after the tinting effect is called not when the actual screen is called.

  2. 22 minutes ago, Thomasino said:

    Hi, I have problem.

    I did a little remodeling of my mod. I copied a few lines from one video. But after launching it throws me this mistake. I tried everything I could but nothing happened.

     

    Version:1.15.2

    image: https://drive.google.com/file/d/1VBRzrxa63Ulv3Y9BKqasTlEM_-PKpKqZ/view?usp=sharing

    latest.log:  https://docs.google.com/document/d/179EvWuyzM7K9mDKmsf8m4HYyG7aKVf7tHh0zciTWkek/edit?usp=sharing

    Easier to link here. Than to explain.

  3. Just now, GhostGaming said:

    Basically, I loop through all my blocks in the item registry event and create and register a new ItemBlock with the ItemGroup. The weird thing is, that even when using one of my blocks as the tab icon it doesn't show up

    If you don't show us your code no one on here can actually help you all we can do is make shortsighted guesses on what could be causing your problem. If you don't feel comfortable sharing your code then don't and know we can't really help you.

  4. 4 minutes ago, RobinCirex said:

    public static final Block WATER = register("water", new CustomFlowingFluidBlock(Fluids.WATER, Block.Properties.create(Material.WATER).doesNotBlockMovement().hardnessAndResistance(100.0F).noDrops())); private static Block register(String key, Block p_222382_1_) { return Registry.register(Registry.BLOCK, key, p_222382_1_); }

    This is not how you register things.

    Either use the events or the DeferredRegistry system.

  5. Just now, tydeFriz said:

    thanks, mind explaining why?

    When does a statically intialized instance get initialized? It's hard to answer that question because you never know when. As such forge can't assign it the proper MODID for it's registry name.

    Also just noticing this now, but in the code snippets you posted you never set that blocks registry name in the first place.

  6. 13 minutes ago, DarkAssassin said:

    ok i will try that but what i´m wondering then is: why is the tile entity not loading and just a block when i comment out the TE out of my code when i place the vanilla item spawner

    Did you register a TileEntityType for your TileEntity?

  7. 6 hours ago, PenWallet said:

    This does indeed solve my problem, but I don't know why it smells like stinky code. Am I on the right here or is this just a shitty way to do it?

    You send a pack to the server every frame the Screen is called...

     

    Also when handling the packet you reach across logical sides by using Minecraft.getInstance() You cannot do this Minecraft.class is client only.

     

    Instead whenever the currency is changed send it to the player aka the client. Then in your Screen you can just do Minecraft.getInstance().player.getCapability(...) to get your data from the capability. Your handle method for your packet should store the currency in the capability.

  8. 3 hours ago, firebolt said:

    BlockState blockstateCycled = state.cycle(LOADED); JustToLearnMod.LOGGER.debug("before: " + worldIn.getBlockState(pos).get(LOADED).toString()); JustToLearnMod.LOGGER.debug("expected: " + blockstateCycled.get(LOADED).toString()); worldIn.setBlockState(pos, blockstateCycled, 3);

    You are doing this on the logical client you cannot do that. Do it on the logical server IE !world.isRemote

  9. 8 minutes ago, _Cruelar_ said:

    Worst case I'll make a new model file just to align this.

    I don't think multipart models support offsetting the models no. You'll have to make a new model file.

     

    15 minutes ago, _Cruelar_ said:

    The Item is rendered without transparency (I guess overwrite Block::isOpaqueCube or 1.14 equivalent, sorry still mostly thinking in 1.12 methods)

    The correct way to do this is to override Block::getRenderLayer and return BlockRenderLayer.CUTOUT_MIPPED

    • Thanks 1
  10. 1 minute ago, DarkAssassin said:

    What would be the best way to change vanilla spawners? i want them to ignore the distance between it and a player if powered by redstone.

    Override the Blocks.SPAWNER block in the registry with your own. Note you cannot change the BlockState of the Block. Then create your own version of the MobSpawnerTileEntity which does everything the vanilla one does except insert your feature into it.

×
×
  • Create New...

Important Information

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