-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,646 changed files
with
52,322 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package betterwithaddons; | ||
|
||
import net.minecraft.creativetab.CreativeTabs; | ||
import net.minecraft.init.Items; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraftforge.fml.relauncher.Side; | ||
import net.minecraftforge.fml.relauncher.SideOnly; | ||
|
||
public class BWACreativeTab extends CreativeTabs | ||
{ | ||
public BWACreativeTab() | ||
{ | ||
super("bwa.name"); | ||
} | ||
|
||
@Override | ||
@SideOnly(Side.CLIENT) | ||
public ItemStack createIcon() | ||
{ | ||
return new ItemStack(Items.BEETROOT); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
package betterwithaddons; | ||
|
||
import betterwithaddons.block.ModBlocks; | ||
import betterwithaddons.client.GuiHandler; | ||
import betterwithaddons.config.ModConfiguration; | ||
import betterwithaddons.entity.ModEntities; | ||
import betterwithaddons.interaction.ModInteractions; | ||
import betterwithaddons.item.ModItems; | ||
import betterwithaddons.lib.Reference; | ||
import betterwithaddons.network.BWANetworkHandler; | ||
import betterwithaddons.potion.ModPotions; | ||
import betterwithaddons.tileentity.ModTileEntities; | ||
import betterwithmods.common.BWMRecipes; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.item.crafting.FurnaceRecipes; | ||
import net.minecraft.util.ResourceLocation; | ||
import net.minecraftforge.common.MinecraftForge; | ||
import net.minecraftforge.event.RegistryEvent; | ||
import net.minecraftforge.fluids.FluidRegistry; | ||
import net.minecraftforge.fml.common.Mod; | ||
import net.minecraftforge.fml.common.Mod.EventHandler; | ||
import net.minecraftforge.fml.common.Mod.Instance; | ||
import net.minecraftforge.fml.common.SidedProxy; | ||
import net.minecraftforge.fml.common.event.*; | ||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | ||
import net.minecraftforge.fml.common.network.NetworkRegistry; | ||
import org.apache.logging.log4j.Logger; | ||
|
||
import java.util.Iterator; | ||
import java.util.Map; | ||
|
||
@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.MOD_VERSION, guiFactory = "betterwithaddons.client.GuiFactory", acceptedMinecraftVersions = "1.12,1.12.1,1.12.2", dependencies = "required-after:betterwithmods") | ||
public class BetterWithAddons | ||
{ | ||
@Instance(Reference.MOD_ID) | ||
public static BetterWithAddons instance; | ||
|
||
@SidedProxy(clientSide = "betterwithaddons.ClientProxy",serverSide = "betterwithaddons.ServerProxy") | ||
public static IProxy proxy; | ||
|
||
public BWACreativeTab creativeTab; | ||
public ModConfiguration config; | ||
|
||
public Logger logger; | ||
|
||
static | ||
{ | ||
FluidRegistry.enableUniversalBucket(); | ||
} | ||
|
||
@EventHandler | ||
public void preInit(FMLPreInitializationEvent event) | ||
{ | ||
creativeTab = new BWACreativeTab(); | ||
config = new ModConfiguration(); | ||
|
||
logger = event.getModLog(); | ||
ModInteractions.prePreInit(event); | ||
config.preInit(event); | ||
|
||
ModBlocks.load(event); | ||
ModItems.load(event); | ||
ModTileEntities.register(); | ||
ModEntities.init(); | ||
ModPotions.preInit(event); | ||
ModInteractions.preInit(event); | ||
proxy.preInit(); | ||
ModInteractions.preInitEnd(event); | ||
BWANetworkHandler.registerMessages(); | ||
|
||
MinecraftForge.EVENT_BUS.register(this); | ||
|
||
NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler()); | ||
} | ||
|
||
@EventHandler | ||
public void construct(FMLConstructionEvent event) | ||
{ | ||
proxy.registerResourcePack(); | ||
} | ||
|
||
@EventHandler | ||
public void init(FMLInitializationEvent event) | ||
{ | ||
ModInteractions.init(event); | ||
proxy.init(); | ||
} | ||
|
||
@EventHandler | ||
public void postInit(FMLPostInitializationEvent event) | ||
{ | ||
ModInteractions.postInit(event); | ||
proxy.postInit(); | ||
} | ||
|
||
@EventHandler | ||
public void loadComplete(FMLLoadCompleteEvent event) | ||
{ | ||
ModInteractions.loadComplete(event); | ||
} | ||
|
||
@SubscribeEvent | ||
public void remapBlocks(RegistryEvent.MissingMappings<Block> event) | ||
{ | ||
for(RegistryEvent.MissingMappings.Mapping<Block> mapping : event.getAllMappings()) | ||
{ | ||
if(!mapping.key.getNamespace().equals(Reference.MOD_ID)) | ||
continue; | ||
|
||
if(mapping.key.getPath().equals("pond_base")) | ||
mapping.remap(ModBlocks.POND_REPLACEMENT); | ||
} | ||
} | ||
|
||
@SubscribeEvent | ||
public void remapItems(RegistryEvent.MissingMappings<Item> event) | ||
{ | ||
for(RegistryEvent.MissingMappings.Mapping<Item> mapping : event.getAllMappings()) | ||
{ | ||
if(!mapping.key.getNamespace().equals(Reference.MOD_ID)) | ||
continue; | ||
|
||
if(mapping.key.getPath().equals("pond_base")) | ||
mapping.remap(Item.getItemFromBlock(ModBlocks.POND_REPLACEMENT)); | ||
if(mapping.key.getPath().equals("bowl")) | ||
mapping.remap(ModItems.SALTS); | ||
} | ||
} | ||
|
||
public static void removeSmeltingRecipe(ItemStack withoutput) | ||
{ | ||
Map<ItemStack, ItemStack> smeltingList = FurnaceRecipes.instance().getSmeltingList(); | ||
for(Iterator<Map.Entry<ItemStack, ItemStack>> furnaceIterator = smeltingList.entrySet().iterator(); furnaceIterator.hasNext(); ) { | ||
Map.Entry<ItemStack, ItemStack> recipe = furnaceIterator.next(); | ||
if(withoutput.isEmpty() || !ItemStack.areItemStacksEqual(withoutput, recipe.getValue())) continue; | ||
furnaceIterator.remove(); | ||
} | ||
} | ||
|
||
public static void removeCraftingRecipe(ResourceLocation resloc) | ||
{ | ||
BWMRecipes.removeRecipe(resloc); | ||
|
||
/*List<IRecipe> craftingList = CraftingManager.getInstance().getRecipeList(); | ||
for(Iterator<IRecipe> craftingIterator = craftingList.iterator(); craftingIterator.hasNext(); ) { | ||
IRecipe recipe = craftingIterator.next(); | ||
if(withoutput.isEmpty() || !ItemStack.areItemStacksEqual(withoutput, recipe.getRecipeOutput())) continue; | ||
craftingIterator.remove(); | ||
}*/ | ||
} | ||
} |
Oops, something went wrong.