Rings of Awesome & Heat Collector!

This commit is contained in:
Ellpeck 2015-03-31 20:37:55 +02:00
parent 09d67f95a4
commit 0d090f1d2c
38 changed files with 549 additions and 87 deletions

View file

@ -17,7 +17,7 @@ buildscript {
apply plugin: 'forge'
version = "1.7.10-0.0.2.3"
version = "1.7.10-0.0.3.2"
group = "ellpeck.actuallyadditions"
archivesBaseName = "ActuallyAdditions"

View file

@ -8,10 +8,6 @@
-Advanced ESD
-Has a Filter
-Heat Collector
-Powers Furnaces when next to them
-Needs Warmth Sources around it
-Instant Teleport Device
-Teleports Players to where they look (Much like the Bukkit Compass)
@ -50,9 +46,6 @@
-Cobblestone and Stone Signs
-Potion Rings
-Give certain Potion Effects when held
-Binoculars
-Allow you to see farther and closer
-With Night Vision Addon

View file

@ -0,0 +1,97 @@
package ellpeck.actuallyadditions.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.tile.TileEntityHeatCollector;
import ellpeck.actuallyadditions.util.IName;
import ellpeck.actuallyadditions.util.ItemUtil;
import ellpeck.actuallyadditions.util.KeyUtil;
import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import java.util.List;
public class BlockHeatCollector extends BlockContainerBase implements IName{
private IIcon topIcon;
private IIcon bottomIcon;
public BlockHeatCollector(){
super(Material.rock);
this.setHarvestLevel("pickaxe", 0);
this.setHardness(1.0F);
this.setStepSound(soundTypeStone);
}
@Override
public TileEntity createNewTileEntity(World world, int par2){
return new TileEntityHeatCollector();
}
@Override
public IIcon getIcon(int side, int metadata){
return side == 1 ? this.topIcon : (side == 0 ? this.bottomIcon : this.blockIcon);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Side");
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top");
this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Bottom");
}
@Override
public String getName(){
return "blockHeatCollector";
}
public static class TheItemBlock extends ItemBlock{
private Block theBlock;
public TheItemBlock(Block block){
super(block);
this.theBlock = block;
this.setHasSubtypes(false);
this.setMaxDamage(0);
}
@Override
public EnumRarity getRarity(ItemStack stack){
return EnumRarity.rare;
}
@Override
public String getUnlocalizedName(ItemStack stack){
return this.getUnlocalizedName();
}
@Override
@SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
if(KeyUtil.isShiftPressed()){
for(int i = 0; i < 3; i++){
list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc." + (i + 1)));
}
}
else list.add(ItemUtil.shiftForInfo());
}
@Override
public int getMetadata(int damage){
return damage;
}
}
}

View file

