From d021f502ea5271c3ba669fbb60b3d54376693478 Mon Sep 17 00:00:00 2001 From: canitzp Date: Sun, 25 Oct 2015 02:54:01 +0200 Subject: [PATCH 1/4] -Added Baton with Mob knockback --- .../actuallyadditions/items/InitItems.java | 7 + .../items/tools/ItemBatonAA.java | 132 ++++++++++++++++++ 2 files changed, 139 insertions(+) create mode 100644 src/main/java/ellpeck/actuallyadditions/items/tools/ItemBatonAA.java diff --git a/src/main/java/ellpeck/actuallyadditions/items/InitItems.java b/src/main/java/ellpeck/actuallyadditions/items/InitItems.java index d50739037..00ae5bbb1 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/InitItems.java +++ b/src/main/java/ellpeck/actuallyadditions/items/InitItems.java @@ -129,6 +129,9 @@ public class InitItems{ public static Item itemLaserWrench; + //canitzp: + public static Item itemBatonWood; + public static void init(){ ModUtil.LOGGER.info("Initializing Items..."); @@ -300,5 +303,9 @@ public class InitItems{ obsidianPaxel = new ItemAllToolAA(InitToolMaterials.toolMaterialObsidian, "obsidian", "obsidianPaxel", EnumRarity.epic); quartzPaxel = new ItemAllToolAA(InitToolMaterials.toolMaterialQuartz, "gemQuartzBlack", "quartzPaxel", EnumRarity.rare); ItemUtil.registerItems(new Item[]{woodenPaxel, stonePaxel, ironPaxel, goldPaxel, diamondPaxel, emeraldPaxel, obsidianPaxel, quartzPaxel}); + + //canitzp: + itemBatonWood = new ItemBatonAA(Item.ToolMaterial.WOOD, "plank", "itemBatonWood"); + ItemUtil.register(itemBatonWood); } } diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemBatonAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemBatonAA.java new file mode 100644 index 000000000..92f590863 --- /dev/null +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemBatonAA.java @@ -0,0 +1,132 @@ +package ellpeck.actuallyadditions.items.tools; + +import com.google.common.collect.Multimap; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ellpeck.actuallyadditions.util.IActAddItemOrBlock; +import ellpeck.actuallyadditions.util.ModUtil; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; + +/** + * @author canitzp + */ + +public class ItemBatonAA extends Item implements IActAddItemOrBlock{ + + private String name; + private String repairItem; + private ToolMaterial material; + + public ItemBatonAA(ToolMaterial material, String repairItem, String name){ + this.material = material; + this.name = name; + this.repairItem = repairItem; + } + + public boolean hitEntity(ItemStack stack, EntityLivingBase livingBase, EntityLivingBase attacker) + { + stack.damageItem(1, attacker); + knockback(livingBase, (EntityPlayer) attacker); + return true; + } + + public boolean onBlockDestroyed(ItemStack p_150894_1_, World p_150894_2_, Block p_150894_3_, int p_150894_4_, int p_150894_5_, int p_150894_6_, EntityLivingBase p_150894_7_) + { + if ((double)p_150894_3_.getBlockHardness(p_150894_2_, p_150894_4_, p_150894_5_, p_150894_6_) != 0.0D) + { + p_150894_1_.damageItem(2, p_150894_7_); + } + + return true; + } + + @SideOnly(Side.CLIENT) + public boolean isFull3D() + { + return true; + } + + public EnumAction getItemUseAction(ItemStack p_77661_1_) + { + return EnumAction.block; + } + + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) + { + p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_)); + return p_77659_1_; + } + + public int getItemEnchantability() + { + return this.material.getEnchantability(); + } + + @Override + public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack){ + int[] idsStack = OreDictionary.getOreIDs(stack); + for(int id : idsStack){ + if(OreDictionary.getOreName(id).equals(repairItem)){ + return true; + } + } + return false; + } + + public Multimap getItemAttributeModifiers() + { + Multimap multimap = super.getItemAttributeModifiers(); + multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon modifier", 2F + material.getDamageVsEntity(), 0)); + return multimap; + } + + @Override + public String getName() { + return this.name; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconReg){ + this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); + } + + /** + Method from http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/modification-development/1415944-adding-knockback-to-items-mobs + */ + private void knockback(Entity entity, EntityPlayer player){ + double d = entity.posX - player.posX + material.getEfficiencyOnProperMaterial(); + double d1; + for(d1 = entity.posZ - player.posZ; d * d + d1 * d1 < 0.0001D; d1 = (Math.random() - Math.random()) * 0.01D) + { + d = (Math.random() - Math.random()) * 0.01D; + } + + entity.isAirBorne = true; + float f = MathHelper.sqrt_double(d * d + d1 * d1); + float f1 = 0.4F; + entity.motionX /= 2D; + entity.motionY /= 2D; + entity.motionZ /= 2D; + entity.motionX += (d / (double)f) * (double)f1 * 2; + entity.motionY += 0.40000000596046448D; + entity.motionZ += (d1 / (double)f) * (double)f1 * 2; + if(entity.motionY > 0.40000000596046448D) + { + entity.motionY = 0.40000000596046448D; + } + } + +} From 6b58039721203ed0cce424f50d8b9947cbaa7096 Mon Sep 17 00:00:00 2001 From: canitzp Date: Sun, 25 Oct 2015 22:16:54 +0100 Subject: [PATCH 2/4] -LaserRelay renderer --- .../blocks/render/ModelLaserRelay.java | 9 +++--- .../blocks/render/RenderLaserRelay.java | 5 +++ .../tile/TileEntityLaserRelay.java | 32 +++++++++++++++++++ 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/render/ModelLaserRelay.java b/src/main/java/ellpeck/actuallyadditions/blocks/render/ModelLaserRelay.java index 2daea4c45..ca660758c 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/render/ModelLaserRelay.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/render/ModelLaserRelay.java @@ -188,12 +188,13 @@ public class ModelLaserRelay extends ModelBaseAA{ @Override public void renderExtra(float f, TileEntity tile){ TileEntityLaserRelay relay = (TileEntityLaserRelay)tile; - WorldPos thisPos = new WorldPos(relay.getWorldObj(), relay.xCoord, relay.yCoord, relay.zCoord); - ArrayList network = LaserRelayConnectionHandler.getInstance().getNetworkFor(thisPos); + WorldPos firstWP = new WorldPos(relay.getWorldObj(), relay.xCoord, relay.yCoord, relay.zCoord); + ArrayList network = LaserRelayConnectionHandler.getInstance().getNetworkFor(firstWP); if(network != null){ for(LaserRelayConnectionHandler.ConnectionPair aPair : network){ - if(aPair.contains(thisPos) && aPair.firstRelay.isEqual(thisPos)){ - //TODO Make this work + TileEntityLaserRelay firstRelay = (TileEntityLaserRelay) aPair.firstRelay.getTileEntity(); + if(aPair.contains(firstWP) && aPair.firstRelay.isEqual(firstWP)){ + firstRelay.firstDraw(aPair.firstRelay, aPair.secondRelay); } } } diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/render/RenderLaserRelay.java b/src/main/java/ellpeck/actuallyadditions/blocks/render/RenderLaserRelay.java index 3ec80216d..2aa680065 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/render/RenderLaserRelay.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/render/RenderLaserRelay.java @@ -11,8 +11,10 @@ package ellpeck.actuallyadditions.blocks.render; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; + public class RenderLaserRelay extends RenderTileEntity{ public RenderLaserRelay(ModelBaseAA model){ @@ -52,9 +54,12 @@ public class RenderLaserRelay extends RenderTileEntity{ } theModel.render(0.0625F); + bindTexture(new ResourceLocation("actuallyadditions:textures/blocks/blockBreaker.png")); theModel.renderExtra(0.0625F, tile); + bindTexture(resLoc); GL11.glPopMatrix(); + } } diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLaserRelay.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLaserRelay.java index 0d67e3721..3bc956f4b 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLaserRelay.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLaserRelay.java @@ -13,16 +13,20 @@ package ellpeck.actuallyadditions.tile; import cofh.api.energy.IEnergyReceiver; import ellpeck.actuallyadditions.misc.LaserRelayConnectionHandler; import ellpeck.actuallyadditions.util.WorldPos; +import net.minecraft.client.Minecraft; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; +import org.lwjgl.opengl.GL11; import java.util.ArrayList; public class TileEntityLaserRelay extends TileEntityBase implements IEnergyReceiver{ + @Override public void invalidate(){ super.invalidate(); @@ -96,4 +100,32 @@ public class TileEntityLaserRelay extends TileEntityBase implements IEnergyRecei public boolean canConnectEnergy(ForgeDirection from){ return true; } + + public void firstDraw(WorldPos firstPos, WorldPos secondPos){ + double x = firstPos.getX() - secondPos.getX(); + double y = firstPos.getY() - secondPos.getY() + 1; + double z = -(firstPos.getZ() - secondPos.getZ()); + double player = Minecraft.getMinecraft().thePlayer.posY-firstPos.getY(); + float f = 5; + System.out.println(player); + if(player < 10) f=5; + else if(player < 20 && player > 10) f = 4; + else if(player < 30 && player > 20) f = 3; + else if(player < 40 && player > 30) f = 2; + else if(player < 50 && player > 40) f = 1; + else f=1; + + GL11.glPushMatrix(); + GL11.glLineWidth(f); + GL11.glBegin(GL11.GL_LINE_STRIP); + { + GL11.glColor3f(1.0F, 0, 0); + GL11.glVertex3d(x, y, z); + GL11.glVertex3d(0, 1, 0); + } + GL11.glEnd(); + GL11.glLineWidth(1); + GL11.glPopMatrix(); + } + } From 7859db2f74fca9f0cf6cc6a23f18e35c756d9044 Mon Sep 17 00:00:00 2001 From: canitzp Date: Sun, 25 Oct 2015 22:22:05 +0100 Subject: [PATCH 3/4] -Deleted Baton --- .../actuallyadditions/items/InitItems.java | 7 - .../items/tools/ItemBatonAA.java | 132 ------------------ 2 files changed, 139 deletions(-) delete mode 100644 src/main/java/ellpeck/actuallyadditions/items/tools/ItemBatonAA.java diff --git a/src/main/java/ellpeck/actuallyadditions/items/InitItems.java b/src/main/java/ellpeck/actuallyadditions/items/InitItems.java index 00ae5bbb1..d50739037 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/InitItems.java +++ b/src/main/java/ellpeck/actuallyadditions/items/InitItems.java @@ -129,9 +129,6 @@ public class InitItems{ public static Item itemLaserWrench; - //canitzp: - public static Item itemBatonWood; - public static void init(){ ModUtil.LOGGER.info("Initializing Items..."); @@ -303,9 +300,5 @@ public class InitItems{ obsidianPaxel = new ItemAllToolAA(InitToolMaterials.toolMaterialObsidian, "obsidian", "obsidianPaxel", EnumRarity.epic); quartzPaxel = new ItemAllToolAA(InitToolMaterials.toolMaterialQuartz, "gemQuartzBlack", "quartzPaxel", EnumRarity.rare); ItemUtil.registerItems(new Item[]{woodenPaxel, stonePaxel, ironPaxel, goldPaxel, diamondPaxel, emeraldPaxel, obsidianPaxel, quartzPaxel}); - - //canitzp: - itemBatonWood = new ItemBatonAA(Item.ToolMaterial.WOOD, "plank", "itemBatonWood"); - ItemUtil.register(itemBatonWood); } } diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemBatonAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemBatonAA.java deleted file mode 100644 index 92f590863..000000000 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemBatonAA.java +++ /dev/null @@ -1,132 +0,0 @@ -package ellpeck.actuallyadditions.items.tools; - -import com.google.common.collect.Multimap; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ellpeck.actuallyadditions.util.IActAddItemOrBlock; -import ellpeck.actuallyadditions.util.ModUtil; -import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.attributes.AttributeModifier; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumAction; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import net.minecraftforge.oredict.OreDictionary; - -/** - * @author canitzp - */ - -public class ItemBatonAA extends Item implements IActAddItemOrBlock{ - - private String name; - private String repairItem; - private ToolMaterial material; - - public ItemBatonAA(ToolMaterial material, String repairItem, String name){ - this.material = material; - this.name = name; - this.repairItem = repairItem; - } - - public boolean hitEntity(ItemStack stack, EntityLivingBase livingBase, EntityLivingBase attacker) - { - stack.damageItem(1, attacker); - knockback(livingBase, (EntityPlayer) attacker); - return true; - } - - public boolean onBlockDestroyed(ItemStack p_150894_1_, World p_150894_2_, Block p_150894_3_, int p_150894_4_, int p_150894_5_, int p_150894_6_, EntityLivingBase p_150894_7_) - { - if ((double)p_150894_3_.getBlockHardness(p_150894_2_, p_150894_4_, p_150894_5_, p_150894_6_) != 0.0D) - { - p_150894_1_.damageItem(2, p_150894_7_); - } - - return true; - } - - @SideOnly(Side.CLIENT) - public boolean isFull3D() - { - return true; - } - - public EnumAction getItemUseAction(ItemStack p_77661_1_) - { - return EnumAction.block; - } - - public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) - { - p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_)); - return p_77659_1_; - } - - public int getItemEnchantability() - { - return this.material.getEnchantability(); - } - - @Override - public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack){ - int[] idsStack = OreDictionary.getOreIDs(stack); - for(int id : idsStack){ - if(OreDictionary.getOreName(id).equals(repairItem)){ - return true; - } - } - return false; - } - - public Multimap getItemAttributeModifiers() - { - Multimap multimap = super.getItemAttributeModifiers(); - multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon modifier", 2F + material.getDamageVsEntity(), 0)); - return multimap; - } - - @Override - public String getName() { - return this.name; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconReg){ - this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); - } - - /** - Method from http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/modification-development/1415944-adding-knockback-to-items-mobs - */ - private void knockback(Entity entity, EntityPlayer player){ - double d = entity.posX - player.posX + material.getEfficiencyOnProperMaterial(); - double d1; - for(d1 = entity.posZ - player.posZ; d * d + d1 * d1 < 0.0001D; d1 = (Math.random() - Math.random()) * 0.01D) - { - d = (Math.random() - Math.random()) * 0.01D; - } - - entity.isAirBorne = true; - float f = MathHelper.sqrt_double(d * d + d1 * d1); - float f1 = 0.4F; - entity.motionX /= 2D; - entity.motionY /= 2D; - entity.motionZ /= 2D; - entity.motionX += (d / (double)f) * (double)f1 * 2; - entity.motionY += 0.40000000596046448D; - entity.motionZ += (d1 / (double)f) * (double)f1 * 2; - if(entity.motionY > 0.40000000596046448D) - { - entity.motionY = 0.40000000596046448D; - } - } - -} From 13faae85d40e49742ef39e4c2c0bff34e05e9f2b Mon Sep 17 00:00:00 2001 From: canitzp Date: Sun, 25 Oct 2015 23:01:14 +0100 Subject: [PATCH 4/4] -Colors for the Laser --- .../blocks/render/ModelLaserRelay.java | 2 +- .../blocks/render/RenderLaserRelay.java | 3 +- .../tile/TileEntityLaserRelay.java | 52 ++++++++++++++----- 3 files changed, 42 insertions(+), 15 deletions(-) diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/render/ModelLaserRelay.java b/src/main/java/ellpeck/actuallyadditions/blocks/render/ModelLaserRelay.java index ca660758c..ac9b60b27 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/render/ModelLaserRelay.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/render/ModelLaserRelay.java @@ -194,7 +194,7 @@ public class ModelLaserRelay extends ModelBaseAA{ for(LaserRelayConnectionHandler.ConnectionPair aPair : network){ TileEntityLaserRelay firstRelay = (TileEntityLaserRelay) aPair.firstRelay.getTileEntity(); if(aPair.contains(firstWP) && aPair.firstRelay.isEqual(firstWP)){ - firstRelay.firstDraw(aPair.firstRelay, aPair.secondRelay); + firstRelay.drawLine(aPair.firstRelay, aPair.secondRelay); } } } diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/render/RenderLaserRelay.java b/src/main/java/ellpeck/actuallyadditions/blocks/render/RenderLaserRelay.java index 2aa680065..e65b9524a 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/render/RenderLaserRelay.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/render/RenderLaserRelay.java @@ -54,10 +54,9 @@ public class RenderLaserRelay extends RenderTileEntity{ } theModel.render(0.0625F); + //A Random texture, so it is a smooth Laser! bindTexture(new ResourceLocation("actuallyadditions:textures/blocks/blockBreaker.png")); theModel.renderExtra(0.0625F, tile); - bindTexture(resLoc); - GL11.glPopMatrix(); } diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLaserRelay.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLaserRelay.java index 3bc956f4b..ff0910afe 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLaserRelay.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLaserRelay.java @@ -18,7 +18,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; import org.lwjgl.opengl.GL11; @@ -26,6 +25,7 @@ import java.util.ArrayList; public class TileEntityLaserRelay extends TileEntityBase implements IEnergyReceiver{ + private GLColor laserColor = GLColor.RED_PURE; @Override public void invalidate(){ @@ -101,25 +101,23 @@ public class TileEntityLaserRelay extends TileEntityBase implements IEnergyRecei return true; } - public void firstDraw(WorldPos firstPos, WorldPos secondPos){ + public void drawLine(WorldPos firstPos, WorldPos secondPos){ double x = firstPos.getX() - secondPos.getX(); double y = firstPos.getY() - secondPos.getY() + 1; double z = -(firstPos.getZ() - secondPos.getZ()); - double player = Minecraft.getMinecraft().thePlayer.posY-firstPos.getY(); - float f = 5; - System.out.println(player); - if(player < 10) f=5; - else if(player < 20 && player > 10) f = 4; - else if(player < 30 && player > 20) f = 3; - else if(player < 40 && player > 30) f = 2; - else if(player < 50 && player > 40) f = 1; + double relativePlayerBlockLocation = Minecraft.getMinecraft().thePlayer.posY - firstPos.getY(); + float f; + if(relativePlayerBlockLocation < 10) f=5; + else if(relativePlayerBlockLocation < 20 && relativePlayerBlockLocation > 10) f = 4; + else if(relativePlayerBlockLocation < 30 && relativePlayerBlockLocation > 20) f = 3; + else if(relativePlayerBlockLocation < 40 && relativePlayerBlockLocation > 30) f = 2; + else if(relativePlayerBlockLocation < 50 && relativePlayerBlockLocation > 40) f = 1; else f=1; - GL11.glPushMatrix(); GL11.glLineWidth(f); GL11.glBegin(GL11.GL_LINE_STRIP); { - GL11.glColor3f(1.0F, 0, 0); + GL11.glColor3f(this.laserColor.getRed(), this.laserColor.getGreen(), this.laserColor.getBlue()); GL11.glVertex3d(x, y, z); GL11.glVertex3d(0, 1, 0); } @@ -128,4 +126,34 @@ public class TileEntityLaserRelay extends TileEntityBase implements IEnergyRecei GL11.glPopMatrix(); } + public void changeLineColor(GLColor color){this.laserColor = color;} + + + //Colors for the Laser: + public enum GLColor{ + + RED_PURE(1.0F, 0, 0), + GREEN_PURE(0, 1.0F, 0), + BLUE_PURE(0, 0, 1.0F), + DARK_YELLOW(1, 1, 0); + + private float red, green, blue; + GLColor(float red, float green, float blue){ + this.red = red; + this.green = green; + this.blue = blue; + } + + public float getRed() { + return red; + } + + public float getGreen() { + return green; + } + + public float getBlue() { + return blue; + } + } }