-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...in/java/gregtech/common/metatileentities/storage/MetaTileEntityQuantumEnergyAcceptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |