use of net.minecraftforge.fml.relauncher.SideOnly in project RFToolsDimensions by McJty.
the class GenericWorldProvider method getCloudColor.
@Override
@SideOnly(Side.CLIENT)
public Vec3d getCloudColor(float partialTicks) {
getDimensionInformation();
Vec3d cloudColor = super.getCloudColor(partialTicks);
if (dimensionInformation == null || dimensionInformation.isPatreonBitSet(PatreonType.PATREON_KENNEY)) {
return cloudColor;
} else {
float r = dimensionInformation.getSkyDescriptor().getCloudColorFactorR();
float g = dimensionInformation.getSkyDescriptor().getCloudColorFactorG();
float b = dimensionInformation.getSkyDescriptor().getCloudColorFactorB();
return new Vec3d(cloudColor.x * r, cloudColor.y * g, cloudColor.z * b);
}
}
use of net.minecraftforge.fml.relauncher.SideOnly in project RFToolsDimensions by McJty.
the class DimensionMonitorItem method initModel.
@Override
@SideOnly(Side.CLIENT)
public void initModel() {
for (int i = 0; i <= 8; i++) {
ResourceLocation registryName = getRegistryName();
registryName = new ResourceLocation(registryName.getResourceDomain(), registryName.getResourcePath() + i);
ModelBakery.registerItemVariants(this, new ModelResourceLocation(registryName, "inventory"));
// ModelBakery.addVariantName(this, getRegistryName() + i);
}
ModelLoader.setCustomMeshDefinition(this, stack -> {
WorldClient world = Minecraft.getMinecraft().world;
int id = world.provider.getDimension();
DimensionStorage storage = DimensionStorage.getDimensionStorage(world);
int energyLevel = storage.getEnergyLevel(id);
int level = (9 * energyLevel) / PowerConfiguration.MAX_DIMENSION_POWER;
if (level < 0) {
level = 0;
} else if (level > 8) {
level = 8;
}
ResourceLocation registryName = getRegistryName();
registryName = new ResourceLocation(registryName.getResourceDomain(), registryName.getResourcePath() + (8 - level));
return new ModelResourceLocation(registryName, "inventory");
});
}
use of net.minecraftforge.fml.relauncher.SideOnly in project RFToolsDimensions by McJty.
the class DimensionModuleItem method addInformation.
@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack itemStack, World player, List<String> list, ITooltipFlag whatIsThis) {
super.addInformation(itemStack, player, list, whatIsThis);
list.add(TextFormatting.GREEN + "Uses " + GeneralConfiguration.DIMENSIONMODULE_RFPERTICK + " RF/tick");
NBTTagCompound tagCompound = itemStack.getTagCompound();
if (tagCompound != null) {
list.add(TextFormatting.YELLOW + "Label: " + tagCompound.getString("text"));
list.add(TextFormatting.YELLOW + "Dimension: " + tagCompound.getInteger("dim"));
}
}
use of net.minecraftforge.fml.relauncher.SideOnly in project RFToolsDimensions by McJty.
the class DimletEnergyModuleItem method initModel.
@Override
@SideOnly(Side.CLIENT)
public void initModel() {
ModelResourceLocation[] models = new ModelResourceLocation[3];
for (int i = 0; i < 3; i++) {
ResourceLocation registryName = getRegistryName();
registryName = new ResourceLocation(registryName.getResourceDomain(), registryName.getResourcePath() + i);
models[i] = new ModelResourceLocation(registryName, "inventory");
ModelBakery.registerItemVariants(this, models[i]);
}
ModelLoader.setCustomMeshDefinition(this, stack -> models[stack.getItemDamage()]);
}
use of net.minecraftforge.fml.relauncher.SideOnly in project Gaspunk by Ladysnake.
the class Gas method renderOverlay.
@SideOnly(Side.CLIENT)
@Override
public void renderOverlay(float concentration, float partialTicks, ScaledResolution resolution) {
GlStateManager.disableDepth();
GlStateManager.depthMask(false);
int color = getColor();
float b = (color & 0xFF) / 255F;
float g = (color >> 8 & 0xFF) / 255F;
float r = (color >> 16 & 0xFF) / 255F;
float a = (color >> 24 & 0xFF) / 255F;
GlStateManager.color(r, g, b, concentration * a);
GlStateManager.enableAlpha();
GlStateManager.enableBlend();
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
Minecraft.getMinecraft().getTextureManager().bindTexture(getOverlayTexture());
ShaderUtil.useShader(OVERLAY_SHADER);
ShaderUtil.setUniform("gasColor", r, g, b, a);
ShaderUtil.setUniform("iTime", (int) System.currentTimeMillis());
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferbuilder = tessellator.getBuffer();
bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX);
bufferbuilder.pos(0.0D, (double) resolution.getScaledHeight(), -90.0D).tex(0.0D, 1.0D).endVertex();
bufferbuilder.pos((double) resolution.getScaledWidth(), (double) resolution.getScaledHeight(), -90.0D).tex(1.0D, 1.0D).endVertex();
bufferbuilder.pos((double) resolution.getScaledWidth(), 0.0D, -90.0D).tex(1.0D, 0.0D).endVertex();
bufferbuilder.pos(0.0D, 0.0D, -90.0D).tex(0.0D, 0.0D).endVertex();
tessellator.draw();
ShaderUtil.revert();
GlStateManager.depthMask(true);
GlStateManager.enableDepth();
GlStateManager.enableAlpha();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
Aggregations