-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathWa.java
More file actions
158 lines (141 loc) · 7.68 KB
/
Copy pathWa.java
File metadata and controls
158 lines (141 loc) · 7.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
package wa;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.VillagerRegistry;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraft.util.WeightedRandomChestContent;
import net.minecraftforge.common.BiomeManager;
import net.minecraftforge.common.ChestGenHooks;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.MinecraftForge;
import wa.block.Blocks;
import wa.block.FluidInit;
import wa.entity.*;
import wa.event.BonemealEventHandler;
import wa.event.GetVillageBlockIDEventHandler;
import wa.event.LivingDeathEventHandler;
import wa.event.SaplingGrowTreeEventHandler;
import wa.item.Items;
import wa.recipe.RecipeRegistryWa;
import wa.recipe.Recipes;
import wa.world.WorldChunkManagerWa;
import wa.world.WorldGenTakenoko;
import wa.world.WorldGenTorii;
import wa.world.WorldProviderWa;
@Mod(modid = Wa.modid, name = Wa.modid, version = "1.7.10.16")
public class Wa {
public static final String modid = "Wa";
@Instance("Wa")
public static Wa instance;
@SidedProxy(clientSide = "wa.client.ClientProxy", serverSide = "wa.CommonProxy")
public static CommonProxy proxy;
public static CreativeTabs creativeTab = new WaCreativeTabs();
private WaTrade 倭人取引;
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
// APIの初期化
RecipeRegistryWa.registerInstance();
Config.preInit(event.getSuggestedConfigurationFile());
Blocks.preInit();
Items.preInit();
Achievements.preInit();
proxy.preInit();
// defeatedcrow作成、液体追加
FluidInit.preInit();
}
@EventHandler
public void init(FMLInitializationEvent event) {
EntityRegistry.registerModEntity(EntityObon.class, "Obon", 0, this, 80, 1, true);
EntityRegistry.registerModEntity(EntityShuriken.class, "Shuriken", 1, this, 80, 1, true);
EntityRegistry.registerModEntity(EntityKakejiku.class, "Kakejiku", 2, this, 80, 1, true);
EntityRegistry.registerModEntity(EntityCoin.class, "Coin", 3, this, 80, 1, true);
EntityRegistry.registerModEntity(EntityZabuton.class, "Zabuton", 4, this, 80, 1, true);
//TODO レシピ追加
Recipes.init();
Items.init();
Enchantments.init();
//Entities.init();
//Biomes.init();
//Dimentions.init();
WorldChunkManagerWa.init();
DimensionManager.registerProviderType(Config.providerType, WorldProviderWa.class, false);
DimensionManager.registerDimension(Config.dimensionID, Config.providerType);
GameRegistry.registerWorldGenerator(new WorldGenTorii(), 5);
proxy.init();
//TODO 追加ディメンション内では和の音楽がなるようにする
//TODO 城の生成
//城の生成は天守閣から開始
//天守閣→階段→通路(縦・横)→左右の部屋・通路の折れ曲がり
倭人取引 = new WaTrade();
VillagerRegistry.instance().registerVillagerId(Config.町人ID);
VillagerRegistry.instance().registerVillagerId(Config.刀鍛冶ID);
VillagerRegistry.instance().registerVillagerId(Config.茶人ID);
VillagerRegistry.instance().registerVillagerId(Config.神官ID);
VillagerRegistry.instance().registerVillageTradeHandler(Config.町人ID, 倭人取引);
VillagerRegistry.instance().registerVillageTradeHandler(Config.刀鍛冶ID, 倭人取引);
VillagerRegistry.instance().registerVillageTradeHandler(Config.茶人ID, 倭人取引);
VillagerRegistry.instance().registerVillageTradeHandler(Config.神官ID, 倭人取引);
BiomeManager.addVillageBiome(WorldChunkManagerWa.spring, true);
BiomeManager.addVillageBiome(WorldChunkManagerWa.summer, true);
BiomeManager.addVillageBiome(WorldChunkManagerWa.autumn, true);
BiomeManager.addVillageBiome(WorldChunkManagerWa.winter, true);
MinecraftForge.TERRAIN_GEN_BUS.register(new GetVillageBlockIDEventHandler());
MinecraftForge.TERRAIN_GEN_BUS.register(new SaplingGrowTreeEventHandler());
MinecraftForge.EVENT_BUS.register(new BonemealEventHandler());
MinecraftForge.EVENT_BUS.register(new EntityJoinWorldEventHandler());
MinecraftForge.EVENT_BUS.register(new LivingDeathEventHandler());
MinecraftForge.EVENT_BUS.register(new EntityStruckByLightningEventHandler());
GameRegistry.registerWorldGenerator(new WorldGenTakenoko(), 5);
FMLCommonHandler.instance().bus().register(Items.太刀);
NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
String[] categories = {
ChestGenHooks.MINESHAFT_CORRIDOR,
ChestGenHooks.PYRAMID_DESERT_CHEST,
ChestGenHooks.PYRAMID_JUNGLE_CHEST,
ChestGenHooks.STRONGHOLD_CORRIDOR,
ChestGenHooks.STRONGHOLD_LIBRARY,
ChestGenHooks.STRONGHOLD_CROSSING,
ChestGenHooks.DUNGEON_CHEST,
};
for(String category : categories) {
ChestGenHooks.addItem(category, new WeightedRandomChestContent(new ItemStack(Items.刀), 1, 1, 3));
ChestGenHooks.addItem(category, new WeightedRandomChestContent(new ItemStack(Items.太刀), 1, 1, 3));
ChestGenHooks.addItem(category, new WeightedRandomChestContent(new ItemStack(Items.玉鋼), 1, 1, 4));
ChestGenHooks.addItem(category, new WeightedRandomChestContent(new ItemStack(Items.金槌), 1, 1, 3));
ChestGenHooks.addItem(category, new WeightedRandomChestContent(new ItemStack(Items.鋼の斧), 1, 1, 3));
ChestGenHooks.addItem(category, new WeightedRandomChestContent(new ItemStack(Items.鋼のツルハシ), 1, 1, 3));
ChestGenHooks.addItem(category, new WeightedRandomChestContent(new ItemStack(Items.鋼のシャベル), 1, 1, 3));
ChestGenHooks.addItem(category, new WeightedRandomChestContent(new ItemStack(Items.鋼のクワ), 1, 1, 3));
ChestGenHooks.addItem(category, new WeightedRandomChestContent(new ItemStack(Items.お盆), 1, 1, 3));
ChestGenHooks.addItem(category, new WeightedRandomChestContent(new ItemStack(Items.手裏剣), 1, 1, 10));
ChestGenHooks.addItem(category, new WeightedRandomChestContent(new ItemStack(Items.毛筆), 1, 1, 3));
ChestGenHooks.addItem(category, new WeightedRandomChestContent(new ItemStack(Items.掛け軸), 1, 1, 3));
ChestGenHooks.addItem(category, new WeightedRandomChestContent(new ItemStack(Items.竹炭), 1, 4, 10));
ChestGenHooks.addItem(category, new WeightedRandomChestContent(new ItemStack(Blocks.taiko), 1, 1, 3));
ChestGenHooks.addItem(category, new WeightedRandomChestContent(new ItemStack(Blocks.noren), 1, 1, 3));
ChestGenHooks.addItem(category, new WeightedRandomChestContent(new ItemStack(Blocks.sakuraSapling), 1, 4, 10));
ChestGenHooks.addItem(category, new WeightedRandomChestContent(new ItemStack(Blocks.takenoko), 1, 4, 10));
ChestGenHooks.addItem(category, new WeightedRandomChestContent(new ItemStack(Items.種籾), 1, 4, 10));
ChestGenHooks.addItem(category, new WeightedRandomChestContent(new ItemStack(Items.貨幣, 1, 0), 1, 4, 10));
ChestGenHooks.addItem(category, new WeightedRandomChestContent(new ItemStack(Items.貨幣, 1, 1), 1, 1, 3));
ChestGenHooks.addItem(category, new WeightedRandomChestContent(new ItemStack(Items.貨幣, 1, 2), 1, 1, 3));
ChestGenHooks.addItem(category, new WeightedRandomChestContent(new ItemStack(Items.勾玉), 1, 1, 3));
ChestGenHooks.addItem(category, new WeightedRandomChestContent(new ItemStack(Items.御鏡), 1, 1, 3));
}
}
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
Recipes.postInit();
RecipeRegistryWa.registerRecipe();
}
}