Jump to content

TheOnlyTrueEnte

Members
  • Posts

    33
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Recent Profile Visitors

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

TheOnlyTrueEnte's Achievements

Tree Puncher

Tree Puncher (2/8)

2

Reputation

  1. I'm currently working on recipes for my custom paxel mod. Explanation with pictures: I created a custom recipe class for the recipe. The recipe accepts an axe, pickaxe, shovel and two sticks and yields a paxel. My recipe also works if the tools are damaged: the result is a damaged paxel. My problem is that when clicking on the recipe in the recipe book, it doesn't accept damaged items (or even undamaged, enchanted ones) from my inventory. Code of the 1.14.4 project for reference: In this version of the code, I hadn't written a proper json serializer yet so my recipe constructor is hardcoded to create the recipe for the golden paxel. This is probably more readable anyway. The method responsible for matching a recipe from the recipe book to my inventory seems to be IRecipe#getIngredients. Since Ingredient#test only tests for the ItemStack's Item and not other data though, I'm very confused as to why item stack's nbt matters there.
  2. NoteBlock updates its INSTRUMENT property by calling NoteBlockInstrument#byState. This method is completely hardcoded. It would be nice if it instead did a lookup on a Map that modders can register their blocks to, for example. Currently, if you want your modded block to serve as a specific NoteBlockInstrument you have to intercept a NoteBlockEvent.Play and change its instrument there. This event is only fired when the NoteBlock is actually played and does not update the INSTRUMENT property. This sucks especially if you're using a resource pack to display the NoteBlock's instrument.
  3. Hi there, I'm trying to render my custom entity's blockstate member with my own texture all over it but keeping the original alpha channel. If that's too hard I'll settle for rendering it in all white. I'm really new to GL11 and the closest I've gotten is this: GlStateManager.disableTexture(); //disables alpha as well GlStateManager.disableLighting(); GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); blockrendererdispatcher.renderBlockBrightness(Blocks.TNT.getDefaultState(), 1.0F); But that completely disables the texture, including the alpha channel. If anyone could link any good resources to learn GL's basic function that would also be greatly appreciated.
  4. You're right, I should have checked the new version first. Thank you. Just out of curiosity though and since I might add more Dispense behaviors in the future, is there a way to actually add Dispense functionality to an already registered block?
  5. No. If my TNT extends TNTBlock, dispensing Flint and Steel onto it will just spawn a vanilla TNTEntity. Here's an excerpt from IDispenseItemBehavior#init, of the OptionalDispenseBehavior for FLINT_AND_STEEL: if (blockstate.getBlock() instanceof TNTBlock) { TNTBlock.explode(world, blockpos); world.removeBlock(blockpos, false); } TNTBlock#explode is obviously a static method here so I can't do anything to sort of override it. EDIT: as of 1.14.4-28.1.92, this calls blockstate.catchFire which my TNT block can override.
  6. Solved for my specific issue! My TNT just needed to override IForgeBlock#catchFire. Hi there, My mod adds new types of TNT and I would like Dispensers to be able to prime them with vanilla Flint and Steel. My problem is that DispenserBlock#registerDispenseBehavior(item, behavior) puts the specified behavior in a map with item as the key so if I register a new Behavior for Items.FLINT_AND_STEEL, the old vanilla behavior and/or behavior that another mod might have added gets overridden. Is there another way of doing it? I haven't found any sort of Dispenser event or Redstone event (although a Redstone event probably wouldn't work because I also need the exact slot of the dispenser that is being used). Cheers, TheOnlyTrueEnte
  7. That's good to know, thanks. I managed to get it to work! EDIT: The fix (canceling the off-hand's event if the main hand's event stripped a log) now successfully prevents the offhand from placing dirt. If the offhand is holding an Ender Pearl, however, it is thrown regardless. I'll have to do some more testing tomorrow. Also, if another mod registers an event listener for the item in the off-hand and that listener is executed before mine, it will go through and I can't do anything against it.
  8. But if a vanilla item (or an item from another mod) is in the offhand and an axe is in the main hand, how can I make my event prevent the offhand from using the item? before right-click: after right-click:
  9. Thank you, that explains why the event is being fired twice from each hand but it doesn't solve the problem. My problem is that it's being fired for the offhand even if the main hand's event already changed the results.
  10. Hi, I created a RightClickEvent to allow the player to strip my modded wood by right-clicking it with an axe. The problem is that if the player also has an item in their off-hand (e.g. dirt), that one is also used after the wood is stripped (e.g. the dirt is placed). The cause seems to be that the event is always for both hands even if one has already changed the result. I've tried every combination of setting event.useItem/useBlock/result to ALLOW/DEFAULT/DENY and calling event.setCancelled() but nothing helped. At the beginning of the method, event.getResult() always returns DEFAULT, so a special case there also doesn't help. My event is defined as: @SubscribeEvent public static void centeBlockStripping(PlayerInteractEvent.RightClickBlock event){ LOGGER.info("Event hand: "+event.getHand()); if(event.getItemStack().getItem() instanceof AxeItem){ if(event.getWorld().getBlockState(event.getPos()).getBlock() instanceof CustomLog) { stripWood(...); damageAxe(...); event.setResult(Event.Result.ALLOW); event.setUseItem(Event.Result.DENY); event.setUseBlock(Event.Result.DENY); } } } and every time I right click a block, the event is fired twice for each hand. Log: What am I doing wrong? Cheers
  11. I've been messing around with stairs and noticed that when textures are overridden in the "defaults" block, uvlock doesn't work. The screenshots were made by modifying minecraft/.../brick_stairs.json This works (first screenshot): This doesn't (second screenshot):
  12. I'm creating a new type of dirt that I want the vanilla grass_block to be able to spread to. I could do this in custom_dirt#tick but I thought there was probably a way to do it better. I might also make grass be able to spread to soul sand, creating custom_soul_grass. The only way to do that is to add something to vanilla grass_block or soul_sand's tick which I don't know is possible.
  13. I'm trying to add functionality to a vanilla block's tick function. It seems like the best way would be to add an event subscriber but I can't find the appropriate event type in net.minecraftforge.event. Is there another way? Thanks
  14. I'm using Forge 1.14.4-28.1.0 I've been trying to figure out Forge's blockstate.jsons. I cannot get them to work even though I'm following the official docs closely. The block I'm trying them with is the acacia slab. The first thing I tried is have the "type" state change the textures. The model is correctly applied but the textures are not (the pink/black debug texture is shown): { "forge_marker": 1, "defaults": { "model": "block/pressure_plate_up" }, "variants": { "type": { "bottom": { "textures": { "texture": "block/black_wool" } }, "top": { "textures": { "texture": "block/blue_wool" } }, "double":{ "textures": { "texture": "block/red_wool" } } } } } In fact, not even this works, producing the same result: { "forge_marker": 1, "defaults": { "model": "block/pressure_plate_up", "textures": { "texture": "block/white_wool" } }, "variants": { "type": { "bottom": {}, "top": {}, "double":{} } } } This one breaks the model. Only the debug cube is shown. In fact I can't get any forge blockstate to work that doesn't have any states/variants, like cobblestone. { "forge_marker": 1, "defaults": { "model": "block/dirt" }, "variants": { "normal": [{}] } } What am I doing wrong? Thank you.
×
×
  • Create New...

Important Information

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