@ -17,6 +17,7 @@ public class InitBlocks{
public static Block blockInputter;
public static Block blockFishingNet;
public static Block blockFurnaceSolar;
public static Block blockHeatCollector;
public static void init(){
Util.logInfo("Initializing Blocks...");
@ -50,5 +51,8 @@ public class InitBlocks{
blockFurnaceSolar = new BlockFurnaceSolar();
BlockUtil.register(blockFurnaceSolar, BlockFurnaceSolar.TheItemBlock.class);
blockHeatCollector = new BlockHeatCollector();
BlockUtil.register(blockHeatCollector, BlockHeatCollector.TheItemBlock.class);
}
}

View file

@ -2,12 +2,14 @@ package ellpeck.actuallyadditions.config;
import ellpeck.actuallyadditions.items.metalists.TheFoods;
import ellpeck.actuallyadditions.items.metalists.TheMiscItems;
import ellpeck.actuallyadditions.items.metalists.ThePotionRings;
import net.minecraftforge.common.config.Configuration;
public class ConfigValues{
public static boolean[] enabledFoodRecipes = new boolean[TheFoods.values().length];
public static boolean[] enabledMiscRecipes = new boolean[TheMiscItems.values().length];
public static boolean[] enablePotionRingRecipes = new boolean[ThePotionRings.values().length];
public static boolean enableCompostRecipe;
public static boolean enableKnifeRecipe;
public static boolean enableCrusherRecipe;
@ -69,6 +71,13 @@ public class ConfigValues{
public static boolean leafBlowerParticles;
public static boolean leafBlowerHasSound;
public static boolean enableSolarRecipe;
public static boolean enableFishingNetRecipe;
public static boolean enableHeatCollectorRecipe;
public static int heatCollectorRandomChance;
public static int heatCollectorBlocksNeeded;
public static void defineConfigValues(Configuration config){
for(int i = 0; i < enabledFoodRecipes.length; i++){
@ -78,6 +87,10 @@ public class ConfigValues{
enabledMiscRecipes[i] = config.getBoolean(TheMiscItems.values()[i].name, ConfigurationHandler.CATEGORY_MISC_CRAFTING, true, "If the Crafting Recipe for " + TheMiscItems.values()[i].name + " is Enabled");
}
for(int i = 0; i < enablePotionRingRecipes.length; i++){
enablePotionRingRecipes[i] = config.getBoolean(ThePotionRings.values()[i].name, ConfigurationHandler.CATEGORY_POTION_RING_CRAFTING, i != ThePotionRings.SATURATION.ordinal(), "If the Crafting Recipe for the Ring of " + ThePotionRings.values()[i].name + " is Enabled");
}
enableLeafBlowerRecipe = config.getBoolean("Leaf Blower", ConfigurationHandler.CATEGORY_ITEMS_CRAFTING, true, "If the Crafting Recipe for the Leaf Blower is Enabled");
enableLeafBlowerAdvancedRecipe = config.getBoolean("Advanced Leaf Blower", ConfigurationHandler.CATEGORY_ITEMS_CRAFTING, true, "If the Crafting Recipe for the Advanced Leaf Blower is Enabled");
leafBlowerDropItems = config.getBoolean("Leaf Blower: Drops Items", ConfigurationHandler.CATEGORY_TOOL_VALUES, true, "If the Leaf Blower lets destroyed Blocks' Drops drop");
@ -110,6 +123,10 @@ public class ConfigValues{
enableFeederRecipe = config.getBoolean("Feeder", ConfigurationHandler.CATEGORY_BLOCKS_CRAFTING, true, "If the Crafting Recipe for the Feeder is Enabled");
enableCrafterRecipe = config.getBoolean("Crafting Table On A Stick", ConfigurationHandler.CATEGORY_ITEMS_CRAFTING, true, "If the Crafting Recipe for the Crafting Table On A Stick is Enabled");
enableSolarRecipe = config.getBoolean("Solar Panel", ConfigurationHandler.CATEGORY_BLOCKS_CRAFTING, true, "If the Crafting Recipe for the Solar Panel is Enabled");
enableFishingNetRecipe = config.getBoolean("Fishing Net", ConfigurationHandler.CATEGORY_BLOCKS_CRAFTING, true, "If the Crafting Recipe for the Fishing Net is Enabled");
enableHeatCollectorRecipe = config.getBoolean("Heat Collector", ConfigurationHandler.CATEGORY_BLOCKS_CRAFTING, true, "If the Crafting Recipe for the Heat Collector is Enabled");
tileEntityCompostAmountNeededToConvert = config.getInt("Compost: Amount Needed To Convert", ConfigurationHandler.CATEGORY_MACHINE_VALUES, 10, 1, 64, "How many items are needed in the Compost to convert to Fertilizer");
tileEntityCompostConversionTimeNeeded = config.getInt("Compost: Conversion Time Needed", ConfigurationHandler.CATEGORY_MACHINE_VALUES, 1000, 30, 10000, "How long the Compost needs to convert to Fertilizer");
@ -138,5 +155,8 @@ public class ConfigValues{
grinderCrushTime = config.getInt("Crusher: Crush Time", ConfigurationHandler.CATEGORY_MACHINE_VALUES, 200, 10, 1000, "How long the Crusher takes to crush an item");
grinderDoubleCrushTime = config.getInt("Double Crusher: Crush Time", ConfigurationHandler.CATEGORY_MACHINE_VALUES, 300, 10, 1000, "How long the Double Crusher takes to crush an item");
furnaceDoubleSmeltTime = config.getInt("Double Furnace: Smelt Time", ConfigurationHandler.CATEGORY_MACHINE_VALUES, 300, 10, 1000, "How long the Double Furnace takes to crush an item");
heatCollectorBlocksNeeded = config.getInt("Heat Collector: Blocks Needed", ConfigurationHandler.CATEGORY_MACHINE_VALUES, 4, 1, 5, "How many Blocks are needed for the Heat Collector to power Machines above it");
heatCollectorRandomChance = config.getInt("Heat Collector: Random Chance", ConfigurationHandler.CATEGORY_MACHINE_VALUES, 2000, 10, 100000, "The Chance of the Heat Collector destroying a Lava Block around (Default Value 2000 meaning a 1/2000 Chance!)");
}
}

View file

@ -15,6 +15,7 @@ public class ConfigurationHandler{
public static final String CATEGORY_MACHINE_VALUES = "machine values";
public static final String CATEGORY_MOB_DROPS = "mob drops";
public static final String CATEGORY_WORLD_GEN = "world gen";
public static final String CATEGORY_POTION_RING_CRAFTING = "ring crafting";
public static void init(File configFile){

View file

@ -28,10 +28,28 @@ public class BlockCrafting{
'Q', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()));
//Fishing Net
GameRegistry.addRecipe(new ItemStack(InitBlocks.blockFishingNet),
"SSS", "SDS", "SSS",
'D', new ItemStack(Items.diamond),
'S', new ItemStack(Items.string));
if(ConfigValues.enableFishingNetRecipe)
GameRegistry.addRecipe(new ItemStack(InitBlocks.blockFishingNet),
"SSS", "SDS", "SSS",
'D', new ItemStack(Items.diamond),
'S', new ItemStack(Items.string));
//Solar Panel
if(ConfigValues.enableSolarRecipe)
GameRegistry.addRecipe(new ItemStack(InitBlocks.blockFurnaceSolar),
"IBI", "BDB", "IBI",
'D', new ItemStack(Blocks.diamond_block),
'I', new ItemStack(Items.iron_ingot),
'B', new ItemStack(Blocks.iron_bars));
//Heat Collector
if(ConfigValues.enableHeatCollectorRecipe)
GameRegistry.addRecipe(new ItemStack(InitBlocks.blockHeatCollector),
"BRB", "LDL", "BRB",
'D', new ItemStack(Blocks.diamond_block),
'R', new ItemStack(Items.repeater),
'L', new ItemStack(Items.lava_bucket),
'B', new ItemStack(Blocks.iron_bars));
//Quartz Pillar
GameRegistry.addRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ_PILLAR.ordinal()),

View file

@ -7,6 +7,7 @@ import ellpeck.actuallyadditions.config.ConfigValues;
import ellpeck.actuallyadditions.items.InitItems;
import ellpeck.actuallyadditions.items.metalists.TheDusts;
import ellpeck.actuallyadditions.items.metalists.TheMiscItems;
import ellpeck.actuallyadditions.items.metalists.ThePotionRings;
import ellpeck.actuallyadditions.items.metalists.TheSpecialDrops;
import ellpeck.actuallyadditions.util.Util;
import net.minecraft.init.Blocks;
@ -69,6 +70,9 @@ public class ItemCrafting{
if(ConfigValues.enabledMiscRecipes[TheMiscItems.MASHED_FOOD.ordinal()])
initMashedFoodRecipes();
//Rings
initPotionRingRecipes();
//Ingots from Dusts
GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.IRON.ordinal()),
new ItemStack(Items.iron_ingot), 1F);
@ -89,6 +93,22 @@ public class ItemCrafting{
}
public static void initPotionRingRecipes(){
GameRegistry.addRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RING.ordinal()),
"IGI", "GDG", "IGI",
'G', new ItemStack(Items.gold_ingot),
'I', new ItemStack(Items.iron_ingot),
'D', new ItemStack(Items.glowstone_dust));
for(int i = 0; i < ThePotionRings.values().length; i++){
if(ConfigValues.enablePotionRingRecipes[i]){
ItemStack mainStack = ThePotionRings.values()[i].craftingItem;
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemPotionRing, 1, i), mainStack, mainStack, mainStack, mainStack, new ItemStack(Blocks.diamond_block), new ItemStack(Items.nether_wart), new ItemStack(Items.potionitem), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RING.ordinal()));
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemPotionRingAdvanced, 1, i), new ItemStack(InitItems.itemPotionRing, 1, i), new ItemStack(Items.nether_star));
}
}
}
public static void initMashedFoodRecipes(){
for(Object nextIterator : Item.itemRegistry){
if(nextIterator instanceof ItemFood){

View file

@ -32,6 +32,7 @@ public class CreativeTab extends CreativeTabs{
this.addBlock(InitBlocks.blockFurnaceDouble);
this.addBlock(InitBlocks.blockFurnaceSolar);
this.addBlock(InitBlocks.blockFishingNet);
this.addBlock(InitBlocks.blockHeatCollector);
this.addBlock(InitBlocks.blockMisc);
this.addBlock(InitBlocks.blockFeeder);
@ -59,6 +60,9 @@ public class CreativeTab extends CreativeTabs{
this.addItem(InitItems.itemAxeObsidian);
this.addItem(InitItems.itemShovelObsidian);
this.addItem(InitItems.itemHoeObsidian);
this.addItem(InitItems.itemPotionRing);
this.addItem(InitItems.itemPotionRingAdvanced);
}
@Override

View file

@ -1,7 +1,7 @@
package ellpeck.actuallyadditions.event;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import ellpeck.actuallyadditions.blocks.render.ModelFurnaceSolar;
import ellpeck.actuallyadditions.gadget.ModelStandardBlock;
import ellpeck.actuallyadditions.gadget.ModelTorch;
import ellpeck.actuallyadditions.gadget.RenderSpecial;
@ -11,35 +11,36 @@ import java.util.UUID;
public class RenderPlayerEventAA{
private RenderSpecial ellpeckRender = new RenderSpecial(new ModelStandardBlock("ESD"));
private RenderSpecial ellpeckRender = new RenderSpecial(new ModelStandardBlock("Ellpeck"));
private RenderSpecial hoseRender = new RenderSpecial(new ModelTorch());
private RenderSpecial paktoRender = new RenderSpecial(new ModelStandardBlock("Derp"));
private RenderSpecial glenRender = new RenderSpecial(new ModelFurnaceSolar());
private RenderSpecial paktoRender = new RenderSpecial(new ModelStandardBlock("Pakto"));
private RenderSpecial glenRender = new RenderSpecial(new ModelStandardBlock("Glenthor"));
@SubscribeEvent
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void RenderPlayerEvent(RenderPlayerEvent.Pre event){
//Ellpeck
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("3f9f4a94-95e3-40fe-8895-e8e3e84d1468"))){
ellpeckRender.render(0.3F, 1F);
return;
}
if(!event.entityPlayer.isInvisible()){
//Ellpeck
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("3f9f4a94-95e3-40fe-8895-e8e3e84d1468"))){
ellpeckRender.render(event.entityPlayer, event.partialRenderTick, 0.3F, 1F);
return;
}
//Paktosan
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("0bac71ad-9156-487e-9ade-9c5b57274b23"))){
paktoRender.render(0.3F, 1F);
return;
}
//Paktosan
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("0bac71ad-9156-487e-9ade-9c5b57274b23"))){
paktoRender.render(event.entityPlayer, event.partialRenderTick, 0.3F, 1F);
return;
}
//TwoOfEight
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("a57d2829-9711-4552-a7de-ee800802f643"))){
glenRender.render(0.3F, 1F);
return;
}
//TwoOfEight
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("a57d2829-9711-4552-a7de-ee800802f643"))){
glenRender.render(event.entityPlayer, event.partialRenderTick, 0.3F, 1F);
return;
}
//dqmhose
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("cb7b293a-5031-484e-b5be-b4f2f4e92726"))){
hoseRender.render(0.5F, 1.25F);
//dqmhose
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("cb7b293a-5031-484e-b5be-b4f2f4e92726"))){
hoseRender.render(event.entityPlayer, event.partialRenderTick, 0.5F, 1.25F);
}
}
}
}

