Skip to content

Commit

Permalink
Finally make it work with 7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinSVK12 committed Dec 3, 2023
1 parent 230ebca commit 27337ab
Show file tree
Hide file tree
Showing 20 changed files with 101 additions and 94 deletions.
9 changes: 9 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ repositories {
}
metadataSources { artifact() }
}
ivy {
url = "https://github.com/UselessBullets"
patternLayout {
artifact "[organisation]/releases/download/v[revision]/[module]-[revision].jar"
m2compatible = true
}
metadataSources { artifact() }
}
ivy {
url = "https://github.com/MartinSVK12"
patternLayout {
Expand Down Expand Up @@ -125,6 +133,7 @@ dependencies {
implementation project(path: ":catalyst:energy",configuration: "namedElements")
implementation project(path: ":catalyst:fluids",configuration: "namedElements")
implementation project(path: ":catalyst:multiblocks",configuration: "namedElements")
modImplementation("DragonFly:dragonfly:1.0.0-7.1")
//modImplementation "BTWaila:btwaila:0.2.2"
//modImplementation "potato-logistics:PotatoLogistics:0.2.2_1"
//modImplementation "retrostorage:retrostorage:1.2.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
import net.minecraft.core.entity.player.EntityPlayer;
import net.minecraft.core.item.ItemStack;
import net.minecraft.core.world.World;
import sunsetsatellite.fluidapi.template.tiles.TileEntityFluidPipe;
import sunsetsatellite.catalyst.core.util.Direction;
import sunsetsatellite.catalyst.fluids.impl.tiles.TileEntityFluidPipe;
import sunsetsatellite.signalindustries.SignalIndustries;
import sunsetsatellite.signalindustries.containers.ContainerSignalumDynamo;
import sunsetsatellite.signalindustries.gui.GuiSignalumDynamo;
import sunsetsatellite.signalindustries.inventories.TileEntitySignalumDynamo;
import sunsetsatellite.signalindustries.util.Tier;
import sunsetsatellite.sunsetutils.util.Direction;

import java.util.ArrayList;
import java.util.Random;
Expand All @@ -28,7 +28,7 @@ protected TileEntity getNewBlockEntity() {
}

@Override
public boolean isOpaqueCube() {
public boolean isSolidRender() {
return false;
}

Expand All @@ -49,8 +49,8 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
}

@Override
public void onBlockRemoval(World world, int i, int j, int k) {
TileEntitySignalumDynamo tile = (TileEntitySignalumDynamo) world.getBlockTileEntity(i, j, k);
public void onBlockRemoved(World world, int x, int y, int z, int data) {
TileEntitySignalumDynamo tile = (TileEntitySignalumDynamo) world.getBlockTileEntity(x, y, z);
if (tile != null) {
for (Direction dir : Direction.values()) {
TileEntity tile2 = dir.getTileEntity(world, tile);
Expand All @@ -73,7 +73,7 @@ public void onBlockRemoval(World world, int i, int j, int k) {
}

itemstack.stackSize -= i1;
EntityItem entityitem = new EntityItem(world, (float) i + f, (float) j + f1, (float) k + f2, new ItemStack(itemstack.itemID, i1, itemstack.getMetadata()));
EntityItem entityitem = new EntityItem(world, (float) x + f, (float) y + f1, (float) z + f2, new ItemStack(itemstack.itemID, i1, itemstack.getMetadata()));
float f3 = 0.05F;
entityitem.xd = (float) random.nextGaussian() * f3;
entityitem.yd = (float) random.nextGaussian() * f3 + 0.2F;
Expand All @@ -83,7 +83,7 @@ public void onBlockRemoval(World world, int i, int j, int k) {
}
}
}

super.onBlockRemoval(world, i, j, k);
super.onBlockRemoved(world, x, y, z, data);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import net.minecraft.core.item.ItemStack;
import net.minecraft.core.player.inventory.InventoryPlayer;
import net.minecraft.core.player.inventory.slot.Slot;
import sunsetsatellite.fluidapi.api.ContainerItemFluid;
import sunsetsatellite.fluidapi.api.FluidStack;
import sunsetsatellite.catalyst.fluids.impl.ContainerItemFluid;
import sunsetsatellite.catalyst.fluids.util.FluidStack;
import sunsetsatellite.signalindustries.inventories.InventoryPulsar;
import sunsetsatellite.signalindustries.items.attachments.ItemPulsarAttachment;
import sunsetsatellite.signalindustries.util.NBTHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import net.minecraft.core.entity.player.EntityPlayer;
import net.minecraft.core.player.inventory.IInventory;
import net.minecraft.core.player.inventory.slot.Slot;
import sunsetsatellite.fluidapi.api.ContainerFluid;
import sunsetsatellite.fluidapi.api.SlotFluid;
import sunsetsatellite.catalyst.fluids.impl.ContainerFluid;
import sunsetsatellite.catalyst.fluids.util.SlotFluid;
import sunsetsatellite.signalindustries.inventories.TileEntitySignalumDynamo;

public class ContainerSignalumDynamo extends ContainerFluid {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package sunsetsatellite.signalindustries.entities.fx;


import net.minecraft.client.entity.fx.EntityFX;
import net.minecraft.client.render.Tessellator;
import net.minecraft.core.HitResult;
import net.minecraft.core.entity.Entity;
import net.minecraft.core.entity.EntityLiving;
import net.minecraft.core.entity.fx.EntityFX;
import net.minecraft.core.util.helper.DamageType;
import net.minecraft.core.util.phys.Vec3d;
import net.minecraft.core.world.World;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import net.minecraft.core.item.ItemStack;
import net.minecraft.core.player.inventory.InventoryPlayer;
import org.lwjgl.opengl.GL11;
import sunsetsatellite.fluidapi.api.GuiItemFluid;
import sunsetsatellite.catalyst.fluids.impl.GuiItemFluid;
import sunsetsatellite.signalindustries.containers.ContainerPulsarAttachment;
import sunsetsatellite.signalindustries.items.attachments.ItemPulsarAttachment;
import sunsetsatellite.signalindustries.util.NBTHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import net.minecraft.core.player.inventory.InventoryPlayer;
import org.lwjgl.opengl.GL11;
import org.lwjgl.util.Color;
import sunsetsatellite.energyapi.EnergyAPI;
import sunsetsatellite.fluidapi.api.GuiFluid;
import sunsetsatellite.catalyst.CatalystEnergy;
import sunsetsatellite.catalyst.fluids.impl.GuiFluid;
import sunsetsatellite.signalindustries.SignalIndustries;
import sunsetsatellite.signalindustries.blocks.BlockContainerTiered;
import sunsetsatellite.signalindustries.containers.ContainerSignalumDynamo;
Expand Down Expand Up @@ -47,8 +47,8 @@ protected void drawGuiContainerBackgroundLayer(float f)
int y = (this.height - this.ySize) / 2;
int color;
//1 (red, empty) -> 0.65 (green, full)
double color_mapped = EnergyAPI.map((float)tile.energy/(float)tile.capacity,0,1,1,0.65);
double x_mapped = EnergyAPI.map((float)tile.energy/(float)tile.capacity, 0,1,0,15);
double color_mapped = CatalystEnergy.map((float)tile.energy/(float)tile.capacity,0,1,1,0.65);
double x_mapped = CatalystEnergy.map((float)tile.energy/(float)tile.capacity, 0,1,0,15);
Color c = new Color();
c.fromHSB((float) color_mapped,1.0F,1.0F);
color = c.getAlpha() << 24 | c.getRed() << 16 | c.getBlue() << 8 | c.getGreen();
Expand All @@ -73,7 +73,7 @@ public void drawScreen(int x, int y, float renderPartialTicks) {
StringBuilder text = new StringBuilder();
if(x > i+80 && x < i+94){
if(y > j+40 && y < j+46){
text.append(EnergyAPI.ENERGY_NAME).append(": ").append(tile.energy).append(" ").append(EnergyAPI.ENERGY_SUFFIX).append("/").append(tile.capacity).append(" ").append(EnergyAPI.ENERGY_SUFFIX);
text.append(CatalystEnergy.ENERGY_NAME).append(": ").append(tile.energy).append(" ").append(CatalystEnergy.ENERGY_SUFFIX).append("/").append(tile.capacity).append(" ").append(CatalystEnergy.ENERGY_SUFFIX);
GuiTooltip tooltip = new GuiTooltip(mc);
tooltip.render(text.toString(),x,y,8,-8);
//this.drawTooltip(text.toString(),x,y,8,-8,true);
Expand Down Expand Up @@ -107,22 +107,22 @@ protected void buttonPressed(GuiButton guibutton) {
}
switch (guibutton.id){
case 0:
SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.xCoord,tile.yCoord,tile.zCoord);
SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z);
break;
case 1:
SignalIndustries.displayGui(entityplayer, new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.xCoord,tile.yCoord,tile.zCoord);
SignalIndustries.displayGui(entityplayer, new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z);
break;
default:
break;
}
}


public void initGui()
public void init()
{
controlList.add(new GuiButton(0, Math.round((float) width / 2) + 60, Math.round((float) height / 2) - 80, 20, 20, "F"));
controlList.add(new GuiButton(1, Math.round((float) width / 2) + 60, Math.round((float) height / 2) - 60, 20, 20, "I"));
super.initGui();
super.init();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import net.minecraft.core.block.BlockFluid;
import net.minecraft.core.item.ItemStack;
import sunsetsatellite.energyapi.impl.ItemEnergyContainer;
import sunsetsatellite.fluidapi.api.FluidStack;
import sunsetsatellite.catalyst.core.util.Connection;
import sunsetsatellite.catalyst.core.util.Direction;
import sunsetsatellite.catalyst.energy.impl.ItemEnergyContainer;
import sunsetsatellite.catalyst.fluids.util.FluidStack;
import sunsetsatellite.signalindustries.SignalIndustries;
import sunsetsatellite.sunsetutils.util.Connection;
import sunsetsatellite.sunsetutils.util.Direction;

public class TileEntitySignalumDynamo extends TileEntityTieredEnergyConductor {

Expand All @@ -25,8 +25,8 @@ public TileEntitySignalumDynamo(){
}

@Override
public void updateEntity() {
super.updateEntity();
public void tick() {
super.tick();
boolean update = false;
if(fuelBurnTicks > 0){
fuelBurnTicks--;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import com.mojang.nbt.CompoundTag;
import net.minecraft.core.block.entity.TileEntity;
import net.minecraft.core.item.ItemStack;
import sunsetsatellite.energyapi.api.IEnergy;
import sunsetsatellite.energyapi.api.IEnergySink;
import sunsetsatellite.energyapi.api.IEnergySource;
import sunsetsatellite.energyapi.impl.ItemEnergyContainer;
import sunsetsatellite.sunsetutils.util.Connection;
import sunsetsatellite.sunsetutils.util.Direction;
import sunsetsatellite.catalyst.core.util.Connection;
import sunsetsatellite.catalyst.core.util.Direction;
import sunsetsatellite.catalyst.energy.api.IEnergy;
import sunsetsatellite.catalyst.energy.api.IEnergySink;
import sunsetsatellite.catalyst.energy.api.IEnergySource;
import sunsetsatellite.catalyst.energy.impl.ItemEnergyContainer;

public abstract class TileEntityTieredEnergyConductor extends TileEntityTieredEnergyMachine implements IEnergySource, IEnergySink {

Expand Down Expand Up @@ -125,7 +125,7 @@ public void setTransfer(int amount){
}

@Override
public void updateEntity() {
public void tick() {
for (Direction dir : Direction.values()) {
TileEntity facingTile = dir.getTileEntity(worldObj,this);
if(facingTile instanceof IEnergySink && !facingTile.equals(lastReceived)){
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package sunsetsatellite.signalindustries.inventories;

import com.mojang.nbt.CompoundTag;
import sunsetsatellite.energyapi.api.IEnergy;
import sunsetsatellite.sunsetutils.util.Connection;
import sunsetsatellite.sunsetutils.util.Direction;
import sunsetsatellite.sunsetutils.util.TickTimer;
import sunsetsatellite.catalyst.core.util.Connection;
import sunsetsatellite.catalyst.core.util.Direction;
import sunsetsatellite.catalyst.core.util.TickTimer;
import sunsetsatellite.catalyst.energy.api.IEnergy;

import java.util.HashMap;

Expand All @@ -25,7 +25,7 @@ public TileEntityTieredEnergyMachine(){
}

@Override
public void updateEntity() {
public void tick() {
lastTransferMemory.tick();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void tick() {
enemiesLeft.removeIf((E)-> !E.isAlive());
if(active && worldObj.difficultySetting == Difficulty.PEACEFUL.id()){
Minecraft.getMinecraft(Minecraft.class).ingameGUI.addChatMessage("The wrath beacon loses all its strength suddenly..");
worldObj.setBlockWithNotify(xCoord,yCoord,zCoord,0);
worldObj.setBlockWithNotify(x,y,z,0);
}
if(active && started && enemiesLeft.size() == 0 && wave < 5){
for (EntityPlayer player : worldObj.players) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ protected void damageEntity(int damage, DamageType damageType, CallbackInfo ci)
int preventedDamage = damage - newDamage;
if (powerSuit != null && powerSuit.active && powerSuit.status != SignalumPowerSuit.Status.OVERHEAT ) {
if(powerSuit.getEnergy() >= newDamage){
if (damageType != null && damageType.damageArmor()) {
if (damageType != null && damageType.shouldDamageArmor()) {
int armorDamage = (int)Math.ceil((double)preventedDamage / 4.0);
this.inventory.damageArmor(armorDamage);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,40 +24,40 @@ public class GameSettingsMixin
public KeyBinding keySwitchMode = new KeyBinding("key.signalindustries.switchMode").bindKeyboard(50);

@Unique
public KeyBinding keyActivateHeadTopAttachment = new KeyBinding("key.signalindustries.headTopActivate",0);
public KeyBinding keyActivateHeadTopAttachment = new KeyBinding("key.signalindustries.headTopActivate");

@Unique
public KeyBinding keyActivateCoreBackAttachment = new KeyBinding("key.signalindustries.coreBackActivate",0);
public KeyBinding keyActivateCoreBackAttachment = new KeyBinding("key.signalindustries.coreBackActivate");

@Unique
public KeyBinding keyActivateArmFrontLAttachment = new KeyBinding("key.signalindustries.armFrontLActivate",0);
public KeyBinding keyActivateArmFrontLAttachment = new KeyBinding("key.signalindustries.armFrontLActivate");

@Unique
public KeyBinding keyActivateArmFrontRAttachment = new KeyBinding("key.signalindustries.armFrontRActivate",0);
public KeyBinding keyActivateArmFrontRAttachment = new KeyBinding("key.signalindustries.armFrontRActivate");

@Unique
public KeyBinding keyActivateArmSideLAttachment = new KeyBinding("key.signalindustries.armSideLActivate",0);
public KeyBinding keyActivateArmSideLAttachment = new KeyBinding("key.signalindustries.armSideLActivate");

@Unique
public KeyBinding keyActivateArmSideRAttachment = new KeyBinding("key.signalindustries.armSideRActivate",0);
public KeyBinding keyActivateArmSideRAttachment = new KeyBinding("key.signalindustries.armSideRActivate");

@Unique
public KeyBinding keyActivateArmBackLAttachment = new KeyBinding("key.signalindustries.armBackLActivate",0);
public KeyBinding keyActivateArmBackLAttachment = new KeyBinding("key.signalindustries.armBackLActivate");

@Unique
public KeyBinding keyActivateArmBackRAttachment = new KeyBinding("key.signalindustries.armBackRActivate",0);
public KeyBinding keyActivateArmBackRAttachment = new KeyBinding("key.signalindustries.armBackRActivate");

@Unique
public KeyBinding keyActivateLegSideLAttachment = new KeyBinding("key.signalindustries.legSideLActivate",0);
public KeyBinding keyActivateLegSideLAttachment = new KeyBinding("key.signalindustries.legSideLActivate");

@Unique
public KeyBinding keyActivateLegSideRAttachment = new KeyBinding("key.signalindustries.legSideRActivate",0);
public KeyBinding keyActivateLegSideRAttachment = new KeyBinding("key.signalindustries.legSideRActivate");

@Unique
public KeyBinding keyActivateBootBackLAttachment = new KeyBinding("key.signalindustries.bootBackLActivate",0);
public KeyBinding keyActivateBootBackLAttachment = new KeyBinding("key.signalindustries.bootBackLActivate");

@Unique
public KeyBinding keyActivateBootBackRAttachment = new KeyBinding("key.signalindustries.bootBackRActivate",0);
public KeyBinding keyActivateBootBackRAttachment = new KeyBinding("key.signalindustries.bootBackRActivate");

@Override
public KeyBinding signalIndustries$getKeyActivateHeadTopAttachment() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,18 @@
)
public abstract class GuiIngameMixin extends Gui {

@Shadow private FontRenderer fontrenderer;
@Shadow
protected FontRenderer fontrenderer;

@Shadow private Minecraft mc;
@Shadow
protected Minecraft mc;

@Shadow private int updateCounter;
@Shadow
public int updateCounter;

@Shadow protected abstract void renderInventorySlot(int itemIndex, int x, int y, float delta, float alpha);

@Shadow private static ItemEntityRenderer itemRenderer;
@Shadow
public static ItemEntityRenderer itemRenderer;

@Inject(
method = "renderGameOverlay",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.minecraft.core.net.handler.NetHandler;
import net.minecraft.core.net.packet.Packet23VehicleSpawn;
import org.spongepowered.asm.mixin.Debug;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -35,6 +36,7 @@
)
public abstract class NetClientHandlerMixin extends NetHandler implements INetClientHandler {

@Final
@Shadow private Minecraft mc;

@Shadow private WorldClient worldClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public abstract class RenderEngineMixin {

@Shadow private List<DynamicTexture> dynamicTextures;

@Shadow @Final public Minecraft minecraft;
@Shadow @Final public Minecraft mc;

@Shadow public abstract void updateDynamicTexture(DynamicTexture texture);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package sunsetsatellite.signalindustries.mixin;

import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.fx.EntitySlimeFX;
import net.minecraft.client.render.Lighting;
import net.minecraft.client.render.RenderEngine;
import net.minecraft.client.render.RenderGlobal;
import net.minecraft.client.render.Tessellator;
import net.minecraft.core.entity.fx.EntitySlimeFX;
import net.minecraft.core.util.helper.MathHelper;
import net.minecraft.core.util.phys.Vec3d;
import net.minecraft.core.world.World;
Expand Down
Loading

0 comments on commit 27337ab

Please sign in to comment.