mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-22 05:02:30 +00:00
Merge branch 'master' of github.com:Vazkii/Botania into flattening_test
This commit is contained in:
commit
1a10608c11
35 files changed
+211
-94
No files matched your search
@@ -10,8 +10,8 @@
|
||||
*/
|
||||
package vazkii.botania.client.gui.box;
|
||||
|
||||
import baubles.api.BaublesApi;
|
||||
import baubles.api.IBauble;
|
||||
import baubles.api.cap.BaublesCapabilities;
|
||||
import baubles.api.cap.IBaublesItemHandler;
|
||||
import baubles.common.container.SlotBauble;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -40,7 +40,7 @@ public class ContainerBaubleBox extends Container {
|
||||
IInventory playerInv = player.inventory;
|
||||
baubleBoxInv = boxInv;
|
||||
|
||||
baubles = player.getCapability(BaublesCapabilities.CAPABILITY_BAUBLES, null);
|
||||
baubles = BaublesApi.getBaublesHandler(player);
|
||||
|
||||
addSlotToContainer(new SlotBauble(player, baubles, 0, 8, 8 + 0 * 18));
|
||||
addSlotToContainer(new SlotBauble(player, baubles, 1, 8, 8 + 1 * 18));
|
||||
|
||||
@@ -28,6 +28,7 @@ import vazkii.botania.api.state.enums.PoolVariant;
|
||||
import vazkii.botania.client.gui.crafting.ContainerCraftingHalo;
|
||||
import vazkii.botania.client.integration.jei.brewery.BreweryRecipeCategory;
|
||||
import vazkii.botania.client.integration.jei.brewery.BreweryRecipeWrapper;
|
||||
import vazkii.botania.client.integration.jei.crafting.SpecialFloatingFlowerWrapper;
|
||||
import vazkii.botania.client.integration.jei.elventrade.ElvenTradeRecipeCategory;
|
||||
import vazkii.botania.client.integration.jei.elventrade.ElvenTradeRecipeWrapper;
|
||||
import vazkii.botania.client.integration.jei.manapool.ManaPoolRecipeCategory;
|
||||
@@ -39,6 +40,7 @@ import vazkii.botania.client.integration.jei.puredaisy.PureDaisyRecipeWrapper;
|
||||
import vazkii.botania.client.integration.jei.runicaltar.RunicAltarRecipeCategory;
|
||||
import vazkii.botania.client.integration.jei.runicaltar.RunicAltarRecipeWrapper;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.crafting.recipe.SpecialFloatingFlowerRecipe;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
|
||||
|
||||
@@ -73,6 +75,7 @@ public class JEIBotaniaPlugin implements IModPlugin {
|
||||
registry.handleRecipes(RecipePetals.class, PetalApothecaryRecipeWrapper::new, PetalApothecaryRecipeCategory.UID);
|
||||
registry.handleRecipes(RecipeElvenTrade.class, ElvenTradeRecipeWrapper::new, ElvenTradeRecipeCategory.UID);
|
||||
registry.handleRecipes(RecipeManaInfusion.class, ManaPoolRecipeWrapper::new, ManaPoolRecipeCategory.UID);
|
||||
registry.handleRecipes(SpecialFloatingFlowerRecipe.class, SpecialFloatingFlowerWrapper::new, VanillaRecipeCategoryUid.CRAFTING);
|
||||
|
||||
registry.addRecipes(BotaniaAPI.brewRecipes, BreweryRecipeCategory.UID);
|
||||
registry.addRecipes(BotaniaAPI.pureDaisyRecipes, PureDaisyRecipeCategory.UID);
|
||||
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package vazkii.botania.client.integration.jei.crafting;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.crafting.recipe.SpecialFloatingFlowerRecipe;
|
||||
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SpecialFloatingFlowerWrapper implements IRecipeWrapper {
|
||||
private final List<List<ItemStack>> inputs = new ArrayList<>();
|
||||
private final ItemStack output;
|
||||
|
||||
public SpecialFloatingFlowerWrapper(SpecialFloatingFlowerRecipe recipe) {
|
||||
inputs.add(ImmutableList.of(ItemBlockSpecialFlower.ofType(recipe.type)));
|
||||
List<ItemStack> normalFloaters = new ArrayList<>();
|
||||
for (EnumDyeColor color : EnumDyeColor.values()) {
|
||||
normalFloaters.add(new ItemStack(ModBlocks.floatingFlower, 1, color.getMetadata()));
|
||||
}
|
||||
inputs.add(normalFloaters);
|
||||
output = ItemBlockSpecialFlower.ofType(new ItemStack(ModBlocks.floatingSpecialFlower), recipe.type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getIngredients(IIngredients ingredients) {
|
||||
ingredients.setInputLists(ItemStack.class, inputs);
|
||||
ingredients.setOutput(ItemStack.class, output);
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,7 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
@@ -42,7 +43,7 @@ import javax.annotation.Nonnull;
|
||||
|
||||
@Mod.EventBusSubscriber(modid = LibMisc.MOD_ID)
|
||||
public class BlockFelPumpkin extends BlockMod implements ILexiconable {
|
||||
|
||||
private static final ResourceLocation LOOT_TABLE = new ResourceLocation(LibMisc.MOD_ID, "fel_blaze");
|
||||
private static final String TAG_FEL_SPAWNED = "Botania-FelSpawned";
|
||||
|
||||
public BlockFelPumpkin() {
|
||||
@@ -79,7 +80,7 @@ public class BlockFelPumpkin extends BlockMod implements ILexiconable {
|
||||
world.setBlockState(pos.down(2), Blocks.AIR.getDefaultState(), 2);
|
||||
EntityBlaze blaze = new EntityBlaze(world);
|
||||
blaze.setLocationAndAngles(pos.getX() + 0.5D, pos.getY() - 1.95D, pos.getZ() + 0.5D, 0.0F, 0.0F);
|
||||
blaze.getEntityData().setBoolean(TAG_FEL_SPAWNED, true);
|
||||
blaze.deathLootTable = LOOT_TABLE;
|
||||
blaze.onInitialSpawn(world.getDifficultyForLocation(pos), null);
|
||||
world.spawnEntity(blaze);
|
||||
world.notifyNeighborsOfStateChange(pos, Blocks.AIR, false);
|
||||
@@ -93,6 +94,7 @@ public class BlockFelPumpkin extends BlockMod implements ILexiconable {
|
||||
world.setBlockState(pos, state.withProperty(BotaniaStateProps.CARDINALS, placer.getHorizontalFacing().getOpposite()));
|
||||
}
|
||||
|
||||
// Legacy support
|
||||
@SubscribeEvent
|
||||
public static void onDrops(LivingDropsEvent event) {
|
||||
if(event.getEntityLiving() instanceof EntityBlaze && event.getEntityLiving().getEntityData().getBoolean(TAG_FEL_SPAWNED))
|
||||
|
||||
@@ -44,7 +44,7 @@ import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.crafting.IInfusionStabiliser", striprefs = true)
|
||||
@Optional.Interface(modid = "thaumcraft", iface = "thaumcraft.api.crafting.IInfusionStabiliser", striprefs = true)
|
||||
public class BlockPylon extends BlockMod implements ILexiconable, IInfusionStabiliser {
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0.125, 0, 0.125, 0.875, 21.0/16, 0.875);
|
||||
|
||||
@@ -62,7 +62,7 @@ import vazkii.botania.common.lib.LibBlockNames;
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Random;
|
||||
|
||||
@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.crafting.IInfusionStabiliser", striprefs = true)
|
||||
@Optional.Interface(modid = "thaumcraft", iface = "thaumcraft.api.crafting.IInfusionStabiliser", striprefs = true)
|
||||
public class BlockFloatingFlower extends BlockMod implements ILexiconable, IInfusionStabiliser {
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0.1, 0.1, 0.1, 0.9, 0.9, 0.9);
|
||||
|
||||
@@ -48,7 +48,7 @@ import vazkii.botania.common.lib.LibMisc;
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Random;
|
||||
|
||||
@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.crafting.IInfusionStabiliser", striprefs = true)
|
||||
@Optional.Interface(modid = "thaumcraft", iface = "thaumcraft.api.crafting.IInfusionStabiliser", striprefs = true)
|
||||
public class BlockModMushroom extends BlockMushroom implements IInfusionStabiliser, IHornHarvestable, ILexiconable, IModelRegister, IFlowerComponent {
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0.3, 0, 0.3, 0.8, 1, 0.8);
|
||||
|
||||
@@ -32,7 +32,7 @@ import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.crafting.IInfusionStabiliser", striprefs = true)
|
||||
@Optional.Interface(modid = "thaumcraft", iface = "thaumcraft.api.crafting.IInfusionStabiliser", striprefs = true)
|
||||
public class BlockShinyFlower extends BlockModFlower implements IInfusionStabiliser, IHornHarvestable {
|
||||
|
||||
public BlockShinyFlower() {
|
||||
|
||||
@@ -12,6 +12,7 @@ package vazkii.botania.common.block.subtile;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.mana.IManaPool;
|
||||
import vazkii.botania.api.subtile.SubTileEntity;
|
||||
@@ -35,9 +36,12 @@ public class SubTileManastar extends SubTileEntity {
|
||||
} else {
|
||||
int mana = 0;
|
||||
for(EnumFacing dir : EnumFacing.HORIZONTALS) {
|
||||
TileEntity tile = supertile.getWorld().getTileEntity(supertile.getPos().offset(dir));
|
||||
if(tile instanceof IManaPool)
|
||||
mana += ((IManaPool) tile).getCurrentMana();
|
||||
BlockPos pos = supertile.getPos().offset(dir);
|
||||
if(getWorld().isBlockLoaded(pos)) {
|
||||
TileEntity tile = supertile.getWorld().getTileEntity(pos);
|
||||
if(tile instanceof IManaPool)
|
||||
mana += ((IManaPool) tile).getCurrentMana();
|
||||
}
|
||||
}
|
||||
|
||||
int newState = mana > lastMana ? INCREASING : mana < lastMana ? DECREASING : NONE;
|
||||
|
||||
@@ -49,13 +49,16 @@ public class TileHourglass extends TileSimpleInventory implements ITickable {
|
||||
public int flipTicks = 0;
|
||||
public boolean lock = false;
|
||||
public boolean move = true;
|
||||
public boolean dust = false;
|
||||
|
||||
private boolean isDust() {
|
||||
ItemStack stack = itemHandler.getStackInSlot(0);
|
||||
return !stack.isEmpty() && stack.getItem() == ModItems.manaPowder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
int totalTime = getTotalTime();
|
||||
ItemStack dustStack = itemHandler.getStackInSlot(0);
|
||||
dust = !dustStack.isEmpty() && dustStack.getItem() == ModItems.manaPowder;
|
||||
boolean dust = isDust();
|
||||
|
||||
if(totalTime > 0 || dust) {
|
||||
if(move && !dust)
|
||||
@@ -66,8 +69,7 @@ public class TileHourglass extends TileSimpleInventory implements ITickable {
|
||||
flip = !flip;
|
||||
flipTicks = 4;
|
||||
if(!world.isRemote) {
|
||||
world.setBlockState(getPos(), world.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, true), 1 | 2);
|
||||
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(this);
|
||||
world.setBlockState(getPos(), world.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, true), 1);
|
||||
world.scheduleUpdate(pos, getBlockType(), getBlockType().tickRate(world));
|
||||
}
|
||||
|
||||
@@ -93,7 +95,7 @@ public class TileHourglass extends TileSimpleInventory implements ITickable {
|
||||
|
||||
public void onManaCollide() {
|
||||
if(!world.isRemote) {
|
||||
if(dust)
|
||||
if(isDust())
|
||||
time++;
|
||||
else move = !move;
|
||||
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(this);
|
||||
@@ -144,6 +146,16 @@ public class TileHourglass extends TileSimpleInventory implements ITickable {
|
||||
return super.insertItem(slot, stack, simulate);
|
||||
else return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onContentsChanged(int slot) {
|
||||
super.onContentsChanged(slot);
|
||||
if(!TileHourglass.this.world.isRemote) {
|
||||
time = 0;
|
||||
timeFraction = 0F;
|
||||
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(TileHourglass.this);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -174,14 +186,6 @@ public class TileHourglass extends TileSimpleInventory implements ITickable {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty() {
|
||||
super.markDirty();
|
||||
time = 0;
|
||||
timeFraction = 0F;
|
||||
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(this);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderHUD(ScaledResolution res) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.block.tile.mana;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ITickable;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import vazkii.botania.api.internal.VanillaPacketDispatcher;
|
||||
import vazkii.botania.api.mana.IManaPool;
|
||||
import vazkii.botania.api.mana.IManaReceiver;
|
||||
@@ -23,7 +24,7 @@ import java.util.List;
|
||||
|
||||
public class TileDistributor extends TileMod implements IManaReceiver, ITickable {
|
||||
|
||||
final List<IManaReceiver> validPools = new ArrayList<>();
|
||||
private final List<IManaReceiver> validPools = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
@@ -31,11 +32,14 @@ public class TileDistributor extends TileMod implements IManaReceiver, ITickable
|
||||
return;
|
||||
validPools.clear();
|
||||
for(EnumFacing dir : EnumFacing.HORIZONTALS) {
|
||||
TileEntity tileAt = world.getTileEntity(pos.offset(dir));
|
||||
if(tileAt != null && tileAt instanceof IManaPool && !tileAt.isInvalid()) {
|
||||
IManaReceiver receiver = (IManaReceiver) tileAt;
|
||||
if(!receiver.isFull())
|
||||
validPools.add(receiver);
|
||||
BlockPos pos = this.pos.offset(dir);
|
||||
if(world.isBlockLoaded(pos)) {
|
||||
TileEntity tileAt = world.getTileEntity(pos);
|
||||
if(tileAt instanceof IManaPool && !tileAt.isInvalid()) {
|
||||
IManaReceiver receiver = (IManaReceiver) tileAt;
|
||||
if(!receiver.isFull())
|
||||
validPools.add(receiver);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,10 +257,12 @@ public class InternalMethodHandler extends DummyMethodHandler {
|
||||
return block instanceof BlockModFlower || block instanceof BlockFloatingFlower || block instanceof ISpecialFlower;
|
||||
}
|
||||
|
||||
// todo use our own sync packet or use the autosync system
|
||||
@Override
|
||||
public void sendBaubleUpdatePacket(EntityPlayer player, int slot) {
|
||||
if(player instanceof EntityPlayerMP)
|
||||
PacketHandler.INSTANCE.sendTo(new PacketSync(player, slot), (EntityPlayerMP) player);
|
||||
if(player instanceof EntityPlayerMP) {
|
||||
PacketHandler.INSTANCE.sendTo(new PacketSync(player, slot, BaublesApi.getBaublesHandler(player).getStackInSlot(slot)), (EntityPlayerMP) player);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -40,12 +40,6 @@ public class InventoryHelper {
|
||||
if(te == null)
|
||||
return null;
|
||||
|
||||
if(te instanceof TileEntityChest) {
|
||||
IItemHandler doubleChest = VanillaDoubleChestItemHandler.get((TileEntityChest) te);
|
||||
if(doubleChest != VanillaDoubleChestItemHandler.NO_ADJACENT_CHESTS_INSTANCE)
|
||||
return doubleChest;
|
||||
}
|
||||
|
||||
IItemHandler ret = te.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side) ?
|
||||
te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side) : null;
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
@@ -338,9 +339,12 @@ public final class ModCraftingRecipes {
|
||||
r.register(new ManaGunRemoveLensRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "mana_gun_remove_lens")));
|
||||
r.register(new ManaGunClipRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "mana_gun_add_clip")));
|
||||
r.register(new PhantomInkRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "phantom_ink")));
|
||||
r.register(new SpecialFloatingFlowerRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "special_floating_flower")));
|
||||
r.register(new TerraPickTippingRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "terra_pick_tipping")));
|
||||
|
||||
for (String s : BotaniaAPI.getAllSubTiles()) {
|
||||
r.register(new SpecialFloatingFlowerRecipe(s).setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "floating_" + s)));
|
||||
}
|
||||
|
||||
for(int i = 0; i < 8; i++) {
|
||||
GameRegistry.addSmelting(new ItemStack(ModFluffBlocks.biomeStoneA, 1, i + 8), new ItemStack(ModFluffBlocks.biomeStoneA, 1, i), 0.1F);
|
||||
}
|
||||
|
||||
+8
-3
@@ -22,6 +22,11 @@ import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class SpecialFloatingFlowerRecipe extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe {
|
||||
public final String type;
|
||||
|
||||
public SpecialFloatingFlowerRecipe(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDynamic() {
|
||||
@@ -39,7 +44,7 @@ public class SpecialFloatingFlowerRecipe extends IForgeRegistryEntry.Impl<IRecip
|
||||
if(stack.getItem() == Item.getItemFromBlock(ModBlocks.floatingFlower))
|
||||
foundFloatingFlower = true;
|
||||
|
||||
else if(stack.getItem() == Item.getItemFromBlock(ModBlocks.specialFlower))
|
||||
else if(stack.getItem() == Item.getItemFromBlock(ModBlocks.specialFlower) && ItemBlockSpecialFlower.getType(stack).equals(type))
|
||||
foundSpecialFlower = true;
|
||||
|
||||
else return false; // Found an invalid item, breaking the recipe
|
||||
@@ -56,14 +61,14 @@ public class SpecialFloatingFlowerRecipe extends IForgeRegistryEntry.Impl<IRecip
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
if(!stack.isEmpty() && stack.getItem() == Item.getItemFromBlock(ModBlocks.specialFlower))
|
||||
if(!stack.isEmpty() && stack.getItem() == Item.getItemFromBlock(ModBlocks.specialFlower) && ItemBlockSpecialFlower.getType(stack).equals(type))
|
||||
specialFlower = stack;
|
||||
}
|
||||
|
||||
if(specialFlower.isEmpty())
|
||||
return ItemStack.EMPTY;
|
||||
|
||||
return ItemBlockSpecialFlower.ofType(new ItemStack(ModBlocks.floatingSpecialFlower), ItemBlockSpecialFlower.getType(specialFlower));
|
||||
return ItemBlockSpecialFlower.ofType(new ItemStack(ModBlocks.floatingSpecialFlower), type);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -27,7 +27,7 @@ import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@Optional.Interface(modid = "Railcraft", iface = "mods.railcraft.api.core.items.IMinecartItem", striprefs = true)
|
||||
@Optional.Interface(modid = "railcraft", iface = "mods.railcraft.api.core.items.IMinecartItem", striprefs = true)
|
||||
public class ItemPoolMinecart extends ItemMod implements IMinecartItem {
|
||||
|
||||
public ItemPoolMinecart() {
|
||||
|
||||
@@ -21,6 +21,7 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityMobSpawner;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
@@ -44,7 +45,6 @@ import java.util.List;
|
||||
public class ItemSpawnerMover extends ItemMod {
|
||||
|
||||
public static final String TAG_SPAWNER = "spawner";
|
||||
private static final String TAG_PLACE_DELAY = "placeDelay";
|
||||
|
||||
public ItemSpawnerMover() {
|
||||
super(LibItemNames.SPAWNER_MOVER);
|
||||
@@ -76,14 +76,6 @@ public class ItemSpawnerMover extends ItemMod {
|
||||
return getEntityId(stack) != null;
|
||||
}
|
||||
|
||||
private static int getDelay(ItemStack stack) {
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
if(tag != null)
|
||||
return tag.getInteger(TAG_PLACE_DELAY);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, World world, List<String> infoList, ITooltipFlag flags) {
|
||||
@@ -92,13 +84,6 @@ public class ItemSpawnerMover extends ItemMod {
|
||||
infoList.add(I18n.format("entity." + id + ".name"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) {
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
if(tag != null && tag.hasKey(TAG_PLACE_DELAY) && tag.getInteger(TAG_PLACE_DELAY) > 0)
|
||||
tag.setInteger(TAG_PLACE_DELAY, tag.getInteger(TAG_PLACE_DELAY) - 1);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float xOffset, float yOffset, float zOffset) {
|
||||
@@ -110,12 +95,12 @@ public class ItemSpawnerMover extends ItemMod {
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setTag(TAG_SPAWNER, new NBTTagCompound());
|
||||
te.writeToNBT(tag.getCompoundTag(TAG_SPAWNER));
|
||||
tag.setInteger(TAG_PLACE_DELAY, 20);
|
||||
player.getCooldownTracker().setCooldown(this, 20);
|
||||
itemstack.setTagCompound(tag);
|
||||
world.setBlockToAir(pos);
|
||||
UseItemSuccessTrigger.INSTANCE.trigger((EntityPlayerMP) player, itemstack, (WorldServer) world, pos.getX(), pos.getY(), pos.getZ());
|
||||
} else {
|
||||
player.renderBrokenItemStack(itemstack);
|
||||
} else {
|
||||
for(int i = 0; i < 50; i++) {
|
||||
float red = (float) Math.random();
|
||||
float green = (float) Math.random();
|
||||
@@ -126,7 +111,7 @@ public class ItemSpawnerMover extends ItemMod {
|
||||
return EnumActionResult.SUCCESS;
|
||||
} else return EnumActionResult.PASS;
|
||||
} else {
|
||||
return getDelay(itemstack) <= 0 && placeBlock(itemstack, player, world, pos, side, xOffset, yOffset, zOffset) ? EnumActionResult.SUCCESS : EnumActionResult.PASS;
|
||||
return placeBlock(itemstack, player, world, pos, side, xOffset, yOffset, zOffset) ? EnumActionResult.SUCCESS : EnumActionResult.PASS;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,16 +152,17 @@ public class ItemSpawnerMover extends ItemMod {
|
||||
return false;
|
||||
|
||||
Block block = world.getBlockState(pos).getBlock();
|
||||
if(block.equals(Blocks.MOB_SPAWNER)) {
|
||||
if(block == Blocks.MOB_SPAWNER) {
|
||||
TileEntity te = world.getTileEntity(pos);
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
if (tag.hasKey(TAG_SPAWNER))
|
||||
if (te instanceof TileEntityMobSpawner && tag.hasKey(TAG_SPAWNER)) {
|
||||
tag = tag.getCompoundTag(TAG_SPAWNER);
|
||||
tag.setInteger("x", pos.getX());
|
||||
tag.setInteger("y", pos.getY());
|
||||
tag.setInteger("z", pos.getZ());
|
||||
te.readFromNBT(tag);
|
||||
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos);
|
||||
tag.setInteger("x", pos.getX());
|
||||
tag.setInteger("y", pos.getY());
|
||||
tag.setInteger("z", pos.getZ());
|
||||
te.readFromNBT(tag);
|
||||
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ import java.util.EnumMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.items.IRunicArmor")
|
||||
@Optional.Interface(modid = "thaumcraft", iface = "thaumcraft.api.items.IRunicArmor")
|
||||
public class ItemManasteelArmor extends ItemArmor implements ISpecialArmor, IManaUsingItem, IPhantomInkable, IRunicArmor, IModelRegister {
|
||||
|
||||
private static final int MANA_PER_DAMAGE = 70;
|
||||
|
||||
@@ -49,7 +49,7 @@ import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.items.IRunicArmor")
|
||||
@Optional.Interface(modid = "thaumcraft", iface = "thaumcraft.api.items.IRunicArmor")
|
||||
@Mod.EventBusSubscriber(modid = LibMisc.MOD_ID)
|
||||
public abstract class ItemBauble extends ItemMod implements IBauble, ICosmeticAttachable, IPhantomInkable, IRunicArmor {
|
||||
|
||||
|
||||
+2
-2
@@ -22,8 +22,8 @@ import vazkii.botania.common.item.equipment.armor.elementium.ItemElementiumHelm;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
@Optional.InterfaceList({
|
||||
@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.items.IGoggles", striprefs = true),
|
||||
@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.items.IRevealer", striprefs = true)})
|
||||
@Optional.Interface(modid = "thaumcraft", iface = "thaumcraft.api.items.IGoggles", striprefs = true),
|
||||
@Optional.Interface(modid = "thaumcraft", iface = "thaumcraft.api.items.IRevealer", striprefs = true)})
|
||||
public class ItemElementiumHelmRevealing extends ItemElementiumHelm implements IGoggles, IRevealer {
|
||||
|
||||
public ItemElementiumHelmRevealing() {
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.items.IScribeTools")
|
||||
@Optional.Interface(modid = "thaumcraft", iface = "thaumcraft.api.items.IScribeTools")
|
||||
public class ItemManaInkwell extends ItemMod implements IManaItem, IScribeTools {
|
||||
|
||||
private static final int COST_PER_USE = 50;
|
||||
|
||||
+2
-2
@@ -22,8 +22,8 @@ import vazkii.botania.common.item.equipment.armor.manasteel.ItemManasteelHelm;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
@Optional.InterfaceList({
|
||||
@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.items.IGoggles", striprefs = true),
|
||||
@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.items.IRevealer", striprefs = true)})
|
||||
@Optional.Interface(modid = "thaumcraft", iface = "thaumcraft.api.items.IGoggles", striprefs = true),
|
||||
@Optional.Interface(modid = "thaumcraft", iface = "thaumcraft.api.items.IRevealer", striprefs = true)})
|
||||
public class ItemManasteelHelmRevealing extends ItemManasteelHelm implements IGoggles, IRevealer {
|
||||
|
||||
public ItemManasteelHelmRevealing() {
|
||||
|
||||
+2
-2
@@ -22,8 +22,8 @@ import vazkii.botania.common.item.equipment.armor.terrasteel.ItemTerrasteelHelm;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
@Optional.InterfaceList({
|
||||
@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.items.IGoggles", striprefs = true),
|
||||
@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.items.IRevealer", striprefs = true)})
|
||||
@Optional.Interface(modid = "thaumcraft", iface = "thaumcraft.api.items.IGoggles", striprefs = true),
|
||||
@Optional.Interface(modid = "thaumcraft", iface = "thaumcraft.api.items.IRevealer", striprefs = true)})
|
||||
public class ItemTerrasteelHelmRevealing extends ItemTerrasteelHelm implements IGoggles, IRevealer {
|
||||
|
||||
public ItemTerrasteelHelmRevealing() {
|
||||
|
||||
@@ -17,8 +17,8 @@ public final class LibMisc {
|
||||
public static final String MOD_NAME = "Botania";
|
||||
public static final String BUILD = "GRADLE:BUILD";
|
||||
public static final String VERSION = "GRADLE:VERSION-" + BUILD;
|
||||
public static final String DEPENDENCIES = "required-after:baubles;after:thaumcraft";
|
||||
public static final int DATA_VERSION = 1;
|
||||
public static final String DEPENDENCIES = "required-after:baubles@[1.5.2,);after:thaumcraft";
|
||||
|
||||
// Network Contants
|
||||
public static final String NETWORK_CHANNEL = MOD_ID;
|
||||
|
||||
Reference in new issue
Block a user