View file

@ -22,6 +22,6 @@ public class ModelTorch extends ModelBaseAA{
@Override
public String getName(){
return "modelTorch";
return "modelHose";
}
}

View file

@ -1,42 +1,55 @@
package ellpeck.actuallyadditions.gadget;
import ellpeck.actuallyadditions.blocks.render.ModelBaseAA;
import ellpeck.actuallyadditions.blocks.render.ModelFurnaceSolar;
import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Vec3;
import org.lwjgl.opengl.GL11;
public class RenderSpecial{
private double bobbing;
private double rotation;
private double lastTimeForBobbing;
ModelBaseAA theModel;
ResourceLocation theTexture;
public RenderSpecial(ModelBaseAA model){
this.theModel = model;
this.theTexture = new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/blocks/models/" + (model instanceof ModelFurnaceSolar ? "" : "special/") + this.theModel.getName() + ".png");
this.theTexture = new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/blocks/models/special/" + this.theModel.getName() + ".png");
}
public void render(float size, float offsetUp){
public void render(EntityPlayer player, float renderTick, float size, float offsetUp){
int bobHeight = 70;
double rotationModifier = 3;
if(bobbing >= 0.5) bobbing = 0;
else bobbing+=0.01;
if(rotation >= 360) rotation = 0;
else rotation+=1;
long time = player.worldObj.getTotalWorldTime();
if(time-bobHeight >= lastTimeForBobbing){
this.lastTimeForBobbing = time;
}
GL11.glPushMatrix();
GL11.glTranslatef(0F, offsetUp, 0F);
if(player != Minecraft.getMinecraft().thePlayer){
Vec3 clientPos = Minecraft.getMinecraft().thePlayer.getPosition(renderTick);
Vec3 playerPos = player.getPosition(renderTick);
GL11.glTranslated(playerPos.xCoord-clientPos.xCoord, playerPos.yCoord-clientPos.yCoord+1.6225, playerPos.zCoord-clientPos.zCoord);
}
GL11.glTranslated(0F, offsetUp+0.15D, 0F);
GL11.glRotatef(180F, 1.0F, 0.0F, 1.0F);
GL11.glScalef(size, size, size);
if(bobbing <= 0.25)GL11.glTranslated(0, bobbing, 0);
else GL11.glTranslated(0, 0.5 - bobbing, 0);
if(!(time-(bobHeight/2) < lastTimeForBobbing)){
GL11.glTranslated(0, ((double)time-this.lastTimeForBobbing)/100, 0);
}
else{
GL11.glTranslated(0, -((double)time-lastTimeForBobbing)/100+(double)bobHeight/100, 0);
}
GL11.glRotated(rotation, 0, 1, 0);
GL11.glRotated(time * rotationModifier, 0, 1, 0);
Minecraft.getMinecraft().renderEngine.bindTexture(theTexture);
theModel.render(0.0625F);

View file

@ -22,6 +22,9 @@ public class InitItems{
public static Item itemLeafBlower;
public static Item itemLeafBlowerAdvanced;
public static Item itemPotionRing;
public static Item itemPotionRingAdvanced;
public static Item itemPickaxeEmerald;
public static Item itemAxeEmerald;
public static Item itemShovelEmerald;
@ -64,6 +67,12 @@ public class InitItems{
itemLeafBlowerAdvanced = new ItemLeafBlower(true);
ItemUtil.register(itemLeafBlowerAdvanced);
itemPotionRing = new ItemPotionRing(false);
ItemUtil.register(itemPotionRing);
itemPotionRingAdvanced = new ItemPotionRing(true);
ItemUtil.register(itemPotionRingAdvanced);
itemPickaxeEmerald = new ItemPickaxeAA(InitItemMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemPickaxeEmerald", EnumRarity.rare);
itemAxeEmerald = new ItemAxeAA(InitItemMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemAxeEmerald", EnumRarity.rare);
itemShovelEmerald = new ItemShovelAA(InitItemMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemShovelEmerald", EnumRarity.rare);

View file

@ -0,0 +1,121 @@
package ellpeck.actuallyadditions.items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.items.metalists.ThePotionRings;
import ellpeck.actuallyadditions.util.*;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import java.util.List;
public class ItemPotionRing extends Item implements IName{
public static final ThePotionRings[] allRings = ThePotionRings.values();
private boolean isAdvanced;
public ItemPotionRing(boolean isAdvanced){
this.setHasSubtypes(true);
this.setMaxStackSize(1);
this.isAdvanced = isAdvanced;
}
@Override
@SuppressWarnings("unchecked")
public void onUpdate(ItemStack stack, World world, Entity player, int par4, boolean par5){
super.onUpdate(stack, world, player, par4, par5);
if(player instanceof EntityPlayer){
EntityPlayer thePlayer = (EntityPlayer)player;
ItemStack equippedStack = ((EntityPlayer)player).getCurrentEquippedItem();
ThePotionRings effect = ThePotionRings.values()[stack.getItemDamage()];
if(!effect.needsWaitBeforeActivating || !thePlayer.isPotionActive(effect.effectID)){
if(!((ItemPotionRing)stack.getItem()).isAdvanced){
if(equippedStack != null && stack.isItemEqual(equippedStack)){
thePlayer.addPotionEffect(new PotionEffect(effect.effectID, effect.activeTime, effect.normalAmplifier, true));
}
}
else thePlayer.addPotionEffect(new PotionEffect(effect.effectID, effect.activeTime, effect.advancedAmplifier, true));
}
}
}
@Override
public String getName(){
return this.isAdvanced ? "itemPotionRingAdvanced" : "itemPotionRing";
}
@Override
public int getMetadata(int damage){
return damage;
}
@Override
public EnumRarity getRarity(ItemStack stack){
return allRings[stack.getItemDamage()].rarity;
}
@SuppressWarnings("all")
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tab, List list){
for(int j = 0; j < allRings.length; j++){
list.add(new ItemStack(this, 1, j));
}
}
@Override
public String getUnlocalizedName(ItemStack stack){
return this.getUnlocalizedName() + allRings[stack.getItemDamage()].name;
}
@Override
@SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){
if(KeyUtil.isShiftPressed()){
list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + ".desc.1"));
list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + ".desc.2"));
if(stack.getItemDamage() == ThePotionRings.SATURATION.ordinal()){
list.add(StringUtil.RED + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".itemPotionRing.desc.off.1"));
list.add(StringUtil.RED + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".itemPotionRing.desc.off.2"));
}
}
else list.add(ItemUtil.shiftForInfo());
}
@Override
public IIcon getIcon(ItemStack stack, int pass){
return this.itemIcon;
}
@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack stack, int pass){
return allRings[stack.getItemDamage()].color;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){
this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
}
@Override
public String getItemStackDisplayName(ItemStack stack){
String standardName = StatCollector.translateToLocal(this.getUnlocalizedName() + ".name");
String name = allRings[stack.getItemDamage()].getName();
String effect = StatCollector.translateToLocal("effect." + ModUtil.MOD_ID_LOWER + "." + name.substring(0, 1).toLowerCase() + name.substring(1) + ".name");
return standardName + " " + effect;
}
}

