Merge pull request #2708 from matthijsvdmeulen/master

Removed Railcraft support for the Mana Pool with Minecart.
This commit is contained in:
Vincent Lee authored and GitHub committed 2018-08-21 12:46:05 -05:00
commit de905a4bd1
2 files changed
+1 -75

No files matched your search

@@ -1,49 +0,0 @@
/*
* ******************************************************************************
* Copyright 2011-2015 CovertJaguar
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.md for details.
* ***************************************************************************
*/
package mods.railcraft.api.core.items;
import com.mojang.authlib.GameProfile;
import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
/**
* This interface should be implemented by any cart item,
* but it is generally optional.
*
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface IMinecartItem
{
/**
* Controls whether this cart item can be placed by the Cart and Train Dispensers.
*
* Generally, you can ignore the placeCart() function if this returns false.
*
* @param cart
* @return true if it can be placed, false otherwise
*/
public boolean canBePlacedByNonPlayer(ItemStack cart);
/**
* Places a cart at the specified location.
*
* Implementing this function is optional.
*
* @param owner the name of the player placing the cart or "[MyMod]" with the brackets
* @param cart An ItemStack that contains the cart
* @param world The World
* @param i x-Coord
* @param j y-Coord
* @param k z-Coord
* @return the cart placed or null if failed
*/
public EntityMinecart placeCart(GameProfile owner, ItemStack cart, World world, int i, int j, int k);
}
@@ -10,8 +10,6 @@
*/
package vazkii.botania.common.item;
import com.mojang.authlib.GameProfile;
import mods.railcraft.api.core.items.IMinecartItem;
import net.minecraft.block.BlockRailBase;
import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.entity.player.EntityPlayer;
@@ -21,14 +19,12 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.Optional;
import vazkii.botania.common.entity.EntityPoolMinecart;
import vazkii.botania.common.lib.LibItemNames;
import javax.annotation.Nonnull;
@Optional.Interface(modid = "railcraft", iface = "mods.railcraft.api.core.items.IMinecartItem", striprefs = true)
public class ItemPoolMinecart extends ItemMod implements IMinecartItem {
public class ItemPoolMinecart extends ItemMod {
public ItemPoolMinecart() {
super(LibItemNames.POOL_MINECART);
@@ -57,25 +53,4 @@ public class ItemPoolMinecart extends ItemMod implements IMinecartItem {
return EnumActionResult.PASS;
}
@Override
public boolean canBePlacedByNonPlayer(ItemStack cart) {
return true;
}
@Override
public EntityMinecart placeCart(GameProfile owner, ItemStack cart, World world, int i, int j, int k) {
if(BlockRailBase.isRailBlock(world.getBlockState(new BlockPos(i, j, k)))) {
if(!world.isRemote) {
EntityMinecart entityminecart = new EntityPoolMinecart(world, i + 0.5,j + 0.5, k + 0.5);
if(cart.hasDisplayName())
entityminecart.setCustomNameTag(cart.getDisplayName());
if(world.spawnEntity(entityminecart))
return entityminecart;
}
}
return null;
}
}