Skip to content

Commit

Permalink
Add Missing Side Only Annotations (GregTechCEu#2579)
Browse files Browse the repository at this point in the history
  • Loading branch information
IntegerLimit authored Aug 11, 2024
1 parent fbc0f91 commit 7ca48a9
Show file tree
Hide file tree
Showing 22 changed files with 64 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import org.jetbrains.annotations.NotNull;

Expand All @@ -25,6 +27,7 @@ public static CleanroomProperty getInstance() {
}

@Override
@SideOnly(Side.CLIENT)
public void drawInfo(@NotNull Minecraft minecraft, int x, int y, int color, Object value) {
CleanroomType type = castValue(value);
if (type == null) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class ComputationProperty extends RecipeProperty<Integer> {

Expand All @@ -21,6 +23,7 @@ public static ComputationProperty getInstance() {
}

@Override
@SideOnly(Side.CLIENT)
public void drawInfo(Minecraft minecraft, int x, int y, int color, Object value) {
minecraft.fontRenderer.drawString(I18n.format("gregtech.recipe.computation_per_tick", castValue(value)), x, y,
color);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class DefaultProperty<T> extends RecipeProperty<T> {

public DefaultProperty(String key, Class<T> type) {
super(key, type);
}

@SideOnly(Side.CLIENT)
public void drawInfo(Minecraft minecraft, int x, int y, int color, Object value) {
minecraft.fontRenderer.drawString(I18n.format("gregtech.recipe." + getKey(),
castValue(value)), x, y, color);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.IntArrayList;
Expand All @@ -26,6 +28,7 @@ public static DimensionProperty getInstance() {
}

@Override
@SideOnly(Side.CLIENT)
public void drawInfo(Minecraft minecraft, int x, int y, int color, Object value) {
DimensionPropertyList list = castValue(value);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.tuple.Pair;
Expand Down Expand Up @@ -32,6 +34,7 @@ public static FusionEUToStartProperty getInstance() {
}

@Override
@SideOnly(Side.CLIENT)
public void drawInfo(Minecraft minecraft, int x, int y, int color, Object value) {
minecraft.fontRenderer.drawString(I18n.format("gregtech.recipe.eu_to_start",
TextFormattingUtil.formatLongToCompactString(castValue(value))) + getFusionTierName(castValue(value)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class ImplosionExplosiveProperty extends RecipeProperty<ItemStack> {

Expand All @@ -23,6 +25,7 @@ public static ImplosionExplosiveProperty getInstance() {
}

@Override
@SideOnly(Side.CLIENT)
public void drawInfo(Minecraft minecraft, int x, int y, int color, Object value) {
minecraft.fontRenderer.drawString(I18n.format("gregtech.recipe.explosive",
((ItemStack) value).getDisplayName()), x, y, color);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package gregtech.api.recipes.recipeproperties;

import net.minecraft.client.Minecraft;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

/**
* Simple Marker Property to tell JEI to not display Total EU and EU/t.
Expand All @@ -22,6 +24,7 @@ public static PrimitiveProperty getInstance() {
}

@Override
@SideOnly(Side.CLIENT)
public void drawInfo(Minecraft minecraft, int x, int y, int color, Object value) {}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import org.jetbrains.annotations.NotNull;

Expand All @@ -24,6 +26,7 @@ public static ResearchProperty getInstance() {
}

@Override
@SideOnly(Side.CLIENT)
public void drawInfo(@NotNull Minecraft minecraft, int x, int y, int color, Object value) {
minecraft.fontRenderer.drawString(I18n.format("gregtech.recipe.research"), x, y, color);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import org.jetbrains.annotations.NotNull;

Expand All @@ -24,6 +26,7 @@ public static ScanProperty getInstance() {
}

@Override
@SideOnly(Side.CLIENT)
public void drawInfo(Minecraft minecraft, int x, int y, int color, Object value) {
minecraft.fontRenderer.drawString(I18n.format("gregtech.recipe.scan_for_research"), x, y, color);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import org.apache.commons.lang3.Validate;
import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -31,6 +33,7 @@ public static TemperatureProperty getInstance() {
}

@Override
@SideOnly(Side.CLIENT)
public void drawInfo(Minecraft minecraft, int x, int y, int color, Object value) {
minecraft.fontRenderer.drawString(I18n.format("gregtech.recipe.temperature",
value, getMinTierForTemperature(castValue(value))), x, y, color);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class TotalComputationProperty extends RecipeProperty<Integer> {

Expand All @@ -21,6 +23,7 @@ public static TotalComputationProperty getInstance() {
}

@Override
@SideOnly(Side.CLIENT)
public void drawInfo(Minecraft minecraft, int x, int y, int color, Object value) {
minecraft.fontRenderer.drawString(I18n.format("gregtech.recipe.total_computation", castValue(value)), x, y,
color);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import codechicken.lib.raytracer.CuboidRayTraceResult;
import codechicken.lib.raytracer.IndexedCuboid6;
Expand Down Expand Up @@ -330,6 +332,7 @@ public IndexedCuboid6 getPageCuboid() {
}

@Override
@SideOnly(Side.CLIENT)
public Pair<TextureAtlasSprite, Integer> getParticleTexture() {
return Pair.of(CLIPBOARD_RENDERER.getParticleTexture(), 0xFFFFFF);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import net.minecraft.world.World;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.energy.CapabilityEnergy;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import codechicken.lib.raytracer.CuboidRayTraceResult;
import codechicken.lib.render.CCRenderState;
Expand Down Expand Up @@ -155,6 +157,7 @@ public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation,
}

@Override
@SideOnly(Side.CLIENT)
public Pair<TextureAtlasSprite, Integer> getParticleTexture() {
return Pair.of(Textures.VOLTAGE_CASINGS[getTier()].getParticleSprite(), getPaintingColorForRendering());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,7 @@ public void addInformation(ItemStack stack, @Nullable World player, List<String>
}

@Override
@SideOnly(Side.CLIENT)
public Pair<TextureAtlasSprite, Integer> getParticleTexture() {
return Pair.of(null, -1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import codechicken.lib.render.CCRenderState;
import codechicken.lib.render.pipeline.ColourMultiplier;
Expand All @@ -40,6 +42,7 @@ public MetaTileEntityMultiblockPart(ResourceLocation metaTileEntityId, int tier)
}

@Override
@SideOnly(Side.CLIENT)
public Pair<TextureAtlasSprite, Integer> getParticleTexture() {
return Pair.of(getBaseTexture().getParticleSprite(), getPaintingColorForRendering());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.ItemStackHandler;

import codechicken.lib.render.CCRenderState;
Expand Down Expand Up @@ -64,6 +66,7 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) {
}

@Override
@SideOnly(Side.CLIENT)
public Pair<TextureAtlasSprite, Integer> getParticleTexture() {
return Pair.of(Textures.VOLTAGE_CASINGS[tier].getParticleSprite(), this.getPaintingColorForRendering());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import codechicken.lib.render.CCRenderState;
import codechicken.lib.render.pipeline.ColourMultiplier;
Expand Down Expand Up @@ -78,6 +80,7 @@ public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation,
}

@Override
@SideOnly(Side.CLIENT)
public Pair<TextureAtlasSprite, Integer> getParticleTexture() {
return Pair.of(Textures.VOLTAGE_CASINGS[this.setTier].getParticleSprite(), this.getPaintingColorForRendering());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
import net.minecraft.world.World;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.util.Constants.NBT;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.IItemHandlerModifiable;
Expand Down Expand Up @@ -117,6 +119,7 @@ public void renderMetaTileEntity(double x, double y, double z, float partialTick
}

@Override
@SideOnly(Side.CLIENT)
public Pair<TextureAtlasSprite, Integer> getParticleTexture() {
return Pair.of(Textures.VOLTAGE_CASINGS[tier].getParticleSprite(), getPaintingColorForRendering());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
import net.minecraftforge.fluids.capability.IFluidHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.IItemHandlerModifiable;

import codechicken.lib.raytracer.CuboidRayTraceResult;
Expand Down Expand Up @@ -296,6 +298,7 @@ public void renderMetaTileEntity(double x, double y, double z, float partialTick
}

@Override
@SideOnly(Side.CLIENT)
public Pair<TextureAtlasSprite, Integer> getParticleTexture() {
return Pair.of(Textures.VOLTAGE_CASINGS[tier].getParticleSprite(), getPaintingColorForRendering());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.ItemStackHandler;

import codechicken.lib.render.CCRenderState;
Expand Down Expand Up @@ -119,6 +121,7 @@ public int getDefaultPaintingColor() {
}

@Override
@SideOnly(Side.CLIENT)
public Pair<TextureAtlasSprite, Integer> getParticleTexture() {
return Pair.of(Textures.CRAFTING_TABLE.getParticleSprite(), getDefaultPaintingColor());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
import net.minecraftforge.fluids.capability.IFluidHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import codechicken.lib.render.CCRenderState;
import codechicken.lib.render.pipeline.ColourMultiplier;
Expand Down Expand Up @@ -96,6 +98,7 @@ public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation,
}

@Override
@SideOnly(Side.CLIENT)
public Pair<TextureAtlasSprite, Integer> getParticleTexture() {
return Pair.of(Textures.VOLTAGE_CASINGS[GTValues.LV].getParticleSprite(), 0xFFFFFF);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.ItemStackHandler;
Expand Down Expand Up @@ -97,6 +99,7 @@ public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation,
}

@Override
@SideOnly(Side.CLIENT)
public Pair<TextureAtlasSprite, Integer> getParticleTexture() {
return Pair.of(Textures.VOLTAGE_CASINGS[GTValues.LV].getParticleSprite(), 0xFFFFFF);
}
Expand Down

0 comments on commit 7ca48a9

Please sign in to comment.