Overlay with a procedure is broken

Started by ZUHOWKS on Wed, 11/04/2020 - 15:37

Topic category: Bugs and solutions

Last seen on 18:23, 11. Nov 2020
Joined Jun 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Overlay with a procedure is broken
Mon, 11/16/2020 - 18:34 (edited)

Hello ! I'm on 2020.4 (with prelease update of 2020.5) in 1.12. and I have a problem with procedure for my overlay I have a wrong message and he don't find the symbol of this line:

if (SlotDisplayProcedure.executeProcedure(ImmutableMap.of())) {

   ⬆️

If you have an idea ?

The code of overlay:

package asilux.w2.cmws.fr.gui.overlay;

import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.client.event.RenderGameOverlayEvent;

import net.minecraft.world.World;
import net.minecraft.util.ResourceLocation;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.Minecraft;

import com.google.common.collect.ImmutableMap;

import asilux.w2.cmws.fr.ElementsAsiluxdevMod;

@ElementsAsiluxdevMod.ModElement.Tag
public class OverlayRingSlotTrue extends ElementsAsiluxdevMod.ModElement {
    public OverlayRingSlotTrue(ElementsAsiluxdevMod instance) {
        super(instance, 183);
    }

    @Override
    @SideOnly(Side.CLIENT)
    public void init(FMLInitializationEvent event) {
        MinecraftForge.EVENT_BUS.register(new GUIRenderEventClass());
    }
    public static class GUIRenderEventClass {
        @SubscribeEvent(priority = EventPriority.NORMAL)
        @SideOnly(Side.CLIENT)
        public void eventHandler(RenderGameOverlayEvent event) {
            if (!event.isCancelable() && event.getType() == RenderGameOverlayEvent.ElementType.HELMET) {
                int posX = (event.getResolution().getScaledWidth()) / 2;
                int posY = (event.getResolution().getScaledHeight()) / 2;
                EntityPlayer entity = Minecraft.getMinecraft().player;
                World world = entity.world;
                int x = (int) entity.posX;
                int y = (int) entity.posY;
                int z = (int) entity.posZ;
                if (SlotDisplayProcedure.executeProcedure(ImmutableMap.of())) {
                    GlStateManager.disableDepth();
                    GlStateManager.depthMask(false);
                    GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA,
                            GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
                    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
                    GlStateManager.disableAlpha();
                    Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("asiluxdev:textures/slot_with_item.png"));
                    Minecraft.getMinecraft().ingameGUI.drawTexturedModalRect(posX + 99, posY + 90, 0, 0, 256, 256);
                    GlStateManager.depthMask(true);
                    GlStateManager.enableDepth();
                    GlStateManager.enableAlpha();
                    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
                }
            }
        }
    }
}

And the procedure code:

package asilux.w2.cmws.fr.procedure;

import net.minecraft.entity.Entity;

import java.util.Map;

import asilux.w2.cmws.fr.ElementsAsiluxdevMod;

@ElementsAsiluxdevMod.ModElement.Tag
public class ProcedureSlotDisplay extends ElementsAsiluxdevMod.ModElement {
    public ProcedureSlotDisplay(ElementsAsiluxdevMod instance) {
        super(instance, 184);
    }

    public static boolean executeProcedure(Map<String, Object> dependencies) {
        if (dependencies.get("entity") == null) {
            System.err.println("Failed to load dependency entity for procedure SlotDisplay!");
            return false;
        }
        Entity entity = (Entity) dependencies.get("entity");
        boolean slot = false;
        if (((entity.getEntityData().getDouble("tagName")) == 0)) {
            slot = (boolean) (false);
        } else if (((entity.getEntityData().getDouble("tagName")) == 1)) {
            slot = (boolean) (true);
        }
        return (slot);
    }
}

a solution please ?

Edited by ZUHOWKS on Mon, 11/16/2020 - 18:34
Last seen on 18:27, 26. Jan 2021
Joined Apr 2010
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
1.12.2 is no longer…
Wed, 11/04/2020 - 19:10

1.12.2 is no longer supported. If you want any changes in this generator, consider finding a fix and opening PR on GitHub to get it fixed.

No contributor is interested in maintaining 1.12.2 atm.

Last seen on 18:23, 11. Nov 2020
Joined Jun 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
You have wrong !  Many…
Wed, 11/11/2020 - 18:26

You have wrong !  Many peoples are interested be 1.12.2 ofr me it's a Server faction (is not really a faction).

Last seen on 18:27, 26. Jan 2021
Joined Apr 2010
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
MCreator is open-source. If…
Mon, 11/16/2020 - 18:35

MCreator is open-source. If 1.12.2 is that popular, surely, there would be many people working on it.

I think you do not understand how open-source projects work.