View file

@ -10,7 +10,8 @@ public enum TheMiscItems implements IName{
KNIFE_BLADE("KnifeBlade", EnumRarity.common),
KNIFE_HANDLE("KnifeHandle", EnumRarity.common),
DOUGH("Dough", EnumRarity.common),
QUARTZ("BlackQuartz", EnumRarity.epic);
QUARTZ("BlackQuartz", EnumRarity.epic),
RING("Ring", EnumRarity.uncommon);
public final String name;
public final EnumRarity rarity;

View file

@ -0,0 +1,61 @@
package ellpeck.actuallyadditions.items.metalists;
import ellpeck.actuallyadditions.util.IName;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
public enum ThePotionRings implements IName{
SPEED("Speed", 8171462, 1, 0, 3, 10, false, EnumRarity.uncommon, new ItemStack(Items.sugar)),
//TODO Slowness
HASTE("Haste", 14270531, 3, 0, 3, 10, false, EnumRarity.epic, new ItemStack(Items.repeater)),
//TODO Mining Fatigue
STRENGTH("Strength", 9643043, 5, 0, 3, 10, false, EnumRarity.rare, new ItemStack(Items.blaze_powder)),
//Health (Not Happening)
//TODO Damage
JUMP_BOOST("JumpBoost", 7889559, 8, 0, 3, 10, false, EnumRarity.rare, new ItemStack(Blocks.piston)),
//TODO Nausea
REGEN("Regen", 13458603, 10, 0, 3, 50, true, EnumRarity.rare, new ItemStack(Items.ghast_tear)),
RESISTANCE("Resistance", 10044730, 11, 0, 3, 10, false, EnumRarity.epic, new ItemStack(Items.slime_ball)),
FIRE_RESISTANCE("FireResistance", 14981690, 12, 0, 0, 10, false, EnumRarity.uncommon, new ItemStack(Items.magma_cream)),
WATER_BREATHING("WaterBreathing", 3035801, 13, 0, 0, 10, false, EnumRarity.rare, new ItemStack(Items.fish, 1, 3)),
INVISIBILITY("Invisibility", 8356754, 14, 0, 0, 10, false, EnumRarity.epic, new ItemStack(Items.fermented_spider_eye)),
//TODO Blindness
NIGHT_VISION("NightVision", 2039713, 16, 0, 0, 300, false, EnumRarity.rare, new ItemStack(Items.golden_carrot)),
//TODO Hunger
//TODO Weakness
//TODO Poison
//TODO Withering
//Health Boost (Not Happening)
//Absorption (Not Happening)
SATURATION("Saturation", 16262179, 23, 0, 3, 10, false, EnumRarity.epic, new ItemStack(Items.cooked_beef));
public final String name;
public final int color;
public final EnumRarity rarity;
public final int effectID;
public final int normalAmplifier;
public final int advancedAmplifier;
public final int activeTime;
public final boolean needsWaitBeforeActivating;
public final ItemStack craftingItem;
ThePotionRings(String name, int color, int effectID, int normalAmplifier, int advancedAmplifier, int activeTime, boolean needsWaitBeforeActivating, EnumRarity rarity, ItemStack craftingItem){
this.name = name;
this.color = color;
this.rarity = rarity;
this.effectID = effectID;
this.normalAmplifier = normalAmplifier;
this.advancedAmplifier = advancedAmplifier;
this.activeTime = activeTime;
this.needsWaitBeforeActivating = needsWaitBeforeActivating;
this.craftingItem = craftingItem;
}
@Override
public String getName(){
return this.name;
}
}

View file

@ -37,6 +37,7 @@ public class TileEntityBase extends TileEntity{
GameRegistry.registerTileEntity(TileEntityInputter.class, ModUtil.MOD_ID_LOWER + ":tileEntityInputter");
GameRegistry.registerTileEntity(TileEntityFishingNet.class, ModUtil.MOD_ID_LOWER + ":tileEntityFishingNet");
GameRegistry.registerTileEntity(TileEntityFurnaceSolar.class, ModUtil.MOD_ID_LOWER + ":tileEntityFurnaceSolar");
GameRegistry.registerTileEntity(TileEntityHeatCollector.class, ModUtil.MOD_ID_LOWER + ":tileEntityHeatCollector");
}
@Override

View file

@ -12,38 +12,42 @@ public class TileEntityFurnaceSolar extends TileEntityBase{
if(worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord) && worldObj.isDaytime()){
TileEntity tileBelow = TileEntityInputter.getTileEntityFromSide(1, worldObj, xCoord, yCoord, zCoord);
if(tileBelow instanceof TileEntityFurnace){
TileEntityFurnace furnaceBelow = (TileEntityFurnace)tileBelow;
int burnTimeBefore = furnaceBelow.furnaceBurnTime;
furnaceBelow.furnaceBurnTime = 42;
furnaceBelow.currentItemBurnTime = 42;
if(burnTimeBefore == 0){
BlockFurnace.updateFurnaceBlockState(true, this.worldObj, furnaceBelow.xCoord, furnaceBelow.yCoord, furnaceBelow.zCoord);
}
return;
}
givePowerTo(tileBelow);
}
}
}
if(tileBelow instanceof TileEntityFurnaceDouble){
TileEntityFurnaceDouble doubleBelow = (TileEntityFurnaceDouble)tileBelow;
int coalTimeBefore = doubleBelow.coalTime;
doubleBelow.coalTime = 42;
doubleBelow.coalTimeLeft = 42;
if(coalTimeBefore == 0){
int metaBefore = worldObj.getBlockMetadata(doubleBelow.xCoord, doubleBelow.yCoord, doubleBelow.zCoord);
worldObj.setBlockMetadataWithNotify(doubleBelow.xCoord, doubleBelow.yCoord, doubleBelow.zCoord, metaBefore+4, 2);
}
return;
}
public static void givePowerTo(TileEntity tile){
if(tile instanceof TileEntityFurnace){
TileEntityFurnace furnaceBelow = (TileEntityFurnace)tile;
int burnTimeBefore = furnaceBelow.furnaceBurnTime;
furnaceBelow.furnaceBurnTime = 42;
furnaceBelow.currentItemBurnTime = 42;
if(burnTimeBefore == 0){
BlockFurnace.updateFurnaceBlockState(true, tile.getWorldObj(), furnaceBelow.xCoord, furnaceBelow.yCoord, furnaceBelow.zCoord);
}
return;
}
if(tileBelow instanceof TileEntityGrinder){
TileEntityGrinder grinderBelow = (TileEntityGrinder)tileBelow;
int coalTimeBefore = grinderBelow.coalTime;
grinderBelow.coalTime = 42;
grinderBelow.coalTimeLeft = 42;
if(coalTimeBefore == 0){
worldObj.setBlockMetadataWithNotify(grinderBelow.xCoord, grinderBelow.yCoord, grinderBelow.zCoord, 1, 2);
}
}
if(tile instanceof TileEntityFurnaceDouble){
TileEntityFurnaceDouble doubleBelow = (TileEntityFurnaceDouble)tile;
int coalTimeBefore = doubleBelow.coalTime;
doubleBelow.coalTime = 42;
doubleBelow.coalTimeLeft = 42;
if(coalTimeBefore == 0){
int metaBefore = tile.getWorldObj().getBlockMetadata(doubleBelow.xCoord, doubleBelow.yCoord, doubleBelow.zCoord);
tile.getWorldObj().setBlockMetadataWithNotify(doubleBelow.xCoord, doubleBelow.yCoord, doubleBelow.zCoord, metaBefore+4, 2);
}
return;
}
if(tile instanceof TileEntityGrinder){
TileEntityGrinder grinderBelow = (TileEntityGrinder)tile;
int coalTimeBefore = grinderBelow.coalTime;
grinderBelow.coalTime = 42;
grinderBelow.coalTimeLeft = 42;
if(coalTimeBefore == 0){
tile.getWorldObj().setBlockMetadataWithNotify(grinderBelow.xCoord, grinderBelow.yCoord, grinderBelow.zCoord, 1, 2);
}
}
}

