mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 03:39:17 +00:00
Merge upstream
This commit is contained in:
commit
a40a443607
92 files changed
+837
-47
No files matched your search
@@ -214,7 +214,7 @@ public final class BotaniaAPI {
|
||||
registerModWiki("EnderIO", new SimpleWikiProvider("EnderIO Wiki", "http://wiki.enderio.com/%s"));
|
||||
registerModWiki("TropiCraft", new SimpleWikiProvider("Tropicraft Wiki", "http://wiki.tropicraft.net/wiki/%s"));
|
||||
registerModWiki("RandomThings", new SimpleWikiProvider("Random Things Wiki", "http://randomthingsminecraftmod.wikispaces.com/%s"));
|
||||
registerModWiki("Witchery", new SimpleWikiProvider("Witchery Wiki", "https://sites.google.com/site/witcherymod/%s", "-"));
|
||||
registerModWiki("Witchery", new SimpleWikiProvider("Witchery Wiki", "https://sites.google.com/site/witcherymod/%s", "-", true));
|
||||
registerModWiki("AppliedEnergistics2", new SimpleWikiProvider("AE2 Wiki", "http://ae-mod.info/%s"));
|
||||
registerModWiki("BigReactors", technicWiki);
|
||||
registerModWiki("BuildCraft|Core", buildcraftWiki);
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* This class was created by <WireSegal>. 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 @ [Nov 23, 2015, 10:30:34 AM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.api.mana;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Have an Item implement this to be counted as a lens that can be combined with an ItemLens.
|
||||
*/
|
||||
public interface ICompositableLens extends ILens {
|
||||
|
||||
/**
|
||||
* Returns the properties of the itemstack, used to check if two lenses can combine.
|
||||
*/
|
||||
public int getProps(ItemStack stack);
|
||||
|
||||
/**
|
||||
* Checks if the lens is combinable.
|
||||
*/
|
||||
public boolean isCombinable(ItemStack stack);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@API(owner = "Botania", apiVersion = "68", provides = "BotaniaAPI")
|
||||
@API(owner = "Botania", apiVersion = "69", provides = "BotaniaAPI")
|
||||
package vazkii.botania.api;
|
||||
import net.minecraftforge.fml.common.API;
|
||||
|
||||
@@ -21,15 +21,28 @@ import org.apache.commons.lang3.text.WordUtils;
|
||||
public class SimpleWikiProvider implements IWikiProvider {
|
||||
|
||||
final String name, urlBase, replacement;
|
||||
final boolean lowercase;
|
||||
|
||||
public SimpleWikiProvider(String name, String urlBase) {
|
||||
this(name, urlBase, "%20");
|
||||
}
|
||||
|
||||
public SimpleWikiProvider(String name, String urlBase, boolean lowercase) {
|
||||
this(name, urlBase, "%20", lowercase);
|
||||
}
|
||||
|
||||
public SimpleWikiProvider(String name, String urlBase, String replacement) {
|
||||
this.name = name;
|
||||
this.urlBase = urlBase;
|
||||
this.replacement = replacement;
|
||||
this.lowercase = false;
|
||||
}
|
||||
|
||||
public SimpleWikiProvider(String name, String urlBase, String replacement, boolean lowercase) {
|
||||
this.name = name;
|
||||
this.urlBase = urlBase;
|
||||
this.replacement = replacement;
|
||||
this.lowercase = lowercase;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -60,7 +73,12 @@ public class SimpleWikiProvider implements IWikiProvider {
|
||||
String name = getBlockName(world, pos);
|
||||
if(name == null)
|
||||
return null;
|
||||
return String.format(urlBase, WordUtils.capitalizeFully(name).replaceAll(" ", replacement));
|
||||
|
||||
if(lowercase) {
|
||||
return String.format(urlBase, name.toLowerCase().replaceAll(" ", replacement));
|
||||
} else {
|
||||
return String.format(urlBase, WordUtils.capitalizeFully(name).replaceAll(" ", replacement));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -42,11 +42,16 @@ public final class MultiblockRenderHandler {
|
||||
public static MultiblockSet currentMultiblock;
|
||||
public static BlockPos anchor;
|
||||
public static int angle;
|
||||
public static int dimension;
|
||||
|
||||
public static void setMultiblock(MultiblockSet set) {
|
||||
currentMultiblock = set;
|
||||
anchor = null;
|
||||
angle = 0;
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if(mc.theWorld != null)
|
||||
dimension = mc.theWorld.provider.dimensionId;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@@ -68,7 +73,7 @@ public final class MultiblockRenderHandler {
|
||||
}
|
||||
|
||||
private void renderPlayerLook(EntityPlayer player, MovingObjectPosition src) {
|
||||
if(currentMultiblock != null) {
|
||||
if(currentMultiblock != null && dimension == player.worldObj.provider.dimensionId) {
|
||||
int anchorX = anchor != null ? anchor.posX : src.blockX;
|
||||
int anchorY = anchor != null ? anchor.posY : src.blockY;
|
||||
int anchorZ = anchor != null ? anchor.posZ : src.blockZ;
|
||||
|
||||
@@ -85,8 +85,10 @@ public final class PersistentVariableHelper {
|
||||
for(int i = 0; i < count; i++) {
|
||||
NBTTagCompound bookmarkCmp = bookmarksCmp.getCompoundTag(TAG_BOOKMARK_PREFIX + i);
|
||||
GuiLexicon gui = GuiLexicon.create(bookmarkCmp);
|
||||
if(gui != null)
|
||||
if(gui != null) {
|
||||
GuiLexicon.bookmarks.add(gui);
|
||||
GuiLexicon.bookmarkKeys.add(gui.getNotesKey());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -147,6 +147,7 @@ public final class TooltipAdditionDisplayHandler {
|
||||
mc.thePlayer.inventory.currentItem = lexSlot;
|
||||
Botania.proxy.setEntryToOpen(data.entry);
|
||||
Botania.proxy.setLexiconStack(lexiconStack);
|
||||
mc.thePlayer.closeScreen();
|
||||
ItemLexicon.openBook(mc.thePlayer, lexiconStack, mc.theWorld, false);
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* File Created @ [Sep 6, 2015, 1:11:25 AM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.client.gui.bag;
|
||||
package vazkii.botania.client.gui;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.client.gui.bag;
|
||||
|
||||
import vazkii.botania.client.gui.SlotLocked;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
/**
|
||||
* 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 @ [25/11/2015, 19:59:06 (GMT)]
|
||||
*/
|
||||
package vazkii.botania.client.gui.box;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.api.mana.IManaItem;
|
||||
import vazkii.botania.client.gui.SlotLocked;
|
||||
import baubles.api.BaubleType;
|
||||
import baubles.api.IBauble;
|
||||
import baubles.common.container.InventoryBaubles;
|
||||
import baubles.common.container.SlotBauble;
|
||||
import baubles.common.lib.PlayerHandler;
|
||||
|
||||
public class ContainerBaubleBox extends Container {
|
||||
|
||||
InventoryBaubleBox baubleBoxInv;
|
||||
InventoryBaubles baubles;
|
||||
|
||||
public ContainerBaubleBox(EntityPlayer player) {
|
||||
int i;
|
||||
int j;
|
||||
|
||||
int slot = player.inventory.currentItem;
|
||||
IInventory playerInv = player.inventory;
|
||||
baubleBoxInv = new InventoryBaubleBox(player, slot);
|
||||
|
||||
baubles = new InventoryBaubles(player);
|
||||
baubles.setEventHandler(this);
|
||||
if(!player.worldObj.isRemote)
|
||||
baubles.stackList = PlayerHandler.getPlayerBaubles(player).stackList;
|
||||
|
||||
addSlotToContainer(new SlotBauble(baubles, BaubleType.AMULET, 0, 8, 8 + 0 * 18));
|
||||
addSlotToContainer(new SlotBauble(baubles, BaubleType.RING, 1, 8, 8 + 1 * 18));
|
||||
addSlotToContainer(new SlotBauble(baubles, BaubleType.RING, 2, 8, 8 + 2 * 18));
|
||||
addSlotToContainer(new SlotBauble(baubles, BaubleType.BELT, 3, 8, 8 + 3 * 18));
|
||||
|
||||
for(i = 0; i < 4; ++i)
|
||||
for(j = 0; j < 6; ++j) {
|
||||
int k = j + i * 6;
|
||||
addSlotToContainer(new SlotAnyBauble(baubleBoxInv, k, 62 + j * 18, 8 + i * 18));
|
||||
}
|
||||
|
||||
for(i = 0; i < 3; ++i)
|
||||
for(j = 0; j < 9; ++j)
|
||||
addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
|
||||
for(i = 0; i < 9; ++i) {
|
||||
if(player.inventory.currentItem == i)
|
||||
addSlotToContainer(new SlotLocked(playerInv, i, 8 + i * 18, 142));
|
||||
else addSlotToContainer(new Slot(playerInv, i, 8 + i * 18, 142));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
boolean can = baubleBoxInv.isUseableByPlayer(player);
|
||||
if(!can)
|
||||
onContainerClosed(player);
|
||||
|
||||
return can;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onContainerClosed(EntityPlayer player) {
|
||||
super.onContainerClosed(player);
|
||||
baubleBoxInv.pushInventory();
|
||||
|
||||
if(!player.worldObj.isRemote)
|
||||
PlayerHandler.setPlayerBaubles(player, baubles);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putStacksInSlots(ItemStack[] p_75131_1_) {
|
||||
baubles.blockEvents = true;
|
||||
super.putStacksInSlots(p_75131_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot)inventorySlots.get(p_82846_2_);
|
||||
|
||||
if(slot != null && slot.getHasStack()) {
|
||||
ItemStack itemstack1 = slot.getStack();
|
||||
itemstack = itemstack1.copy();
|
||||
|
||||
System.out.println(p_82846_2_ + " " + itemstack);
|
||||
if(p_82846_2_ < 28) {
|
||||
if(!mergeItemStack(itemstack1, 28, 64, true))
|
||||
return null;
|
||||
} else {
|
||||
if(itemstack1 != null && (itemstack1.getItem() instanceof IBauble || itemstack1.getItem() instanceof IManaItem) && !mergeItemStack(itemstack1, 4, 28, false))
|
||||
return null;
|
||||
}
|
||||
|
||||
if(itemstack1.stackSize == 0)
|
||||
slot.putStack((ItemStack)null);
|
||||
else slot.onSlotChanged();
|
||||
|
||||
if(itemstack1.stackSize == itemstack.stackSize)
|
||||
return null;
|
||||
|
||||
slot.onPickupFromSlot(p_82846_1_, itemstack1);
|
||||
}
|
||||
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/**
|
||||
* 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 @ [25/11/2015, 19:59:11 (GMT)]
|
||||
*/
|
||||
package vazkii.botania.client.gui.box;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiInventory;
|
||||
import net.minecraft.client.renderer.InventoryEffectRenderer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
|
||||
public class GuiBaubleBox extends InventoryEffectRenderer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(LibResources.GUI_BAUBLE_BOX);
|
||||
|
||||
public GuiBaubleBox(EntityPlayer player) {
|
||||
super(new ContainerBaubleBox(player));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkHotbarKeys(int p_146983_1_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
mc.getTextureManager().bindTexture(texture);
|
||||
int k = (width - xSize) / 2;
|
||||
int l = (height - ySize) / 2;
|
||||
drawTexturedModalRect(k, l, 0, 0, xSize, ySize);
|
||||
|
||||
for(int i1 = 0; i1 < 4; ++i1) {
|
||||
Slot slot = (Slot) inventorySlots.inventorySlots.get(i1);
|
||||
if(slot.getHasStack() && slot.getSlotStackLimit() == 1)
|
||||
drawTexturedModalRect(k+slot.xDisplayPosition, l+slot.yDisplayPosition, 200, 0, 16, 16);
|
||||
}
|
||||
|
||||
GuiInventory.func_147046_a(this.guiLeft + 43, this.guiTop + 61, 20, (float)(this.guiLeft + 43 - p_146976_2_), (float)(this.guiTop + 45 - 30 - p_146976_3_), this.mc.thePlayer);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
/**
|
||||
* 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 @ [25/11/2015, 19:59:16 (GMT)]
|
||||
*/
|
||||
package vazkii.botania.client.gui.box;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.common.item.ItemBaubleBox;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class InventoryBaubleBox implements IInventory {
|
||||
|
||||
private static final ItemStack[] FALLBACK_INVENTORY = new ItemStack[16];
|
||||
|
||||
EntityPlayer player;
|
||||
int slot;
|
||||
ItemStack[] stacks = null;
|
||||
|
||||
boolean invPushed = false;
|
||||
ItemStack storedInv = null;
|
||||
|
||||
public InventoryBaubleBox(EntityPlayer player, int slot) {
|
||||
this.player = player;
|
||||
this.slot = slot;
|
||||
}
|
||||
|
||||
public static boolean isBaubleBox(ItemStack stack) {
|
||||
return stack != null && stack.getItem() == ModItems.baubleBox;
|
||||
}
|
||||
|
||||
ItemStack getStack() {
|
||||
ItemStack stack = player.inventory.getStackInSlot(slot);
|
||||
if(stack != null)
|
||||
storedInv = stack;
|
||||
return stack;
|
||||
}
|
||||
|
||||
ItemStack[] getInventory() {
|
||||
if(stacks != null)
|
||||
return stacks;
|
||||
|
||||
ItemStack stack = getStack();
|
||||
if(isBaubleBox(getStack())) {
|
||||
stacks = ItemBaubleBox.loadStacks(stack);
|
||||
return stacks;
|
||||
}
|
||||
|
||||
return FALLBACK_INVENTORY;
|
||||
}
|
||||
|
||||
public void pushInventory() {
|
||||
if(invPushed)
|
||||
return;
|
||||
|
||||
ItemStack stack = getStack();
|
||||
if(stack == null)
|
||||
stack = storedInv;
|
||||
|
||||
if(stack != null) {
|
||||
ItemStack[] inv = getInventory();
|
||||
ItemBaubleBox.setStacks(stack, inv);
|
||||
}
|
||||
|
||||
invPushed = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return 16;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int i) {
|
||||
return getInventory()[i];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int i, int j) {
|
||||
ItemStack[] inventorySlots = getInventory();
|
||||
if (inventorySlots[i] != null) {
|
||||
ItemStack stackAt;
|
||||
|
||||
if (inventorySlots[i].stackSize <= j) {
|
||||
stackAt = inventorySlots[i];
|
||||
inventorySlots[i] = null;
|
||||
return stackAt;
|
||||
} else {
|
||||
stackAt = inventorySlots[i].splitStack(j);
|
||||
|
||||
if (inventorySlots[i].stackSize == 0)
|
||||
inventorySlots[i] = null;
|
||||
|
||||
return stackAt;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int i) {
|
||||
return getStackInSlot(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int slot, ItemStack itemstack) {
|
||||
ItemStack[] inventorySlots = getInventory();
|
||||
inventorySlots[slot] = itemstack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return isBaubleBox(getStack()) ? 64 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
|
||||
return isBaubleBox(getStack());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemstack) {
|
||||
return isBaubleBox(getStack());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return LibItemNames.BAUBLE_BOX;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty() {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* 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 @ [25/11/2015, 19:59:22 (GMT)]
|
||||
*/
|
||||
package vazkii.botania.client.gui.box;
|
||||
|
||||
import baubles.api.IBauble;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.api.mana.IManaItem;
|
||||
import vazkii.botania.client.gui.bag.InventoryFlowerBag;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
|
||||
public class SlotAnyBauble extends Slot {
|
||||
|
||||
InventoryBaubleBox inv;
|
||||
|
||||
public SlotAnyBauble(InventoryBaubleBox p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_) {
|
||||
super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_);
|
||||
inv = p_i1824_1_;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlotChange(ItemStack oldStack, ItemStack newStack) {
|
||||
inv.setInventorySlotContents(slotNumber, newStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack stack) {
|
||||
return stack.getItem() instanceof IBauble || stack.getItem() instanceof IManaItem;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -79,6 +79,7 @@ public class GuiLexicon extends GuiScreen {
|
||||
public static final int NOTES_BUTTON_ID = 1336; // random button tho
|
||||
public static final int MAX_BOOKMARK_COUNT = 8;
|
||||
public static List<GuiLexicon> bookmarks = new ArrayList();
|
||||
public static List<String> bookmarkKeys = new ArrayList();
|
||||
boolean bookmarksNeedPopulation = false;
|
||||
|
||||
public static Queue<LexiconEntry> tutorial = new ArrayDeque();
|
||||
@@ -393,19 +394,24 @@ public class GuiLexicon extends GuiScreen {
|
||||
public void handleBookmark(GuiButton par1GuiButton) {
|
||||
boolean modified = false;
|
||||
int i = par1GuiButton.id - BOOKMARK_START;
|
||||
String key = getNotesKey();
|
||||
if(i == bookmarks.size()) {
|
||||
if(!bookmarks.contains(this)) {
|
||||
bookmarks.add(this);
|
||||
if(!bookmarkKeys.contains(key)) {
|
||||
bookmarks.add(this.copy());
|
||||
bookmarkKeys.add(key);
|
||||
modified = true;
|
||||
}
|
||||
} else {
|
||||
if(isShiftKeyDown()) {
|
||||
bookmarks.remove(i);
|
||||
int index = bookmarkKeys.indexOf(key);
|
||||
bookmarks.remove(index);
|
||||
bookmarkKeys.remove(index);
|
||||
|
||||
modified = true;
|
||||
} else {
|
||||
GuiLexicon bookmark = bookmarks.get(i).copy();
|
||||
Minecraft.getMinecraft().displayGuiScreen(bookmark);
|
||||
if(!bookmark.getTitle().equals(getTitle())) {
|
||||
Minecraft.getMinecraft().displayGuiScreen(bookmark);
|
||||
if(bookmark instanceof IParented)
|
||||
((IParented) bookmark).setParent(this);
|
||||
ClientTickHandler.notifyPageChange();
|
||||
|
||||
@@ -44,6 +44,7 @@ public final class LibResources {
|
||||
public static final String GUI_NEI_BLANK = PREFIX_GUI + "neiBlank.png";
|
||||
public static final String GUI_NEI_BREWERY = PREFIX_GUI + "neiBrewery.png";
|
||||
public static final String GUI_FLOWER_BAG = PREFIX_GUI + "flowerBag.png";
|
||||
public static final String GUI_BAUBLE_BOX = PREFIX_GUI + "baubleBox.png";
|
||||
public static final String GUI_HUD_ICONS = PREFIX_GUI + "hudIcons.png";
|
||||
public static final String GUI_STENCIL = PREFIX_GUI + "stencil.png";
|
||||
|
||||
@@ -104,6 +105,7 @@ public final class LibResources {
|
||||
public static final String MODEL_BREWERY = PREFIX_MODEL + "brewery.png";
|
||||
public static final String MODEL_TRAVEL_BELT = PREFIX_MODEL + "travelBelt.png";
|
||||
public static final String MODEL_SUPER_TRAVEL_BELT = PREFIX_MODEL + "superTravelBelt.png";
|
||||
public static final String MODEL_SPEED_UP_BELT = PREFIX_MODEL + "speedUpBelt.png";
|
||||
public static final String MODEL_KNOCKBACK_BELT = PREFIX_MODEL + "knockbackBelt.png";
|
||||
public static final String MODEL_HOLY_CLOAK = PREFIX_MODEL + "holyCloak.png";
|
||||
public static final String MODEL_UNHOLY_CLOAK = PREFIX_MODEL + "unholyCloak.png";
|
||||
@@ -114,6 +116,12 @@ public final class LibResources {
|
||||
public static final String MODEL_MINI_ISLAND_PODZOL = PREFIX_MODEL + "miniIslandPodzol.png";
|
||||
public static final String MODEL_MINI_ISLAND_MYCEL = PREFIX_MODEL + "miniIslandMycelium.png";
|
||||
public static final String MODEL_MINI_ISLAND_SNOW = PREFIX_MODEL + "miniIslandSnow.png";
|
||||
public static final String MODEL_MINI_ISLAND_DRY = PREFIX_MODEL + "miniIslandDry.png";
|
||||
public static final String MODEL_MINI_ISLAND_GOLDEN = PREFIX_MODEL + "miniIslandGolden.png";
|
||||
public static final String MODEL_MINI_ISLAND_VIVID = PREFIX_MODEL + "miniIslandVivid.png";
|
||||
public static final String MODEL_MINI_ISLAND_SCORCHED = PREFIX_MODEL + "miniIslandScorched.png";
|
||||
public static final String MODEL_MINI_ISLAND_INFUSED = PREFIX_MODEL + "miniIslandInfused.png";
|
||||
public static final String MODEL_MINI_ISLAND_MUTATED = PREFIX_MODEL + "miniIslandMutated.png";
|
||||
public static final String MODEL_PINK_WITHER = PREFIX_MODEL + "pinkWither.png";
|
||||
public static final String MODEL_CRYSTAL_CUBE = PREFIX_MODEL + "crystalCube.png";
|
||||
public static final String MODEL_INCENSE_PLATE = PREFIX_MODEL + "incensePlate.png";
|
||||
|
||||
@@ -246,6 +246,7 @@ public class ModelArmorElementium extends ModelBiped {
|
||||
ItemStack itemstack = player.inventory.getCurrentItem();
|
||||
heldItemRight = itemstack != null ? 1 : 0;
|
||||
|
||||
aimedBow = false;
|
||||
if (itemstack != null && player.getItemInUseCount() > 0) {
|
||||
EnumAction enumaction = itemstack.getItemUseAction();
|
||||
|
||||
|
||||
@@ -175,12 +175,13 @@ public class ModelArmorManasteel extends ModelBiped {
|
||||
ItemStack itemstack = player.inventory.getCurrentItem();
|
||||
heldItemRight = itemstack != null ? 1 : 0;
|
||||
|
||||
aimedBow = false;
|
||||
if (itemstack != null && player.getItemInUseCount() > 0) {
|
||||
EnumAction enumaction = itemstack.getItemUseAction();
|
||||
|
||||
if (enumaction == EnumAction.BLOCK)
|
||||
heldItemRight = 3;
|
||||
else if (enumaction == EnumAction.BOW)
|
||||
else if(enumaction == EnumAction.BOW)
|
||||
aimedBow = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,6 +176,7 @@ public class ModelArmorManaweave extends ModelBiped {
|
||||
ItemStack itemstack = player.inventory.getCurrentItem();
|
||||
heldItemRight = itemstack != null ? 1 : 0;
|
||||
|
||||
aimedBow = false;
|
||||
if (itemstack != null && player.getItemInUseCount() > 0) {
|
||||
EnumAction enumaction = itemstack.getItemUseAction();
|
||||
|
||||
|
||||
@@ -267,6 +267,7 @@ public class ModelArmorTerrasteel extends ModelBiped {
|
||||
ItemStack itemstack = player.inventory.getCurrentItem();
|
||||
heldItemRight = itemstack != null ? 1 : 0;
|
||||
|
||||
aimedBow = false;
|
||||
if (itemstack != null && player.getItemInUseCount() > 0) {
|
||||
EnumAction enumaction = itemstack.getItemUseAction();
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ public class BlockAltGrass extends BlockMod {
|
||||
setStepSound(soundTypeGrass);
|
||||
setUnlocalizedName(LibBlockNames.ALT_GRASS);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.ALTGRASS_VARIANT, AltGrassVariant.DRY));
|
||||
setTickRandomly(true)
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,12 +10,23 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockSkull;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTUtil;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.tileentity.TileEntitySkull;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.common.block.tile.TileGaiaHead;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
@@ -29,6 +40,7 @@ public class BlockGaiaHead extends BlockSkull {
|
||||
|
||||
public BlockGaiaHead() {
|
||||
setUnlocalizedName(LibBlockNames.GAIA_HEAD);
|
||||
setHardness(1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -42,7 +54,28 @@ public class BlockGaiaHead extends BlockSkull {
|
||||
public Item getItem(World p_149694_1_, BlockPos pos) {
|
||||
return ModItems.gaiaHead;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(IBlockAccess p_149749_1_, BlockPos pos, IBlockState state, int fortune) {
|
||||
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
|
||||
if((p_149749_6_ & 8) == 0) { // todo 1.8 p_<>_6 is meta
|
||||
ItemStack itemstack = new ItemStack(ModItems.gaiaHead, 1);
|
||||
TileEntitySkull tileentityskull = (TileEntitySkull)p_149749_1_.getTileEntity(pos);
|
||||
|
||||
if(tileentityskull == null)
|
||||
return ret;
|
||||
|
||||
ret.add(itemstack);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState p_149650_1_, Random p_149650_2_, int p_149650_3_) {
|
||||
return ModItems.gaiaHead;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDamageValue(World p_149643_1_, BlockPos pos) {
|
||||
return 0;
|
||||
@@ -57,5 +90,4 @@ public class BlockGaiaHead extends BlockSkull {
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileGaiaHead();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,8 +20,10 @@ import net.minecraft.world.World;
|
||||
import thaumcraft.api.crafting.IInfusionStabiliser;
|
||||
import vazkii.botania.api.item.IHornHarvestable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.block.BlockModFlower;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.integration.coloredlights.ColoredLightHelper;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
@@ -30,6 +32,9 @@ import net.minecraftforge.fml.common.Optional;
|
||||
@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.crafting.IInfusionStabiliser", striprefs = true)
|
||||
public class BlockShinyFlower extends BlockModFlower implements IInfusionStabiliser, IHornHarvestable {
|
||||
|
||||
private static IIcon[] icons;
|
||||
private static IIcon[] iconsAlt;
|
||||
|
||||
public BlockShinyFlower() {
|
||||
super(LibBlockNames.SHINY_FLOWER);
|
||||
setLightLevel(1F);
|
||||
@@ -42,13 +47,18 @@ public class BlockShinyFlower extends BlockModFlower implements IInfusionStabili
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
// NO-OP
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
icons = new IIcon[16];
|
||||
iconsAlt = new IIcon[16];
|
||||
for(int i = 0; i < 16; i++) {
|
||||
icons[i] = IconHelper.forName(register, "flowerGlimmering" + i);
|
||||
iconsAlt[i] = IconHelper.forName(register, "flowerGlimmering" + i, BlockModFlower.ALT_DIR);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int par1, int par2) {
|
||||
return ModBlocks.flower.getIcon(par1, par2);
|
||||
return (ConfigHandler.altFlowerTextures ? iconsAlt : icons)[Math.min(icons.length - 1, par2)];
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,12 +21,18 @@ public interface IFloatingFlower {
|
||||
public IslandType getIslandType();
|
||||
|
||||
public void setIslandType(IslandType type);
|
||||
|
||||
|
||||
public static enum IslandType {
|
||||
GRASS(LibResources.MODEL_MINI_ISLAND),
|
||||
PODZOL(LibResources.MODEL_MINI_ISLAND_PODZOL),
|
||||
MYCEL(LibResources.MODEL_MINI_ISLAND_MYCEL),
|
||||
SNOW(LibResources.MODEL_MINI_ISLAND_SNOW);
|
||||
SNOW(LibResources.MODEL_MINI_ISLAND_SNOW),
|
||||
DRY(LibResources.MODEL_MINI_ISLAND_DRY),
|
||||
GOLDEN(LibResources.MODEL_MINI_ISLAND_GOLDEN),
|
||||
VIVID(LibResources.MODEL_MINI_ISLAND_VIVID),
|
||||
SCORCHED(LibResources.MODEL_MINI_ISLAND_SCORCHED),
|
||||
INFUSED(LibResources.MODEL_MINI_ISLAND_INFUSED),
|
||||
MUTATED(LibResources.MODEL_MINI_ISLAND_MUTATED);
|
||||
|
||||
private IslandType(String s) {
|
||||
res = new ResourceLocation(s);
|
||||
|
||||
@@ -29,7 +29,7 @@ public class TileFloatingFlower extends TileMod implements IFloatingFlower {
|
||||
return retStack;
|
||||
}
|
||||
|
||||
return new ItemStack(ModBlocks.flower, 1, getBlockMetadata());
|
||||
return new ItemStack(ModBlocks.shinyFlower, 1, getBlockMetadata());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -28,7 +28,7 @@ public class PotionFeatherfeet extends PotionMod {
|
||||
public void onEntityUpdate(LivingUpdateEvent event) {
|
||||
EntityLivingBase e = event.entityLiving;
|
||||
if(hasEffect(e))
|
||||
e.fallDistance = 0F;
|
||||
e.fallDistance = 2.5F;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -224,6 +224,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
|
||||
addItem(ModItems.aesirRing);
|
||||
}
|
||||
|
||||
addItem(ModItems.baubleBox);
|
||||
addItem(ModItems.tinyPlanet);
|
||||
addBlock(ModBlocks.tinyPlanet);
|
||||
addItem(ModItems.manaRing);
|
||||
@@ -239,6 +240,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
|
||||
addItem(ModItems.pixieRing);
|
||||
addItem(ModItems.travelBelt);
|
||||
addItem(ModItems.superTravelBelt);
|
||||
addItem(ModItems.speedUpBelt);
|
||||
addItem(ModItems.knockbackBelt);
|
||||
addItem(ModItems.itemFinder);
|
||||
addItem(ModItems.monocle);
|
||||
|
||||
@@ -306,6 +306,8 @@ public final class ModCraftingRecipes {
|
||||
public static IRecipe recipeAvatar;
|
||||
public static IRecipe recipeSextant;
|
||||
public static List<IRecipe> recipesAltGrassSeeds;
|
||||
public static IRecipe recipeSpeedUpBelt;
|
||||
public static IRecipe recipeBaubleCase;
|
||||
|
||||
// Garden of Glass
|
||||
public static IRecipe recipeRootToSapling;
|
||||
@@ -2063,6 +2065,23 @@ public final class ModCraftingRecipes {
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.grassSeeds, 1, 8), new ItemStack(ModItems.grassSeeds), new ItemStack(Items.spider_eye));
|
||||
recipesAltGrassSeeds = BotaniaAPI.getLatestAddedRecipes(6);
|
||||
|
||||
// Planestrider's Sash Recipe
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.speedUpBelt),
|
||||
" M ", "PBP", " S ",
|
||||
'M', new ItemStack(Items.filled_map, 1, Short.MAX_VALUE),
|
||||
'P', new ItemStack(ModItems.grassSeeds),
|
||||
'B', new ItemStack(ModItems.travelBelt),
|
||||
'S', new ItemStack(Items.sugar));
|
||||
recipeSpeedUpBelt = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
// Bauble Case Recipe
|
||||
addOreDictRecipe(new ItemStack(ModItems.baubleBox),
|
||||
" M ", "MCG", " M ",
|
||||
'M', LibOreDict.MANA_STEEL,
|
||||
'C', new ItemStack(Blocks.chest),
|
||||
'G', "ingotGold");
|
||||
recipeBaubleCase = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Storage Block/Nugget Recipes
|
||||
|
||||
@@ -16,7 +16,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import vazkii.botania.api.mana.ILens;
|
||||
import vazkii.botania.api.mana.ICompositableLens;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.lens.ItemLens;
|
||||
|
||||
@@ -31,7 +31,7 @@ public class CompositeLensRecipe implements IRecipe {
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
if(stack != null) {
|
||||
if(stack.getItem() instanceof ILens && !foundSecondLens) {
|
||||
if(stack.getItem() instanceof ICompositableLens && !foundSecondLens) {
|
||||
if(foundLens)
|
||||
foundSecondLens = true;
|
||||
else foundLens = true;
|
||||
@@ -52,15 +52,15 @@ public class CompositeLensRecipe implements IRecipe {
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
if(stack != null) {
|
||||
if(stack.getItem() instanceof ILens)
|
||||
if(stack.getItem() instanceof ICompositableLens)
|
||||
if(lens == null)
|
||||
lens = stack;
|
||||
else secondLens = stack;
|
||||
}
|
||||
}
|
||||
|
||||
if(lens.getItem() instanceof ILens) {
|
||||
ILens lensItem = (ILens) lens.getItem();
|
||||
if(lens.getItem() instanceof ICompositableLens) {
|
||||
ICompositableLens lensItem = (ICompositableLens) lens.getItem();
|
||||
if(secondLens == null || !lensItem.canCombineLenses(lens, secondLens) || lensItem.getCompositeLens(lens) != null || lensItem.getCompositeLens(secondLens) != null)
|
||||
return null;
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ public class EntityBabylonWeapon extends EntityThrowableCopy {
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
EntityLivingBase thrower = getThrower();
|
||||
if(!worldObj.isRemote && (thrower == null || !(thrower instanceof EntityPlayer))) {
|
||||
if(!worldObj.isRemote && (thrower == null || !(thrower instanceof EntityPlayer) || thrower.isDead)) {
|
||||
setDead();
|
||||
return;
|
||||
}
|
||||
@@ -129,8 +129,8 @@ public class EntityBabylonWeapon extends EntityThrowableCopy {
|
||||
|
||||
if(living.hurtTime == 0) {
|
||||
if(player != null)
|
||||
living.attackEntityFrom(DamageSource.causePlayerDamage(player), 14);
|
||||
else living.attackEntityFrom(DamageSource.generic, 14);
|
||||
living.attackEntityFrom(DamageSource.causePlayerDamage(player), 20);
|
||||
else living.attackEntityFrom(DamageSource.generic, 20);
|
||||
onImpact(new MovingObjectPosition(living));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -47,6 +47,8 @@ import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemTinyPlanet;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class EntityManaBurst extends EntityThrowable implements IManaBurst {
|
||||
|
||||
@@ -390,6 +392,13 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_) {
|
||||
setPosition(p_70056_1_, p_70056_3_, p_70056_5_);
|
||||
setRotation(p_70056_7_, p_70056_8_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleWaterMovement() {
|
||||
return false;
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
/**
|
||||
* 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 @ [25/11/2015, 19:46:11 (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityChest;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.helper.InventoryHelper;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.lib.LibGuiIDs;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class ItemBaubleBox extends ItemMod {
|
||||
|
||||
private static final String TAG_ITEMS = "InvItems";
|
||||
private static final String TAG_SLOT = "Slot";
|
||||
|
||||
public ItemBaubleBox() {
|
||||
setUnlocalizedName(LibItemNames.BAUBLE_BOX);
|
||||
setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
player.openGui(Botania.instance, LibGuiIDs.BAUBLE_BOX, world, 0, 0, 0);
|
||||
return stack;
|
||||
}
|
||||
|
||||
|
||||
public static ItemStack[] loadStacks(ItemStack stack) {
|
||||
NBTTagList var2 = ItemNBTHelper.getList(stack, TAG_ITEMS, 10, false);
|
||||
ItemStack[] inventorySlots = new ItemStack[36];
|
||||
for(int var3 = 0; var3 < var2.tagCount(); ++var3) {
|
||||
NBTTagCompound var4 = var2.getCompoundTagAt(var3);
|
||||
byte var5 = var4.getByte(TAG_SLOT);
|
||||
if(var5 >= 0 && var5 < inventorySlots.length)
|
||||
inventorySlots[var5] = ItemStack.loadItemStackFromNBT(var4);
|
||||
}
|
||||
|
||||
return inventorySlots;
|
||||
}
|
||||
|
||||
public static void setStacks(ItemStack stack, ItemStack[] inventorySlots) {
|
||||
NBTTagList var2 = new NBTTagList();
|
||||
for(int var3 = 0; var3 < inventorySlots.length; ++var3)
|
||||
if(inventorySlots[var3] != null) {
|
||||
NBTTagCompound var4 = new NBTTagCompound();
|
||||
var4.setByte(TAG_SLOT, (byte)var3);
|
||||
inventorySlots[var3].writeToNBT(var4);
|
||||
var2.appendTag(var4);
|
||||
}
|
||||
|
||||
ItemNBTHelper.setList(stack, TAG_ITEMS, var2);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,6 +16,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
@@ -455,11 +456,11 @@ public class ItemCraftingHalo extends ItemMod implements ICraftAchievement {
|
||||
} else {
|
||||
GlStateManager.scale(0.75F, 0.75F, 0.75F);
|
||||
GlStateManager.translate(0F, 0F, 0.5F);
|
||||
GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
int renderPass = 0;
|
||||
do {
|
||||
IIcon icon = slotStack.getItem().getIcon(slotStack, renderPass);
|
||||
if(icon != null) {
|
||||
GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
Color color = new Color(slotStack.getItem().getColorFromItemStack(slotStack, renderPass));
|
||||
GlStateManager.color((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue());
|
||||
float f = icon.getMinU();
|
||||
|
||||
@@ -47,7 +47,8 @@ public class ItemGrassSeeds extends ItemMod {
|
||||
|
||||
private static final IslandType[] ISLAND_TYPES = {
|
||||
IslandType.GRASS, IslandType.PODZOL, IslandType.MYCEL,
|
||||
null, null, null, null, null, null
|
||||
IslandType.DRY, IslandType.GOLDEN, IslandType.VIVID,
|
||||
IslandType.SCORCHED, IslandType.INFUSED, IslandType.MUTATED
|
||||
};
|
||||
|
||||
private static final int SUBTYPES = 9;
|
||||
|
||||
@@ -55,6 +55,7 @@ import vazkii.botania.common.item.equipment.bauble.ItemMiningRing;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemMonocle;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemPixieRing;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemReachRing;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemSpeedUpBelt;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemSuperLavaPendant;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemSuperTravelBelt;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemSwapRing;
|
||||
@@ -266,6 +267,8 @@ public final class ModItems {
|
||||
public static Item autocraftingHalo;
|
||||
public static Item gaiaHead;
|
||||
public static Item sextant;
|
||||
public static Item speedUpBelt;
|
||||
public static Item baubleBox;
|
||||
|
||||
public static void init() {
|
||||
lexicon = new ItemLexicon();
|
||||
@@ -414,6 +417,8 @@ public final class ModItems {
|
||||
autocraftingHalo = new ItemAutocraftingHalo();
|
||||
gaiaHead = new ItemGaiaHead();
|
||||
sextant = new ItemSextant();
|
||||
speedUpBelt = new ItemSpeedUpBelt();
|
||||
baubleBox = new ItemBaubleBox();
|
||||
|
||||
OreDictionary.registerOre(LibOreDict.LEXICON, lexicon);
|
||||
for(int i = 0; i < 16; i++) {
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
/**
|
||||
* 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 @ [24/11/2015, 22:50:29 (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item.equipment.bauble;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemSpeedUpBelt extends ItemTravelBelt {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_SPEED_UP_BELT);
|
||||
|
||||
private static final String TAG_SPEED = "speed";
|
||||
private static final String TAG_OLD_X = "oldX";
|
||||
private static final String TAG_OLD_Y = "oldY";
|
||||
private static final String TAG_OLD_Z = "oldZ";
|
||||
|
||||
public ItemSpeedUpBelt() {
|
||||
super(LibItemNames.SPEED_UP_BELT, 0F, 0.2F, 2F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getRenderTexture() {
|
||||
return texture;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getSpeed(ItemStack stack) {
|
||||
return ItemNBTHelper.getFloat(stack, TAG_SPEED, 0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMovedTick(ItemStack stack, EntityPlayer player) {
|
||||
float speed = getSpeed(stack);
|
||||
float newspeed = Math.min(0.25F, speed + 0.00035F);
|
||||
ItemNBTHelper.setFloat(stack, TAG_SPEED, newspeed);
|
||||
commitPositionAndCompare(stack, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNotMovingTick(ItemStack stack, EntityPlayer player) {
|
||||
if(!commitPositionAndCompare(stack, player))
|
||||
ItemNBTHelper.setFloat(stack, TAG_SPEED, 0F);
|
||||
}
|
||||
|
||||
public boolean commitPositionAndCompare(ItemStack stack, EntityPlayer player) {
|
||||
if(player.worldObj.isRemote)
|
||||
return true;
|
||||
|
||||
double oldX = ItemNBTHelper.getDouble(stack, TAG_OLD_X, 0);
|
||||
double oldY = ItemNBTHelper.getDouble(stack, TAG_OLD_Y, 0);
|
||||
double oldZ = ItemNBTHelper.getDouble(stack, TAG_OLD_Z, 0);
|
||||
|
||||
ItemNBTHelper.setDouble(stack, TAG_OLD_X, player.posX);
|
||||
ItemNBTHelper.setDouble(stack, TAG_OLD_Y, player.posY);
|
||||
ItemNBTHelper.setDouble(stack, TAG_OLD_Z, player.posZ);
|
||||
|
||||
return Math.abs(oldX - player.posX) > 0.001 || Math.abs(oldY - player.posY) > 0.001 || Math.abs(oldZ - player.posZ) > 0.001;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -79,15 +79,21 @@ public class ItemTravelBelt extends ItemBauble implements IBaubleRender, IManaUs
|
||||
ItemStack belt = PlayerHandler.getPlayerBaubles(player).getStackInSlot(3);
|
||||
if(playersWithStepup.contains(s)) {
|
||||
if(shouldPlayerHaveStepup(player)) {
|
||||
if((player.onGround || player.capabilities.isFlying) && player.moveForward > 0F && !player.isInsideOfMaterial(Material.water))
|
||||
player.moveFlying(0F, 1F, player.capabilities.isFlying ? ((ItemTravelBelt) belt.getItem()).speed : ((ItemTravelBelt) belt.getItem()).speed * 2);
|
||||
ItemTravelBelt beltItem = (ItemTravelBelt) belt.getItem();
|
||||
|
||||
if((player.onGround || player.capabilities.isFlying) && player.moveForward > 0F && !player.isInsideOfMaterial(Material.water)) {
|
||||
float speed = beltItem.getSpeed(belt);
|
||||
player.moveFlying(0F, 1F, player.capabilities.isFlying ? speed : speed);
|
||||
beltItem.onMovedTick(belt, player);
|
||||
|
||||
if(player.ticksExisted % COST_INTERVAL == 0)
|
||||
ManaItemHandler.requestManaExact(belt, player, COST, true);
|
||||
} else beltItem.onNotMovingTick(belt, player);
|
||||
|
||||
if(player.isSneaking())
|
||||
player.stepHeight = 0.50001F; // Not 0.5F because that is the default
|
||||
else player.stepHeight = 1F;
|
||||
|
||||
if(player.ticksExisted % COST_INTERVAL == 0)
|
||||
ManaItemHandler.requestManaExact(belt, player, COST, true);
|
||||
} else {
|
||||
player.stepHeight = 0.5F;
|
||||
playersWithStepup.remove(s);
|
||||
@@ -98,6 +104,18 @@ public class ItemTravelBelt extends ItemBauble implements IBaubleRender, IManaUs
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public float getSpeed(ItemStack stack) {
|
||||
return speed;
|
||||
}
|
||||
|
||||
public void onMovedTick(ItemStack stack, EntityPlayer player) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
public void onNotMovingTick(ItemStack stack, EntityPlayer player) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerJump(LivingJumpEvent event) {
|
||||
|
||||
@@ -137,6 +137,8 @@ public final class ToolCommons {
|
||||
float f2 = player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw) * f;
|
||||
double d0 = player.prevPosX + (player.posX - player.prevPosX) * f;
|
||||
double d1 = player.prevPosY + (player.posY - player.prevPosY) * f;
|
||||
if (!world.isRemote && player instanceof EntityPlayer)
|
||||
d1 += ((EntityPlayer) player).eyeHeight; // todo 1.8 possibly unneeded
|
||||
double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * f;
|
||||
Vec3 vec3 = new Vec3(d0, d1, d2);
|
||||
float f3 = MathHelper.cos(-f2 * 0.017453292F - (float) Math.PI);
|
||||
|
||||
@@ -29,6 +29,7 @@ import net.minecraftforge.oredict.RecipeSorter;
|
||||
import net.minecraftforge.oredict.RecipeSorter.Category;
|
||||
import vazkii.botania.api.internal.IManaBurst;
|
||||
import vazkii.botania.api.mana.BurstProperties;
|
||||
import vazkii.botania.api.mana.ICompositableLens;
|
||||
import vazkii.botania.api.mana.ILens;
|
||||
import vazkii.botania.api.mana.ILensControl;
|
||||
import vazkii.botania.api.mana.IManaSpreader;
|
||||
@@ -42,7 +43,7 @@ import vazkii.botania.common.item.ItemMod;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
public class ItemLens extends ItemMod implements ILensControl, ITinyPlanetExcempt {
|
||||
public class ItemLens extends ItemMod implements ILensControl, ICompositableLens, ITinyPlanetExcempt {
|
||||
|
||||
public static final int SUBTYPES = 22;
|
||||
|
||||
@@ -273,8 +274,10 @@ public class ItemLens extends ItemMod implements ILensControl, ITinyPlanetExcemp
|
||||
lenses[index] = lens;
|
||||
}
|
||||
|
||||
public static boolean isBlacklisted(int lens1, int lens2) {
|
||||
return (props[lens1] & props[lens2]) != 0;
|
||||
public static boolean isBlacklisted(ItemStack lens1, ItemStack lens2) {
|
||||
ICompositableLens item1 = (ICompositableLens) lens1.getItem();
|
||||
ICompositableLens item2 = (ICompositableLens) lens2.getItem();
|
||||
return (item1.getProps(lens1) & item2.getProps(lens2)) != 0;
|
||||
}
|
||||
|
||||
public static Lens getLens(int index) {
|
||||
@@ -287,13 +290,15 @@ public class ItemLens extends ItemMod implements ILensControl, ITinyPlanetExcemp
|
||||
|
||||
@Override
|
||||
public boolean canCombineLenses(ItemStack sourceLens, ItemStack compositeLens) {
|
||||
if(sourceLens.getItemDamage() == compositeLens.getItemDamage())
|
||||
ICompositableLens sourceItem = (ICompositableLens) sourceLens.getItem();
|
||||
ICompositableLens compositeItem = (ICompositableLens) compositeLens.getItem();
|
||||
if(sourceItem == compositeItem && sourceLens.getItemDamage() == compositeLens.getItemDamage())
|
||||
return false;
|
||||
|
||||
if(sourceLens.getItemDamage() == NORMAL || compositeLens.getItemDamage() == NORMAL)
|
||||
if(!sourceItem.isCombinable(sourceLens) || !compositeItem.isCombinable(compositeLens))
|
||||
return false;
|
||||
|
||||
if(isBlacklisted(sourceLens.getItemDamage(), compositeLens.getItemDamage()))
|
||||
if(isBlacklisted(sourceLens, compositeLens))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -322,7 +327,7 @@ public class ItemLens extends ItemMod implements ILensControl, ITinyPlanetExcemp
|
||||
|
||||
@Override
|
||||
public boolean isControlLens(ItemStack stack) {
|
||||
return (props[stack.getItemDamage()] & PROP_CONTROL) != 0;
|
||||
return (getProps(stack) & PROP_CONTROL) != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -339,4 +344,14 @@ public class ItemLens extends ItemMod implements ILensControl, ITinyPlanetExcemp
|
||||
public void onControlledSpreaderPulse(ItemStack stack, IManaSpreader spreader, boolean redstone) {
|
||||
lenses[stack.getItemDamage()].onControlledSpreaderPulse(stack, spreader, redstone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProps(ItemStack stack) {
|
||||
return props[stack.getItemDamage()];
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCombinable(ItemStack stack) {
|
||||
return stack.getItemDamage() != NORMAL;
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,19 @@ public class ItemTerraformRod extends ItemMod implements IManaUsingItem, IBlockP
|
||||
"snowLayer",
|
||||
"mycelium",
|
||||
"podzol",
|
||||
"sandstone"
|
||||
"sandstone",
|
||||
|
||||
// Mod support
|
||||
"blockDiorite",
|
||||
"stoneDiorite",
|
||||
"blockGranite",
|
||||
"stoneGranite",
|
||||
"blockAndesite",
|
||||
"stoneAndesite",
|
||||
"marble",
|
||||
"blockMarble",
|
||||
"limestone",
|
||||
"blockLimestone"
|
||||
});
|
||||
|
||||
public ItemTerraformRod() {
|
||||
|
||||
@@ -250,6 +250,8 @@ public final class LexiconData {
|
||||
public static LexiconEntry judgementCloaks;
|
||||
public static LexiconEntry monocle;
|
||||
public static LexiconEntry swapRing;
|
||||
public static LexiconEntry speedUpBelt;
|
||||
public static LexiconEntry baubleBox;
|
||||
|
||||
public static LexiconEntry alfhomancyIntro;
|
||||
public static LexiconEntry elvenMessage;
|
||||
@@ -951,6 +953,12 @@ public final class LexiconData {
|
||||
swapRing = new BLexiconEntry(LibLexicon.BAUBLE_SWAP_RING, categoryBaubles);
|
||||
swapRing.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeSwapRing));
|
||||
|
||||
speedUpBelt = new BLexiconEntry(LibLexicon.BAUBLE_SPEED_UP_BELT, categoryBaubles);
|
||||
speedUpBelt.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeSpeedUpBelt));
|
||||
|
||||
baubleBox = new BLexiconEntry(LibLexicon.BAUBLE_BOX, categoryBaubles);
|
||||
baubleBox.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeBaubleCase)).setPriority();
|
||||
|
||||
// ALFHOMANCY ENTRIES
|
||||
alfhomancyIntro = new BLexiconEntry(LibLexicon.ALF_INTRO, categoryAlfhomancy);
|
||||
alfhomancyIntro.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeAlfPortal), new PageCraftingRecipe("3", ModCraftingRecipes.recipeNaturaPylon), new PageMultiblock("4", ModMultiblocks.alfPortal),
|
||||
|
||||
@@ -15,5 +15,6 @@ public final class LibGuiIDs {
|
||||
public static final int LEXICON = 0;
|
||||
public static final int CRAFTING_HALO = 1;
|
||||
public static final int FLOWER_BAG = 2;
|
||||
public static final int BAUBLE_BOX = 3;
|
||||
|
||||
}
|
||||
@@ -159,6 +159,8 @@ public final class LibItemNames {
|
||||
public static final String AUTOCRAFTING_HALO = "autocraftingHalo";
|
||||
public static final String GAIA_HEAD = "gaiaHead";
|
||||
public static final String SEXTANT = "sextant";
|
||||
public static final String SPEED_UP_BELT = "speedUpBelt";
|
||||
public static final String BAUBLE_BOX = "baubleBox";
|
||||
|
||||
public static final String[] LENS_NAMES = new String[] {
|
||||
"lensNormal",
|
||||
|
||||
@@ -221,6 +221,8 @@ public final class LibLexicon {
|
||||
public static final String BAUBLE_JUDGEMENT_CLOAKS = "judgementCloaks";
|
||||
public static final String BAUBLE_MONOCLE = "monocle";
|
||||
public static final String BAUBLE_SWAP_RING = "swapRing";
|
||||
public static final String BAUBLE_SPEED_UP_BELT = "speedUpBelt";
|
||||
public static final String BAUBLE_BOX = "baubleBox";
|
||||
|
||||
public static final String ALF_INTRO = "aIntro";
|
||||
public static final String ALF_MESSAGE = "elfMessage";
|
||||
|
||||
@@ -14,6 +14,8 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.client.gui.bag.ContainerFlowerBag;
|
||||
import vazkii.botania.client.gui.bag.GuiFlowerBag;
|
||||
import vazkii.botania.client.gui.box.ContainerBaubleBox;
|
||||
import vazkii.botania.client.gui.box.GuiBaubleBox;
|
||||
import vazkii.botania.client.gui.crafting.ContainerCraftingHalo;
|
||||
import vazkii.botania.client.gui.crafting.GuiCraftingHalo;
|
||||
import vazkii.botania.client.gui.lexicon.GuiLexicon;
|
||||
@@ -29,6 +31,8 @@ public class GuiHandler implements IGuiHandler {
|
||||
return new ContainerCraftingHalo(player.inventory, world);
|
||||
case LibGuiIDs.FLOWER_BAG :
|
||||
return new ContainerFlowerBag(player);
|
||||
case LibGuiIDs.BAUBLE_BOX :
|
||||
return new ContainerBaubleBox(player);
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -44,6 +48,8 @@ public class GuiHandler implements IGuiHandler {
|
||||
return new GuiCraftingHalo(player.inventory, world);
|
||||
case LibGuiIDs.FLOWER_BAG :
|
||||
return new GuiFlowerBag(player);
|
||||
case LibGuiIDs.BAUBLE_BOX :
|
||||
return new GuiBaubleBox(player);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in new issue
Block a user