Jump to content

AragoniteDragon

Members
  • Posts

    10
  • Joined

  • Last visited

Recent Profile Visitors

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

AragoniteDragon's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. My bad (I have show hidden files enabled)
  2. Thanks for the help! Yeah, I originally had them all using MainModClass.MOD_ID but I hard coded in the strings out of desperation hoping it would fix the issue. I changed them back now. Unfortunately, the problem still persists. Still have any ideas what could be causing the issue?
  3. Here: mods.toml: # The name of the mod loader type to load - for regular FML @Mod mods it should be javafml modLoader="javafml" #mandatory # A version range to match for said mod loader - for regular FML @Mod it will be the forge version loaderVersion="[32,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions. # A URL to refer people to when problems occur with this mod issueTrackerURL="http://my.issue.tracker/" #optional # A list of mods - how many allowed here is determined by the individual mod loader [[mods]] #mandatory # The modid of the mod modId="theworldofshmowmod" #mandatory # The version number of the mod - there's a few well known ${} variables useable here or just hardcode it version="1.0" #mandatory # A display name for the mod displayName="The World of Shmows" #mandatory # A URL to query for updates for this mod. See the JSON update specification <here> updateJSONURL="http://myurl.me/" #optional # A URL for the "homepage" for this mod, displayed in the mod UI displayURL="http://example.com/" #optional # A file name (in the root of the mod JAR) containing a logo for display logoFile="examplemod.png" #optional # A text field displayed in the mod UI credits="Thanks for this example mod goes to Java" #optional # A text field displayed in the mod UI authors="TheEmeraldNin_ja" #optional # The description text for the mod (multi line!) (#mandatory) description=''' Placeholder ''' # A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional. [[dependencies.examplemod]] #optional # the modid of the dependency modId="forge" #mandatory # Does this dependency have to exist - if not, ordering below must be specified mandatory=true #mandatory # The version range of the dependency versionRange="[32,)" #mandatory # An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory ordering="NONE" # Side this dependency is applied on - BOTH, CLIENT or SERVER side="BOTH" # Here's another dependency [[dependencies.examplemod]] modId="minecraft" mandatory=true versionRange="[1.16.1]" ordering="NONE" side="BOTH"
  4. Nope it doesn't P.S. I've never used IntelliJ before this, but whenever I change the modId in the code, it doesn't change the modId in the error message???
  5. Sorry guys, but the mod id is all lower case with no spaces or banned characters... I actually have no clue why it's capitalised in the error but heres the main class: @Mod("theworldofshmowmod") public class MainModClass { // Directly reference a log4j logger. private static final Logger LOGGER = LogManager.getLogger(); public static final String MOD_ID = "theworldofshmowmod"; public MainModClass() { // Register the setup method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); // Register the enqueueIMC method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::enqueueIMC); // Register the processIMC method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::processIMC); // Register the doClientStuff method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff); RegistryHandler.init(); // Register ourselves for server and other game events we are interested in MinecraftForge.EVENT_BUS.register(this); } private void setup(final FMLCommonSetupEvent event) { // some preinit code LOGGER.info("HELLO FROM PREINIT"); LOGGER.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName()); } private void doClientStuff(final FMLClientSetupEvent event) { // do something that can only be done on the client LOGGER.info("Got game settings {}", event.getMinecraftSupplier().get().gameSettings); } private void enqueueIMC(final InterModEnqueueEvent event) { // some example code to dispatch IMC to another mod InterModComms.sendTo("examplemod", "helloworld", () -> { LOGGER.info("Hello world from the MDK"); return "Hello world";}); } private void processIMC(final InterModProcessEvent event) { // some example code to receive and process InterModComms from other mods LOGGER.info("Got IMC {}", event.getIMCStream(). map(m->m.getMessageSupplier().get()). collect(Collectors.toList())); } // You can use SubscribeEvent and let the Event Bus discover methods to call @SubscribeEvent public void onServerStarting(FMLServerStartingEvent event) { // do something when the server starts LOGGER.info("HELLO from server starting"); } // You can use EventBusSubscriber to automatically subscribe events on the contained class (this is subscribing to the MOD // Event bus for receiving Registry Events) @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) public static class RegistryEvents { @SubscribeEvent public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) { // register a new block here LOGGER.info("HELLO from Register Block"); } } } And heres the Registry Handler: public class RegistryHandler { public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, "theworldofshmowmod"); // Adds registered objects to the game. public static void init() { ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); } // Items public static final RegistryObject<Item> STYGIAN_INGOT = ITEMS.register("stygian_ingot", ItemBase::new); // Blocks }
  6. Hey all! I just started teaching my brother how to mod, but its my first time modding in 1.16 so I assume some things are different. I used some tutorials to update my code and it all seems fine but I've been getting an error once I added a texture along the lines of "net.minecraft.util.ResourceLocationException: Non [a-z0-9_.-] character in namespace of location: TheWorldOfShmowMod:sounds.json". I understand I'm not allowed to use certain characters in file names, but no such "Sounds.json" file exists in our mod (that we created) and I've never had an issue with this before ever. Anyone know whats up. P.S. Im on windows 10 with IntelliJ if that helps Full Error Log:
  7. After some more tinkering, I used a different texture and it appears the renderer is only using a tiny fraction of the whole texture. Does anyone know how to change that?
  8. After some working, I finally got the entity to render, and the lighting bug fixed, but something appears to be wrong with the texture. The texture that is showing up is not what is programmed in and I cant tell if its a code issue or mapping issue (Note: When imported into a modeling software the texture maps perfectly fine and the UV's match up perfectly). The entity looks like this ingame: But the texture only vaguely has those colors. It appears to be extremely simplifying the texture. It could be an issue because my texture is very large, but large textures have worked fine in the past... Can anyone tell whats wrong? Original Texture (1024px x 1024px): EntityRenderer: @Override public void doRender(final EntityBaneling entity, final double x, final double y, final double z, final float entityYaw, final float partialTicks) { super.doRender(entity, x, y, z, entityYaw, partialTicks); GlStateManager.pushMatrix(); GlStateManager.scale(.8, .8, .8); try { GlStateManager.pushMatrix(); GlStateManager.translate((float) x, (float) y + .3, (float) z); ClientUtil2.renderModelWithColor(ModelsCache.INSTANCE.getBakedModel(new ResourceLocation(Reference.MOD_ID + ":models/entity/banelingnew.obj")), (new ResourceLocation(Reference.MOD_ID + ":textures/entity/banelingnew2.png")), entity); GlStateManager.popMatrix(); } catch (Exception e) { System.out.println("Error in loading Baneling model."); e.printStackTrace(); } GlStateManager.pushMatrix(); GlStateManager.translate(x, y, z); //this.bindTexture(new ResourceLocation(Reference.MOD_ID + ":textures/entity/banelingnew.png")); //this.bindEntityTexture(entity); GlStateManager.popMatrix(); } @SideOnly(Side.CLIENT) public static void renderModelWithColor(final IBakedModel model, final int color, final ResourceLocation texture, Entity entity) { GlStateManager.pushMatrix(); GL11.glPushMatrix(); GL11.glDisable(GL11.GL_LIGHTING); RenderHelper.disableStandardItemLighting(); Minecraft.getMinecraft().entityRenderer.enableLightmap(); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240f, 240f); Tessellator tessellator = Tessellator.getInstance(); BufferBuilder builder = tessellator.getBuffer(); WavefrontObject obj = new WavefrontObject(); Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation(Reference.MOD_ID + ":textures/entity/banelingnew2.png")); builder.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_NORMAL); obj.load(new ResourceLocation(Reference.MOD_ID + ":models/entity/banelingnew.obj").getResourcePath()); obj.putVertices(builder); renderQuadsColor(builder, model.getQuads(null, (EnumFacing) null, 0L), -1); tessellator.draw(); GL11.glEnable(GL11.GL_LIGHTING); GL11.glPopMatrix(); GlStateManager.popMatrix(); } @SideOnly(Side.CLIENT) private static void renderQuadsColor(final BufferBuilder bufferbuilder, final List<BakedQuad> quads, int color) { int i = 0; for (final int j = quads.size(); i < j; ++i) { final BakedQuad bakedquad = quads.get(i); net.minecraftforge.client.model.pipeline.LightUtil.renderQuadColor(bufferbuilder, bakedquad, 1); }
  9. Hello everyone! I finally figured out how to render a model in the .obj file format using some of Cardiboo's programming, but I cant seem to get the texture to render properly. It just renders as a black an yellow texture as shown here: The program seems to be rejecting the .mtl file but I cant figure out why. RenderBaneling.class: Modified ModelsCache.class: Modified ClientUtil.class: banelingnew.obj: banelingnew.mtl: banelingnew.png:
  10. I'm trying to program entities using .obj files but I cant seem to figure out how to go about rendering them. I was basing my render code on the ones used for vanilla mobs. I tried using the the OBJLoader to load the model but the entities just load in as white boxes. I read somewhere about baking the model but I couldn't figure out how to obtain the Function<ResourceLocation, TextureAtlasSprite> as it is a protected static. Can somone explain what I should do? Render file:
×
×
  • Create New...

Important Information

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