Skip to content

Commit

Permalink
add quantum energy acceptor
Browse files Browse the repository at this point in the history
  • Loading branch information
ghzdude committed Dec 21, 2023
1 parent 1a51610 commit 70d9e5a
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
import gregtech.common.metatileentities.storage.MetaTileEntityCreativeTank;
import gregtech.common.metatileentities.storage.MetaTileEntityDrum;
import gregtech.common.metatileentities.storage.MetaTileEntityQuantumChest;
import gregtech.common.metatileentities.storage.MetaTileEntityQuantumEnergyAcceptor;
import gregtech.common.metatileentities.storage.MetaTileEntityQuantumExtender;
import gregtech.common.metatileentities.storage.MetaTileEntityQuantumProxy;
import gregtech.common.metatileentities.storage.MetaTileEntityQuantumStorageController;
Expand Down Expand Up @@ -273,6 +274,7 @@ public class MetaTileEntities {
public static final MetaTileEntityMufflerHatch[] MUFFLER_HATCH = new MetaTileEntityMufflerHatch[GTValues.UV + 1]; // LV-UV
public static final MetaTileEntityFusionReactor[] FUSION_REACTOR = new MetaTileEntityFusionReactor[3];
public static MetaTileEntityQuantumStorageController QUANTUM_STORAGE_CONTROLLER;
public static MetaTileEntityQuantumEnergyAcceptor QUANTUM_ENERGY_ACCEPTOR;
public static MetaTileEntityQuantumProxy QUANTUM_STORAGE_PROXY;
public static MetaTileEntityQuantumExtender QUANTUM_STORAGE_EXTENDER;
public static final MetaTileEntityQuantumChest[] QUANTUM_CHEST = new MetaTileEntityQuantumChest[11];
Expand Down Expand Up @@ -1030,6 +1032,8 @@ public static void init() {
new MetaTileEntityQuantumProxy(gregtechId("quantum_storage_proxy")));
QUANTUM_STORAGE_EXTENDER = registerMetaTileEntity(1755,
new MetaTileEntityQuantumExtender(gregtechId("quantum_storage_extender")));
QUANTUM_ENERGY_ACCEPTOR = registerMetaTileEntity(1756,
new MetaTileEntityQuantumEnergyAcceptor(gregtechId("quantum_energy_acceptor")));

QUANTUM_CHEST[10] = new MetaTileEntityQuantumChest(
gregtechId("super_chest." + GTValues.VN[GTValues.ULV].toLowerCase()), 0, 1000000L);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package gregtech.common.metatileentities.storage;

import codechicken.lib.render.CCRenderState;
import codechicken.lib.render.pipeline.IVertexOperation;
import codechicken.lib.vec.Matrix4;

import gregtech.api.capability.GregtechCapabilities;
import gregtech.api.capability.IEnergyContainer;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.interfaces.IGregTechTileEntity;

import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.capabilities.Capability;

public class MetaTileEntityQuantumEnergyAcceptor extends MetaTileEntityQuantumStorage<IEnergyContainer> {

public MetaTileEntityQuantumEnergyAcceptor(ResourceLocation metaTileEntityId) {
super(metaTileEntityId);
}

@Override
protected boolean openGUIOnRightClick() {
return false;
}

@Override
public Type getType() {
return Type.ENERGY;
}

@Override
public IEnergyContainer getTypeValue() {
return getController() == null ? null : getController().getEnergyContainer();
}

@SuppressWarnings("unchecked")
@Override
public <T> T getCapability(Capability<T> capability, EnumFacing side) {
if (capability == GregtechCapabilities.CAPABILITY_ENERGY_CONTAINER) {
return (T) getTypeValue();
}
return super.getCapability(capability, side);
}

@Override
public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) {
return new MetaTileEntityQuantumEnergyAcceptor(metaTileEntityId);
}
}

0 comments on commit 70d9e5a

Please sign in to comment.