Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0
The Simon

TIS-3D addon help

Question

Hi

I ran into the problem showing up here:

2019-04-19_16_44.09_1.png.26d9c7131585647a273fcbbded634b10.png

I made a issue suggestion report here explaining the problem. But due to the mod being focused more to later versions of Minecraft it might be better to make an addon instead.

I haven't modded Minecraft that much and simply only made a few mods to create items and items in use with Baubles API. But I kind of got stuck right away when adding a new module:

help1.png.93988f8774eb46111e70f3a11c41b36b.png

ModuleFacade.java

package net.simon.tiscovers.items;

import li.cil.tis3d.api.machine.Casing;
import li.cil.tis3d.api.machine.Face;
import li.cil.tis3d.api.machine.Port;
import li.cil.tis3d.api.util.RenderUtil;
import li.cil.tis3d.client.renderer.TextureLoader;
import li.cil.tis3d.common.module.ModuleDisplay;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumHand;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class ModuleCover extends ModuleDisplay {

    private Casing casing;
    private Face face;


    public ModuleCover(Casing casing, Face face) {
        super(casing, face);
    }

    @Override
    public Casing getCasing() {
        return this.casing;
    }

    @Override
    public Face getFace() {
        return this.face;
    }

    @Override
    public void onInstalled(ItemStack itemStack) {

    }

    @Override
    public void onUninstalled(ItemStack itemStack) {

    }
    @Override
    public void onEnabled() {

    }
    @Override
    public void onDisabled() {

    }
    @Override
    public void onDisposed() {

    }

    @Override
    public boolean onActivate(EntityPlayer player, EnumHand hand, float x,float y,float z) {
        if (player.isSneaking()) {
            return false;
        }

        // Reasoning: don't remove module from casing while activating the
        // module while the casing is disabled. Could be frustrating.
        if (!getCasing().isEnabled()) {
            return true;
        }

        return true;
    }

    @Override
    public void step() {

    }

    @Override
    public void onBeforeWriteComplete(final Port port) {
        // No need to clear other writing pipes because we're outputting random
        // values anyway, so yey.

        // Start writing again right away to write as fast as possible.
    }

    @Override
    public void onWriteComplete(final Port port) {
        // No need to clear other writing pipes because we're outputting random
        // values anyway, so yey.

        // Start writing again right away to write as fast as possible.
    }

    @SideOnly(Side.CLIENT)
    @Override
    public void render(final boolean enabled, final float partialTicks) {
        if (!enabled) {
            return;
        }

        RenderUtil.ignoreLighting();
        GlStateManager.enableBlend();

        RenderUtil.drawQuad(RenderUtil.getSprite(TextureLoader.LOCATION_OVERLAY_MODULE_RANDOM));

        GlStateManager.disableBlend();
    }
}

 

Some help is greatly appreciated. For the time being, I simply want the mod to compile and adding the new module.

Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...

×
×
  • Create New...

Important Information

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