Merge branch 'meconduit-denseultra' of https://github.com/Pilzinsel64/EnderIO into meconduit-denseultra

This commit is contained in:
Pilzinsel64 committed 2023-03-03 15:31:42 +01:00
commit 1ea892dce8
14 files changed
+388 -66

No files matched your search

@@ -213,9 +213,11 @@ public class ItemSettings extends BaseSettingsPanel {
} else if (guiButton.id == ID_EXTRACT_CHANNEL) {
DyeColor col = DyeColor.fromIndex(extractChannelB.getColorIndex());
itemConduit.setInputColor(gui.getDir(), col);
} else {
if (insertFilterGui != null) insertFilterGui.actionPerformed(guiButton);
if (extractFilterGui != null) extractFilterGui.actionPerformed(guiButton);
return;
}
if (insertFilterGui != null) insertFilterGui.actionPerformed(guiButton);
if (extractFilterGui != null) extractFilterGui.actionPerformed(guiButton);
PacketHandler.INSTANCE.sendToServer(new PacketItemConduitFilter(itemConduit, gui.getDir()));
}
@@ -288,6 +288,10 @@ public final class Config {
public static int maxPhotovoltaicAdvancedOutputRF = 40;
public static int maxPhotovoltaicVibrantOutputRF = 160;
public static int photovoltaicCellCapacityRF = 10000;
public static int photovoltaicAdvancedCellCapacityRF = 10000;
public static int photovoltaicVibrantCellCapacityRF = 10000;
public static int zombieGeneratorRfPerTick = 80;
public static int zombieGeneratorTicksPerBucketFuel = 12000;
@@ -809,6 +813,26 @@ public final class Config {
"Maximum output in RF/t of the Vibrant Photovoltaic Panels.")
.getInt(maxPhotovoltaicVibrantOutputRF);
photovoltaicCellCapacityRF = config.get(
sectionPower.name,
"photovoltaicCellCapacityRF",
photovoltaicCellCapacityRF,
"Maximum capacity in RF/t of the Photovoltaic Panels.").getInt(photovoltaicCellCapacityRF);
photovoltaicAdvancedCellCapacityRF = config
.get(
sectionPower.name,
"photovoltaicAdvancedCellCapacityRF",
photovoltaicAdvancedCellCapacityRF,
"Maximum capacity in RF/t of the Advanced Photovoltaic Panels.")
.getInt(photovoltaicAdvancedCellCapacityRF);
photovoltaicVibrantCellCapacityRF = config
.get(
sectionPower.name,
"photovoltaicVibrantCellCapacityRF",
photovoltaicVibrantCellCapacityRF,
"Maximum capacity in RF/t of the Vibrant Photovoltaic Panels.")
.getInt(photovoltaicVibrantCellCapacityRF);
useAlternateBinderRecipe = config
.get(
sectionRecipe.name,
@@ -22,6 +22,9 @@ public class PacketConfigSync implements IMessage, IMessageHandler<PacketConfigS
buf.writeInt(Config.travelStaffMaxDistance);
buf.writeInt(Config.travelStaffMaxBlinkDistance);
buf.writeFloat(Config.travelStaffPowerPerBlockRF);
buf.writeInt(Config.teleportStaffMaxDistance);
buf.writeInt(Config.teleportStaffMaxBlinkDistance);
buf.writeInt(Config.teleportStaffFailedBlinkDistance);
buf.writeBoolean(Config.telepadLockCoords);
buf.writeBoolean(Config.telepadLockDimension);
}
@@ -38,6 +41,9 @@ public class PacketConfigSync implements IMessage, IMessageHandler<PacketConfigS
Config.travelStaffMaxDistance = data.readInt();
Config.travelStaffMaxBlinkDistance = data.readInt();
Config.travelStaffPowerPerBlockRF = data.readFloat();
Config.teleportStaffMaxDistance = data.readInt();
Config.teleportStaffMaxBlinkDistance = data.readInt();
Config.teleportStaffFailedBlinkDistance = data.readInt();
Config.telepadLockCoords = data.readBoolean();
Config.telepadLockDimension = data.readBoolean();
}
@@ -54,7 +54,7 @@ public class TileSliceAndSplice extends AbstractPoweredTaskEntity {
private static final BasicCapacitor CAP_FIVE = new BasicCapacitor(
0,
POWER_PER_TICK_FIVE * 2,
Capacitors.ENDER_CAPACITOR.capacitor.getMaxEnergyStored(),
Capacitors.MELODIC_CAPACITOR.capacitor.getMaxEnergyStored(),
POWER_PER_TICK_FIVE);
public static final int POWER_PER_TICK_SIX = Config.sliceAndSpliceLevelSixPowerPerTickRF;
@@ -135,13 +135,13 @@ public class TileSliceAndSplice extends AbstractPoweredTaskEntity {
setCapacitor(CAP_SEVEN);
break;
case SILVER_CAPACITOR:
setCapacitor(CAP_ONE);
setCapacitor(CAP_EIGHT);
break;
case ENDERGETIC_CAPACITOR:
setCapacitor(CAP_TWO);
setCapacitor(CAP_NINE);
break;
case ENDERGISED_CAPACITOR:
setCapacitor(CAP_THREE);
setCapacitor(CAP_TEN);
break;
default:
break;
@@ -10,6 +10,7 @@ import net.minecraftforge.common.util.ForgeDirection;
import cofh.api.energy.EnergyStorage;
import com.google.common.collect.Lists;
import crazypants.enderio.config.Config;
public class SolarPanelNetwork {
@@ -17,6 +18,7 @@ public class SolarPanelNetwork {
private boolean empty = true;
private EnergyStorage energy;
private boolean hasAppliedMaxEnergyConfig = false;
public static final int ENERGY_PER = 10000;
@@ -25,12 +27,13 @@ public class SolarPanelNetwork {
public SolarPanelNetwork() {
panels = Lists.newArrayList();
energy = new EnergyStorage(ENERGY_PER);
energy = new EnergyStorage(getCapacity());
}
SolarPanelNetwork(TileEntitySolarPanel initial) {
this();
panels.add(initial);
energy.setCapacity(getCapacity(initial, 1));
empty = false;
}
@@ -83,8 +86,49 @@ public class SolarPanelNetwork {
destroyNetwork();
}
private int getCapacity() {
int capacity = ENERGY_PER;
if (panels.size() > 0) {
TileEntitySolarPanel masterPanel = getMaster();
capacity = getCapacity(masterPanel, panels.size());
}
return capacity;
}
private int getCapacity(TileEntitySolarPanel panel, int panelsCount) {
int capacity = ENERGY_PER;
if (panel != null && panel.hasWorldObj()) {
int meta = panel.getBlockMetadata();
switch (meta) {
case 0: // Default
capacity = Config.photovoltaicCellCapacityRF;
break;
case 1: // Advanced
capacity = Config.photovoltaicAdvancedCellCapacityRF;
break;
case 2: // Vibrant
capacity = Config.photovoltaicVibrantCellCapacityRF;
break;
}
hasAppliedMaxEnergyConfig = true;
}
capacity = capacity * panelsCount;
return capacity;
}
private void updateEnergyIfNeeded() {
if (!hasAppliedMaxEnergyConfig) {
updateEnergy();
}
}
private void updateEnergy() {
energy.setCapacity(ENERGY_PER * panels.size());
energy.setCapacity(getCapacity());
energy.setMaxExtract(energy.getMaxEnergyStored());
}
@@ -119,6 +163,7 @@ public class SolarPanelNetwork {
}
public int setEnergyStored(int energy) {
updateEnergyIfNeeded();
if (isValid()) {
this.energy.setEnergyStored(energy);
}
@@ -554,8 +554,8 @@ public class TravelController {
return null;
}
ItemStack equipped = ep.getCurrentEquippedItem();
if (equipped.getItem() instanceof ItemTravelStaff) {
if (((ItemTravelStaff) equipped.getItem()).isActive(ep, equipped)) {
if (equipped.getItem() instanceof ItemTeleportStaff) {
if (((ItemTeleportStaff) equipped.getItem()).isActive(ep, equipped)) {
return TravelSource.TELEPORT_STAFF;
}
} else if (equipped.getItem() instanceof IItemOfTravel) {
@@ -301,7 +301,7 @@ public class WailaCompat implements IWailaDataProvider {
return;
}
if (itemStack.getItem() == EnderIO.itemPowerConduit) {
if (itemStack.getItem() == EnderIO.itemPowerConduit || itemStack.getItem() == EnderIO.itemPowerConduitEndergy) {
NBTTagCompound nbtRoot = _accessor.getNBTData();
if (nbtRoot.hasKey("storedEnergyRF")) {
int stored = nbtRoot.getInteger("storedEnergyRF");