View file

@ -0,0 +1,65 @@
package ellpeck.actuallyadditions.tile;
import ellpeck.actuallyadditions.config.ConfigValues;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World;
import java.util.ArrayList;
import java.util.Random;
public class TileEntityHeatCollector extends TileEntityBase{
private int randomChance = ConfigValues.heatCollectorRandomChance;
private int blocksNeeded = ConfigValues.heatCollectorBlocksNeeded;
@Override
public void updateEntity(){
if(!worldObj.isRemote){
ArrayList<Integer> blocksAround = new ArrayList<Integer>();
for(int i = 1; i <= 5; i++){
ChunkCoordinates coords = getBlockFromSide(i, xCoord, yCoord, zCoord);
if(coords != null){
Block block = worldObj.getBlock(coords.posX, coords.posY, coords.posZ);
if(block != null && block.getMaterial() == Material.lava && worldObj.getBlockMetadata(coords.posX, coords.posY, coords.posZ) == 0){
blocksAround.add(i);
}
}
}
if(blocksAround.size() >= blocksNeeded){
TileEntity tileAbove = TileEntityInputter.getTileEntityFromSide(0, worldObj, xCoord, yCoord, zCoord);
TileEntityFurnaceSolar.givePowerTo(tileAbove);
Random rand = new Random();
if(rand.nextInt(randomChance) == 0){
int randomSide = blocksAround.get(rand.nextInt(blocksAround.size()));
breakBlockAtSide(randomSide, worldObj, xCoord, yCoord, zCoord);
}
}
}
}
public static ChunkCoordinates getBlockFromSide(int side, int x, int y, int z){
if(side == 0) return new ChunkCoordinates(x, y + 1, z);
if(side == 1) return new ChunkCoordinates(x, y - 1, z);
if(side == 2) return new ChunkCoordinates(x, y, z - 1);
if(side == 3) return new ChunkCoordinates(x - 1, y, z);
if(side == 4) return new ChunkCoordinates(x, y, z + 1);
if(side == 5) return new ChunkCoordinates(x + 1, y, z);
else return null;
}
public static void breakBlockAtSide(int side, World world, int x, int y, int z){
if(side == 0) world.setBlockToAir(x, y + 1, z);
if(side == 1) world.setBlockToAir(x, y - 1, z);
if(side == 2) world.setBlockToAir(x, y, z - 1);
if(side == 3) world.setBlockToAir(x - 1, y, z);
if(side == 4) world.setBlockToAir(x, y, z + 1);
if(side == 5) world.setBlockToAir(x + 1, y, z);
}
}

