Skip to content

Commit

Permalink
Freezing Doll 추가, 모드 호환성 수정, 버전 1.04
Browse files Browse the repository at this point in the history
  • Loading branch information
LoveHoly committed Sep 10, 2014
1 parent 3f694dc commit 2811e06
Show file tree
Hide file tree
Showing 11 changed files with 146 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ buildscript {

apply plugin: 'forge'

version = "1.03b"
version = "1.04"
group= "exastris"
archivesBaseName = "Ex-Astris"

Expand Down
5 changes: 5 additions & 0 deletions src/main/java/ExAstris/Block/BlockBarrelThaumium.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@ else if(FluidContainerRegistry.isContainer(item))
barrel.setMode(BarrelMode.SPORED);
useItem(player);
}
if(item.getItem() == ExAstrisItem.DollFreezing)
{
barrel.setMode(BarrelMode.BLIZZ_COOKING);
useItem(player);
}

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import exnihilo.registries.helpers.Color;
import exnihilo.registries.helpers.Compostable;
import thaumcraft.common.entities.monster.EntityPech;
import thermalfoundation.entity.monster.EntityBlizz;

public class TileEntityBarrelThaumium extends TileEntity implements IFluidHandler, ISidedInventory{
private static final float MIN_RENDER_CAPACITY = 0.1f;
Expand Down Expand Up @@ -77,7 +78,9 @@ public enum BarrelMode
OBSIDIANTOTEM(20, ExtractMode.Always),
PECK_COOKING(21, ExtractMode.None),
PECK(22, ExtractMode.None),
BEEINFUSED(23, ExtractMode.Always);
BEEINFUSED(23, ExtractMode.Always),
BLIZZ_COOKING(24, ExtractMode.None),
BLIZZ(25, ExtractMode.None);

private BarrelMode(int v, ExtractMode extract){this.value = v; this.canExtract = extract;}
public int value;
Expand Down Expand Up @@ -554,6 +557,69 @@ public void updateEntity()
}
}

break;
case BLIZZ_COOKING:
timer++;

if (worldObj.isRemote && worldObj.rand.nextInt(20) == 0)
{
float f = (worldObj.rand.nextFloat() - 0.5F) * 0.2F;
float f1 = (worldObj.rand.nextFloat() - 0.5F) * 0.2F;
float f2 = (worldObj.rand.nextFloat() - 0.5F) * 0.2F;
this.worldObj.spawnParticle("snowballpoof", xCoord + (double)(worldObj.rand.nextFloat() * 0.6) + 0.2d, yCoord + 1, zCoord + (double)(worldObj.rand.nextFloat() * 0.6) + 0.2d, (double)f, (double)f1, (double)f2);
}

if(isDone())
{
setMode(BarrelMode.BLIZZ);
timer = 0;
}
break;

case BLIZZ:
if (worldObj.isRemote && worldObj.rand.nextInt(5) == 0)
{
//spawn ender particles
float f = (worldObj.rand.nextFloat() - 0.5F) * 0.2F;
float f1 = (worldObj.rand.nextFloat() - 0.5F) * 0.2F;
float f2 = (worldObj.rand.nextFloat() - 0.5F) * 0.2F;
this.worldObj.spawnParticle("snowballpoof", xCoord + (double)(worldObj.rand.nextFloat() * 0.6) + 0.2d, yCoord + 1, zCoord + (double)(worldObj.rand.nextFloat() * 0.6) + 0.2d, (double)f, (double)f1, (double)f2);
}

if (!worldObj.isRemote && worldObj.difficultySetting.getDifficultyId() > 0)
{
if(isDone())
{
timer = 0;
resetBarrel();
break;
}

//Try to spawn enderman, if you can't keep trying.
for (int x = -1; x <= 1; x++)
{
for (int y = -1; y <= 1; y++)
{
for (int z = -1; z <= 1; z++)
{
if (
worldObj.isAirBlock(xCoord + x, yCoord + y, zCoord + z) &&
worldObj.isAirBlock(xCoord + x, yCoord + y + 1, zCoord + z) &&
worldObj.isAirBlock(xCoord + x, yCoord + y + 2, zCoord + z) &&
worldObj.rand.nextInt(10) == 0 && !isDone())
{
timer = MAX_COMPOSTING_TIME;

EntityBlizz blizz = new EntityBlizz(worldObj);
blizz.setPosition(xCoord + x + 0.5d, yCoord + y, zCoord + z + 0.5d);

worldObj.spawnEntityInWorld(blizz);
}
}
}
}
}

break;
default:
break;
Expand Down Expand Up @@ -830,6 +896,13 @@ public void readFromNBT(NBTTagCompound compound)
case 23:
setMode(BarrelMode.BEEINFUSED);
break;
case 24:
setMode(BarrelMode.BLIZZ_COOKING);
break;

case 25:
setMode(BarrelMode.BLIZZ);
break;

}

Expand Down Expand Up @@ -1157,6 +1230,10 @@ public void setInventorySlotContents(int slot, ItemStack stack) {
{
setMode(BarrelMode.CLAY);
}
if(item == ExAstrisItem.DollFreezing)
{
setMode(BarrelMode.BLIZZ_COOKING);
}
}

