Jump to content

warjort

Members
  • Posts

    5420
  • Joined

  • Last visited

  • Days Won

    175

Everything posted by warjort

  1. Subscribe to EntityRenderersEvent.RegisterRenderers to register your entity renderers. You code with the arrow is completely out of context. You don't even show the compiler error message. I would guess it is a problem with the type parameters of your RegistryObject and the EntityRenderer not matching. But you don't show either definition.
  2. You say you have different textures and yet you only setShaderTexture() once? Other parts of your code look confused as well. e.g. Why are you doing that bindForSetup() You can replace Minecraft.getInstance().screen.blit() with this.blit() - the current minecraft screen is your Screen instance. You should add widgets in your init(), but I don't see any calls to super.render() which is where the widgets would get drawn. See Screen.render() I also don't see a call to renderBackground()
  3. You have the wrong version of rftools builder for 1.19.2: https://www.curseforge.com/minecraft/mc-mods/rftools-builder/files/all?filter-game-version=1738749986%3a73407 Looks like the same is true for journey map: https://www.curseforge.com/minecraft/mc-mods/journeymap/files/all?filter-game-version=1738749986%3a73407 You need to check the versions you download actually say they are compatible with 1.19.2 and not just 1.19
  4. It's not difficult to find this. You know the bow does this and you need the item instance to register it. So just search for references to Items.BOW and you will find the vanilla code in net.minecraft.client.renderer.item.ItemProperties
  5. Also your brackets are in the wrong place. You have literal().then(argument()).executes() when it should be literal().then(argument().executes()) otherwise the execute can't see the argument.
  6. This is basic java, your question has nothing to do with forge or minecraft You can't use a static field if it varies by subclass. Static fields are not polymorphic.. public abstract class AbstractClass { public int getMaxFood () { return 10000; // default value } } public class ConcreteClass extends AbstractClass { @Override public int getMaxFood () { return 20000; // different value for this class } } AbstractClass x = ...; x.getMaxFood(); // will vary by the class of x I would suggest you find something to help you learn java.
  7. Since you don't show the code you tried and/or post the error, your question is unanswerable. We have no psychic powers. SynchedEntityData is used to send your entity instance data to the client. I am not sure of relevance for spawning entities, which should happen on the server? https://forge.gemwire.uk/wiki/Networking_with_Entities There are many different ways, which you use depends upon the use case, e.g. * public static final fields to hold values that never change * instance fields which may or may not be synched to the client and usually persisted to disk in add/readAdditionalSaveData() * entity attributes that store values that can be modified by things like enchants or mob effects (e.g. max health, armor rating, etc.) * writing your own entity capability for storing data on other people's entities
  8. That's a pretty esoteric question. 🙂 You have to navigate 2 different changes; * The change of name from the old forge mappings to the mojang mappings * The change of graphics engine Here's how you can do it: Find where your method is used in vanilla, e.g. in 1.12 with the stable_39 mappings this is SimpleTexture.loadTexture() Find the same processing in 1.19 which also happens to be called SimpleTexture. Now compare the 1.12 vanilla code with the 1.19 version, so you can determine the modern way to do your processing. It won't always be as "easy" as this. Sometimes you would have to repeat the process. e.g. If you couldn't find SimpleTexture in 1.19, find where SimpleTexture.loadTexture() is called and locate that processing in 1.19 However, in this case, you can already think of something that loads "external images". Minecraft player skins. So you can look at and adapt what that does - SkinManager
  9. level.getRawBrightness(blockPos, 0) This gives you the max of the block light and the sky light. It's what gets used by vanilla for things like mob spawning or crop growth. Replace blockPos with blockPos.above() if your block does not let light through it.
  10. You are missing auto reg lib.: https://www.curseforge.com/minecraft/mc-mods/autoreglib
  11. You are going to find this very difficult. The issue is this: https://minecraft.fandom.com/wiki/Java_Edition_1.13/Flattening You can see how vanilla deals with it in for example BlockStateFlatteningFix/BlockStateFlattening but there are may other similar fixes for items, entities, block/tile entities, falling blocks, etc. See net.minecraft.datafixer.Schemas.build() where the flattening is around schema version 1451 You are going to have a number of issues (this is not a complete list): * The only real way for you to plugin into Mojang's mechanism AFAIK is to use byte code weaving * The numeric ids you have aren't guaranteed to be those used in real worlds. In 1.12 mods could conflict in their requested ids and so forge had to choose one of them to be a different number and remember the change in the world save folder * Mods would often accidently have "id shifts" where the numeric id changed across releases and so different worlds could have different ids depending which mod version they used. * A lot of 1.12 worlds (big mod packs) had issues with the 65535 numeric limit and so used mods like this to workaround it: https://www.curseforge.com/minecraft/mc-mods/jeid. While this used a format similar to 1.13 it isn't really the 1.13 format * Depending upon what your mod does, the task may be "impossible" for other reasons, e.g. there are known problems for updating modded worlds even in recent versions because of the way Mojang keeps changing the worldgen, structures being a notable problem.
  12. Your block -> ingots recipe should be minecraft:crafting_shapeless, that is the json formatting you are using. and you need separate recipes for the smelting recipe or use an item tag i.e. if this really did take multiple items (which it does not) it would be an array instead of a structure "ingredient": { "item": "denmod:ruby_ore", "item": "denmod:deepslate_ruby_ore" },
  13. The short answer is you probably can't in general because it will depend on if/how mods modify the sky rendering. Assuming vanilla rendering, try this which (I think?) shows the player's view vector and a calculation of the vector to the sun at the top of the screen. @Mod.EventBusSubscriber(modid = MODID, bus = Bus.MOD, value = Dist.CLIENT) public class ModClientEvents { @SubscribeEvent public static void registerOverlay(RegisterGuiOverlaysEvent event) { event.registerAboveAll("view_sun", (gui, poseStack, partialTick, screenWidth, screenHeight) -> { Minecraft minecraft = Minecraft.getInstance(); Entity entity = minecraft.cameraEntity; Level level = minecraft.level; float sunAngle = level.getSunAngle(partialTick) + (float) Math.PI / 2; // use -pi/2 for the moon Vec3 view = entity.getViewVector(1.0f); Vec3 sun = new Vec3(Math.cos(sunAngle), Math.sin(sunAngle), 0f); String msg = String.format(Locale.ROOT, "%.3f / %.3f / %.3f / %.3f / %.3f / %.3f / %.3f", sunAngle, view.x, view.y, view.z, sun.x, sun.y, sun.z); gui.setupOverlayRenderState(true, false, null); Font font = minecraft.font; GuiComponent.fill(poseStack, 1, 1, 3 + font.width(msg), 1 + font.lineHeight, 0x6FAFAFB0); font.draw(poseStack, msg, 2, 2, 0xE0E0E0); }); } } You can probably use this as a starting point of your calculation to see if the 2 vector's components are close in value, or maybe something more complicated (e.g. taking into account moon phases). I would guess you also want to do some kind of ray trace - entity.pick() - to see if there is a block/fluid or entity blocking the sun, and also check the weather. 🙂
  14. I can see your mod getting loaded: This says you either need to have cheat mode (or op for a server) to use the command. https://github.com/GeheimagentNr1/DimensionTeleport/blob/745206adf2b749d27d50664cb181224a6fe59595/src/main/java/de/geheimagentnr1/dimensionteleport/elements/commands/dimension_teleport/DimensionTeleportCommand.java#L40
  15. And this version of optifine doesn't work with your version of forge. You need the latest preview: https://github.com/sp614x/optifine/issues/7009#issuecomment-1228057896
  16. Caused by: org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException: Critical injection failure: @ModifyVariable annotation on valhelsia_renderModelFaceFlat could not find any targets matching 'Lnet/minecraft/client/renderer/block/ModelBlockRenderer;m_111001_(Lnet/minecraft/world/level/BlockAndTintGetter;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/core/BlockPos;IIZLcom/mojang/blaze3d/vertex/PoseStack;Lcom/mojang/blaze3d/vertex/VertexConsumer;Ljava/util/List;Ljava/util/BitSet;)V' in net.minecraft.client.renderer.block.ModelBlockRenderer. Using refmap valhelsia_core.refmap.json [PREINJECT Applicator Phase -> valhelsia_core.mixins.json:client.ModelBlockRendererMixin -> Prepare Injections -> -> localvar$blj000$valhelsia_renderModelFaceFlat(ILnet/minecraft/world/level/BlockAndTintGetter;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/core/BlockPos;)I -> Parse] This is valhelsia core. It is probably conflicting with another mod doing the same thing? Make sure you have the latest version then contact the mod author.
  17. I don't advise you to downgrade. That will be a "ten times" more difficult task than trying to find compatible mods with the latest versions. You should just remove the mods if the mod authors are not updating their mods. That is unless there is a reason why you can't do that, e.g. you have an existing world that uses the mod's blocks in your builds.
  18. BTW: Please don't paste logs into the forums. That makes it difficult to search and the log you are posting is not the debug.log so it doesn't have all information.
  19. [29Aug2022 17:12:03.332] [Worker-Main-3/ERROR] [net.minecraftforge.fml.javafmlmod.FMLModContainer/]: Exception caught during firing event: GOGGLES Index: 1 Listeners: 0: NORMAL 1: net.minecraftforge.eventbus.EventBus$$Lambda$3063/0x0000000800c3f0d0@32a371b5 java.lang.NoSuchFieldError: GOGGLES at TRANSFORMER/[email protected]/com.luis.createcurios.goggle.Render.register(Render.java:14) This is this error: https://forums.minecraftforge.net/topic/115979-create-curios-createcurios-encountered-an-error-during-the-sided_setup-event-phase-javalangnosuchfielderror-goggles/#comment-512597
  20. https://docs.minecraftforge.net/en/latest/items/#advanced-items If you still don't understand, you should find something that helps you learn java. This is basic stuff.
  21. There is no Item.getRegistryName() in 1.18 Anyway, you added your method to a random class. You need to make your own custom Item class for this. You can't use the generic "new Item()" public class MyItem extends Item { public MyItem(Properties p_41383_) { super(p_41383_); } @Override public boolean onEntityItemUpdate(ItemStack stack, ItemEntity entity) { // etc.
  22. Please don't paste text as images. Which version is this? https://forums.minecraftforge.net/topic/91712-supported-version-directory/
  23. You don't post this. It will be in the same place as where you downloaded the installer jar. The error is usually caused by having an old version of java, make sure you have it updated to a recent version. It can also be caused by broken entries in your operating system's hosts file.
  24. You should also note, that this method is called on both the client and the server. Depending upon what processing you want to do, you will need to check entity.level.isClientSide
  25. In your Item class implementation.
×
×
  • Create New...

Important Information

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