-
Notifications
You must be signed in to change notification settings - Fork 1
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
Sven Pöche
committed
Jul 30, 2017
1 parent
9ffc0f3
commit db9e88c
Showing
13 changed files
with
311 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,11 @@ | ||
# Compiled class file | ||
*.class | ||
|
||
# Log file | ||
*.log | ||
|
||
# BlueJ files | ||
*.ctxt | ||
|
||
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
*.ear | ||
*.zip | ||
*.tar.gz | ||
*.rar | ||
|
||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* | ||
.gradle | ||
/build/ | ||
/.idea | ||
/eclipse | ||
/gradle | ||
/LavaVacuum.iml | ||
/LavaVacuum.ipr | ||
/LavaVacuum.iws | ||
/gradlew | ||
/gradlew.bat | ||
/out |
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,63 @@ | ||
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 = "0.0.1-alpha" | ||
group= "com.trontheim.lavavacuum" // http://maven.apache.org/guides/mini/guide-naming-conventions.html | ||
archivesBaseName = "lavavacuum" | ||
|
||
minecraft { | ||
version = "1.7.10-10.13.4.1614-1.7.10" | ||
runDir = "eclipse" | ||
} | ||
|
||
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' | ||
} | ||
} |
Binary file not shown.
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,58 @@ | ||
package com.trontheim.lavavacuum; | ||
|
||
import com.trontheim.lavavacuum.common.proxy.CommonProxy; | ||
import cpw.mods.fml.common.Mod; | ||
import cpw.mods.fml.common.Mod.EventHandler; | ||
import cpw.mods.fml.common.Mod.InstanceFactory; | ||
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 org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
|
||
@Mod( | ||
modid = LavaVacuum.MODID, | ||
name = LavaVacuum.NAME, | ||
version = LavaVacuum.VERSION, | ||
acceptedMinecraftVersions = LavaVacuum.MCVERSION | ||
// updateJSON = "http://minecraft.valgard-lp.de" | ||
) | ||
public class LavaVacuum { | ||
|
||
public static final String MODID = "lavavacuum"; | ||
public static final String NAME = "Lava Vacuum"; | ||
public static final String VERSION = "0.0.1-alpha"; | ||
public static final String MCVERSION = "[1.7.10]"; | ||
|
||
private static final Logger logger = LogManager.getLogger(MODID); | ||
|
||
@SidedProxy( | ||
clientSide = "com.trontheim.lavavacuum.client.proxy.ClientProxy", | ||
serverSide = "com.trontheim.lavavacuum.server.proxy.ServerProxy" | ||
) | ||
public static CommonProxy proxy; | ||
|
||
private static LavaVacuum instance = new LavaVacuum(); | ||
|
||
@InstanceFactory | ||
public static LavaVacuum instance() { | ||
return instance; | ||
} | ||
|
||
@EventHandler | ||
public void preinit(FMLPreInitializationEvent event) { | ||
proxy.preInit(event); | ||
} | ||
|
||
@EventHandler | ||
public void init(FMLInitializationEvent event) { | ||
proxy.init(event); | ||
} | ||
|
||
@EventHandler | ||
public void postinit(FMLPostInitializationEvent event) { | ||
proxy.postInit(event); | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/com/trontheim/lavavacuum/client/proxy/ClientProxy.java
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,25 @@ | ||
package com.trontheim.lavavacuum.client.proxy; | ||
|
||
import com.trontheim.lavavacuum.common.proxy.CommonProxy; | ||
import cpw.mods.fml.common.event.FMLInitializationEvent; | ||
import cpw.mods.fml.common.event.FMLPostInitializationEvent; | ||
import cpw.mods.fml.common.event.FMLPreInitializationEvent; | ||
|
||
public class ClientProxy extends CommonProxy { | ||
|
||
@Override | ||
public void preInit(FMLPreInitializationEvent event) { | ||
super.preInit(event); | ||
} | ||
|
||
@Override | ||
public void init(FMLInitializationEvent event) { | ||
super.init(event); | ||
} | ||
|
||
@Override | ||
public void postInit(FMLPostInitializationEvent event) { | ||
super.postInit(event); | ||
} | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/com/trontheim/lavavacuum/common/proxy/CommonProxy.java
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,20 @@ | ||
package com.trontheim.lavavacuum.common.proxy; | ||
|
||
import com.trontheim.lavavacuum.init.LVItems; | ||
import cpw.mods.fml.common.event.FMLInitializationEvent; | ||
import cpw.mods.fml.common.event.FMLPostInitializationEvent; | ||
import cpw.mods.fml.common.event.FMLPreInitializationEvent; | ||
|
||
abstract public class CommonProxy { | ||
|
||
public void preInit(FMLPreInitializationEvent event) { | ||
LVItems.registerItems(); | ||
} | ||
|
||
public void init(FMLInitializationEvent event) { | ||
} | ||
|
||
public void postInit(FMLPostInitializationEvent event) { | ||
} | ||
|
||
} |
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 com.trontheim.lavavacuum.init; | ||
|
||
import com.trontheim.lavavacuum.LavaVacuum; | ||
import com.trontheim.lavavacuum.item.ItemLavaVacuum; | ||
import cpw.mods.fml.common.registry.GameRegistry; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.launchwrapper.Launch; | ||
|
||
public class LVItems { | ||
|
||
public static Item lavaVacuum; | ||
|
||
private static final boolean developmentEnvironment = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment"); | ||
|
||
public static void registerItems() { | ||
lavaVacuum = GameRegistry.registerItem(new ItemLavaVacuum(), "lavaVacuum", LavaVacuum.MODID); | ||
} | ||
|
||
public static boolean isDevelopmentEnvironment() { | ||
return developmentEnvironment; | ||
} | ||
|
||
} |
61 changes: 61 additions & 0 deletions
61
src/main/java/com/trontheim/lavavacuum/item/ItemLavaVacuum.java
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,61 @@ | ||
package com.trontheim.lavavacuum.item; | ||
|
||
import com.trontheim.lavavacuum.LavaVacuum; | ||
import net.minecraft.block.material.Material; | ||
import net.minecraft.creativetab.CreativeTabs; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.MovingObjectPosition; | ||
import net.minecraft.world.World; | ||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
|
||
public class ItemLavaVacuum extends Item { | ||
|
||
public static final String NAME = "lavavacuum"; | ||
|
||
private static final Logger logger = LogManager.getLogger(LavaVacuum.MODID); | ||
|
||
public ItemLavaVacuum() { | ||
super(); | ||
setCreativeTab(CreativeTabs.tabTools); | ||
setUnlocalizedName(LavaVacuum.MODID + "." + NAME); | ||
setTextureName(LavaVacuum.MODID + ":" + NAME); | ||
} | ||
|
||
@Override | ||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { | ||
|
||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, true); | ||
|
||
if(movingobjectposition == null) { | ||
return itemStack; | ||
} else { | ||
if(movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { | ||
int i = movingobjectposition.blockX; | ||
int j = movingobjectposition.blockY; | ||
int k = movingobjectposition.blockZ; | ||
|
||
if(!world.canMineBlock(player, i, j, k)) { | ||
return itemStack; | ||
} | ||
|
||
if(!player.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) { | ||
return itemStack; | ||
} | ||
|
||
Material material = world.getBlock(i, j, k).getMaterial(); | ||
int l = world.getBlockMetadata(i, j, k); | ||
|
||
if(material == Material.lava && l == 0) { | ||
world.setBlockToAir(i, j, k); | ||
return itemStack; | ||
} | ||
} | ||
} | ||
|
||
return itemStack; | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/com/trontheim/lavavacuum/server/proxy/ServerProxy.java
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,25 @@ | ||
package com.trontheim.lavavacuum.server.proxy; | ||
|
||
import com.trontheim.lavavacuum.common.proxy.CommonProxy; | ||
import cpw.mods.fml.common.event.FMLInitializationEvent; | ||
import cpw.mods.fml.common.event.FMLPostInitializationEvent; | ||
import cpw.mods.fml.common.event.FMLPreInitializationEvent; | ||
|
||
public class ServerProxy extends CommonProxy { | ||
|
||
@Override | ||
public void preInit(FMLPreInitializationEvent event) { | ||
super.preInit(event); | ||
} | ||
|
||
@Override | ||
public void init(FMLInitializationEvent event) { | ||
super.init(event); | ||
} | ||
|
||
@Override | ||
public void postInit(FMLPostInitializationEvent event) { | ||
super.postInit(event); | ||
} | ||
|
||
} |
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 @@ | ||
item.lavavacuum.lavavacuum.name=Lava Staubsauger |
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 @@ | ||
item.lavavacuum.lavavacuum.name=Lava Vacuum Cleaner |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
[{ | ||
"modid": "lavavacuum", | ||
"name": "Lava Vacuum - A lava cacuum cleaner", | ||
"description": "These modification adds a new item to absorb lava.", | ||
"version": "${version}", | ||
"mcversion": "${mcversion}", | ||
"url": "http://minecraft.valgard-lp.de/mods/lavavacuum/", | ||
"updateUrl": "", | ||
"authorList": [ | ||
"Valgard Trontheim (a.k.a Sven Pöche)" | ||
], | ||
"credits": "Thanks to _Bedrock_Miner_ and greyminecraftcoder for there tutorials.", | ||
"logoFile": "logo.png", | ||
"screenshots": [ | ||
], | ||
"parent":"", | ||
"requiredMods": [ | ||
"Forge" | ||
], | ||
"dependencies": [ | ||
], | ||
"useDependencyInformation": "true" | ||
}] |