if(fluid.fluidID == FluidRegistry.LAVA.getID())
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/ExAstris/Bridge/ThermalExpansion.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ public static void Initialize()
if (Loader.isModLoaded("ExtraBees") && Loader.isModLoaded("exnihilo"))
{
addTransposerRecipe(10000, new ItemStack(GameRegistry.findBlock("exnihilo", "bee_trap_treated")),new ItemStack(GameRegistry.findBlock("ExtraBees", "hive"),1,0),new FluidStack(FluidRegistry.WATER, 8000),false);
addTransposerRecipe(10000, new ItemStack(GameRegistry.findBlock("exnihilo", "bee_trap_treated")),new ItemStack(GameRegistry.findBlock("ExtraBees", "hive"),1,1),new FluidStack(TinkerSmeltery.moltenStoneFluid, 8000),false);
if(Loader.isModLoaded("TConstruct")){
addTransposerRecipe(10000, new ItemStack(GameRegistry.findBlock("exnihilo", "bee_trap_treated")),new ItemStack(GameRegistry.findBlock("ExtraBees", "hive"),1,1),new FluidStack(TinkerSmeltery.moltenStoneFluid, 8000),false);
}
addTransposerRecipe(10000, new ItemStack(GameRegistry.findBlock("exnihilo", "bee_trap_treated")),new ItemStack(GameRegistry.findBlock("ExtraBees", "hive"),1,2),new FluidStack(TFFluids.fluidRedstone, 8000),false);
if(Loader.isModLoaded("MineFactoryReloaded")){
addTransposerRecipe(10000, new ItemStack(GameRegistry.findBlock("exnihilo", "bee_trap_treated")),new ItemStack(GameRegistry.findBlock("ExtraBees", "hive"),1,3),new FluidStack(LiquidRegistry.getLiquid("milk"), 8000),false);
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/ExAstris/Bridge/Waila.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,13 @@ public String getBarrelDisplay(BarrelMode mode, TileEntityBarrelThaumium barrel)
case ENDER_COOKING:
case BLAZE_COOKING:
case PECK_COOKING:
case BLIZZ_COOKING:
return "Summoning: " + Math.round(getBarrelTimeRemaining(barrel))
+ "%";
case ENDER:
case BLAZE:
case PECK:
case BLIZZ:
return "Incoming!";
case DARKOAK:
return "Dark Oak Sapling";
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/ExAstris/Data/ItemData.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ public class ItemData {

public static final String HAMMER_RF_KEY = "hammer_rf";
public static final String HAMMER_RF_UNLOCALIZED_NAME = "hammer_rf";

public static final String FREEZING_DOLL_KEY = "doll_freezing";
public static final String FREEZING_DOLL_UNLOCALIZED_NAME = "doll_freezing";
}
6 changes: 6 additions & 0 deletions src/main/java/ExAstris/ExAstrisItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import ExAstris.Item.ItemDollThaumic;
import ExAstris.Item.ItemHammerRF;
import ExAstris.Item.ItemHammerThaumium;
import ExAstris.Item.ItemDollFreezing;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
Expand All @@ -19,6 +20,7 @@ public class ExAstrisItem {
public static Item DollThaumic;
public static Item HammerThaumium;
public static Item HammerRF;
public static Item DollFreezing;

public static void registerItems()
{
Expand All @@ -28,6 +30,10 @@ public static void registerItems()

HammerThaumium = new ItemHammerThaumium();
GameRegistry.registerItem(HammerThaumium, ItemData.HAMMER_THAUMIUM_UNLOCALIZED_NAME);
if(Loader.isModLoaded("ThermalExpansion")){
DollFreezing = new ItemDollFreezing();
GameRegistry.registerItem(DollFreezing, ItemData.FREEZING_DOLL_UNLOCALIZED_NAME);
}
}

if(Loader.isModLoaded("RedstoneArsenal")){
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/ExAstris/ExAstrisRecipe.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ExAstris;

import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.registry.GameRegistry;
Expand All @@ -24,6 +25,19 @@ public static void registerCraftingRecipes()
'b', new ItemStack(GameRegistry.findItem("exnihilo", "mesh"), 1, 0),
'c', new ItemStack(GameRegistry.findItem("ThermalFoundation", "material"), 1, 135),
'd', new ItemStack(GameRegistry.findItem("ThermalFoundation", "material"), 1, 104));

if(Loader.isModLoaded("Thaumcraft")){
GameRegistry.addRecipe(new ItemStack(ExAstrisItem.DollFreezing, 1, 0),
"aba",
"ded",
"aca",
'a', Items.snowball,
'b', Items.nether_wart,
'c', Items.redstone,
'd', Items.glowstone_dust,
'e', new ItemStack(GameRegistry.findItem("exnihilo", "doll"), 1, 0));
}

}

}
Expand Down
33 changes: 33 additions & 0 deletions src/main/java/ExAstris/Item/ItemDollFreezing.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package ExAstris.Item;

import ExAstris.Data.ItemData;
import ExAstris.Data.ModData;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;

public class ItemDollFreezing extends Item{
public ItemDollFreezing() {
super();
setCreativeTab(CreativeTabs.tabMisc);
}

@Override
public String getUnlocalizedName()
{
return ModData.ID + "." + ItemData.FREEZING_DOLL_UNLOCALIZED_NAME;
}

@Override
public String getUnlocalizedName(ItemStack item)
{
return ModData.ID + "." + ItemData.FREEZING_DOLL_UNLOCALIZED_NAME;
}

@Override
public void registerIcons(IIconRegister register)
{
this.itemIcon = register.registerIcon(ModData.TEXTURE_LOCATION + ":ItemDollBlizz");
}
}
1 change: 1 addition & 0 deletions src/main/resources/assets/exastris/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ tc.research_text.EXASTRIS_VISHROOM=비쉬룸 얻기 막막하죠
exastris.bee_trap_infused.name=Infused Artificial Hive
exastris.barrel.thaumium.name=Thaumium Barrel
exastris.doll_thaumic.name=Thaumic Doll
exastris.doll_freezing.name=Freezing Doll
exastris.hammer_thaumium.name=Thaumium Hammer
exnihilo.nether_cobalt_broken.name=Broken Nether Cobalt Ore
exnihilo.cobalt_crushed.name=Crushed Cobalt Ore
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2811e06

Please sign in to comment.