Skip to content

Commit

Permalink
Portable workbench is now usable on its own.
Browse files Browse the repository at this point in the history
Raziel is now a utility application, and can now be put into a suits Ability Module.
Updated GUIs to highlight energy slot.
  • Loading branch information
MartinSVK12 committed Jul 5, 2024
1 parent 6932862 commit ce971b5
Show file tree
Hide file tree
Showing 41 changed files with 181 additions and 126 deletions.
12 changes: 10 additions & 2 deletions src/main/java/sunsetsatellite/signalindustries/SIItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
import net.minecraft.core.item.material.ToolMaterial;
import sunsetsatellite.signalindustries.covers.*;
import sunsetsatellite.signalindustries.items.*;
import sunsetsatellite.signalindustries.items.applications.ItemWithAbility;
import sunsetsatellite.signalindustries.items.applications.ItemRaziel;
import sunsetsatellite.signalindustries.items.attachments.ItemAbilityModule;
import sunsetsatellite.signalindustries.items.applications.ItemPortableWorkbench;
import sunsetsatellite.signalindustries.items.applications.ItemSmartWatch;
import sunsetsatellite.signalindustries.items.applications.ItemTrigger;
import sunsetsatellite.signalindustries.items.applications.base.ItemWithAbility;
import sunsetsatellite.signalindustries.items.attachments.*;
import sunsetsatellite.signalindustries.items.containers.*;
import sunsetsatellite.signalindustries.items.covers.ItemCover;
Expand Down Expand Up @@ -187,7 +192,10 @@ public void init() {
condensedMilkCan = simpleItem("condensedMilkCan","condensedMilkCan","signalindustries:item/condensed_milk_can").setMaxStackSize(1);
bucketCaramel = simpleItem("bucketCaramel","bucketCaramel","signalindustries:item/bucket_caramel").setMaxStackSize(1).setContainerItem(Item.bucket);
caramelPlate = simpleItem("caramelPlate","caramelPlate","signalindustries:item/caramel_plate");
raziel = simpleItem("raziel","raziel","signalindustries:item/raziel").setMaxStackSize(1);
raziel = new ItemBuilder(MOD_ID)
.setIcon("signalindustries:item/raziel")
.setStackSize(1)
.build(new ItemRaziel("raziel", config.getInt("ItemIDs.raziel"), Tier.BASIC));
krowka = new ItemBuilder(MOD_ID)
.setIcon("signalindustries:item/krowka")
.setStackSize(8)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.useless.dragonfly.model.blockstates.processed.MetaStateInterpreter;
import sunsetsatellite.signalindustries.inventories.machines.TileEntityProgrammer;
import sunsetsatellite.signalindustries.items.ItemRomChip;
import sunsetsatellite.signalindustries.items.ItemTrigger;
import sunsetsatellite.signalindustries.items.applications.ItemTrigger;

import java.util.HashMap;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import net.minecraft.core.player.inventory.slot.Slot;
import sunsetsatellite.catalyst.fluids.impl.ContainerItemFluid;
import sunsetsatellite.catalyst.fluids.impl.ItemInventoryFluid;
import sunsetsatellite.signalindustries.items.ItemAbilityModule;
import sunsetsatellite.signalindustries.items.attachments.ItemAbilityModule;
import sunsetsatellite.catalyst.fluids.util.NBTHelper;
import sunsetsatellite.signalindustries.util.SlotApplication;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import sunsetsatellite.catalyst.fluids.impl.ContainerItemFluid;
import sunsetsatellite.catalyst.fluids.impl.GuiItemFluid;
import sunsetsatellite.signalindustries.containers.ContainerAbilityModule;
import sunsetsatellite.signalindustries.items.ItemAbilityModule;
import sunsetsatellite.signalindustries.items.attachments.ItemAbilityModule;
import sunsetsatellite.signalindustries.util.DrawUtil;
import sunsetsatellite.catalyst.fluids.util.NBTHelper;
import sunsetsatellite.signalindustries.util.Tier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import sunsetsatellite.signalindustries.blocks.base.BlockContainerTiered;
import sunsetsatellite.signalindustries.inventories.base.TileEntityTieredMachineBase;
import sunsetsatellite.signalindustries.items.ItemRomChip;
import sunsetsatellite.signalindustries.items.ItemTrigger;
import sunsetsatellite.signalindustries.items.applications.ItemTrigger;

public class TileEntityProgrammer extends TileEntityTieredMachineBase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import sunsetsatellite.signalindustries.interfaces.IHasOverlay;
import sunsetsatellite.signalindustries.interfaces.IInjectable;
import sunsetsatellite.signalindustries.inventories.item.InventoryHarness;
import sunsetsatellite.signalindustries.items.applications.ItemTrigger;
import sunsetsatellite.signalindustries.powersuit.SignalumPowerSuit;
import sunsetsatellite.catalyst.fluids.util.NBTHelper;
import sunsetsatellite.signalindustries.util.Tier;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package sunsetsatellite.signalindustries.items.applications;

import net.minecraft.core.entity.player.EntityPlayer;
import net.minecraft.core.item.ItemStack;
import net.minecraft.core.util.helper.Side;
import net.minecraft.core.world.World;
import sunsetsatellite.signalindustries.items.applications.base.ItemWithUtility;
import sunsetsatellite.signalindustries.powersuit.SignalumPowerSuit;
import sunsetsatellite.signalindustries.util.Tier;

public class ItemPortableWorkbench extends ItemWithUtility {
public ItemPortableWorkbench(String name, int id, Tier tier) {
super(name, id, tier);
}

@Override
public void activate(ItemStack stack, SignalumPowerSuit signalumPowerSuit, EntityPlayer player, World world) {
player.displayGUIWorkbench((int) player.x, (int) player.y, (int) player.z);
}

@Override
public ItemStack onUseItem(ItemStack itemstack, World world, EntityPlayer player) {
player.displayGUIWorkbench((int) player.x, (int) player.y, (int) player.z);
return itemstack;
}

@Override
public boolean onUseItemOnBlock(ItemStack itemstack, EntityPlayer player, World world, int blockX, int blockY, int blockZ, Side side, double xPlaced, double yPlaced) {
player.displayGUIWorkbench((int) player.x, (int) player.y, (int) player.z);
return true;
}
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package sunsetsatellite.signalindustries.items;
package sunsetsatellite.signalindustries.items.applications;

import net.minecraft.core.entity.player.EntityPlayer;
import net.minecraft.core.item.ItemStack;
import net.minecraft.core.world.World;
import sunsetsatellite.signalindustries.items.applications.ItemWithUtility;
import sunsetsatellite.signalindustries.items.applications.base.ItemWithUtility;
import sunsetsatellite.signalindustries.powersuit.SignalumPowerSuit;
import sunsetsatellite.signalindustries.util.Tier;

public class ItemPortableWorkbench extends ItemWithUtility {
public ItemPortableWorkbench(String name, int id, Tier tier) {
public class ItemRaziel extends ItemWithUtility {
public ItemRaziel(String name, int id, Tier tier) {
super(name, id, tier);
}

@Override
public void activate(ItemStack stack, SignalumPowerSuit signalumPowerSuit, EntityPlayer player, World world) {
player.displayGUIWorkbench((int) player.x, (int) player.y, (int) player.z);

}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package sunsetsatellite.signalindustries.items;
package sunsetsatellite.signalindustries.items.applications;

import net.minecraft.core.entity.player.EntityPlayer;
import net.minecraft.core.item.ItemStack;
import net.minecraft.core.world.World;
import sunsetsatellite.signalindustries.items.applications.ItemWithUtility;
import sunsetsatellite.signalindustries.items.applications.base.ItemWithUtility;
import sunsetsatellite.signalindustries.powersuit.SignalumPowerSuit;
import sunsetsatellite.signalindustries.util.Tier;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sunsetsatellite.signalindustries.items;
package sunsetsatellite.signalindustries.items.applications;


import com.mojang.nbt.CompoundTag;
Expand All @@ -13,6 +13,7 @@
import sunsetsatellite.signalindustries.abilities.trigger.BoostAbility;
import sunsetsatellite.signalindustries.abilities.trigger.ProjectileAbility;
import sunsetsatellite.signalindustries.abilities.trigger.TriggerBaseAbility;
import sunsetsatellite.signalindustries.items.ItemSignalumPrototypeHarness;

import java.util.HashMap;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sunsetsatellite.signalindustries.items.applications;
package sunsetsatellite.signalindustries.items.applications.base;


import net.minecraft.core.item.Item;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package sunsetsatellite.signalindustries.items.applications;
package sunsetsatellite.signalindustries.items.applications.base;

import net.minecraft.core.entity.player.EntityPlayer;
import net.minecraft.core.item.Item;
import net.minecraft.core.item.ItemStack;
import net.minecraft.core.lang.I18n;
import net.minecraft.core.net.command.TextFormatting;
import net.minecraft.core.world.World;
import sunsetsatellite.signalindustries.interfaces.IApplicationItem;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sunsetsatellite.signalindustries.items;
package sunsetsatellite.signalindustries.items.attachments;


import net.minecraft.core.entity.player.EntityPlayer;
Expand All @@ -11,7 +11,6 @@
import sunsetsatellite.signalindustries.gui.GuiAbilityModule;
import sunsetsatellite.signalindustries.interfaces.ITiered;
import sunsetsatellite.signalindustries.inventories.item.InventoryAbilityModule;
import sunsetsatellite.signalindustries.items.attachments.ItemAttachment;
import sunsetsatellite.signalindustries.util.AttachmentPoint;
import sunsetsatellite.signalindustries.util.Tier;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import sunsetsatellite.signalindustries.interfaces.mixins.IPlayerPowerSuit;
import sunsetsatellite.signalindustries.items.ItemPortableWorkbench;
import sunsetsatellite.signalindustries.items.applications.ItemPortableWorkbench;
import sunsetsatellite.signalindustries.powersuit.SignalumPowerSuit;

@Mixin(value = ContainerWorkbench.class,remap = false)
Expand All @@ -21,8 +21,15 @@ public void isUsableByPlayer(EntityPlayer entityplayer, CallbackInfoReturnable<B
for (ItemStack content : powerSuit.module.contents) {
if(content != null && content.getItem() instanceof ItemPortableWorkbench){
cir.setReturnValue(true);
return;
}
}
}
for (ItemStack content : entityplayer.inventory.mainInventory) {
if(content != null && content.getItem() instanceof ItemPortableWorkbench){
cir.setReturnValue(true);
return;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import net.minecraft.core.item.ItemStack;
import net.minecraft.core.lang.I18n;
import net.minecraft.core.player.inventory.InventoryPlayer;
import org.spongepowered.asm.mixin.Debug;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -21,7 +20,7 @@
import sunsetsatellite.signalindustries.SIItems;
import sunsetsatellite.signalindustries.interfaces.IHasOverlay;
import sunsetsatellite.signalindustries.interfaces.mixins.IPlayerPowerSuit;
import sunsetsatellite.signalindustries.items.ItemSmartWatch;
import sunsetsatellite.signalindustries.items.applications.ItemSmartWatch;
import sunsetsatellite.signalindustries.powersuit.SignalumPowerSuit;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import sunsetsatellite.signalindustries.SIItems;
import sunsetsatellite.signalindustries.interfaces.mixins.IPlayerPowerSuit;
import sunsetsatellite.signalindustries.items.ItemSmartWatch;
import sunsetsatellite.signalindustries.items.applications.ItemRaziel;
import sunsetsatellite.signalindustries.items.applications.ItemSmartWatch;
import sunsetsatellite.signalindustries.powersuit.SignalumPowerSuit;
import sunsetsatellite.signalindustries.util.IndexRenderer;

Expand All @@ -40,6 +41,15 @@ public void keyTyped(char c, int i, int mouseX, int mouseY) {
public void drawScreen(int mouseX, int mouseY, float partialTick, CallbackInfo ci){
if(Arrays.stream(mc.thePlayer.inventory.mainInventory).anyMatch((S)->S != null && S.isItemEqual(SIItems.raziel.getDefaultStack()))){
IndexRenderer.drawScreen(mc,mouseX,mouseY,width,height,partialTick);
} else {
SignalumPowerSuit powerSuit = ((IPlayerPowerSuit) mc.thePlayer).getPowerSuit();
if(powerSuit != null && powerSuit.active && powerSuit.module != null){
for (ItemStack content : powerSuit.module.contents) {
if(content != null && content.getItem() instanceof ItemRaziel){
IndexRenderer.drawScreen(mc,mouseX,mouseY,width,height,partialTick);
}
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
import sunsetsatellite.signalindustries.interfaces.IHasOverlay;
import sunsetsatellite.signalindustries.interfaces.mixins.IKeybinds;
import sunsetsatellite.signalindustries.inventories.item.InventoryAbilityModule;
import sunsetsatellite.signalindustries.items.ItemAbilityModule;
import sunsetsatellite.signalindustries.items.applications.ItemWithAbility;
import sunsetsatellite.signalindustries.items.applications.ItemWithUtility;
import sunsetsatellite.signalindustries.items.attachments.ItemAbilityModule;
import sunsetsatellite.signalindustries.items.applications.base.ItemWithAbility;
import sunsetsatellite.signalindustries.items.applications.base.ItemWithUtility;
import sunsetsatellite.signalindustries.items.attachments.ItemAttachment;
import sunsetsatellite.signalindustries.util.ApplicationType;
import sunsetsatellite.signalindustries.util.AttachmentPoint;
Expand Down
Binary file modified src/main/resources/assets/signalindustries/gui/autominer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/assets/signalindustries/gui/basic_pump.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/assets/signalindustries/gui/dynamo_basic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/assets/signalindustries/gui/generic_machine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/assets/signalindustries/gui/infuser_basic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/assets/signalindustries/gui/infuser_recipe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ce971b5

Please sign in to comment.