From 753a03b291dc362b8dee5c18de02b5476f0a3ca5 Mon Sep 17 00:00:00 2001 From: Patric Alexandre Date: Fri, 8 Jan 2016 14:04:34 -0300 Subject: [PATCH 01/11] Brew relataded pages --- .../resources/assets/botania/lang/pt_BR.lang | 123 ++++++++++++++++-- 1 file changed, 109 insertions(+), 14 deletions(-) diff --git a/src/main/resources/assets/botania/lang/pt_BR.lang b/src/main/resources/assets/botania/lang/pt_BR.lang index 2ea703941..752924ae2 100644 --- a/src/main/resources/assets/botania/lang/pt_BR.lang +++ b/src/main/resources/assets/botania/lang/pt_BR.lang @@ -34,12 +34,12 @@ botaniamisc.toolRank=Rank %s&7 botaniamisc.edition=%sª Edição # ^ Leave this empty for no edition display botaniamisc.devEdition=Escritor -botaniamisc.lexiconcover0=Seu guia para -botaniamisc.lexiconcover1=necessidades Botânicas -botaniamisc.lexiconcover2=do melhor autor -botaniamisc.lexiconcover3=Lizbeth "Vazkii" Rika -botaniamisc.lexiconcover4=Editado por BevoLJ -botaniamisc.lexiconcover5=Editado por Saice +botaniamisc.lexiconcover0=Um manual por Lizbeth +botaniamisc.lexiconcover1="Vazkii" Whitewood +botaniamisc.lexiconcover2=O guia oficial para +botaniamisc.lexiconcover3=suas dúvidas em Botania! +botaniamisc.lexiconcover4=Edited by BevoLJ +botaniamisc.lexiconcover5=Edited by Saice botaniamisc.shiftinfo=Segure &bSHIFT&7 para mais informações botaniamisc.knowledgeTypesSingular=Contém a Escola de Conhecimento: %s botaniamisc.knowledgeTypesPlural=Contém as Escolas de Conhecimento: %s @@ -65,7 +65,7 @@ botaniamisc.dropTip1=CTRL-%key% derruba uma stack completa botaniamisc.wandMode.bind=Modo de associação botaniamisc.wandMode.function=Mode funcional botaniamisc.playVideo=Mostrar vídeo -botaniamisc.brewOf=Poção de %s +botaniamisc.brewOf=Fermentado de %s botaniamisc.needsCatalysts=Não importa o quanto você forçe a barra de Terrasteel no Sinalizador, nada acontece, talvez a disposição dos pilões catalizadores esteja errada. botaniamisc.peacefulNoob=Você tenta oferecer a barra de Terrasteel, mas vibrações pacíficas do seu mundo parecem impedir. Talvez você possa fazer algo para resolver. botaniamisc.notInfused=Não infundido @@ -150,6 +150,8 @@ botaniamisc.noVideo=O vídeo volta em breve. Desculpa :( botaniamisc.adaptativeConfigChanges=As configurações adaptivas do Botania mudaram alguns padrões por você: botaniamisc.altarRefill0=Clique com a mão vazia para botaniamisc.altarRefill1=recriar a última receita +botaniamisc.santaweaveInfo=Manaweave, mudada para as &cf&fe&cs&ft&ca&fs +botaniamisc.enterToView=^ Aperte ENTER para ver ^ # NEI INTEGRATION botania.nei.brewery=Fermentador Botânico @@ -159,6 +161,24 @@ botania.nei.manaPool=Infusão com Mana botania.nei.petalApothecary=Boticário de Pétalas botania.nei.runicAltar=Altar Rúnico botania.nei.pureDaisy=Margarida Pura +botania.nei.lexica=Lexica Botania +nei.options.keys.gui.botania_corporea_request=Pedido Corporea + +botania.nei.lexicaSeparator=Informação extra: +botania.nei.lexicaNoInfo=(não há informação adicional aqui, desculpa!) + +# NEI QUICK LOOKS +botania.nei.quickInfo:tile.livingwood0~0=Você pode criar Madeira-viva colocando Madeira do lado da Margarida Pura +botania.nei.quickInfo:tile.livingrock0~0=Você pode criar Rocha-viva colocando Pedra do lado da Margarida Pura + +botania.nei.quickInfo:flower.daybloom=Nesse mundo, é matar ou morrer +botania.nei.quickInfo:flower.daybloomPrimus=Essa flor não pode ser movida, apenas encontrada pelo mundo +botania.nei.quickInfo:flower.nightshadePrimus=Essa flor não pode ser movida, apenas encontrada pelo mundo + +botania.nei.quickInfo:item.bone~0=Você pode se arrepender +botania.nei.quickInfo:item.lexicon~0=O que você esperava? +botania.nei.quickInfo:item.terrasteel~4=Você consegue Terrasteel ao jogar os materiais certos na Placa de Aglomeração Terrestre +botania.nei.quickInfo:item.enderAirBottle~15=Você consegue isso ao clicar com uma Garrafa de Vidro no Fim # BUILDCRAFT INTEGRATION botania.trigger.manaDetector=Pulso de Mana @@ -1512,10 +1532,10 @@ item.botania:diviningRod.name=Cajado do Manto Pleno item.botania:gravityRod.name=Cajado da Mesa Sombria item.botania:regenIvy.name=Hera Eterna item.botania:manaInkwell.name=Tinteiro do Botanurgista -item.botania:vial0.name=Frasco de Vidro de Mana -item.botania:vial1.name=Garrafa de Vidro Élfico -item.botania:brewVial.name=Frasco de %s (%s) -item.botania:brewFlask.name=Garrafa de %s (%s) +item.botania:vial0.name=Frasco Pequeno +item.botania:vial1.name=Frasco de Vidro Élfico +item.botania:brewVial.name=Frasco Pequeno de %s (%s) +item.botania:brewFlask.name=Frasco de %s (%s) item.botania:bloodPendant.name=Pingente de Sangue item.botania:redString.name=Fio-vermelho item.botania:missileRod.name=Cajado do Depósito Instável @@ -1627,6 +1647,10 @@ item.botania:manaweaveHelm.name=Capuz de Tecido de Mana item.botania:manaweaveChest.name=Robe Superior de Tecido de Mana item.botania:manaweaveLegs.name=Robe Inferior de Tecido de Mana item.botania:manaweaveBoots.name=Botas de Tecido de Mana +item.botania:santaweaveHelm.name=Capuz Natalino +item.botania:santaweaveChest.name=Robe Superior Natalino +item.botania:santaweaveLegs.name=Robe Inferior Natalino +item.botania:santaweaveBoots.name=Botas Natalinas item.botania:gaiaHead.name=Cabeça de Guardião de Gaia item.botania:sextant.name=Sextante do Modulador do Mundo item.botania:speedUpBelt.name=Cinta do Desbravador Planar @@ -2238,7 +2262,7 @@ botania.entry.dreamwoodSpreader=Dispersor de Mana Élfico botania.tagline.dreamwoodSpreader=Harder, better, faster, stronger botania.page.dreamwoodSpreader0=Simplificando, &1Madeira dos sonhos&0 conduz &4Mana&0 melhor que &1Madeira-viva&0. Colocando alguns ajustes como usar &1Elementium&0 ao invés de &1Ouro&0 e o que você consegue é um &1Dispersor de Mana&0 que pode conduzir mais &4Mana&0, mais rápido e por mais tempo sem &4perda de Mana&0.
No lado negativo, ele não pode ser convertido em um &1Dispersor de Mana por Redstone&0. botania.page.dreamwoodSpreader1=Um Dispersor melhor, só isso -botania.page.dreamwoodSpreader2=Combinando esse poderoso Dispersor com um &1Espírito de Gaia&0 e uma &1Pedra Draconiana&0, uma variante ainda mais poderosa pode ser criada. O &1Disperosr de Gaia&0 é o melhor dos Dispersores de Mana, com todas melhorias.
Note que esse Dispersordispara cargas maiores de Mana, e por isso pode disparar com menos frequência. +botania.page.dreamwoodSpreader2=Combinando esse poderoso Dispersor com um &1Espírito de Gaia&0 e uma &1Pedra Draconiana&0, uma variante ainda mais poderosa pode ser criada. O &1Dispersor de Gaia&0 é o melhor dos Dispersores de Mana, com todas melhorias.
Note que esse Dispersordispara cargas maiores de Mana, e por isso pode disparar com menos frequência. botania.page.dreamwoodSpreader3=ULTRA_SPREADER # -- ELVEN MANA LENSES @@ -2343,7 +2367,7 @@ botania.page.orechid1=&oNot dragon poop&r. # -- ORECHID IGNEM botania.entry.orechidIgnem=Orechid Ignem botania.tagline.orechidIgnem=Cria minérios a partir de Rocha do Nether -botania.page.orechidIgnem0=A &1Orechid&0 é uma boa flor. A habilidade de criar minérios com &4Mana&0 pode ser uma benção para qualquer botanista sedentério. Entretano, não cria minérios do &4Nether&0. Isso é resolvido facilmente, trocando algumas pétalas, elas cria minérios do &4Nether&0 em &1Rocha do Nether&0. A flor deve estar no Nether para funcionar. +botania.page.orechidIgnem0=A &1Orechid&0 é uma boa flor. A habilidade de criar minérios com &4Mana&0 pode ser uma benção para qualquer botanista sedentério. Entretanto, não cria minérios do &4Nether&0. Isso é resolvido facilmente, trocando algumas pétalas, elas cria minérios do &4Nether&0 em &1Rocha do Nether&0. A flor deve estar no Nether para funcionar. botania.page.orechidIgnem1=&oTá meio quente aqui&r. # -- FALLEN KANADE @@ -2569,7 +2593,7 @@ botania.tagline.rafflowsia=Mana de flores botania.page.rafflowsia0=Uma vez, os plebeus da nação se divertiam em plantar enormes campos de &1Dayblooms&0, &1Nightshades&0 e &1Hydroangeas&0. Os cidadãos inferiores se aprovetiavam do ganho gratuito de &4Mana&0 proveniente de vários elementos.
Eles eram felizes com a própria ignorância. botania.page.rafflowsia1=Um dia, os plebeus acordaram com seus grandes jardins secos, e todo seu trabalho duro se tornou &1Arbustos Mortos&0.
Revoltados com a traição de seus deuses, os homens e mulheres da nação gritaram: "Flores passivas são inúteis agora!" botania.page.rafflowsia2=Ou isso eles acreditavam. Em pouco tempo, sábios engenhosos descobriram uma flor que pode utilizar dessas 'flores inutilizadas'.
Essa flor foi apelidada de &1Rafflowsia&0. -botania.page.rafflowsia3=A &1Rafflowsia&0 funciona como a &1Kekimurus&0, mas usando &4flores passivas&0, ela as encontra e as destrói, gerando &4Mana&0.
Entretando, há retornos diminuídos nesse processo, para um uso eficiente, o mesmo tipo de flor não deve ser usada várias vezes seguidas. +botania.page.rafflowsia3=A &1Rafflowsia&0 funciona como a &1Kekimurus&0, mas usando &4flores passivas&0, ela as encontra e as destrói, gerando &4Mana&0.
Entretanto, há retornos diminuídos nesse processo, para um uso eficiente, o mesmo tipo de flor não deve ser usada várias vezes seguidas. botania.page.rafflowsia4=&oUm Novo Amanhecer, assim dizendo&r. # -- DANDELIFEON @@ -2643,6 +2667,77 @@ botania.page.manaAlchemy23=Fazendo &1Terra Áspera&0 botania.page.manaAlchemy24=Transmutando &1Grama&0 botania.page.manaAlchemy25=Transmutando flores mundanas +# -- BOTANICAL BREWERY +botania.entry.brewery=Fermentador Botânico +botania.tagline.brewery=Cria poções mais fortes +botania.page.brewery0=Devido a versatilidade da &4Mana&0, o fato de ser possível fazer novas &4Poções&0 não é surpresa. Simplificando, &4Fermentados&0 são uma variante de &4Poções&0. Eles são produzidos usando &4Mana&0 e alguns outros ingredientes.
Diferente das &4Poções&0, &4Fermentados&0 possum receita fixa, e cada frasco dura várias doses. +botania.page.brewery1=Para criar &4Fermentados&0 é necessário um &1Fermentador Botânico&0, &1Frascos&0 e claro, os reagentes.
A &4Mana&0 funciona como solvente e fonte de energia e é fornecida por &4Pulsos de Mana&0, mirando um &1Dispersor de Mana&0 para o &1Fermentador&0. +botania.page.brewery2=Criando o &1Fermentador Botânico&0 +botania.page.brewery3=Criando &1Frascos&0 +botania.page.brewery4=Trabalhar com o &1Fermentador Botânico&0 é simples. Primeiramente, para adicionar um item, clique com ele no bloco ou jogue-o.
Comece adicionando o &1Frasco&0, que é colocado ao topo do fermentador. Prossiga adicionando os reagentes necessários. Assim que um &4Fermentado&0 puder ser criado com tais ingredientes, &4Mana&0 começará a fluir, depois basta esperar. +botania.page.brewery5a=Um fermentado simples, que replica uma &1Poção de Velocidade&0, aplicando um efeito de &4Velocidade II&0. +botania.page.brewery5b=Gotta go fast +botania.page.brewery6a=Um fermentado simples, que replica uma &1Poção de Força&0, aplicando um efeito de &4Força II&0. +botania.page.brewery6b=Hodor +botania.page.brewery7a=Um fermentado simples, que replica uma &1Poção de Pressa&0, aplicando um efeito de &4Pressa II&0. +botania.page.brewery7b=Cheio de C9H13NO3 +botania.page.brewery8a=Um fermentado simples, que replica uma &1Poção de Cura&0, aplicando um efeito de &4Cura Instantânea II&0. +botania.page.brewery8b=He pulled a Truesilver, GG +botania.page.brewery9a=Um fermentado simples, que replica uma &1Poção de Super-pulo&0, aplicando um efeito de &4Super Pulo II&0. +botania.page.brewery9b=I got jumps, isn't that what the kids say? +botania.page.brewery10a=Um fermentado simples, que replica uma &1Poção de Regeneração&0, aplicando um efeito de &4Regeneração II&0. +botania.page.brewery10b=Good reaction to simochi +botania.page.brewery17a=Um fermentado simples, que replica uma &1Poção de Regeneração&0, aplicando um efeito de &4Regeneração&0 mais longo que. +botania.page.brewery17b=I guess she was just more resilient +botania.page.brewery11a=Um fermentado simples, que replica uma &1Poção de Resistência&0, aplicando um efeito de &4Resistência II&0. +botania.page.brewery11b=Can't touch this +botania.page.brewery12a=Um fermentado simples, que replica uma &1Poção de Resistência ao Fogo&0, aplicando um efeito de &4Resistência ao Fogo&0. +botania.page.brewery12b=Ele não dragão, fogo não mata dragão +botania.page.brewery13a=Um fermentado simples, que replica uma &1Poção de Respiração Aquática&0, aplicando um efeito de &4Respiração Aquática&0. +botania.page.brewery13b=Under the sea, under the sea +botania.page.brewery14a=Um fermentado simples, que replica uma &1Poção de Invisibilidade&0, aplicando um efeito de &4Invisibilidade&0. +botania.page.brewery14b=Finja que tem Incursio +botania.page.brewery15a=Um fermentado simples, que replica uma &1Poção de Visão Noturna&0, aplicando um efeito de &4Visão Noturna&0. +botania.page.brewery15b=Does it come with a silence? +botania.page.brewery16a=Um fermentado simples, que replica uma &1Poção de Absorção&0, aplicando um efeito de &4Absorção IV&0. +botania.page.brewery16b=Você vai pegar um resfriado + +# -- BREWING FLASKS +botania.entry.flasks=Garrafas de Poção +botania.tagline.flasks=Mais usos para poções +botania.page.flasks0=&1Vidro Élfico&0 parece ser mais maleável que o &1Vidro de Mana&0 comum usado em &1Frascos Pequenos&0. Um &1Frasco&0, feito de &1Vidro Élfico&0 é o típico armazenamento élfico para &4Fermentados&0, e pode conservar 6 doses, ao invés das 4 de um &1Frasco Pequeno&0. +botania.page.flasks1=Os custos em ingredientes para um &1Frasco&0 é menor a longo prazo, o custo de &4Mana&0 dobra.
Finalmente, devido ao gargalo maior do &1Frasco&0, os conteúdos podem ser consumidos mais rapidamente. +botania.page.flasks2=Pegue um em baixo da ponte + +# -- COMPLEX BREWING +botania.entry.complexBrews=Fermentados Complexos +botania.tagline.complexBrews=Poções mais fortes com novos efeitos +botania.page.complexBrews0=Além dos padrões, simples &1Fermentados&0 que não passam de mímicas de &1Poções&0 que podem ser feitas em um &1Estande de Poções&0 também existem fermentados complexos, com mais efeitos. +botania.page.complexBrews1a=Essa poção aplica efeitos positivos e negativos. Tomá-la deixa o usuário em um estado de poder, mas com vulnerabilidades. +botania.page.complexBrews1b=96 Herblore +botania.page.complexBrews2a=Qualquer entidade afetada por essa poção regenera vida sempre que matar outra criatura. +botania.page.complexBrews2b=It predates the set +botania.page.complexBrews3a=Qualquer entidade afetada por essa poção não sofre dano de queda. +botania.page.complexBrews3b=And I call it magic +botania.page.complexBrews4a=Essa poção lança uma aura de vazio ao redor de quem a usar. No raio de 128 blocos, nenhum monstro pode aparecer naturalmente. +botania.page.complexBrews4b=Fechem as comportas +botania.page.complexBrews5a=Essa poção lança uma aura de vazio ao redor de quem a usar. No raio de 64 blocos, as restrições de aparecimento de monstros são retiradas. Não funciona com &1Vazio da Alma&0. +botania.page.complexBrews5b=Devemos rezar por um milagre? +botania.page.complexBrews6a=Um jogador afetado pelo efeito dessa poção possui muito mais habilidade de pesca e consegue os resultados na metade do tempo. +botania.page.complexBrews6b=Maybe you'll catch a Chris +botania.page.complexBrews7a=Quando consumida, limpa qualquer efeito do jogador, negativo ou não. +botania.page.complexBrews7b=Absolute sooooooul + +# -- BREW INCENSES +botania.entry.incense=Incensos +botania.tagline.incense=Poções com efeito em área +botania.page.incense0=&4Fermentado&0 oferecem uma variedade de efeitos na forma líquida. Entretanto, não duram muito e levam espaço no inventário. Usando &1Incensos&0, esse problema é aliviado. Eles podem ser infundidos como &4Fermentados&0, mas levam dez vezes mais &4Mana&0. +botania.page.incense1=Um &1Incenso&0 pode ser colocado numa &1Bandeja de Incensos&0 ao clicar, e um &1Isqueiro&0 para acender. Uma vez acesa, a vareta não pode ser recuperada.
Uma única vareta queima por sessenta vezes mais que a forma líquida da poção antes de acabar. +botania.page.incense2=&1Bandejas de Incenso&0 com &1Incensos&0 acesos aplicam o efeito do &4Fermentado&0 infuso na vareta para qualquer jogador num raio de 30 blocos.
Nem todos efeitos são possíveis de aplicar aos &1Incensos&0, por exemplo, &4Cura Instantânea&0 ou &1Absorção&0, ou qualquer fermentado com mais de um efeito. +botania.page.incense5=Para os amantes de incensos que também são viciados em automação, a &1Bandeja de Incensos&0 pode receber itens por &1Funis&0 ou outros métodos. Ela emite um sinal de &1Comparador&0 de força 1 quando tem uma vareta, e de 2 quando aceso.
Finalmente, quando um &4Pulso de Mana&0 com &1Lente de Aquecimento&0 acerta uma bandeja com um incenso, ele se acende. +botania.page.incense3=Incense is wincense +botania.page.incense4=I can incense it + # -- FEL PUMPKIN botania.entry.felPumpkin=Fel Pumpkin botania.tagline.felPumpkin=Uma abóbora que pode invocar Blazes From f641e165b049c7d2b2b9113d098f09c11996270b Mon Sep 17 00:00:00 2001 From: yrsegal Date: Sat, 9 Jan 2016 17:35:14 -0500 Subject: [PATCH 02/11] actually call canFit --- src/main/java/vazkii/botania/common/block/tile/TileAltar.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/vazkii/botania/common/block/tile/TileAltar.java b/src/main/java/vazkii/botania/common/block/tile/TileAltar.java index c7590243b..d6e58645c 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileAltar.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileAltar.java @@ -94,7 +94,7 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I boolean didChange = false; - if(stack.getItem() instanceof IFlowerComponent) { + if(stack.getItem() instanceof IFlowerComponent && ((IFlowerComponent) stack.getItem()).canFit(stack, this)) { if(getStackInSlot(getSizeInventory() - 1) != null) return false; From cbcc49b8968f04d6ce47701beee88cb261904278 Mon Sep 17 00:00:00 2001 From: Michael Brenan Date: Mon, 11 Jan 2016 18:28:01 -0600 Subject: [PATCH 03/11] Fix #1728 - Pasture seed grass spreading obeys grass block growth rules --- .../botania/common/item/ItemGrassSeeds.java | 156 +++++++++++++----- 1 file changed, 118 insertions(+), 38 deletions(-) diff --git a/src/main/java/vazkii/botania/common/item/ItemGrassSeeds.java b/src/main/java/vazkii/botania/common/item/ItemGrassSeeds.java index 38f401564..0d3937078 100644 --- a/src/main/java/vazkii/botania/common/item/ItemGrassSeeds.java +++ b/src/main/java/vazkii/botania/common/item/ItemGrassSeeds.java @@ -12,6 +12,7 @@ package vazkii.botania.common.item; import java.util.ArrayList; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Random; @@ -169,10 +170,14 @@ public class ItemGrassSeeds extends ItemMod { int dim = event.world.provider.dimensionId; if(blockSwappers.containsKey(dim)) { List swappers = blockSwappers.get(dim); - List swappersSafe = new ArrayList(swappers); - - for(BlockSwapper s : swappersSafe) - s.tick(swappers); + + Iterator iter = swappers.listIterator(); + + while(iter.hasNext()) { + BlockSwapper next = iter.next(); + if(!next.tick()) + iter.remove(); + } } } } @@ -202,30 +207,60 @@ public class ItemGrassSeeds extends ItemMod { } } + /** + * A block swapper for the Pasture Seeds, which swaps dirt and grass blocks + * centered around a provided point to a provided block/metadata. + */ private static class BlockSwapper { - final World world; - final Random rand; - final Block blockToSet; - final int metaToSet; + /** + * The range of the block swapper, in blocks. + */ + public static final int RANGE = 3; + + /** + * The range around which a block can spread in a single tick. + */ + public static final int TICK_RANGE = 1; + + private final World world; + private final Random rand; + private final Block blockToSet; + private final int metaToSet; - ChunkCoordinates startCoords; - int ticksExisted = 0; + private ChunkCoordinates startCoords; + private int ticksExisted = 0; - BlockSwapper(World world, ChunkCoordinates coords, Block block, int meta) { + /** + * Constructs a new block swapper with the provided world, starting + * coordinates, target block, and target metadata. + * @param world The world to swap blocks in. + * @param coords The central coordinates to swap blocks around. + * @param block The target block to swap dirt and grass to. + * @param meta The metadata of the target block to swap dirt and grass to. + */ + public BlockSwapper(World world, ChunkCoordinates coords, Block block, int meta) { this.world = world; - blockToSet = block; - metaToSet = meta; - rand = new Random(coords.posX ^ coords.posY ^ coords.posZ); - startCoords = coords; + this.blockToSet = block; + this.metaToSet = meta; + this.rand = new Random(coords.posX ^ coords.posY ^ coords.posZ); + this.startCoords = coords; } - void tick(List list) { + /** + * Ticks this block swapper, allowing it to make an action during + * this game tick. This method should return "false" when the swapper + * has finished operation and should be removed from the world. + * @return true if the swapper should continue to exist, false if it + * should be removed. + */ + public boolean tick() { ++ticksExisted; - int range = 3; - for(int i = -range; i < range + 1; i++) - for(int j = -range; j < range + 1; j++) { + // Go through all blocks in the specified RANGE, and then + // try and spread around that block if it is our target block already + for(int i = -RANGE; i <= RANGE; i++) { + for(int j = -RANGE; j <= RANGE; j++) { int x = startCoords.posX + i; int y = startCoords.posY; int z = startCoords.posZ + j; @@ -233,28 +268,73 @@ public class ItemGrassSeeds extends ItemMod { int meta = world.getBlockMetadata(x, y, z); if(block == blockToSet && meta == metaToSet) { - if(ticksExisted % 20 == 0) { - List validCoords = new ArrayList(); - for(int k = -1; k < 2; k++) - for(int l = -1; l < 2; l++) { - int x1 = x + k; - int z1 = z + l; - Block block1 = world.getBlock(x1, y, z1); - int meta1 = world.getBlockMetadata(x1, y, z1); - if((block1 == Blocks.dirt || block1 == Blocks.grass) && meta1 == 0) - validCoords.add(new ChunkCoordinates(x1, y, z1)); - } - - if(!validCoords.isEmpty() && !world.isRemote) { - ChunkCoordinates coords = validCoords.get(rand.nextInt(validCoords.size())); - world.setBlock(coords.posX, coords.posY, coords.posZ, blockToSet, metaToSet, 1 | 2); - } - } + // Only make changes every 20 ticks + if(ticksExisted % 20 != 0) continue; + + tickBlock(x, y, z); } } + } - if(ticksExisted >= 80) - list.remove(this); + // This swapper should exist for 80 ticks + return ticksExisted < 80; + } + + /** + * Tick a specific block position, finding the valid blocks + * immediately adjacent to it and then replacing one at random. + * @param x The x-coordinate to use. + * @param y The y-coordinate to use. + * @param z The z-coordinate to use. + */ + public void tickBlock(int x, int y, int z) { + List validCoords = new ArrayList(); + + // Go around this block and aggregate valid blocks. + for(int xOffset = -TICK_RANGE; xOffset <= TICK_RANGE; xOffset++) { + for(int zOffset = -TICK_RANGE; zOffset <= TICK_RANGE; zOffset++) { + // Skip the current block + if(xOffset == 0 && zOffset == 0) continue; + + if(isValidSwapPosition(x + xOffset, y, z + zOffset)) + validCoords.add(new ChunkCoordinates(x + xOffset, y, z + zOffset)); + } + } + + // If we can make changes, and have at least 1 block to swap, + // then swap a random block from the valid blocks we could swap. + if(!validCoords.isEmpty() && !world.isRemote) { + ChunkCoordinates toSwap = validCoords.get(rand.nextInt(validCoords.size())); + + world.setBlock(toSwap.posX, toSwap.posY, toSwap.posZ, blockToSet, metaToSet, 1 | 2); + } + } + + /** + * Determines if a given position is a valid location to spread to, which + * means that the block must be either dirt or grass (with meta 0), + * and have a block above it which does not block grass growth. + * @param x The x-coordinate to check. + * @param y The y-coordinate to check. + * @param z The z-coordinate to check. + * @return True if the position is valid to swap, false otherwise. + */ + public boolean isValidSwapPosition(int x, int y, int z) { + Block block = world.getBlock(x, y, z); + int meta = world.getBlockMetadata(x, y, z); + + Block aboveBlock = world.getBlock(x, y + 1, z); + + // Valid blocks to spread to are either dirt or grass, and do not + // have blocks which block grass growth. + + // See http://minecraft.gamepedia.com/Grass_Block + // The major rule is that a block which reduces light + // levels by 2 or more blocks grass growth. + + return (block == Blocks.dirt || block == Blocks.grass) + && (meta == 0) + && (aboveBlock.getLightOpacity(world, x, y, z) <= 1); } } From ac88d0627a82ae1d798a77ebcd4eecbeb4f386d3 Mon Sep 17 00:00:00 2001 From: Michael Brenan Date: Tue, 12 Jan 2016 01:18:29 -0600 Subject: [PATCH 04/11] Fix #1724 - Slabs and snow prevent Rod of Shifting Crust replacement --- .../common/item/rod/ItemExchangeRod.java | 87 ++++++++++--------- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemExchangeRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemExchangeRod.java index ebd0d40d6..54a188c34 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemExchangeRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemExchangeRod.java @@ -154,56 +154,57 @@ public class ItemExchangeRod extends ItemMod implements IManaUsingItem, IWirefra } } - public Boolean[][][] createMatrix(World world, ItemStack stack, Block blockToSwap, int metaToSwap, int xc, int yc, int zc, Block targetBlock, int targetMeta) { + public List getBlocksToSwap(World world, ItemStack stack, Block blockToSwap, int metaToSwap, int xc, int yc, int zc, Block targetBlock, int targetMeta) { + // If we have no target block passed in, infer it to be + // the block which the swapping is centered on (presumably the block + // which the player is looking at) if(targetBlock == null) { targetBlock = world.getBlock(xc, yc, zc); targetMeta = world.getBlockMetadata(xc, yc, zc); } - int effrange = RANGE + ItemNBTHelper.getInt(stack, TAG_EXTRA_RANGE, 1); - int diameter = effrange * 2 + 1; - Boolean[][][] matrix = new Boolean[diameter][diameter][diameter]; - for(int i = 0; i < diameter; i++) - for(int j = 0; j < diameter; j++) - for(int k = 0; k < diameter; k++) { - int x = xc + i - effrange; - int y = yc + j - effrange; - int z = zc + k - effrange; - Block block = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - boolean invalid = !BlockCamo.isValidBlock(block); - if(invalid) - matrix[i][j][k] = true; - else if(block == blockToSwap && meta == metaToSwap || block != targetBlock || meta != targetMeta) - matrix[i][j][k] = null; - else matrix[i][j][k] = false; - } + // Our result list + List coordsList = new ArrayList(); - return matrix; - } - - public List getBlocksToSwap(World world, ItemStack stack, Block blockToSwap, int metaToSwap, int xc, int yc, int zc, Block targetBlock, int targetMeta) { - List coordsList = new ArrayList(); - Boolean[][][] matrix = createMatrix(world, stack, blockToSwap, metaToSwap, xc, yc, zc, targetBlock, targetMeta); - - int effrange = RANGE + ItemNBTHelper.getInt(stack, TAG_EXTRA_RANGE, 1); - int diameter = effrange * 2; - for(int i = 1; i < diameter; i++) - for(int j = 1; j < diameter; j++) - for(int k = 1; k < diameter; k++) { - int x = xc + i - effrange; - int y = yc + j - effrange; - int z = zc + k - effrange; - - Boolean bool = matrix[i][j][k]; - if(bool != null && !bool) - for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - Boolean obool = matrix[i + dir.offsetX][j + dir.offsetY][k + dir.offsetZ]; - if(obool != null && obool) { - coordsList.add(new ChunkCoordinates(x, y, z)); - break; - } + // We subtract 1 from the effective range as the center tile is included + // So, with a range of 3, we are visiting tiles at -2, -1, 0, 1, 2 + int effRange = RANGE + ItemNBTHelper.getInt(stack, TAG_EXTRA_RANGE, 1) - 1; + + // Iterate in all 3 dimensions through our possible positions. + for(int offsetX = -effRange; offsetX <= effRange; offsetX++) + for(int offsetY = -effRange; offsetY <= effRange; offsetY++) + for(int offsetZ = -effRange; offsetZ <= effRange; offsetZ++) { + int x = xc + offsetX, y = yc + offsetY, z = zc + offsetZ; + + Block currentBlock = world.getBlock(x, y, z); + int currentMeta = world.getBlockMetadata(x, y, z); + + // If this block is not our target, ignore it, as we don't need + // to consider replacing it + if(currentBlock != targetBlock || currentMeta != targetMeta) + continue; + + // If this block is already the block we're swapping to, + // we don't need to swap again + if(currentBlock == blockToSwap && currentMeta == metaToSwap) + continue; + + // Check to see if the block is visible on any side: + for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { + int adjX = x + dir.offsetX, adjY = y + dir.offsetY, adjZ = z + dir.offsetZ; + Block adjBlock = world.getBlock(adjX, adjY, adjZ); + + // If the side of the adjacent block facing this block is + // _not_ solid, then this block is considered "visible" + // and should be replaced. + + // If there is a rendering-specific way to check for this, + // that should be placed in preference to this. + if(!adjBlock.isSideSolid(world, adjX, adjY, adjZ, dir.getOpposite())) { + coordsList.add(new ChunkCoordinates(x, y, z)); + break; } + } } return coordsList; From a7000e8a47e15ee62665487003837f3c761dbf99 Mon Sep 17 00:00:00 2001 From: Jonathan Smith Date: Tue, 12 Jan 2016 12:12:20 +0000 Subject: [PATCH 05/11] Add Material.gourd to Axe materials. Closes #1732. Allows use of the quickest mining tool for items with Material.gourd (Pumpkins, Melons, etc.) --- .../vazkii/botania/common/item/equipment/tool/ToolCommons.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/ToolCommons.java b/src/main/java/vazkii/botania/common/item/equipment/tool/ToolCommons.java index 9c1a31fe6..c6346db91 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/ToolCommons.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/ToolCommons.java @@ -36,7 +36,7 @@ public final class ToolCommons { public static Material[] materialsPick = new Material[]{ Material.rock, Material.iron, Material.ice, Material.glass, Material.piston, Material.anvil }; public static Material[] materialsShovel = new Material[]{ Material.grass, Material.ground, Material.sand, Material.snow, Material.craftedSnow, Material.clay }; - public static Material[] materialsAxe = new Material[]{ Material.coral, Material.leaves, Material.plants, Material.wood }; + public static Material[] materialsAxe = new Material[]{ Material.coral, Material.leaves, Material.plants, Material.wood, Material.gourd }; public static void damageItem(ItemStack stack, int dmg, EntityLivingBase entity, int manaPerDamage) { int manaToRequest = dmg * manaPerDamage; From c20247b680d99a061d4de5d5a8bd313a09327299 Mon Sep 17 00:00:00 2001 From: yrsegal Date: Sun, 10 Jan 2016 11:38:14 -0500 Subject: [PATCH 06/11] Baubles now able to IBlockProvide MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows for things like Botanical Addons’ Toolbelt to provide from the tools in them while worn. --- .../botania/common/item/rod/ItemExchangeRod.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemExchangeRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemExchangeRod.java index ebd0d40d6..c247c2b55 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemExchangeRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemExchangeRod.java @@ -31,6 +31,7 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action; +import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.item.IBlockProvider; import vazkii.botania.api.item.IManaProficiencyArmor; import vazkii.botania.api.item.IWireframeCoordinateListProvider; @@ -278,13 +279,23 @@ public class ItemExchangeRod extends ItemMod implements IManaUsingItem, IWirefra if(player.capabilities.isCreativeMode) return new ItemStack(block, 1, meta); - return removeFromInventory(player, player.inventory, stack, block, meta, doit); + ItemStack outStack = removeFromInventory(player, BotaniaAPI.internalHandler.getBaublesInventory(player), stack, block, meta, doit); + if (outStack == null) + outStack = removeFromInventory(player, player.inventory, stack, block, meta, doit); + return outStack; } public static int getInventoryItemCount(EntityPlayer player, ItemStack stack, Block block, int meta) { if(player.capabilities.isCreativeMode) return -1; - return getInventoryItemCount(player, player.inventory, stack, block, meta); + + int baubleCount = getInventoryItemCount(player, BotaniaAPI.internalHandler.getBaublesInventory(player), stack, block, meta); + if (baubleCount == -1) return -1; + + int count = getInventoryItemCount(player, player.inventory, stack, block, meta); + if (count == -1) return -1; + + return count+baubleCount; } public static int getInventoryItemCount(EntityPlayer player, IInventory inv, ItemStack stack, Block block, int meta) { From 4abb2cdd8920a5ea2fde3e74f669bac3fc4472f6 Mon Sep 17 00:00:00 2001 From: Michael Brenan Date: Wed, 13 Jan 2016 03:42:32 -0600 Subject: [PATCH 07/11] Fix #1700 - Terra Axe strictly follow 32 block range and leaf logic --- .../tool/terrasteel/ItemTerraAxe.java | 311 ++++++++++++++---- 1 file changed, 251 insertions(+), 60 deletions(-) diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraAxe.java b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraAxe.java index 24c275cbc..370081172 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraAxe.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraAxe.java @@ -12,8 +12,12 @@ package vazkii.botania.common.item.equipment.tool.terrasteel; import java.util.ArrayList; import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.PriorityQueue; +import java.util.Set; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; @@ -41,9 +45,32 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker { + + /** + * The number of blocks per tick which the Terra Truncator will + * collect. + */ + public static final int BLOCK_SWAP_RATE = 10; + + /** + * The maximum radius (in blocks) which the Terra Truncator will go + * in order to try and murder/cut down the tree. + */ + public static final int BLOCK_RANGE = 32; + + /** + * The maximum number of leaf blocks which the Terra Truncator will chew/go + * through once a leaf block is encountered. + */ + public static final int LEAF_BLOCK_RANGE = 3; + + /** + * The amount of mana required to restore 1 point of damage. + */ private static final int MANA_PER_DAMAGE = 100; - private static Map> blockSwappers = new HashMap(); + + private static Map> blockSwappers = new HashMap>(); IIcon iconOn, iconOff; @@ -93,7 +120,7 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker public void breakOtherBlock(EntityPlayer player, ItemStack stack, int x, int y, int z, int originX, int originY, int originZ, int side) { if(shouldBreak(player)) { ChunkCoordinates coords = new ChunkCoordinates(x, y, z); - addBlockSwapper(player.worldObj, player, stack, coords, coords, 32, false, true, new ArrayList()); + addBlockSwapper(player.worldObj, player, stack, coords, 32, true); } } @@ -108,84 +135,248 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker int dim = event.world.provider.dimensionId; if(blockSwappers.containsKey(dim)) { List swappers = blockSwappers.get(dim); - List swappersSafe = new ArrayList(swappers); - swappers.clear(); - - for(BlockSwapper s : swappersSafe) - if(s != null) - s.tick(); + + // Iterate through all of our swappers, removing any + // which no longer need to tick. + Iterator swapper = swappers.iterator(); + while(swapper.hasNext()) { + BlockSwapper next = swapper.next(); + if(!next.tick()) + swapper.remove(); + } } } } - private static BlockSwapper addBlockSwapper(World world, EntityPlayer player, ItemStack stack, ChunkCoordinates origCoords, ChunkCoordinates coords, int steps, boolean leaves, boolean force, List posChecked) { - BlockSwapper swapper = new BlockSwapper(world, player, stack, origCoords, coords, steps, leaves, force, posChecked); + private static BlockSwapper addBlockSwapper(World world, EntityPlayer player, ItemStack stack, ChunkCoordinates origCoords, int steps, boolean leaves) { + BlockSwapper swapper = new BlockSwapper(world, player, stack, origCoords, steps, leaves); int dim = world.provider.dimensionId; if(!blockSwappers.containsKey(dim)) - blockSwappers.put(dim, new ArrayList()); + blockSwappers.put(dim, new ArrayList()); + blockSwappers.get(dim).add(swapper); return swapper; } + /** + * A block swapper for the Terra Truncator, which uses a standard + * Breadth First Search to try and murder/cut down trees. + * + * The Terra Truncator will look up to BLOCK_RANGE blocks to find wood + * to cut down (only cutting down adjacent pieces of wood, so it doesn't + * jump through the air). However, the truncator will only go through + * LEAF_BLOCK_RANGE leave blocks in order to prevent adjacent trees which + * are connected only by leaves from being devoured as well. + * + * The leaf restriction is implemented by reducing the number of remaining + * steps to the min of LEAF_BLOCK_RANGE and the current range. The restriction + * can be removed entirely by setting the "leaves" variable to true, in which + * case leaves will be treated normally. + */ private static class BlockSwapper { - - final World world; - final EntityPlayer player; - final ItemStack stack; - final ChunkCoordinates origCoords; - final int steps; - final ChunkCoordinates coords; - final boolean leaves; - final boolean force; - final List posChecked; - BlockSwapper(World world, EntityPlayer player, ItemStack stack, ChunkCoordinates origCoords, ChunkCoordinates coords, int steps, boolean leaves, boolean force, List posChecked) { + + /** + * Represents the range which a single block will scan when looking + * for the next candidates for swapping. 1 is a good default. + */ + public static final int SINGLE_BLOCK_RADIUS = 1; + + + /** + * The world the block swapper is doing the swapping in. + */ + private final World world; + + /** + * The player the swapper is swapping for. + */ + private final EntityPlayer player; + + /** + * The Terra Truncator which created this swapper. + */ + private final ItemStack truncator; + + /** + * The origin of the swapper (eg, where it started). + */ + private final ChunkCoordinates origin; + + /** + * Denotes whether leaves should be treated specially. + */ + private final boolean treatLeavesSpecial; + + /** + * The initial range which this block swapper starts with. + */ + private final int range; + + /** + * The priority queue of all possible candidates for swapping. + */ + private PriorityQueue candidateQueue; + + /** + * The set of already swaps coordinates which do not have + * to be revisited. + */ + private Set completedCoords; + + /** + * Creates a new block swapper with the provided parameters. + * @param world The world the swapper is in. + * @param player The player responsible for creating this swapper. + * @param truncator The Terra Truncator responsible for creating this swapper. + * @param origCoords The original coordinates this swapper should start at. + * @param range The range this swapper should swap in. + * @param leaves If true, leaves will be treated specially and + * severely reduce the radius of further spreading when encountered. + */ + public BlockSwapper(World world, EntityPlayer player, ItemStack truncator, ChunkCoordinates origCoords, int range, boolean leaves) { this.world = world; this.player = player; - this.stack = stack; - this.origCoords = origCoords; - this.coords = coords; - this.steps = steps; - this.leaves = leaves; - this.force = force; - this.posChecked = posChecked; + this.truncator = truncator; + this.origin = origCoords; + this.range = range; + this.treatLeavesSpecial = leaves; + + this.candidateQueue = new PriorityQueue(); + this.completedCoords = new HashSet(); + + // Add the origin to our candidate queue with the original range + candidateQueue.offer(new SwapCandidate(this.origin, this.range)); } - - void tick() { - Block blockat = world.getBlock(coords.posX, coords.posY, coords.posZ); - if(!force && blockat.isAir(world, coords.posX, coords.posY, coords.posZ)) - return; - - ToolCommons.removeBlockWithDrops(player, stack, world, coords.posX, coords.posY, coords.posZ, origCoords.posX, origCoords.posY, origCoords.posZ, null, ToolCommons.materialsAxe, EnchantmentHelper.getEnchantmentLevel(Enchantment.silkTouch.effectId, stack) > 0, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack), 0F, false, !leaves); - - if(steps == 0) - return; - - for(int i = 0; i < 3; i++) - for(int j = 0; j < 3; j++) - for(int k = 0; k < 3; k++) { - int x = coords.posX + i - 1; - int y = coords.posY + j - 1; - int z = coords.posZ + k - 1; - String pstr = posStr(x, y, z); - if(posChecked.contains(pstr)) + + /** + * Ticks this Block Swapper, which allows it to swap BLOCK_SWAP_RATE + * further blocks and expands the breadth first search. The return + * value signifies whether or not the block swapper has more blocks + * to swap, or if it has finished swapping. + * @return True if the block swapper has more blocks to swap, false + * otherwise (implying it can be safely removed). + */ + public boolean tick() { + // If empty, this swapper is done. + if(candidateQueue.isEmpty()) + return false; + + int remainingSwaps = BLOCK_SWAP_RATE; + while(remainingSwaps > 0 && !candidateQueue.isEmpty()) { + SwapCandidate cand = candidateQueue.poll(); + + // If we've already completed this location, move along, as this + // is just a suboptimal one. + if(completedCoords.contains(cand.coordinates)) + continue; + + // If this candidate is out of range, discard it. + if(cand.range <= 0) + continue; + + // Otherwise, perform the break and then look at the adjacent tiles. + // This is a ridiculous function call here. + ToolCommons.removeBlockWithDrops(player, truncator, world, + cand.coordinates.posX, cand.coordinates.posY, cand.coordinates.posZ, + origin.posX, origin.posY, origin.posZ, + null, ToolCommons.materialsAxe, + EnchantmentHelper.getEnchantmentLevel(Enchantment.silkTouch.effectId, truncator) > 0, + EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, truncator), + 0F, false, treatLeavesSpecial); + + remainingSwaps--; + + completedCoords.add(cand.coordinates); + + // Then, go through all of the adjacent blocks and look if + // any of them are any good. + for(ChunkCoordinates adj : adjacent(cand.coordinates)) { + Block block = world.getBlock(adj.posX, adj.posY, adj.posZ); + + boolean isWood = block.isWood(world, adj.posX, adj.posY, adj.posZ); + boolean isLeaf = block.isLeaves(world, adj.posX, adj.posY, adj.posZ); + + // If it's not wood or a leaf, we aren't interested. + if(!isWood && !isLeaf) + continue; + + // If we treat leaves specially and this is a leaf, it gets + // the minimum of the leaf range and the current range - 1. + // Otherwise, it gets the standard range - 1. + int newRange = treatLeavesSpecial && isLeaf ? + Math.min(LEAF_BLOCK_RANGE, cand.range - 1) : + cand.range - 1; + + candidateQueue.offer(new SwapCandidate(adj, newRange)); + } + } + + // If we did any iteration, then hang around until next tick. + return true; + } + + public List adjacent(ChunkCoordinates original) { + List coords = new ArrayList(); + // Visit all the surrounding blocks in the provided radius. + // Gotta love these nested loops, right? + for(int dx = -SINGLE_BLOCK_RADIUS; dx <= SINGLE_BLOCK_RADIUS; dx++) + for(int dy = -SINGLE_BLOCK_RADIUS; dy <= SINGLE_BLOCK_RADIUS; dy++) + for(int dz = -SINGLE_BLOCK_RADIUS; dz <= SINGLE_BLOCK_RADIUS; dz++) { + // Skip the central tile. + if(dx == 0 && dy == 0 && dz == 0) continue; - - Block block = world.getBlock(x, y, z); - boolean log = block.isWood(world, x, y, z); - boolean leaf = block.isLeaves(world, x, y, z); - if(log || leaf) { - int steps = this.steps - 1; - steps = leaf ? leaves ? steps : 3 : steps; - addBlockSwapper(world, player, stack, origCoords, new ChunkCoordinates(x, y, z), steps, leaf, false, posChecked); - posChecked.add(pstr); - } + + coords.add(new ChunkCoordinates(original.posX + dx, original.posY + dy, original.posZ + dz)); } + + return coords; } - String posStr(int x, int y, int z) { - return x + ":" + y + ":" + z; + /** + * Represents a potential candidate for swapping/removal. Sorted by + * range (where a larger range is more preferable). As we're using + * a priority queue, which is a min-heap internally, larger ranges + * are considered "smaller" than smaller ranges (so they show up in the + * min-heap first). + */ + public static final class SwapCandidate implements Comparable { + /** + * The location of this swap candidate. + */ + public ChunkCoordinates coordinates; + + /** + * The remaining range of this swap candidate. + */ + public int range; + + /** + * Constructs a new Swap Candidate with the provided + * coordinates and range. + * @param coordinates The coordinates of this candidate. + * @param range The remaining range of this candidate. + */ + public SwapCandidate(ChunkCoordinates coordinates, int range) { + this.coordinates = coordinates; + this.range = range; + } + + @Override + public int compareTo(SwapCandidate other) { + // Aka, a bigger range implies a smaller value, meaning + // bigger ranges will be preferred in a min-heap + return other.range - range; + } + + @Override + public boolean equals(Object other) { + if(!(other instanceof SwapCandidate)) return false; + + SwapCandidate cand = (SwapCandidate) other; + return coordinates.equals(cand.coordinates) && range == cand.range; + } } } From f5210997ca6bfe97671e2cfb66b7ac8c5d3170b1 Mon Sep 17 00:00:00 2001 From: Michael Brenan Date: Wed, 13 Jan 2016 16:21:47 -0600 Subject: [PATCH 08/11] Clean up common/item/ItemGaiaHead.java --- .../botania/common/item/ItemGaiaHead.java | 148 +++++++----------- 1 file changed, 57 insertions(+), 91 deletions(-) diff --git a/src/main/java/vazkii/botania/common/item/ItemGaiaHead.java b/src/main/java/vazkii/botania/common/item/ItemGaiaHead.java index 42363e19a..ec8205310 100644 --- a/src/main/java/vazkii/botania/common/item/ItemGaiaHead.java +++ b/src/main/java/vazkii/botania/common/item/ItemGaiaHead.java @@ -2,10 +2,10 @@ * This class was created by . 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 @ [Sep 23, 2015, 11:40:51 PM (GMT)] */ package vazkii.botania.common.item; @@ -18,6 +18,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntitySkull; import net.minecraft.util.MathHelper; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.lib.LibItemNames; @@ -27,103 +28,68 @@ public class ItemGaiaHead extends ItemMod { setUnlocalizedName(LibItemNames.GAIA_HEAD); } - // Copypasta from ItemSkull and I'm not even going to bother to clean it up - // - // Deal with it. + // I couldn't deal with it. @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(p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_).isReplaceable(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_) && p_77648_7_ != 0) - { - p_77648_7_ = 1; - p_77648_5_--; + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float sideX, float sideY, float sideZ) { + // The side of the wall the head is being used on. + ForgeDirection sideDir = ForgeDirection.getOrientation(side); + + // If we can replace the block we're clicking on, then we'll go ahead + // and replace it (eg, snow). + if (world.getBlock(x, y, z).isReplaceable(world, x, y, z) && sideDir != ForgeDirection.DOWN) { + sideDir = ForgeDirection.UP; + y--; } - if (p_77648_7_ == 0) - { + + // Skulls can't be placed on the bottom side of a block. + if (sideDir == ForgeDirection.DOWN) return false; - } - else if (!p_77648_3_.isSideSolid(p_77648_4_, p_77648_5_, p_77648_6_, net.minecraftforge.common.util.ForgeDirection.getOrientation(p_77648_7_))) - { + + // If the side we're trying to place the skull on isn't solid, then + // we can't place it either. + if (!world.isSideSolid(x, y, z, sideDir)) return false; + + // Figure out where the skull actually goes based on the side we're placing it against. + switch(sideDir) { + case UP: y++; break; // If we're placing it on the top, then the skull goes 1 block above. + case NORTH: z--; break; // Placing it on the north side (Z- axis). + case SOUTH: z++; break; // Placing it on the south side (Z+ axis). + case WEST: x--; break; // Placing it on the west side (X- axis). + case EAST: x++; break; // Placing it on the east side (X+ axis). + default: return false; // Oops, this shouldn't happen. } - else - { - if (p_77648_7_ == 1) - { - ++p_77648_5_; - } - - if (p_77648_7_ == 2) - { - --p_77648_6_; - } - - if (p_77648_7_ == 3) - { - ++p_77648_6_; - } - - if (p_77648_7_ == 4) - { - --p_77648_4_; - } - - if (p_77648_7_ == 5) - { - ++p_77648_4_; - } - - } - { - if (!p_77648_3_.isRemote) - { - if (!Blocks.skull.canPlaceBlockOnSide(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_)) return false; - p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, ModBlocks.gaiaHead, p_77648_7_, 2); // Gaia head instead of skull - int i1 = 0; - - if (p_77648_7_ == 1) - { - i1 = MathHelper.floor_double(p_77648_2_.rotationYaw * 16.0F / 360.0F + 0.5D) & 15; - } - - TileEntity tileentity = p_77648_3_.getTileEntity(p_77648_4_, p_77648_5_, p_77648_6_); - - if (tileentity != null && tileentity instanceof TileEntitySkull) - { - /*if (p_77648_1_.getItemDamage() == 3) - { - GameProfile gameprofile = null; - - if (p_77648_1_.hasTagCompound()) - { - NBTTagCompound nbttagcompound = p_77648_1_.getTagCompound(); - - if (nbttagcompound.hasKey("SkullOwner", 10)) - { - gameprofile = NBTUtil.func_152459_a(nbttagcompound.getCompoundTag("SkullOwner")); - } - else if (nbttagcompound.hasKey("SkullOwner", 8) && nbttagcompound.getString("SkullOwner").length() > 0) - { - gameprofile = new GameProfile((UUID)null, nbttagcompound.getString("SkullOwner")); - } - } - - ((TileEntitySkull)tileentity).func_152106_a(gameprofile); - } - else - { - ((TileEntitySkull)tileentity).func_152107_a(p_77648_1_.getItemDamage()); - }*/ - - ((TileEntitySkull)tileentity).func_145903_a(i1); - ((BlockSkull)Blocks.skull).func_149965_a(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, (TileEntitySkull)tileentity); - } - - --p_77648_1_.stackSize; - } + // We can't place blocks as a measly client. + if(world.isRemote) return true; + + // If the skull says no, who are we to argue? + if (!ModBlocks.gaiaHead.canPlaceBlockOnSide(world, x, y, z, side)) + return false; + + // Gaia head, instead of skull + world.setBlock(x, y, z, ModBlocks.gaiaHead, sideDir.ordinal(), 2); + int headAngle = 0; + + // If we place the skull on top of a block, we should also make it + // face the player by rotating it. + if (sideDir == ForgeDirection.UP) + headAngle = MathHelper.floor_double(player.rotationYaw * 16.0F / 360.0F + 0.5D) & 15; + + // Update the skull's orientation if it lets us. + TileEntity tileentity = world.getTileEntity(x, y, z); + + if (tileentity != null && tileentity instanceof TileEntitySkull) { + ((TileEntitySkull) tileentity).func_145903_a(headAngle); + ((BlockSkull) Blocks.skull).func_149965_a(world, x, y, z, (TileEntitySkull) tileentity); } + + // Remove a head from the stack. + --stack.stackSize; + + // Call it a success and leave. + return true; } } From cbac5fbb32fa6c09984aa2449b2ae736a177b708 Mon Sep 17 00:00:00 2001 From: yrsegal Date: Wed, 13 Jan 2016 13:17:28 -0500 Subject: [PATCH 09/11] IslandTypes can now be added by addons --- .../block/decor/BlockFloatingFlower.java | 17 +++---- .../common/block/decor/IFloatingFlower.java | 49 ++++++++++++------- .../block/tile/TileFloatingSpecialFlower.java | 11 +++-- .../common/item/IFloatingFlowerVariant.java | 18 +++++++ .../botania/common/item/ItemGrassSeeds.java | 38 +++++++------- 5 files changed, 82 insertions(+), 51 deletions(-) create mode 100644 src/main/java/vazkii/botania/common/item/IFloatingFlowerVariant.java diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockFloatingFlower.java b/src/main/java/vazkii/botania/common/block/decor/BlockFloatingFlower.java index fa300f92d..0d69eae4e 100644 --- a/src/main/java/vazkii/botania/common/block/decor/BlockFloatingFlower.java +++ b/src/main/java/vazkii/botania/common/block/decor/BlockFloatingFlower.java @@ -10,9 +10,8 @@ */ package vazkii.botania.common.block.decor; -import java.util.List; -import java.util.Random; - +import cpw.mods.fml.common.Optional; +import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -38,13 +37,13 @@ import vazkii.botania.common.block.decor.IFloatingFlower.IslandType; import vazkii.botania.common.block.tile.TileFloatingFlower; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.integration.coloredlights.ColoredLightHelper; -import vazkii.botania.common.item.ItemGrassSeeds; -import vazkii.botania.common.item.ModItems; +import vazkii.botania.common.item.IFloatingFlowerVariant; import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.common.registry.GameRegistry; + +import java.util.List; +import java.util.Random; @Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.crafting.IInfusionStabiliser", striprefs = true) public class BlockFloatingFlower extends BlockModContainer implements ILexiconable, IInfusionStabiliser { @@ -133,8 +132,8 @@ public class BlockFloatingFlower extends BlockModContainer implements ILexiconab IslandType type = null; if(stack.getItem() == Items.snowball) type = IslandType.SNOW; - else if(stack.getItem() == ModItems.grassSeeds) { - IslandType newType = ItemGrassSeeds.getIslandType(stack); + else if(stack.getItem() instanceof IFloatingFlowerVariant) { + IslandType newType = ((IFloatingFlowerVariant) stack.getItem()).getIslandType(stack); if(newType != null) type = newType; } diff --git a/src/main/java/vazkii/botania/common/block/decor/IFloatingFlower.java b/src/main/java/vazkii/botania/common/block/decor/IFloatingFlower.java index 74a803eed..49e87d156 100644 --- a/src/main/java/vazkii/botania/common/block/decor/IFloatingFlower.java +++ b/src/main/java/vazkii/botania/common/block/decor/IFloatingFlower.java @@ -14,6 +14,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import vazkii.botania.client.lib.LibResources; +import java.util.HashMap; + public interface IFloatingFlower { public ItemStack getDisplayStack(); @@ -22,36 +24,47 @@ public interface IFloatingFlower { 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), - 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); + public class IslandType { + private static HashMap registry = new HashMap(); - private IslandType(String s) { - res = new ResourceLocation(s); + public static final IslandType GRASS = new IslandType("GRASS", LibResources.MODEL_MINI_ISLAND); + public static final IslandType PODZOL = new IslandType("PODZOL", LibResources.MODEL_MINI_ISLAND_PODZOL); + public static final IslandType MYCEL = new IslandType("MYCEL", LibResources.MODEL_MINI_ISLAND_MYCEL); + public static final IslandType SNOW = new IslandType("SNOW", LibResources.MODEL_MINI_ISLAND_SNOW); + public static final IslandType DRY = new IslandType("DRY", LibResources.MODEL_MINI_ISLAND_DRY); + public static final IslandType GOLDEN = new IslandType("GOLDEN", LibResources.MODEL_MINI_ISLAND_GOLDEN); + public static final IslandType VIVID = new IslandType("VIVID", LibResources.MODEL_MINI_ISLAND_VIVID); + public static final IslandType SCORCHED = new IslandType("SCORCHED", LibResources.MODEL_MINI_ISLAND_SCORCHED); + public static final IslandType INFUSED = new IslandType("INFUSED", LibResources.MODEL_MINI_ISLAND_INFUSED); + public static final IslandType MUTATED = new IslandType("MUTATED", LibResources.MODEL_MINI_ISLAND_MUTATED); + + public IslandType(String name, String s) { + this(name, new ResourceLocation(s)); + } + + public IslandType(String name, ResourceLocation s) { + if (registry.containsKey(name)) throw new IllegalArgumentException(name+" already registered!"); + this.typeName = name; + res = s; + registry.put(name, this); } private final ResourceLocation res; + public final String typeName; public static IslandType ofType(String typeStr) { - for(IslandType type : IslandType.class.getEnumConstants()) - if(type.toString().equals(typeStr)) - return type; - - return GRASS; + IslandType type = registry.get(typeStr); + return type == null ? GRASS : type; } public ResourceLocation getResource() { return res; } + public String toString() { + return this.typeName; + } + } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileFloatingSpecialFlower.java b/src/main/java/vazkii/botania/common/block/tile/TileFloatingSpecialFlower.java index 92d2af39f..9e6fce168 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileFloatingSpecialFlower.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileFloatingSpecialFlower.java @@ -54,11 +54,12 @@ public class TileFloatingSpecialFlower extends TileSpecialFlower implements IFlo @Override public int getSlowdownFactor() { - switch(getIslandType()) { - case MYCEL: return SLOWDOWN_FACTOR_MYCEL; - case PODZOL: return SLOWDOWN_FACTOR_PODZOL; - default: return 0; - } + IslandType type = getIslandType(); + if (type == IslandType.MYCEL) + return SLOWDOWN_FACTOR_MYCEL; + else if (type == IslandType.PODZOL) + return SLOWDOWN_FACTOR_PODZOL; + return 0; } } diff --git a/src/main/java/vazkii/botania/common/item/IFloatingFlowerVariant.java b/src/main/java/vazkii/botania/common/item/IFloatingFlowerVariant.java new file mode 100644 index 000000000..823e21044 --- /dev/null +++ b/src/main/java/vazkii/botania/common/item/IFloatingFlowerVariant.java @@ -0,0 +1,18 @@ +/** + * This class was created by . 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 @ [Jan 13, 2016, 6:02:31 PM (GMT)] + */ +package vazkii.botania.common.item; + +import net.minecraft.item.ItemStack; +import vazkii.botania.common.block.decor.IFloatingFlower.IslandType; + +public interface IFloatingFlowerVariant { + public IslandType getIslandType(ItemStack stack); +} diff --git a/src/main/java/vazkii/botania/common/item/ItemGrassSeeds.java b/src/main/java/vazkii/botania/common/item/ItemGrassSeeds.java index 0d3937078..2400e5582 100644 --- a/src/main/java/vazkii/botania/common/item/ItemGrassSeeds.java +++ b/src/main/java/vazkii/botania/common/item/ItemGrassSeeds.java @@ -39,7 +39,7 @@ import cpw.mods.fml.common.gameevent.TickEvent.Phase; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class ItemGrassSeeds extends ItemMod { +public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant { private static Map> blockSwappers = new HashMap(); @@ -170,9 +170,9 @@ public class ItemGrassSeeds extends ItemMod { int dim = event.world.provider.dimensionId; if(blockSwappers.containsKey(dim)) { List swappers = blockSwappers.get(dim); - + Iterator iter = swappers.listIterator(); - + while(iter.hasNext()) { BlockSwapper next = iter.next(); if(!next.tick()) @@ -209,7 +209,7 @@ public class ItemGrassSeeds extends ItemMod { /** * A block swapper for the Pasture Seeds, which swaps dirt and grass blocks - * centered around a provided point to a provided block/metadata. + * centered around a provided point to a provided block/metadata. */ private static class BlockSwapper { @@ -217,12 +217,12 @@ public class ItemGrassSeeds extends ItemMod { * The range of the block swapper, in blocks. */ public static final int RANGE = 3; - + /** * The range around which a block can spread in a single tick. */ public static final int TICK_RANGE = 1; - + private final World world; private final Random rand; private final Block blockToSet; @@ -270,7 +270,7 @@ public class ItemGrassSeeds extends ItemMod { if(block == blockToSet && meta == metaToSet) { // Only make changes every 20 ticks if(ticksExisted % 20 != 0) continue; - + tickBlock(x, y, z); } } @@ -279,7 +279,7 @@ public class ItemGrassSeeds extends ItemMod { // This swapper should exist for 80 ticks return ticksExisted < 80; } - + /** * Tick a specific block position, finding the valid blocks * immediately adjacent to it and then replacing one at random. @@ -289,27 +289,27 @@ public class ItemGrassSeeds extends ItemMod { */ public void tickBlock(int x, int y, int z) { List validCoords = new ArrayList(); - + // Go around this block and aggregate valid blocks. for(int xOffset = -TICK_RANGE; xOffset <= TICK_RANGE; xOffset++) { for(int zOffset = -TICK_RANGE; zOffset <= TICK_RANGE; zOffset++) { // Skip the current block if(xOffset == 0 && zOffset == 0) continue; - + if(isValidSwapPosition(x + xOffset, y, z + zOffset)) validCoords.add(new ChunkCoordinates(x + xOffset, y, z + zOffset)); } } - + // If we can make changes, and have at least 1 block to swap, // then swap a random block from the valid blocks we could swap. if(!validCoords.isEmpty() && !world.isRemote) { ChunkCoordinates toSwap = validCoords.get(rand.nextInt(validCoords.size())); - + world.setBlock(toSwap.posX, toSwap.posY, toSwap.posZ, blockToSet, metaToSet, 1 | 2); } } - + /** * Determines if a given position is a valid location to spread to, which * means that the block must be either dirt or grass (with meta 0), @@ -322,23 +322,23 @@ public class ItemGrassSeeds extends ItemMod { public boolean isValidSwapPosition(int x, int y, int z) { Block block = world.getBlock(x, y, z); int meta = world.getBlockMetadata(x, y, z); - + Block aboveBlock = world.getBlock(x, y + 1, z); - + // Valid blocks to spread to are either dirt or grass, and do not // have blocks which block grass growth. - + // See http://minecraft.gamepedia.com/Grass_Block // The major rule is that a block which reduces light // levels by 2 or more blocks grass growth. - - return (block == Blocks.dirt || block == Blocks.grass) + + return (block == Blocks.dirt || block == Blocks.grass) && (meta == 0) && (aboveBlock.getLightOpacity(world, x, y, z) <= 1); } } - public static IslandType getIslandType(ItemStack stack) { + public IslandType getIslandType(ItemStack stack) { return ISLAND_TYPES[Math.min(stack.getItemDamage(), ISLAND_TYPES.length - 1)]; } From d0faf3c3c66b54065722edeeefb02ecbbcb991b6 Mon Sep 17 00:00:00 2001 From: Michael Brenan Date: Wed, 13 Jan 2016 22:51:18 -0600 Subject: [PATCH 10/11] Fix #1726 - Accessories on other players now render in the proper position --- src/main/java/vazkii/botania/api/item/IBaubleRender.java | 2 +- .../common/item/equipment/bauble/ItemBaubleCosmetic.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/vazkii/botania/api/item/IBaubleRender.java b/src/main/java/vazkii/botania/api/item/IBaubleRender.java index 7cc492a39..d98a29434 100644 --- a/src/main/java/vazkii/botania/api/item/IBaubleRender.java +++ b/src/main/java/vazkii/botania/api/item/IBaubleRender.java @@ -53,7 +53,7 @@ public interface IBaubleRender { } public static void translateToHeadLevel(EntityPlayer player) { - GL11.glTranslated(0, (player != Minecraft.getMinecraft().thePlayer ? 1.62F : 0F) - player.getDefaultEyeHeight() + (player.isSneaking() ? 0.0625 : 0), 0); + GL11.glTranslated(0, (player != Minecraft.getMinecraft().thePlayer ? 1.68F : 0F) - player.getDefaultEyeHeight() + (player.isSneaking() ? 0.0625 : 0), 0); } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBaubleCosmetic.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBaubleCosmetic.java index ce41f5347..6cf98d16b 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBaubleCosmetic.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBaubleCosmetic.java @@ -213,7 +213,7 @@ public class ItemBaubleCosmetic extends ItemBauble implements ICosmeticBauble { break; case 26: faceTranslate(); - GL11.glTranslatef(-0.1F, -0.5F, 0F); + GL11.glTranslatef(-0.1F, -0.4F, 0F); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(1F, 1F, 1F, 0.7F); @@ -222,7 +222,7 @@ public class ItemBaubleCosmetic extends ItemBauble implements ICosmeticBauble { case 27: faceTranslate(); scale(0.75F); - GL11.glTranslatef(0.04F, -0.5F, 0F); + GL11.glTranslatef(0.04F, -0.65F, 0F); renderIcon(27); break; case 28: From 0595397943108aba4b387799d650c6a90aea8631 Mon Sep 17 00:00:00 2001 From: Michael Brenan Date: Wed, 13 Jan 2016 23:07:47 -0600 Subject: [PATCH 11/11] Hotfix #1722 - Allow client to control sash speedup and slowdown --- .../botania/common/item/equipment/bauble/ItemSpeedUpBelt.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemSpeedUpBelt.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemSpeedUpBelt.java index a3dab4711..36022a24d 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemSpeedUpBelt.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemSpeedUpBelt.java @@ -55,9 +55,6 @@ public class ItemSpeedUpBelt extends ItemTravelBelt { } 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);