Skip to content

Commit

Permalink
reborn idf
Browse files Browse the repository at this point in the history
  • Loading branch information
Ecdcaeb committed May 2, 2024
1 parent 27692e6 commit 7ce5f8a
Show file tree
Hide file tree
Showing 295 changed files with 22,566 additions and 21 deletions.
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ cleanroom_version=15.24.0.3029
# Mod Information
# HIGHLY RECOMMEND complying with SemVer for mod_version: https://semver.org/
mod_version=1.0.0
root_package=com.example
mod_id=modid
root_package=com.somebody.idlframewok
mod_id=idlframewok
mod_name=Mod Name

# Mod Metadata (Optional)
mod_description=
mod_url=
mod_url=https://www.mcmod.cn/class/2421.html
mod_update_json=
# Delimit authors with commas
mod_authors=
mod_credits=
mod_authors=somebody
mod_credits=Idealland - they provided this framework.
mod_logo_path=

# Mapping Properties
Expand Down
150 changes: 150 additions & 0 deletions src/main/java/com/somebody/idlframewok/IdlFramework.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
package com.somebody.idlframewok;

import com.somebody.idlframewok.gui.ModGuiElementLoader;
import com.somebody.idlframewok.init.ModConfig;
import com.somebody.idlframewok.init.ModRecipes;
import com.somebody.idlframewok.init.ModSpawn;
import com.somebody.idlframewok.init.RegistryHandler;
import com.somebody.idlframewok.keys.KeyboardManager;
import com.somebody.idlframewok.meta.MetaUtil;
import com.somebody.idlframewok.network.NetworkHandler;
import com.somebody.idlframewok.proxy.ProxyBase;
import com.somebody.idlframewok.util.CommonDef;
import com.somebody.idlframewok.util.Reference;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import org.apache.logging.log4j.Logger;

//To let the player be a traveling god who plays yin-yang magic.

@Mod(modid = IdlFramework.MODID, name = IdlFramework.NAME, version = IdlFramework.VERSION)//dependencies = "required-after:Forge@[14.23.5.2705,)"
public class IdlFramework {
public static final String MODID = "untitled";
public static final String NAME = "IdlFramework";
public static final String VERSION = "0.1.101";

public static Logger logger;

public static final boolean SHOW_WARN = true;

@Mod.Instance
public static IdlFramework instance;

@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
public static ProxyBase proxy;

@EventHandler
public void preInit(FMLPreInitializationEvent event) {
logger = event.getModLog();

if (MODID.equals("untitled"))
{
logger.error("Please change your mod id in the main class.");

}

if (Reference.CLIENT_PROXY_CLASS.indexOf("somebody.idlframewok.proxy.ClientProxy") > 0)
{
logger.warn("Have you changed your package name to author and modname?");

}

RegistryHandler.preInitRegistries(event);

}

@EventHandler
public static void Init(FMLInitializationEvent event) {
ModRecipes.Init();
RegisterTileEntity();
RegistryHandler.initRegistries(event);
new ModGuiElementLoader();
if (!proxy.isServer())
{
KeyboardManager.init();
}
NetworkHandler.init();

LogWarning("%s has finished its initializations", MODID);

}

@EventHandler
public void postInit(FMLPostInitializationEvent event) {
// Moved Spawning registry to last since forge doesn't auto-generate sub
// "M' biomes until late
if (ModConfig.SPAWN_CONF.SPAWN) {
ModSpawn.registerSpawnList();
}

MetaUtil.isIDLLoaded = Loader.isModLoaded("idealland");
MetaUtil.isIRRLoaded = Loader.isModLoaded("itemrender");
MetaUtil.isLoaded_TiC = Loader.isModLoaded("tconstruct");
MetaUtil.isLoaded_Slashblade = Loader.isModLoaded("flammpfeil.slashblade");
MetaUtil.isLoaded_Botania = Loader.isModLoaded("botania");
MetaUtil.isLoaded_DWeapon = Loader.isModLoaded("dweapon");
MetaUtil.isLoaded_AOA3 = Loader.isModLoaded(CommonDef.MOD_NAME_AOA3);
MetaUtil.isLoaded_GC = Loader.isModLoaded("galacticraftcore");
MetaUtil.isLoaded_Taoism = Loader.isModLoaded("taoism");
MetaUtil.isLoaded_GOG = Loader.isModLoaded(CommonDef.MOD_NAME_GOG);

TrashTalking();

RegistryHandler.postInitReg();
}

@EventHandler
public static void serverInit(FMLServerStartingEvent event) {
RegistryHandler.serverRegistries(event);
}


private void TrashTalking() {
if (MetaUtil.isIDLLoaded)
{
IdlFramework.Log("[Idealland Framework] Bow to Idealland.");
}
else {
IdlFramework.Log("[Idealland Framework] Made with Idealland Framework.");
}
}

private static void RegisterTileEntity() {
// GameRegistry.registerTileEntity(TileEntityDeBoomOrb.class, new ResourceLocation(MODID, "deboom_orb_basic"));

//GameRegistry.registerTileEntity(TileEntityBuilderFarm.class, new ResourceLocation(MODID, "builder_farm_basic"));
//GameRegistry.registerTileEntity(TileEntityBuilderOne.class, new ResourceLocation(MODID, "builder.builder_one"));
}

public static void LogWarning(String str, Object... args) {
if (SHOW_WARN) {
logger.warn(String.format(str, args));
}
}

public static void LogWarning(String str) {
if (SHOW_WARN) {
logger.warn(str);
}
}

public static void Log(String str) {
// if (ModConfig.GeneralConf.LOG_ON)
// {
logger.info(str);
// }
}

public static void Log(String str, Object... args) {
// if (ModConfig.GeneralConf.LOG_ON)
// {
logger.info(String.format(str, args));
// }
}
}
15 changes: 15 additions & 0 deletions src/main/java/com/somebody/idlframewok/TODO.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
plans:
buff:
[shield A]: absorbs damage. for each damage absorbed, -1s.
[shield B]: (Darker Protection) absorbs damage, revenges attacker, try create explosion
[Explosion Proof]
[Arrow Proof]* only arrows, or other bullets
[melee proof]
[nullified/phased]deal and receive no melee damage

