Premier commit - Initialisation au système git
This commit is contained in:
commit
b18463aa1e
9
.gitignore
vendored
Normal file
9
.gitignore
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
.classpath
|
||||
.gradle/
|
||||
.project
|
||||
.settings/
|
||||
bin/
|
||||
eclipse/
|
||||
gradle/
|
||||
gradlew
|
||||
gradlew.bat
|
||||
70
build.gradle
Normal file
70
build.gradle
Normal file
@ -0,0 +1,70 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "http://files.minecraftforge.net/maven"
|
||||
}
|
||||
maven {
|
||||
name = "sonatype"
|
||||
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'forge'
|
||||
|
||||
version = "1.0"
|
||||
group= "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = "modid"
|
||||
|
||||
minecraft {
|
||||
version = "1.8-11.14.3.1450"
|
||||
runDir = "eclipse"
|
||||
|
||||
// the mappings can be changed at any time, and must be in the following format.
|
||||
// snapshot_YYYYMMDD snapshot are built nightly.
|
||||
// stable_# stables are built at the discretion of the MCP team.
|
||||
// Use non-default mappings at your own risk. they may not allways work.
|
||||
// simply re-run your setup task after changing the mappings to update your workspace.
|
||||
mappings = "snapshot_20141130"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// you may put jars on which you depend on in ./libs
|
||||
// or you may define them like so..
|
||||
//compile "some.group:artifact:version:classifier"
|
||||
//compile "some.group:artifact:version"
|
||||
|
||||
// real examples
|
||||
//compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
|
||||
//compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
|
||||
|
||||
// for more info...
|
||||
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
|
||||
// http://www.gradle.org/docs/current/userguide/dependency_management.html
|
||||
|
||||
}
|
||||
|
||||
processResources
|
||||
{
|
||||
// this will ensure that this task is redone when the versions change.
|
||||
inputs.property "version", project.version
|
||||
inputs.property "mcversion", project.minecraft.version
|
||||
|
||||
// replace stuff in mcmod.info, nothing else
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
include 'mcmod.info'
|
||||
|
||||
// replace version and mcversion
|
||||
expand 'version':project.version, 'mcversion':project.minecraft.version
|
||||
}
|
||||
|
||||
// copy everything else, thats not the mcmod.info
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
exclude 'mcmod.info'
|
||||
}
|
||||
}
|
||||
41
src/main/java/com/samsoule63/luckyWaking/LuckyWakingMod.java
Normal file
41
src/main/java/com/samsoule63/luckyWaking/LuckyWakingMod.java
Normal file
@ -0,0 +1,41 @@
|
||||
package com.samsoule63.luckyWaking;
|
||||
|
||||
import com.samsoule63.luckyWaking.init.LuckyWakingBlocks;
|
||||
import com.samsoule63.luckyWaking.init.LuckyWakingItems;
|
||||
import com.samsoule63.luckyWaking.proxy.ProxyCommon;
|
||||
|
||||
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;
|
||||
|
||||
@Mod(modid = References.MODID, name = References.MODNAME, version = References.VERSION)
|
||||
public class LuckyWakingMod
|
||||
{
|
||||
@SidedProxy(clientSide = References.CLIENT_PROXY, serverSide = References.COMMON_PROXY)
|
||||
public static ProxyCommon proxy;
|
||||
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event)
|
||||
{
|
||||
LuckyWakingItems.init();
|
||||
LuckyWakingItems.register();
|
||||
LuckyWakingBlocks.init();
|
||||
LuckyWakingBlocks.register();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void init(FMLInitializationEvent event)
|
||||
{
|
||||
proxy.registerRenders();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
10
src/main/java/com/samsoule63/luckyWaking/References.java
Normal file
10
src/main/java/com/samsoule63/luckyWaking/References.java
Normal file
@ -0,0 +1,10 @@
|
||||
package com.samsoule63.luckyWaking;
|
||||
|
||||
public class References
|
||||
{
|
||||
public static final String MODID = "luckyW";
|
||||
public static final String MODNAME = "Lucky Waking";
|
||||
public static final String VERSION = "1.0";
|
||||
public static final String CLIENT_PROXY = "com.samsoule63.luckyWaking.proxy.ProxyClient";
|
||||
public static final String COMMON_PROXY = "com.samsoule63.luckyWaking.proxy.ProxyCommon";
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package com.samsoule63.luckyWaking.blocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
public class StarBlock extends Block
|
||||
{
|
||||
|
||||
public StarBlock(Material materialIn)
|
||||
{
|
||||
super(materialIn);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
package com.samsoule63.luckyWaking.event;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.BlockPos;
|
||||
|
||||
public class OnPlayerSleep
|
||||
{
|
||||
public static void onPlayerSleep(EntityPlayer player, BlockPos pos){
|
||||
System.out.println("!!!!****µµµµ$$$$££££"+player.toString()+"sleep in "+pos.toString());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
package com.samsoule63.luckyWaking.event;
|
||||
|
||||
import tv.twitch.chat.ChatMessageToken;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
||||
public class OnPlayerWakeUp
|
||||
{
|
||||
public static void playerWakeUp(EntityPlayer player, boolean wakeImmediatly, boolean updateWorld, boolean setSpawn)
|
||||
{
|
||||
int z = (int)(Math.random() * 2);
|
||||
switch(z)
|
||||
{
|
||||
case 0:
|
||||
player.addChatComponentMessage(new ChatComponentText("Ca te dit une barre de vie en plus ?"));;
|
||||
player.setAbsorptionAmount(player.getAbsorptionAmount() + 20);
|
||||
break;
|
||||
case 1:
|
||||
player.addChatComponentMessage(new ChatComponentText("Ca te dit 100 niveaux en plus ?"));;
|
||||
player.addExperienceLevel(100);
|
||||
break;
|
||||
default:
|
||||
player.addChatComponentMessage(new ChatComponentText("Rien aujourdhui ..."));;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package com.samsoule63.luckyWaking.init;
|
||||
|
||||
import com.samsoule63.luckyWaking.References;
|
||||
import com.samsoule63.luckyWaking.blocks.StarBlock;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
public class LuckyWakingBlocks
|
||||
{
|
||||
public static Block starBlock;
|
||||
|
||||
public static void init()
|
||||
{
|
||||
starBlock = new StarBlock(Material.ground).setUnlocalizedName("starBlock").setCreativeTab(CreativeTabs.tabBlock);
|
||||
}
|
||||
|
||||
public static void register()
|
||||
{
|
||||
GameRegistry.registerBlock(starBlock,starBlock.getUnlocalizedName().substring(5));
|
||||
}
|
||||
|
||||
public static void registerRenders()
|
||||
{
|
||||
registerRender(starBlock);
|
||||
}
|
||||
|
||||
public static void registerRender(Block block)
|
||||
{
|
||||
Item item = Item.getItemFromBlock(block);
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(References.MODID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package com.samsoule63.luckyWaking.init;
|
||||
|
||||
import com.samsoule63.luckyWaking.References;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
public class LuckyWakingItems
|
||||
{
|
||||
public static Item itemBasic;
|
||||
|
||||
public static void init()
|
||||
{
|
||||
itemBasic = new Item().setUnlocalizedName("itemBasic").setCreativeTab(CreativeTabs.tabMisc);
|
||||
}
|
||||
|
||||
public static void register()
|
||||
{
|
||||
GameRegistry.registerItem(itemBasic, "itemBasic");
|
||||
}
|
||||
|
||||
public static void registerRenders()
|
||||
{
|
||||
registerRender(itemBasic);
|
||||
}
|
||||
|
||||
public static void registerRender(Item item)
|
||||
{
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(References.MODID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package com.samsoule63.luckyWaking.proxy;
|
||||
|
||||
import com.samsoule63.luckyWaking.init.LuckyWakingBlocks;
|
||||
import com.samsoule63.luckyWaking.init.LuckyWakingItems;
|
||||
|
||||
public class ProxyClient extends ProxyCommon
|
||||
{
|
||||
@Override
|
||||
public void registerRenders()
|
||||
{
|
||||
LuckyWakingItems.registerRenders();
|
||||
LuckyWakingBlocks.registerRenders();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
package com.samsoule63.luckyWaking.proxy;
|
||||
|
||||
public class ProxyCommon
|
||||
{
|
||||
|
||||
public void registerRenders()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package net.minecraftforge.event.entity.player;
|
||||
|
||||
import com.samsoule63.luckyWaking.event.OnPlayerSleep;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayer.EnumStatus;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.entity.player.EntityPlayer.EnumStatus;
|
||||
/**
|
||||
* PlayerSleepInBedEvent is fired when a player sleeps in a bed.
|
||||
* <br>
|
||||
* This event is fired whenever a player sleeps in a bed in
|
||||
* EntityPlayer#sleepInBedAt(BlockPos).<br>
|
||||
* <br>
|
||||
* {@link #result} contains whether the player is able to sleep. <br>
|
||||
* <br>
|
||||
* This event is not {@link Cancelable}.
|
||||
* <br>
|
||||
* This event does not have a result. {@link HasResult}
|
||||
* <br>
|
||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||
**/
|
||||
public class PlayerSleepInBedEvent extends PlayerEvent
|
||||
{
|
||||
public EnumStatus result = null;
|
||||
public final BlockPos pos;
|
||||
|
||||
public PlayerSleepInBedEvent(EntityPlayer player, BlockPos pos)
|
||||
{
|
||||
super(player);
|
||||
OnPlayerSleep.onPlayerSleep(player, pos);
|
||||
this.pos = pos;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package net.minecraftforge.event.entity.player;
|
||||
|
||||
import com.samsoule63.luckyWaking.event.OnPlayerWakeUp;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
/**
|
||||
* This event is fired when the player is waking up.<br/>
|
||||
* This is merely for purposes of listening for this to happen.<br/>
|
||||
* There is nothing that can be manipulated with this event.
|
||||
*/
|
||||
public class PlayerWakeUpEvent extends PlayerEvent
|
||||
{
|
||||
/**
|
||||
* Used for the 'wake up animation'.
|
||||
* This is false if the player is considered 'sleepy' and the overlay should slowly fade away.
|
||||
*/
|
||||
public final boolean wakeImmediatly;
|
||||
|
||||
/**
|
||||
* Indicates if the server should be notified of sleeping changes.
|
||||
* This will only be false if the server is considered 'up to date' already, because, for example, it initiated the call.
|
||||
*/
|
||||
public final boolean updateWorld;
|
||||
|
||||
/**
|
||||
* Indicates if the player's sleep was considered successful.
|
||||
* In vanilla, this is used to determine if the spawn chunk is to be set to the bed's position.
|
||||
*/
|
||||
public final boolean setSpawn;
|
||||
|
||||
public PlayerWakeUpEvent(EntityPlayer player, boolean wakeImmediatly, boolean updateWorld, boolean setSpawn)
|
||||
{
|
||||
super(player);
|
||||
this.wakeImmediatly = wakeImmediatly;
|
||||
this.updateWorld = updateWorld;
|
||||
this.setSpawn = setSpawn;
|
||||
OnPlayerWakeUp.playerWakeUp(player, wakeImmediatly, updateWorld, setSpawn);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
{
|
||||
"variants": {
|
||||
"normal": [
|
||||
{ "model": "luckyW:starBlock" },
|
||||
]
|
||||
}
|
||||
}
|
||||
3
src/main/resources/assets/luckyW/lang/fr_FR.lang
Normal file
3
src/main/resources/assets/luckyW/lang/fr_FR.lang
Normal file
@ -0,0 +1,3 @@
|
||||
item.itemBasic.name=Item Basique
|
||||
|
||||
tile.starBlock.name=Bloc étoile
|
||||
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "block/cube_all",
|
||||
"textures": {
|
||||
"all": "luckyw:item/starBlock"
|
||||
}
|
||||
}
|
||||
18
src/main/resources/assets/luckyW/models/item/itemBasic.json
Normal file
18
src/main/resources/assets/luckyW/models/item/itemBasic.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"parent": "builtin/generated",
|
||||
"textures": {
|
||||
"layer0": "luckyW:items/itemBasic"
|
||||
},
|
||||
"display": {
|
||||
"thirdperson": {
|
||||
"rotation": [ -90, 0, 0 ],
|
||||
"translation": [ 0, 1, -3 ],
|
||||
"scale": [ 0.55, 0.55, 0.55 ]
|
||||
},
|
||||
"firstperson": {
|
||||
"rotation": [ 0, -135, 25 ],
|
||||
"translation": [ 0, 4, 2 ],
|
||||
"scale": [ 1.7, 1.7, 1.7 ]
|
||||
}
|
||||
}
|
||||
}
|
||||
10
src/main/resources/assets/luckyW/models/item/starBlock.json
Normal file
10
src/main/resources/assets/luckyW/models/item/starBlock.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"parent": "luckyW:block/starBlock",
|
||||
"display": {
|
||||
"thirdperson": {
|
||||
"rotation": [ 10, -45, 170 ],
|
||||
"translation": [ 0, 1.5, -2.75 ],
|
||||
"scale": [ 0.375, 0.375, 0.375 ]
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
src/main/resources/assets/luckyW/textures/blocks/starBlock.png
Normal file
BIN
src/main/resources/assets/luckyW/textures/blocks/starBlock.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 524 B |
BIN
src/main/resources/assets/luckyW/textures/items/itemBasic.png
Normal file
BIN
src/main/resources/assets/luckyW/textures/items/itemBasic.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
16
src/main/resources/mcmod.info
Normal file
16
src/main/resources/mcmod.info
Normal file
@ -0,0 +1,16 @@
|
||||
[
|
||||
{
|
||||
"modid": "luckyW",
|
||||
"name": "Lucky Waking",
|
||||
"description": "Ton réveil sera-t-il chanceux ?",
|
||||
"version": "${version}",
|
||||
"mcversion": "${mcversion}",
|
||||
"url": "",
|
||||
"updateUrl": "",
|
||||
"authorList": ["Samsoule63"],
|
||||
"credits": "... I don't know",
|
||||
"logoFile": "",
|
||||
"screenshots": [],
|
||||
"dependencies": []
|
||||
}
|
||||
]
|
||||
Loading…
x
Reference in New Issue
Block a user