mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 10:55:17 +00:00
Mana Pool minecart. Kinda broken.
This commit is contained in:
1 parent
78f271e8f6
commit
6c479052aa
10 files changed
+141
-1
No files matched your search
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Mar 17, 2015, 6:29:07 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.api.mana;
|
||||
|
||||
/**
|
||||
* Interface for an entity that counts as a Mana Pool Minecart
|
||||
*/
|
||||
public interface IPoolCart {
|
||||
|
||||
/**
|
||||
* Adds Mana to this cart. The mana param can be both positive or negative.
|
||||
*/
|
||||
public void addMana(int mana);
|
||||
|
||||
/**
|
||||
* Gets the amount of mana in the cart.
|
||||
*/
|
||||
public int getMana();
|
||||
|
||||
/**
|
||||
* Gets the max amount of mana the cart can store.
|
||||
*/
|
||||
public int getMaxMana();
|
||||
|
||||
}
|
||||
@@ -215,6 +215,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
|
||||
addItem(ModItems.lens);
|
||||
addItem(ModItems.manaGun);
|
||||
addItem(ModItems.clip);
|
||||
addItem(ModItems.poolMinecart);
|
||||
addItem(ModItems.spark);
|
||||
addItem(ModItems.sparkUpgrade);
|
||||
addItem(ModItems.corporeaSpark);
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Mar 17, 2015, 6:36:43 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.entity;
|
||||
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.item.EntityMinecart;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityPoolMinecart extends EntityMinecart {
|
||||
|
||||
public EntityPoolMinecart(World p_i1712_1_) {
|
||||
super(p_i1712_1_);
|
||||
}
|
||||
|
||||
public EntityPoolMinecart(World p_i1715_1_, double p_i1715_2_, double p_i1715_4_, double p_i1715_6_) {
|
||||
super(p_i1715_1_, p_i1715_2_, p_i1715_4_, p_i1715_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block func_145817_o() {
|
||||
return ModBlocks.pool;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinecartType() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void killMinecart(DamageSource p_94095_1_) {
|
||||
super.killMinecart(p_94095_1_);
|
||||
this.func_145778_a(Item.getItemFromBlock(ModBlocks.pool), 1, 0.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDefaultDisplayTileOffset() {
|
||||
return 8;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -32,6 +32,7 @@ public final class ModEntities {
|
||||
EntityRegistry.registerModEntity(EntityThornChakram.class, LibEntityNames.THORN_CHAKRAM, id++, Botania.instance, 64, 10, true);
|
||||
EntityRegistry.registerModEntity(EntityCorporeaSpark.class, LibEntityNames.CORPOREA_SPARK, id++, Botania.instance, 64, 10, false);
|
||||
EntityRegistry.registerModEntity(EntityEnderAirBottle.class, LibEntityNames.ENDER_AIR_BOTTLE, id++, Botania.instance, 64, 10, true);
|
||||
EntityRegistry.registerModEntity(EntityPoolMinecart.class, LibEntityNames.POOL_MINECART, id++, Botania.instance, 80, 3, true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Mar 17, 2015, 6:48:29 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item;
|
||||
|
||||
import vazkii.botania.common.entity.EntityPoolMinecart;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import net.minecraft.block.BlockRailBase;
|
||||
import net.minecraft.entity.item.EntityMinecart;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemPoolMinecart extends ItemMod {
|
||||
|
||||
public ItemPoolMinecart() {
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName(LibItemNames.POOL_MINECART);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) {
|
||||
if(BlockRailBase.func_150051_a(p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_))) {
|
||||
if(!p_77648_3_.isRemote) {
|
||||
EntityMinecart entityminecart = new EntityPoolMinecart(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_);
|
||||
|
||||
if(p_77648_1_.hasDisplayName())
|
||||
entityminecart.setMinecartName(p_77648_1_.getDisplayName());
|
||||
|
||||
p_77648_3_.spawnEntityInWorld(entityminecart);
|
||||
}
|
||||
|
||||
--p_77648_1_.stackSize;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -212,6 +212,7 @@ public final class ModItems {
|
||||
public static Item swapRing;
|
||||
public static Item flowerBag;
|
||||
public static Item phantomInk;
|
||||
public static Item poolMinecart;
|
||||
|
||||
public static void init() {
|
||||
lexicon = new ItemLexicon();
|
||||
@@ -328,6 +329,7 @@ public final class ModItems {
|
||||
swapRing = new ItemSwapRing();
|
||||
flowerBag = new ItemFlowerBag();
|
||||
phantomInk = new ItemPhantomInk();
|
||||
poolMinecart = new ItemPoolMinecart();
|
||||
|
||||
OreDictionary.registerOre(LibOreDict.LEXICON, lexicon);
|
||||
for(int i = 0; i < 16; i++) {
|
||||
|
||||
@@ -27,5 +27,6 @@ public final class LibEntityNames {
|
||||
public static final String THORN_CHAKRAM = LibResources.PREFIX_MOD + "thornChakram";
|
||||
public static final String CORPOREA_SPARK = LibResources.PREFIX_MOD + "corporeaSpark";
|
||||
public static final String ENDER_AIR_BOTTLE = LibResources.PREFIX_MOD + "enderAirBottle";
|
||||
public static final String POOL_MINECART = LibResources.PREFIX_MOD + "poolMinecart";
|
||||
|
||||
}
|
||||
@@ -127,7 +127,8 @@ public final class LibItemNames {
|
||||
public static final String SWAP_RING = "swapRing";
|
||||
public static final String FLOWER_BAG = "flowerBag";
|
||||
public static final String PHANTOM_INK = "phantomInk";
|
||||
|
||||
public static final String POOL_MINECART = "poolMinecart";
|
||||
|
||||
public static final String[] LENS_NAMES = new String[] {
|
||||
"lensNormal",
|
||||
"lensSpeed",
|
||||
|
||||
Reference in new issue
Block a user