-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #344 from MCTian-mi/plastic-cans
Implement plastic cans
- Loading branch information
Showing
13 changed files
with
98 additions
and
74 deletions.
There are no files selected for viewing
74 changes: 0 additions & 74 deletions
74
src/main/java/supersymmetry/client/renderer/textures/SidedDrumRenderer.java
This file was deleted.
Oops, something went wrong.
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
52 changes: 52 additions & 0 deletions
52
src/main/java/supersymmetry/common/metatileentities/storage/MetaTileEntityPlasticCan.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,52 @@ | ||
package supersymmetry.common.metatileentities.storage; | ||
|
||
import codechicken.lib.colour.ColourRGBA; | ||
import codechicken.lib.render.CCRenderState; | ||
import codechicken.lib.render.pipeline.ColourMultiplier; | ||
import codechicken.lib.render.pipeline.IVertexOperation; | ||
import codechicken.lib.vec.Matrix4; | ||
import gregtech.api.capability.IPropertyFluidFilter; | ||
import gregtech.api.metatileentity.MetaTileEntity; | ||
import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; | ||
import gregtech.api.unification.material.Material; | ||
import gregtech.api.util.GTUtility; | ||
import gregtech.client.renderer.texture.Textures; | ||
import gregtech.common.metatileentities.storage.MetaTileEntityDrum; | ||
import net.minecraft.util.EnumFacing; | ||
import net.minecraft.util.ResourceLocation; | ||
import org.apache.commons.lang3.ArrayUtils; | ||
import org.jetbrains.annotations.NotNull; | ||
import supersymmetry.client.renderer.textures.SusyTextures; | ||
import supersymmetry.mixins.gregtech.MetaTileEntityDrumAccessor; | ||
|
||
public class MetaTileEntityPlasticCan extends MetaTileEntityDrum { | ||
|
||
private final MetaTileEntityDrumAccessor self; | ||
|
||
public MetaTileEntityPlasticCan(ResourceLocation metaTileEntityId, @NotNull Material material, int tankSize) { | ||
super(metaTileEntityId, material, tankSize); | ||
this.self = (MetaTileEntityDrumAccessor) this; | ||
} | ||
|
||
public MetaTileEntityPlasticCan(ResourceLocation metaTileEntityId, @NotNull IPropertyFluidFilter fluidFilter, int color, int tankSize) { | ||
super(metaTileEntityId, fluidFilter, false, color, tankSize); | ||
this.self = (MetaTileEntityDrumAccessor) this; | ||
} | ||
|
||
@Override | ||
public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) { | ||
return new MetaTileEntityPlasticCan(this.metaTileEntityId, self.getFluidFilter(), self.getColor(), self.getTankSize()); | ||
} | ||
|
||
@Override | ||
public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) { | ||
ColourMultiplier multiplier = new ColourMultiplier( | ||
ColourRGBA.multiply(GTUtility.convertRGBtoOpaqueRGBA_CL(self.getColor()), | ||
GTUtility.convertRGBtoOpaqueRGBA_CL(getPaintingColorForRendering()))); | ||
SusyTextures.PLASTIC_CAN.render(renderState, translation, ArrayUtils.add(pipeline, multiplier), getFrontFacing()); | ||
SusyTextures.PLASTIC_CAN_OVERLAY.render(renderState, translation, pipeline); | ||
if (self.isAutoOutput()) { | ||
Textures.STEAM_VENT_OVERLAY.renderSided(EnumFacing.DOWN, renderState, translation, pipeline); | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/supersymmetry/mixins/gregtech/MetaTileEntityDrumAccessor.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,25 @@ | ||
package supersymmetry.mixins.gregtech; | ||
|
||
import gregtech.api.capability.IPropertyFluidFilter; | ||
import gregtech.common.metatileentities.storage.MetaTileEntityDrum; | ||
import org.jetbrains.annotations.ApiStatus.ScheduledForRemoval; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.gen.Accessor; | ||
|
||
@Deprecated | ||
@ScheduledForRemoval(inVersion = "Next CEu update") | ||
@Mixin(value = MetaTileEntityDrum.class, remap = false) | ||
public interface MetaTileEntityDrumAccessor { | ||
|
||
@Accessor("fluidFilter") | ||
IPropertyFluidFilter getFluidFilter(); | ||
|
||
@Accessor("color") | ||
int getColor(); | ||
|
||
@Accessor("tankSize") | ||
int getTankSize(); | ||
|
||
@Accessor("isAutoOutput") | ||
boolean isAutoOutput(); | ||
} |
Binary file added
BIN
+389 Bytes
.../resources/assets/gregtech/textures/blocks/storage/drums/plastic_can/bottom.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
+389 Bytes
...in/resources/assets/gregtech/textures/blocks/storage/drums/plastic_can/side.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
+425 Bytes
...ain/resources/assets/gregtech/textures/blocks/storage/drums/plastic_can/top.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
+141 Bytes
...ources/assets/gregtech/textures/blocks/storage/drums/plastic_can_top/bottom.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
+141 Bytes
...esources/assets/gregtech/textures/blocks/storage/drums/plastic_can_top/side.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
+428 Bytes
...resources/assets/gregtech/textures/blocks/storage/drums/plastic_can_top/top.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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