[void touch]all damage is void damage.

[Berserk]Damage dealt and receive is increaed by Lv * 10%
--crtical
[Crit% Up/Down]
[Crit% Dmg Up/Down]
49 changes: 49 additions & 0 deletions src/main/java/com/somebody/idlframewok/blocks/BlockBase.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package com.somebody.idlframewok.blocks;

import java.util.Random;

import com.somebody.idlframewok.IdlFramework;
import com.somebody.idlframewok.init.ModCreativeTab;
import com.somebody.idlframewok.item.ModItems;
import com.somebody.idlframewok.util.IHasModel;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;

public class BlockBase extends Block implements IHasModel
{
public BlockBase(String name, Material material)
{
super(material);
setUnlocalizedName(name);
setRegistryName(name);
setCreativeTab(ModCreativeTab.IDL_MISC);;

ModBlocks.BLOCKS.add(this);
ModItems.ITEMS.add(new ItemBlock(this).setRegistryName(this.getRegistryName()));

setHardness(5.0F);
//setResistance(1000.0F);
//setHarvestLevel("pickaxe", 1);
//setLightLevel(1f);
setLightOpacity(1);
}

@Override
public Item getItemDropped(IBlockState state, Random rand, int fortune)
{
return super.getItemDropped(state, rand, fortune);
}

@Override
public int quantityDropped(Random rand) {
return super.quantityDropped(rand);
}

@Override
public void registerModels() {
IdlFramework.proxy.registerItemRenderer(Item.getItemFromBlock(this), 0, "inventory");
}
}
26 changes: 26 additions & 0 deletions src/main/java/com/somebody/idlframewok/blocks/BlockTeleporter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.somebody.idlframewok.blocks;

import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class BlockTeleporter extends BlockBase {
public BlockTeleporter(String name, Material material) {
super(name, material);
}

@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
if (!worldIn.isRemote) {
// Teleport.teleportToDim(playerIn, ModConfig.DEBUG_CONF.DIM_ONE_ID, playerIn.getPosition().getX(),
// playerIn.posY + 5, playerIn.posZ);
return true;
}

return false;
}
}
Loading

0 comments on commit 7ce5f8a

Please sign in to comment.