-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement the sterile maintenance hatch (#66)
* Init (idk how java works so this probably won't work! ) * spotlesase * init * Pink/purple overlay * Lang and casing texture funny-ness * More lang and spoblese * Fix weird item placement in creative tabs * Recipe
- Loading branch information
Showing
8 changed files
with
124 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
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
94 changes: 94 additions & 0 deletions
94
...zbgt/common/metatileentities/multi/multiblockpart/MetaTileEntitySterileCleaningHatch.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,94 @@ | ||
package com.zorbatron.zbgt.common.metatileentities.multi.multiblockpart; | ||
|
||
import static gregtech.api.metatileentity.multiblock.CleanroomType.CLEANROOM; | ||
import static gregtech.api.metatileentity.multiblock.CleanroomType.STERILE_CLEANROOM; | ||
|
||
import java.util.List; | ||
|
||
import net.minecraft.client.resources.I18n; | ||
import net.minecraft.creativetab.CreativeTabs; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.NonNullList; | ||
import net.minecraft.util.ResourceLocation; | ||
import net.minecraft.util.text.TextFormatting; | ||
import net.minecraft.world.World; | ||
import net.minecraftforge.fml.relauncher.Side; | ||
import net.minecraftforge.fml.relauncher.SideOnly; | ||
|
||
import org.jetbrains.annotations.Nullable; | ||
|
||
import com.zorbatron.zbgt.api.render.ZBGTTextures; | ||
import com.zorbatron.zbgt.common.metatileentities.ZBGTMetaTileEntities; | ||
|
||
import codechicken.lib.render.CCRenderState; | ||
import codechicken.lib.render.pipeline.IVertexOperation; | ||
import codechicken.lib.vec.Matrix4; | ||
import gregtech.api.GTValues; | ||
import gregtech.api.metatileentity.MetaTileEntity; | ||
import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; | ||
import gregtech.api.metatileentity.multiblock.*; | ||
import gregtech.client.renderer.ICubeRenderer; | ||
import gregtech.client.renderer.texture.Textures; | ||
import gregtech.common.metatileentities.multi.multiblockpart.MetaTileEntityAutoMaintenanceHatch; | ||
|
||
public class MetaTileEntitySterileCleaningHatch extends MetaTileEntityAutoMaintenanceHatch { | ||
|
||
private static ICleanroomProvider DUMMY_CLEANROOM; | ||
|
||
public MetaTileEntitySterileCleaningHatch(ResourceLocation metaTileEntityId) { | ||
super(metaTileEntityId); | ||
|
||
DUMMY_CLEANROOM = DummyCleanroom.createForAllTypes(); | ||
} | ||
|
||
@Override | ||
public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) { | ||
return new MetaTileEntitySterileCleaningHatch(metaTileEntityId); | ||
} | ||
|
||
@Override | ||
public void addToMultiBlock(MultiblockControllerBase controllerBase) { | ||
super.addToMultiBlock(controllerBase); | ||
if (controllerBase instanceof ICleanroomReceiver cleanroomReceiver && | ||
cleanroomReceiver.getCleanroom() == null) { | ||
cleanroomReceiver.setCleanroom(DUMMY_CLEANROOM); | ||
} | ||
} | ||
|
||
@Override | ||
public void addInformation(ItemStack stack, @Nullable World player, List<String> tooltip, boolean advanced) { | ||
super.addInformation(stack, player, tooltip, advanced); | ||
tooltip.add(I18n.format("gregtech.machine.maintenance_hatch.cleanroom_auto.tooltip.2")); | ||
tooltip.add(String.format(" %s%s", TextFormatting.GREEN, I18n.format(CLEANROOM.getTranslationKey()))); | ||
tooltip.add(String.format(" %s%s", TextFormatting.GREEN, I18n.format(STERILE_CLEANROOM.getTranslationKey()))); | ||
} | ||
|
||
@SideOnly(Side.CLIENT) | ||
@Override | ||
public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) { | ||
super.renderMetaTileEntity(renderState, translation, pipeline); | ||
if (shouldRenderOverlay()) { | ||
ZBGTTextures.MAINTENANCE_OVERLAY_STERILE.renderSided(getFrontFacing(), renderState, translation, pipeline); | ||
} | ||
} | ||
|
||
@Override | ||
public ICubeRenderer getBaseTexture() { | ||
MultiblockControllerBase controller = getController(); | ||
if (controller != null) { | ||
return this.hatchTexture = controller.getBaseTexture(this); | ||
} else if (this.hatchTexture != null) { | ||
if (hatchTexture != Textures.getInactiveTexture(hatchTexture)) { | ||
return this.hatchTexture = Textures.getInactiveTexture(hatchTexture); | ||
} | ||
return this.hatchTexture; | ||
} else { | ||
return Textures.VOLTAGE_CASINGS[GTValues.UHV]; | ||
} | ||
} | ||
|
||
@Override | ||
public void getSubItems(CreativeTabs creativeTab, NonNullList<ItemStack> subItems) { | ||
subItems.add(ZBGTMetaTileEntities.STERILE_CLEANING_HATCH.getStackForm()); | ||
} | ||
} |
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
Binary file added
BIN
+214 Bytes
...assets/gregtech/textures/blocks/overlay/machine/overlay_maintenance_sterile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+436 Bytes
...egtech/textures/blocks/overlay/machine/overlay_maintenance_sterile_emissive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions
6
.../gregtech/textures/blocks/overlay/machine/overlay_maintenance_sterile_emissive.png.mcmeta
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,6 @@ | ||
{ | ||
"animation": { | ||
"interpolate": true, | ||
"frametime": 10 | ||
} | ||
} |
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