View file

@ -5,7 +5,7 @@ import org.apache.logging.log4j.Logger;
public class ModUtil{
public static final String VERSION = "1.7.10-0.0.2.3";
public static final String VERSION = "1.7.10-0.0.3.2";
public static final String MOD_ID = "ActuallyAdditions";
public static final String NAME = "Actually Additions";

View file

@ -15,7 +15,7 @@ public class Util{
}
public static void registerEvent(Object o){
FMLCommonHandler.instance().bus().register(o);
MinecraftForge.EVENT_BUS.register(o);
FMLCommonHandler.instance().bus().register(o);
}
}

View file

@ -13,6 +13,7 @@ tile.actuallyadditions.blockGrinderDouble.name=Double Crusher
tile.actuallyadditions.blockFurnaceDouble.name=Double Furnace
tile.actuallyadditions.blockFishingNet.name=Fishing Net
tile.actuallyadditions.blockFurnaceSolar.name=Solar Panel
tile.actuallyadditions.blockHeatCollector.name=Heat Collector
tile.actuallyadditions.blockInputter.name=ESD
tile.actuallyadditions.blockInputter.add.0.name=Ellpeck's Slot Device
@ -36,6 +37,7 @@ item.actuallyadditions.itemMiscPaperCone.name=Paper Cone
item.actuallyadditions.itemMiscKnifeBlade.name=Knife Blade
item.actuallyadditions.itemMiscKnifeHandle.name=Knife Handle
item.actuallyadditions.itemMiscBlackQuartz.name=Black Quartz
item.actuallyadditions.itemMiscRing.name=Ring
item.actuallyadditions.itemLeafBlower.name=Leaf Blower
item.actuallyadditions.itemLeafBlowerAdvanced.name=Advanced Leaf Blower
@ -69,6 +71,9 @@ item.actuallyadditions.itemFoodCarrotJuice.name=Carrot Juice
item.actuallyadditions.itemFoodPumpkinStew.name=Pumpkin Stew
item.actuallyadditions.itemFoodCheese.name=Cheese
item.actuallyadditions.itemPotionRing.name=Ring of
item.actuallyadditions.itemPotionRingAdvanced.name=Advanced Ring of
item.actuallyadditions.itemSpecialUnknownSubstance.name=Unknown Substance
item.actuallyadditions.itemSpecialSolidifiedExperience.name=Solidified Experience
item.actuallyadditions.itemSpecialBloodFragment.name=Blood Fragment
@ -113,6 +118,9 @@ tooltip.actuallyadditions.blockInputter.desc.4=-Side to Output to and Input from
tooltip.actuallyadditions.blockInputter.desc.5=-Slot in the other Inventory to Output to and Input from
tooltip.actuallyadditions.blockFishingNet.desc=Catches Fish automatically when placed above Water
tooltip.actuallyadditions.blockFurnaceSolar.desc=Powers Furnaces and Crushers below it in Daylight
tooltip.actuallyadditions.blockHeatCollector.desc.1=Powers Furnaces and Crushers above it
tooltip.actuallyadditions.blockHeatCollector.desc.2=Needs a bunch of Lava around it
tooltip.actuallyadditions.blockHeatCollector.desc.3=Occasionally steals the Lava. Watch out!
tooltip.actuallyadditions.itemMiscMashedFood.desc=Used to make Fertilizer
tooltip.actuallyadditions.itemFertilizer.desc=Om nom nom. Don't eat it. Made in a Compost.
@ -121,6 +129,15 @@ tooltip.actuallyadditions.itemMiscPaperCone.desc=Used to store foodstuffs!
tooltip.actuallyadditions.itemMiscKnifeBlade.desc=Sharp like a tooth! A whale's tooth!
tooltip.actuallyadditions.itemMiscKnifeHandle.desc=Fits comfortably in your hand.
tooltip.actuallyadditions.itemMiscBlackQuartz.desc=Used in the Quartz Enchanter!
tooltip.actuallyadditions.itemMiscRing.desc=Used for crafting Effect Rings
tooltip.actuallyadditions.itemPotionRing.desc.1=Gives Potion Effect of Level 1
tooltip.actuallyadditions.itemPotionRing.desc.2=Needs to be held in Hand
tooltip.actuallyadditions.itemPotionRing.desc.off.1=Crafting Recipe of this particular Potion Effect is turned OFF by default
tooltip.actuallyadditions.itemPotionRing.desc.off.2=as it is extremely overpowered! Turn it on in the Config File if needed.
tooltip.actuallyadditions.itemPotionRingAdvanced.desc.1=Gives Potion Effect of a High Level
tooltip.actuallyadditions.itemPotionRingAdvanced.desc.2=Can be anywhere in the Inventory
tooltip.actuallyadditions.itemLeafBlower.desc.1=Destroys Grass and Flowers around you
tooltip.actuallyadditions.itemLeafBlowerAdvanced.desc.1=Destroys Grass, Flowers and Leaves around you
@ -211,4 +228,16 @@ info.actuallyadditions.gui.west=West
info.actuallyadditions.gui.all=All
info.actuallyadditions.gui.slot=Slot
info.actuallyadditions.gui.put=Put
info.actuallyadditions.gui.pull=Pull
info.actuallyadditions.gui.pull=Pull
effect.actuallyadditions.speed.name=Speed
effect.actuallyadditions.haste.name=Haste
effect.actuallyadditions.strength.name=Strength
effect.actuallyadditions.jumpBoost.name=Jump Boost
effect.actuallyadditions.regen.name=Regeneration
effect.actuallyadditions.resistance.name=Resistance
effect.actuallyadditions.fireResistance.name=Fire Resistance
effect.actuallyadditions.waterBreathing.name=Water Breathing
effect.actuallyadditions.invisibility.name=Invisibility
effect.actuallyadditions.nightVision.name=Night Vision
effect.actuallyadditions.saturation.name=Saturation

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 523 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 718 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 825 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

View file

@ -3,14 +3,14 @@
"modid": "ActuallyAdditions",
"name": "Actually Additions",
"description": "A bunch of random stuff added to your Game to make it even more fun, exciting and add some more variety!",
"version": "0.0.2.3",
"version": "0.0.3.2",
"mcversion": "1.7.10",
"url": "https://github.com/Ellpeck/ActuallyAdditions",
"updateUrl": "",
"authorList": [
"Ellpeck"
],
"credits": "GlenthorLP for all of the awesome Graphics",
"credits": "GlenthorLP for all of the awesome Graphics, xdqmhose for a bunch of Ideas",
"logoFile": "assets/actuallyadditions/textures/logo.png",
"screenshots": [
],