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

Brand new at this getting issues loading textures 1.7


SteamPunk_Devil
 Share

Recommended Posts

I've been following the generic tutorial on the wiki but have run into issues when adding images to my mods. I had it working at one point but after I added another item it stopped working. Ive tried pretty much everything I could think of. but with no luck. Heres a image of the file tree and code. Please ask if you need anything else. 

Link to comment
Share on other sites

Try changing the the package

 

assets.extratools.textures.items

 

Also, you might want to make certain that your modid is "extratools"

 

[coolboy actually beat me to this]

 

It's a really good idea to great a static class that references your mod id, mod name, and version number

 

package com.mmg.candymod.lib;

public class Strings {

    public static final String MODID = "extratools";
    public static final String MODNAME = "Extra Tools";
    public static final String VERSION = "0.1";	

}

 

That way, when you have to reference any of that information, it will always be correct.

 

Then your texture would be

setTextureName(Strings.MODID + ":EnderShard");

 

This is assuming that the EnderShard texture is in your assets.extratools.textures.items folder is named "EnderShard.png"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • This usually happens because of a bad manifest (mods.toml). Can you show us what's in your src folder?
    • Don't change it, the launcher comes with it configured properly.
    • Hello all. I am trying to implement oil into my mod (I know I know, unoriginal). But I just can't seem to get it to work. (System/Minecraft information: Java 17, forge: 1.17.1-37.0.95, mappings: official) I am using DeferredRegisters. In the current configuration, the bucket doesn't do anything most of the time, the block doesn't appear and doesn't flow. I am extending "ForgeFlowingFluid". It seems in LiquidBlock there are two constructors, one deprecated taking in a Fluid, the other takes in a supplier/RegistryObject<Fluid>. Because I am using DeferredRegisters, I have to use the second one, because blocks are registered before fluids. But it seems that in the code, most of it relies on the LiquidBlock.fluid field, which never gets set in the second constructor. I tried hacking in a solution with a "Fixed" version of LiquidBlock: public class FixedLiquidBlock extends LiquidBlock { private static final List<FixedLiquidBlock> liquidBlocksNeedingFixing = new ArrayList<>(); // Check if the supplier is a registry object. If it is, and the value is not null, set the value of the fluid field, else mark it so that it gets set later. public FixedLiquidBlock(Supplier<? extends FlowingFluid> supplier, Properties properties) { super(supplier, properties); try { if (supplier instanceof RegistryObject registryObject && registryObject.get() != null) { try { Class<?> class_ = LiquidBlock.class; Field fluidField = ObfuscationReflectionHelper.findField(class_, "fluid"); fluidField.setAccessible(true); fluidField.set(this, supplier.get()); } catch (Exception e) { throw new RuntimeException(e); } } } catch (NullPointerException ignored) {} liquidBlocksNeedingFixing.add(this); } @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) private static class FixedLiquidBlockEvents { @SubscribeEvent(priority = EventPriority.LOWEST) // Force the event to be called last // After registration of fluids is finished, set the fluids field. public static void onFluidsRegister(RegistryEvent<Fluid> fluidRegistryEvent) { for (FixedLiquidBlock fixedLiquidBlock : liquidBlocksNeedingFixing) { try { Class<?> class_ = LiquidBlock.class; Field fluidField = ObfuscationReflectionHelper.findField(class_, "fluid"); fluidField.setAccessible(true); fluidField.set(fixedLiquidBlock, fixedLiquidBlock.getFluid()); } catch (Exception e) { throw new RuntimeException(e); } } } } } But clearly what I'm doing is stupid because it still doesn't work. I even tried without my hacky solution, and it still didn't work! Am I doing something wrong? Should I be extending something else? What else should I do?   Code for fluid, OilFluid.java:   public abstract class OilFluid extends ForgeFlowingFluid { protected OilFluid() { super(new ForgeFlowingFluid.Properties( Source::new, Flowing::new, FluidAttributes.builder( new ResourceLocation(MiniTech.MODID, "block/oil_still"), new ResourceLocation(MiniTech.MODID, "block/oil_flow") ).overlay(new ResourceLocation(MiniTech.MODID, "block/oil_overlay")) .translationKey("block." + MiniTech.MODID + ".oil") .color(0xffffff))); } public static class Flowing extends OilFluid { public Flowing() { registerDefaultState(getStateDefinition().any().setValue(LEVEL, 7)); } @Override protected void createFluidStateDefinition(StateDefinition.Builder<Fluid, FluidState> p_76476_) { super.createFluidStateDefinition(p_76476_); p_76476_.add(LEVEL); } @Override public int getAmount(FluidState p_76480_) { return p_76480_.getValue(LEVEL); } @Override public boolean isSource(FluidState p_76478_) { return false; } } public static class Source extends OilFluid { @Override public int getAmount(FluidState p_76485_) { return 8; } @Override public boolean isSource(FluidState p_76483_) { return true; } } } Code for ModBlocks.java:   public class ModBlocks { private static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, MiniTech.MODID); public static final RegistryObject<RefineryFurnaceBlock> REFINERY_FURNACE = BLOCKS.register("refinery_furnace", () -> new RefineryFurnaceBlock(BlockBehaviour.Properties.of(Material.STONE).requiresCorrectToolForDrops().strength(3.5F).lightLevel(litBlockEmission(13)))); // Fluids public static final RegistryObject<LiquidBlock> OIL = BLOCKS.register("oil", () -> new FixedLiquidBlock(ModFluids.OIL, BlockBehaviour.Properties.of(Material.WATER).noCollission().strength(100.0F).noDrops())); public static void register(IEventBus eventBus) { BLOCKS.register(eventBus); } private static ToIntFunction<BlockState> litBlockEmission(int lightLevel) { return (blockState) -> { return blockState.getValue(BlockStateProperties.LIT) ? lightLevel : 0; }; } }  
    • No, no and no. The server knows the sending player, so the UUID is unnecessary. If you really needed to send a player (or any entity) across, you'd send the entity ID, not the UUID. The button name is irrelevant, if anything you'd send an Enum that specifies the button (if multiple buttons needs to be sent). The block position is also known on the server, sending it again only allows for cheats (if you don't validate it on the server, at which point you might as well just not send it at all).
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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