Skip to content

Commit

Permalink
Add Superluminal Acceleration Card for IOPort (#617)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Robertz <dream-master@gmx.net>
  • Loading branch information
lordIcocain and Dream-Master authored Dec 26, 2024
1 parent 7c369c9 commit 35c33df
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/main/java/appeng/api/config/Upgrades.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public enum Upgrades {
ORE_FILTER(1),
ADVANCED_BLOCKING(1),
LOCK_CRAFTING(1),
FAKE_CRAFTING(1);
FAKE_CRAFTING(1),
SUPERLUMINALSPEED(1);

/**
* @deprecated use {@link Upgrades#getTier()}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/appeng/api/definitions/IMaterials.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,6 @@ public interface IMaterials {
IItemDefinition cardLockCrafting();

IItemDefinition cardFakeCrafting();

IItemDefinition cardSuperluminalSpeed();
}
1 change: 1 addition & 0 deletions src/main/java/appeng/core/Registration.java
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ void postInit(final FMLPostInitializationEvent event) {
// IO Port!
Upgrades.SPEED.registerItem(blocks.iOPort(), 3);
Upgrades.SUPERSPEED.registerItem(blocks.iOPort(), 3);
Upgrades.SUPERLUMINALSPEED.registerItem(blocks.iOPort(), 3);
Upgrades.REDSTONE.registerItem(blocks.iOPort(), 1);

// Level Emitter!
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/appeng/core/api/definitions/ApiMaterials.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public final class ApiMaterials implements IMaterials {
private final IItemDefinition cardRedstone;
private final IItemDefinition cardSpeed;
private final IItemDefinition cardSuperSpeed;
private final IItemDefinition cardSuperluminalSpeed;
private final IItemDefinition cardCapacity;
private final IItemDefinition cardPatternCapacity;
private final IItemDefinition cardFuzzy;
Expand Down Expand Up @@ -169,6 +170,8 @@ public ApiMaterials(final DefinitionConstructor constructor) {
this.cardRedstone = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.CardRedstone));
this.cardSpeed = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.CardSpeed));
this.cardSuperSpeed = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.CardSuperSpeed));
this.cardSuperluminalSpeed = new DamagedItemDefinition(
itemMultiMaterial.createMaterial(MaterialType.CardSuperluminalSpeed));
this.cardCapacity = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.CardCapacity));
this.cardPatternCapacity = new DamagedItemDefinition(
itemMultiMaterial.createMaterial(MaterialType.CardPatternCapacity));
Expand Down Expand Up @@ -554,4 +557,9 @@ public IItemDefinition cardLockCrafting() {
public IItemDefinition cardFakeCrafting() {
return this.cardFakeCrafting;
}

@Override
public IItemDefinition cardSuperluminalSpeed() {
return this.cardSuperluminalSpeed;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ public Upgrades getType(final ItemStack itemstack) {
case CardLockCrafting -> Upgrades.LOCK_CRAFTING;
case CardSticky -> Upgrades.STICKY;
case CardFakeCrafting -> Upgrades.FAKE_CRAFTING;
case CardSuperluminalSpeed -> Upgrades.SUPERLUMINALSPEED;
default -> null;
};
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/appeng/items/materials/MaterialType.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ public enum MaterialType {
CardAdvancedBlocking(63),
CardSticky(64),
CardLockCrafting(65),
CardFakeCrafting(66);
CardFakeCrafting(66),
CardSuperluminalSpeed(67);

private final EnumSet<AEFeature> features;
// IIcon for the material.
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/appeng/parts/automation/UpgradeInventory.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public abstract class UpgradeInventory extends AppEngInternalInventory implement
private int fuzzyUpgrades = 0;
private int speedUpgrades = 0;
private int superSpeedUpgrades = 0;
private int SuperluminalSpeedUpgrades = 0;
private int redstoneUpgrades = 0;
private int capacityUpgrades = 0;
private int inverterUpgrades = 0;
Expand Down Expand Up @@ -91,6 +92,7 @@ public int getInstalledUpgrades(final Upgrades u) {
case LOCK_CRAFTING -> this.lockCraftingUpgrades;
case STICKY -> this.stickyUpgrades;
case FAKE_CRAFTING -> this.fakeCraftingUpgrades;
case SUPERLUMINALSPEED -> this.SuperluminalSpeedUpgrades;
default -> 0;
};
}
Expand All @@ -99,7 +101,7 @@ public int getInstalledUpgrades(final Upgrades u) {

private void updateUpgradeInfo() {
this.cached = true;
this.patternCapacityUpgrades = this.stickyUpgrades = this.inverterUpgrades = this.capacityUpgrades = this.redstoneUpgrades = this.speedUpgrades = this.superSpeedUpgrades = this.fuzzyUpgrades = this.craftingUpgrades = this.oreFilterUpgrades = this.advancedBlockingUpgrades = this.lockCraftingUpgrades = this.fakeCraftingUpgrades = 0;
this.patternCapacityUpgrades = this.SuperluminalSpeedUpgrades = this.stickyUpgrades = this.inverterUpgrades = this.capacityUpgrades = this.redstoneUpgrades = this.speedUpgrades = this.superSpeedUpgrades = this.fuzzyUpgrades = this.craftingUpgrades = this.oreFilterUpgrades = this.advancedBlockingUpgrades = this.lockCraftingUpgrades = this.fakeCraftingUpgrades = 0;

for (final ItemStack is : this) {
if (is == null || is.getItem() == null || !(is.getItem() instanceof IUpgradeModule)) {
Expand All @@ -121,6 +123,7 @@ private void updateUpgradeInfo() {
case LOCK_CRAFTING -> this.lockCraftingUpgrades++;
case STICKY -> this.stickyUpgrades++;
case FAKE_CRAFTING -> this.fakeCraftingUpgrades++;
case SUPERLUMINALSPEED -> this.SuperluminalSpeedUpgrades++;
default -> {}
}
}
Expand All @@ -140,6 +143,8 @@ private void updateUpgradeInfo() {
this.lockCraftingUpgrades = Math.min(this.lockCraftingUpgrades, this.getMaxInstalled(Upgrades.LOCK_CRAFTING));
this.fakeCraftingUpgrades = Math.min(this.fakeCraftingUpgrades, this.getMaxInstalled(Upgrades.FAKE_CRAFTING));
this.stickyUpgrades = Math.min(this.stickyUpgrades, this.getMaxInstalled(Upgrades.STICKY));
this.SuperluminalSpeedUpgrades = Math
.min(this.SuperluminalSpeedUpgrades, this.getMaxInstalled(Upgrades.SUPERLUMINALSPEED));
}

@Override
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/appeng/tile/storage/TileIOPort.java
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,12 @@ public TickRateModulation tickingRequest(final IGridNode node, final int ticksSi
case 3 -> ItemsToMove *= 1024;
}

switch (this.getInstalledUpgrades(Upgrades.SUPERLUMINALSPEED)) {
case 1 -> ItemsToMove *= 131_072;
case 2 -> ItemsToMove *= 8_388_608;
case 3 -> ItemsToMove *= 536_870_912;
}

try {
final IMEInventory<IAEItemStack> itemNet = this.getProxy().getStorage().getItemInventory();
final IMEInventory<IAEFluidStack> fluidNet = this.getProxy().getStorage().getFluidInventory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ item.appliedenergistics2.ItemMaterial.CardAdvancedBlocking.name=Advanced Blockin
item.appliedenergistics2.ItemMaterial.CardLockCrafting.name=Locking Card
item.appliedenergistics2.ItemMaterial.CardSticky.name=Sticky Card
item.appliedenergistics2.ItemMaterial.CardFakeCrafting.name=Fake Crafting Card
item.appliedenergistics2.ItemMaterial.CardSuperluminalSpeed.name=Superluminal Acceleration Card

item.appliedenergistics2.ItemMaterial.Cell2SpatialPart.name=2³ Spatial Component
item.appliedenergistics2.ItemMaterial.Cell16SpatialPart.name=16³ Spatial Component
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 35c33df

Please sign in to comment.