Compare commits

...
44 Commits
Author SHA1 Message Date
Vincent Lee 2c15b6150c Lots of MOP guards. closes #41 2016-01-15 11:27:32 -06:00
Vincent Lee bee13337ad Made laputa shard save string block id's instead of integer id's. Also, a possible fix for #40 2016-01-15 10:56:23 -06:00
Vincent Lee 98e28a0967 Made some things one sided only 2016-01-14 22:44:50 -06:00
Vincent Lee 4a4e583aa8 Fix wonky petal apothecary collision 2016-01-14 21:53:18 -06:00
Vincent Lee 300b1926de Possible fix for #38 2016-01-14 17:20:05 -06:00
Vincent Lee 3818d2879d no longer register gaia tesr onto vanilla skulls 2016-01-14 16:47:48 -06:00
Vincent Lee e12163f70c Merge upstream 2016-01-14 16:40:14 -06:00
Vincent Lee dcb236607d Fix hopperhock placing items one block too far away. Closes #39 2016-01-14 12:08:57 -06:00
Vincent Lee 08de553593 No longer use the raw potion array, use potio registry 2016-01-14 11:54:08 -06:00
Jonathan Smith f6bf6589ad Merge pull request #1743 from yrsegal/master
IslandTypes can now be added by addons
2016-01-14 16:59:20 +00:00
Jonathan Smith da43dd8ca0 Merge pull request #1748 from blacksmithgu/patch-1722
Hotfix #1722 - Allow client to control sash speedup and slowdown
2016-01-14 16:55:01 +00:00
Jonathan Smith fdd1ad8d4e Merge pull request #1747 from blacksmithgu/patch-1726
Fix #1726 - Accessories on other players now render in the proper position
2016-01-14 16:54:53 +00:00
Jonathan Smith d4dd4cf42f Merge pull request #1746 from blacksmithgu/gaia-head
Clean up common/item/ItemGaiaHead.java
2016-01-14 16:54:46 +00:00
Michael Brenan 0595397943 Hotfix #1722 - Allow client to control sash speedup and slowdown 2016-01-13 23:07:47 -06:00
Michael Brenan d0faf3c3c6 Fix #1726 - Accessories on other players now render in the proper position 2016-01-13 22:53:21 -06:00
Vincent Lee b01e9dfed7 Staging changes would be a good idea. Also fix possible potion crash 2016-01-13 17:14:12 -06:00
yrsegal cbac5fbb32 IslandTypes can now be added by addons 2016-01-13 17:44:47 -05:00
Michael Brenan f5210997ca Clean up common/item/ItemGaiaHead.java 2016-01-13 16:21:47 -06:00
Vincent Lee 4b7608fc2a Add nag that this is unofficial right now 2016-01-13 14:13:19 -06:00
Vincent Lee 103efe9c7b Destitch cocoon texmap 2016-01-13 12:54:02 -06:00
Vincent Lee 1402e2a50a Start work on destitching apothecary texmaps 2016-01-13 12:37:15 -06:00
Vincent Lee c8d9764fe3 Read atlas size dynamically 2016-01-13 10:59:10 -06:00
Jonathan Smith d3055c4c4d Merge pull request #1742 from blacksmithgu/patch-1700
Fix #1700 - Terra Axe strictly follow 32 block range and leaf logic
2016-01-13 12:24:40 +00:00
Jonathan Smith c94df0bf67 Merge pull request #1738 from blacksmithgu/master
Fix #1728 - Grass seeds will not spread to dirt/grass blocks under other blocks
2016-01-13 12:24:32 +00:00
Michael Brenan 4abb2cdd89 Fix #1700 - Terra Axe strictly follow 32 block range and leaf logic 2016-01-13 03:42:32 -06:00
Jonathan Smith cabcab80e2 Merge pull request #1739 from blacksmithgu/patch-1724
Fix #1724 - Slabs and snow don't prevent Rod of Shifting Crust replacement
2016-01-13 09:36:21 +00:00
Vincent Lee 3e19a84b6d Fix terra shatterer tooltip darkening screen. Closes #37 2016-01-13 00:42:32 -06:00
Vincent Lee a30887d6f9 Debug thing for me, to dump the texture atlas 2016-01-13 00:02:18 -06:00
Vincent Lee 80bd63be0b Bunch of TE particle textures. Fix a bellows crash and teru teru bozu not working with sunflower 2016-01-12 23:27:36 -06:00
Vincent Lee 6c9a01978a Cocoon of caprice model 2016-01-12 15:04:08 -06:00
Vincent Lee 19e387f359 Fix off by one in forest drum meta to state 2016-01-12 13:58:19 -06:00
Vincent Lee f799f7bc32 Revert "Trying to render AO pool"
This reverts commit d8a74e2e44.
2016-01-12 12:00:29 -06:00
Jonathan Smith a2f1776245 Merge pull request #1735 from yrsegal/master
Make baubles able to IBlockProvide
2016-01-12 12:59:05 +00:00
yrsegal c20247b680 Baubles now able to IBlockProvide
This allows for things like Botanical Addons’ Toolbelt to provide from
the tools in them while worn.
2016-01-12 07:47:30 -05:00
Jonathan Smith a7000e8a47 Add Material.gourd to Axe materials.
Closes #1732. 

Allows use of the quickest mining tool for items with Material.gourd (Pumpkins, Melons, etc.)
2016-01-12 12:12:20 +00:00
Michael Brenan ac88d0627a Fix #1724 - Slabs and snow prevent Rod of Shifting Crust replacement 2016-01-12 01:32:15 -06:00
Vincent Lee d8a74e2e44 Trying to render AO pool 2016-01-11 20:06:59 -06:00
Michael Brenan cbcc49b896 Fix #1728 - Pasture seed grass spreading obeys grass block growth rules 2016-01-11 18:28:01 -06:00
Vincent Lee 30578abfb4 Merge pull request #36 from GirafiStudios/MC18
Fixed special named Tiny Potatoes. (Besides Ible)
2016-01-11 17:14:30 -06:00
GirafiStudios a172a325e1 Fixed named Tiny Potatoes rendering (Besides Ible) 2016-01-11 23:45:43 +01:00
Vasco Lavos b7975401b3 Merge pull request #1727 from yrsegal/master
Make CanFit (IFlowerComponent) affect items fitting into petal apothecary
2016-01-09 22:36:57 +00:00
yrsegal f641e165b0 actually call canFit 2016-01-09 17:35:14 -05:00
Jonathan Smith 7e5974cd7c Merge pull request #1721 from AlterAkima/patch-2
Brew related pages
2016-01-08 21:33:08 +00:00
Patric Alexandre 753a03b291 Brew relataded pages 2016-01-08 14:04:34 -03:00
129 changed files with 1582 additions and 715 deletions

No files matched your search

@@ -1,10 +1,14 @@
package vazkii.botania.api;
import com.google.common.base.Preconditions;
import com.google.common.collect.Maps;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.LoaderState;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import vazkii.botania.api.subtile.SubTileEntity;
import vazkii.botania.api.item.IFloatingFlower;
import java.util.Collections;
import java.util.Map;
@@ -15,8 +19,9 @@ import java.util.Map;
@SideOnly(Side.CLIENT)
public final class BotaniaAPIClient {
private static final Map<String, ModelResourceLocation> queuedBlockModels = Maps.newHashMap();
private static final Map<String, ModelResourceLocation> queuedItemModels = Maps.newHashMap();
private static final Map<String, ModelResourceLocation> subtileBlockModels = Maps.newHashMap();
private static final Map<String, ModelResourceLocation> subtileItemModels = Maps.newHashMap();
private static final Map<IFloatingFlower.IslandType, ModelResourceLocation> islandTypeModels = Maps.newHashMap();
/**
* Register your model for the given subtile class here.
@@ -29,13 +34,14 @@ public final class BotaniaAPIClient {
* @param itemModel A path to a blockstate json and variant to be used for this subtile's item form
*/
public static void registerSubtileModel(String subTileName, ModelResourceLocation model, ModelResourceLocation itemModel) {
queuedBlockModels.put(subTileName, model);
queuedItemModels.put(subTileName, itemModel);
Preconditions.checkState(Loader.instance().isInState(LoaderState.PREINITIALIZATION));
subtileBlockModels.put(subTileName, model);
subtileItemModels.put(subTileName, itemModel);
}
/**
* Register your model for the given subtile class here.
* Call this DURING PREINIT. Calling it anytime after blockModels have already baked does not guarantee that your model will work.
* Call this DURING PREINIT.
* Your model json must specify key "tintindex" in all the faces it wants tint applied.
* Tint is applied whenever a player recolors the flower using floral dye
*
@@ -56,17 +62,35 @@ public final class BotaniaAPIClient {
}
/**
* @return An immutable view of the registered subtile block model map
* @return An immutable and live view of the registered subtile block model map
*/
public static Map<String, ModelResourceLocation> getRegisteredSubtileBlockModels() {
return Collections.unmodifiableMap(queuedBlockModels);
return Collections.unmodifiableMap(subtileBlockModels);
}
/**
* @return An immutable view of the registered subtile item model map
* @return An immutable and live view of the registered subtile item model map
*/
public static Map<String, ModelResourceLocation> getRegisteredSubtileItemModels() {
return Collections.unmodifiableMap(queuedItemModels);
return Collections.unmodifiableMap(subtileItemModels);
}
/**
* Registers your model for island type islandType here.
* Call this DURING PREINIT.
* @param islandType The islandtype to register
* @param model The variant within a blockstate json to use as the islandtype's model
*/
public static void registerIslandTypeModel(IFloatingFlower.IslandType islandType, ModelResourceLocation model) {
Preconditions.checkState(Loader.instance().isInState(LoaderState.PREINITIALIZATION));
islandTypeModels.put(islandType, model);
}
/**
* @return An immutable and live view of the registered island type model map
*/
public static Map<IFloatingFlower.IslandType, ModelResourceLocation> getRegisteredIslandTypeModels() {
return Collections.unmodifiableMap(islandTypeModels);
}
private BotaniaAPIClient() {}
@@ -0,0 +1,63 @@
/**
* 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 @ [Nov 17, 2014, 6:05:18 PM (GMT)]
*/
package vazkii.botania.api.item;
import net.minecraft.item.ItemStack;
import java.util.HashMap;
public interface IFloatingFlower {
public ItemStack getDisplayStack();
public IslandType getIslandType();
public void setIslandType(IslandType type);
public class IslandType {
private static HashMap<String, IslandType> registry = new HashMap<String, IslandType>();
public static final IslandType GRASS = new IslandType("GRASS");
public static final IslandType PODZOL = new IslandType("PODZOL");
public static final IslandType MYCEL = new IslandType("MYCEL");
public static final IslandType SNOW = new IslandType("SNOW");
public static final IslandType DRY = new IslandType("DRY");
public static final IslandType GOLDEN = new IslandType("GOLDEN");
public static final IslandType VIVID = new IslandType("VIVID");
public static final IslandType SCORCHED = new IslandType("SCORCHED");
public static final IslandType INFUSED = new IslandType("INFUSED");
public static final IslandType MUTATED = new IslandType("MUTATED");
/**
* Instantiates and registers a new floating flower island type
* Note that you need to register the model for this island type, see BotaniaAPIClient
* @param name The name of this floating flower island type
*/
public IslandType(String name) {
if (registry.containsKey(name)) throw new IllegalArgumentException(name+" already registered!");
this.typeName = name;
registry.put(name, this);
}
public final String typeName;
public static IslandType ofType(String typeStr) {
IslandType type = registry.get(typeStr);
return type == null ? GRASS : type;
}
@Override
public String toString() {
return this.typeName;
}
}
}
@@ -25,14 +25,15 @@ public class TinyPotatoRenderEvent extends Event {
public final String name;
public final double x, y, z;
public final float partTicks;
public final int destroyStage;
public TinyPotatoRenderEvent(TileEntity tile, String name, double x, double y, double z, float partTicks) {
public TinyPotatoRenderEvent(TileEntity tile, String name, double x, double y, double z, float partTicks, int destroyStage) {
this.tile = tile;
this.name = name;
this.x = x;
this.y = y;
this.z = z;
this.partTicks = partTicks;
this.destroyStage = destroyStage;
}
}
}
@@ -8,7 +8,6 @@
*/
package vazkii.botania.api.state;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import net.minecraft.block.BlockRailBase;
import net.minecraft.block.BlockRailPowered;
@@ -16,8 +15,10 @@ import net.minecraft.block.BlockRotatedPillar;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.util.EnumFacing;
import vazkii.botania.api.item.IFloatingFlower;
import vazkii.botania.api.state.enums.*;
/**
@@ -28,10 +29,13 @@ public class BotaniaStateProps {
/** Unlisted properties **/
// The property for specialFlower subtile id
public static final PropertyString SUBTILE_ID = new PropertyString("subtile_id");
public static final PropertyObject<String> SUBTILE_ID = new PropertyObject<>("subtile_id", String.class);
// The property for floating flower island type
public static final PropertyObject<IFloatingFlower.IslandType> ISLAND_TYPE = new PropertyObject<>("islandtype", IFloatingFlower.IslandType.class);
// The property for platform held blockstate id
public static final PropertyState HELD_STATE = new PropertyState("held_state");
public static final PropertyObject<IBlockState> HELD_STATE = new PropertyObject<>("held_state", IBlockState.class);
/** Common properties to all blocks to use **/
@@ -0,0 +1,46 @@
package vazkii.botania.api.state;
import com.google.common.base.Function;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import net.minecraftforge.common.property.IUnlistedProperty;
// Generic base class for unlisted properties
public class PropertyObject<T> implements IUnlistedProperty<T> {
private final String name;
private final Class<T> clazz;
private final Predicate<T> validator;
private final Function<T, String> stringFunction;
public PropertyObject(String name, Class<T> clazz, Predicate<T> validator, Function<T, String> stringFunction) {
this.name = name;
this.clazz = clazz;
this.validator = validator;
this.stringFunction = stringFunction;
}
public PropertyObject(String name, Class<T> clazz) {
this(name, clazz, Predicates.alwaysTrue(), Object::toString);
}
@Override
public String getName() {
return name;
}
@Override
public boolean isValid(T value) {
return validator.apply(value);
}
@Override
public Class<T> getType() {
return clazz;
}
@Override
public String valueToString(T value) {
return stringFunction.apply(value);
}
}
@@ -1,43 +0,0 @@
/**
* This class was created by <williewillus>. 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
*/
package vazkii.botania.api.state;
import net.minecraft.block.state.IBlockState;
import net.minecraftforge.common.property.IUnlistedProperty;
// An unlisted property that holds an IBlockState. Used for platform rendering
public class PropertyState implements IUnlistedProperty<IBlockState> {
private final String name;
public PropertyState(String name) {
this.name = name;
}
@Override
public String getName() {
return name;
}
@Override
public boolean isValid(IBlockState value) {
return true;
}
@Override
public Class<IBlockState> getType() {
return IBlockState.class;
}
@Override
public String valueToString(IBlockState value) {
return value.toString();
}
}
@@ -1,41 +0,0 @@
/**
* This class was created by <williewillus>. 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
*/
package vazkii.botania.api.state;
import net.minecraftforge.common.property.IUnlistedProperty;
// An unlisted property that holds a String, used for subtile rendering
public class PropertyString implements IUnlistedProperty<String> {
private final String name;
public PropertyString(String name) {
this.name = name;
}
@Override
public String getName() {
return name;
}
@Override
public boolean isValid(String value) {
return true;
}
@Override
public Class<String> getType() {
return String.class;
}
@Override
public String valueToString(String value) {
return value;
}
}
@@ -10,13 +10,20 @@ package vazkii.botania.client.core.handler;
import com.google.common.collect.Maps;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.statemap.DefaultStateMapper;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraftforge.client.event.ModelBakeEvent;
import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.event.CommandEvent;
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.apache.commons.lang3.text.WordUtils;
import org.lwjgl.BufferUtils;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import vazkii.botania.client.core.helper.IconHelper;
import vazkii.botania.client.model.FloatingFlowerModel;
import vazkii.botania.client.model.PlatformModel;
@@ -27,6 +34,11 @@ import vazkii.botania.common.item.ItemSparkUpgrade;
import vazkii.botania.common.item.equipment.bauble.ItemFlightTiara;
import vazkii.botania.common.item.relic.ItemKingKey;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.nio.IntBuffer;
import java.util.Map;
public class MiscellaneousIcons {
@@ -127,5 +139,48 @@ public class MiscellaneousIcons {
}
}
@SubscribeEvent
public void dumpAtlas(ArrowLooseEvent evt) {
if (!evt.entityPlayer.worldObj.isRemote || false)
return;
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
int width = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH);
int height = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_HEIGHT);
System.out.printf("Atlas is %d wide by %d tall%n", width, height);
int pixels = width * height;
IntBuffer buffer = BufferUtils.createIntBuffer(pixels);
int[] pixelValues = new int[pixels];
GL11.glPixelStorei(GL11.GL_PACK_ALIGNMENT, 1);
GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1);
GL11.glGetTexImage(GL11.GL_TEXTURE_2D, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, buffer);
buffer.get(pixelValues);
BufferedImage bufferedimage = new BufferedImage(width, height, 2);
for (int k = 0; k < height; ++k)
{
for (int l = 0; l < width; ++l)
{
bufferedimage.setRGB(l, k, pixelValues[k * width + l]);
}
}
File mcFolder = Minecraft.getMinecraft().mcDataDir;
File result = new File(mcFolder, "atlas.png");
try {
ImageIO.write(bufferedimage, "png", result);
} catch (IOException e) {
e.printStackTrace();
}
}
private MiscellaneousIcons() {}
}
@@ -12,6 +12,7 @@ import com.google.common.collect.ImmutableList;
import net.minecraft.block.Block;
import net.minecraft.block.BlockDoublePlant;
import net.minecraft.block.BlockFlower;
import net.minecraft.block.BlockSkull;
import net.minecraft.block.BlockSlab;
import net.minecraft.block.BlockWall;
import net.minecraft.block.state.IBlockState;
@@ -33,6 +34,7 @@ import net.minecraftforge.client.model.ModelLoaderRegistry;
import net.minecraftforge.client.model.obj.OBJLoader;
import net.minecraftforge.fml.common.registry.GameData;
import vazkii.botania.api.BotaniaAPIClient;
import vazkii.botania.api.item.IFloatingFlower;
import vazkii.botania.api.state.enums.PlatformVariant;
import vazkii.botania.api.state.enums.SpreaderVariant;
import vazkii.botania.client.model.SpecialFlowerModel;
@@ -286,6 +288,17 @@ public final class ModelHandler {
}
private static void registerSubtiles() {
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.GRASS, new ModelResourceLocation("botania:miniIsland", "variant=grass"));
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.PODZOL, new ModelResourceLocation("botania:miniIsland", "variant=podzol"));
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.MYCEL, new ModelResourceLocation("botania:miniIsland", "variant=mycel"));
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.SNOW, new ModelResourceLocation("botania:miniIsland", "variant=snow"));
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.DRY, new ModelResourceLocation("botania:miniIsland", "variant=dry"));
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.GOLDEN, new ModelResourceLocation("botania:miniIsland", "variant=golden"));
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.VIVID, new ModelResourceLocation("botania:miniIsland", "variant=vivid"));
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.SCORCHED, new ModelResourceLocation("botania:miniIsland", "variant=scorched"));
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.INFUSED, new ModelResourceLocation("botania:miniIsland", "variant=infused"));
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.MUTATED, new ModelResourceLocation("botania:miniIsland", "variant=mutated"));
BotaniaAPIClient.registerSubtileModel(SubTileManastar.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MANASTAR));
BotaniaAPIClient.registerSubtileModel(SubTilePureDaisy.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_PUREDAISY));
@@ -352,6 +365,7 @@ public final class ModelHandler {
registerItemModel(ModBlocks.cacophonium);
registerItemModel(ModBlocks.cellBlock);
registerItemModel(ModBlocks.conjurationCatalyst);
registerItemModel(ModBlocks.cocoon);
registerItemModel(ModBlocks.corporeaFunnel);
registerItemModel(ModBlocks.corporeaInterceptor);
registerItemModel(ModBlocks.corporeaRetainer);
@@ -560,7 +574,7 @@ public final class ModelHandler {
registerItemModelMetas(blackHoleTalisman, LibItemNames.BLACK_HOLE_TALISMAN, 2);
registerItemModelMetas(slimeBottle, LibItemNames.SLIME_BOTTLE, 2);
registerItemModelMetas(grassSeeds, LibItemNames.GRASS_SEEDS, 9);
registerItemModelMetas(quartz, LibItemNames.QUARTZ, 8);
registerItemModelMetas(quartz, LibItemNames.QUARTZ, 7);
registerItemModelMetas(cosmetic, LibItemNames.COSMETIC, 32);
registerItemModelMetas(craftPattern, LibItemNames.CRAFT_PATTERN, 9);
registerItemModelMetas(virus, LibItemNames.VIRUS, 2);
@@ -761,6 +775,14 @@ public final class ModelHandler {
for (Block b : otherFullSlabs) {
ModelLoader.setCustomStateMapper(b, (new StateMap.Builder()).ignore(BlockModSlab.DUMMY, BlockSlab.HALF).build());
}
// Ignore everything in TESR items to suppress missing model errors
ModelLoader.setCustomStateMapper(ModBlocks.avatar, new StateMap.Builder().ignore(BotaniaStateProps.CARDINALS).build());
ModelLoader.setCustomStateMapper(ModBlocks.bellows, new StateMap.Builder().ignore(BotaniaStateProps.CARDINALS).build());
ModelLoader.setCustomStateMapper(ModBlocks.brewery, new StateMap.Builder().ignore(BotaniaStateProps.POWERED).build());
ModelLoader.setCustomStateMapper(ModBlocks.gaiaHead, new StateMap.Builder().ignore(BlockSkull.FACING, BlockSkull.NODROP).build());
ModelLoader.setCustomStateMapper(ModBlocks.hourglass, new StateMap.Builder().ignore(BotaniaStateProps.POWERED).build());
ModelLoader.setCustomStateMapper(ModBlocks.pump, new StateMap.Builder().ignore(BotaniaStateProps.CARDINALS).build());
}
private static void registerMushrooms() {
@@ -190,7 +190,7 @@ public final class TooltipAdditionDisplayHandler {
String rank = StatCollector.translateToLocal("botania.rank" + level).replaceAll("&", "\u00a7");
GL11.glPushAttrib(GL11.GL_LIGHTING);
GlStateManager.disableLighting();
GL11.glDisable(GL11.GL_LIGHTING);
font.drawStringWithShadow(rank, mouseX + offx, mouseY - offy - 12, 0xFFFFFF);
if(!ss) {
rank = StatCollector.translateToLocal("botania.rank" + (level + 1)).replaceAll("&", "\u00a7");
@@ -256,8 +256,6 @@ public class ClientProxy extends CommonProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileTeruTeruBozu.class, new RenderTileTeruTeruBozu());
ClientRegistry.bindTileEntitySpecialRenderer(TileAvatar.class, new RenderTileAvatar());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySkull.class, new RenderTileSkullOverride());
RenderingRegistry.registerEntityRenderingHandler(EntityPixie.class, RenderPixie::new);
RenderingRegistry.registerEntityRenderingHandler(EntityDoppleganger.class, RenderDoppleganger::new);
RenderingRegistry.registerEntityRenderingHandler(EntitySpark.class, RenderSpark::new);
@@ -53,6 +53,7 @@ public class FXSparkle extends EntityFX {
particleRed = red;
particleGreen = green;
particleBlue = blue;
particleAlpha = 0.5F; // So MC renders us on the alpha layer, value not actually used
particleGravity = 0;
motionX = motionY = motionZ = 0;
particleScale *= size;
@@ -50,6 +50,7 @@ public class FXWisp extends EntityFX {
particleRed = red;
particleGreen = green;
particleBlue = blue;
particleAlpha = 0.5F; // So MC renders us on the alpha layer, value not actually used
particleGravity = 0;
motionX = motionY = motionZ = 0;
particleScale *= size;
@@ -8,10 +8,8 @@
*/
package vazkii.botania.client.model;
import com.google.common.base.Function;
import com.google.common.collect.HashBasedTable;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import com.google.common.collect.Table;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
@@ -35,10 +33,12 @@ import net.minecraftforge.client.model.pipeline.IVertexConsumer;
import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad;
import net.minecraftforge.client.model.pipeline.VertexTransformer;
import net.minecraftforge.common.property.IExtendedBlockState;
import net.minecraftforge.fml.common.FMLLog;
import vazkii.botania.api.BotaniaAPIClient;
import vazkii.botania.api.state.BotaniaStateProps;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.decor.BlockFloatingFlower;
import vazkii.botania.common.block.decor.IFloatingFlower;
import vazkii.botania.api.item.IFloatingFlower;
import vazkii.botania.common.item.block.ItemBlockFloatingSpecialFlower;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
@@ -79,12 +79,12 @@ public class FloatingFlowerModel implements ISmartItemModel, ISmartBlockModel, I
@Override
public IBakedModel handleBlockState(IBlockState state) {
IFloatingFlower.IslandType islandType = state.getValue(BlockFloatingFlower.ISLAND_TYPE);
IExtendedBlockState realState = ((IExtendedBlockState) state);
IFloatingFlower.IslandType islandType = realState.getValue(BotaniaStateProps.ISLAND_TYPE);
String identifier;
if (state.getBlock() == ModBlocks.floatingSpecialFlower) {
// Magic flower
IExtendedBlockState realState = ((IExtendedBlockState) state);
identifier = realState.getValue(BotaniaStateProps.SUBTILE_ID);
} else {
// Mundane flower
@@ -101,7 +101,7 @@ public class FloatingFlowerModel implements ISmartItemModel, ISmartBlockModel, I
if (CACHE.contains(islandType, identifier)) {
return CACHE.get(islandType, identifier);
} else {
IBakedModel islandModel = modelManager.getModel(new ModelResourceLocation("botania:miniIsland", "variant=" + islandType.getName()));
IBakedModel islandModel = modelManager.getModel(BotaniaAPIClient.getRegisteredIslandTypeModels().get(islandType));
IBakedModel flowerModel;
if (identifier.startsWith(MUNDANE_PREFIX)) {
@@ -113,6 +113,7 @@ public class FloatingFlowerModel implements ISmartItemModel, ISmartBlockModel, I
// Enhance!
CompositeBakedModel model = new CompositeBakedModel(flowerModel, islandModel);
FMLLog.info("[Botania]: Cached floating flower model for islandtpye %s and flowertype %s", islandType, identifier);
CACHE.put(islandType, identifier, model);
return model;
}
@@ -42,7 +42,7 @@ import net.minecraftforge.fml.common.FMLLog;
import org.apache.commons.lang3.tuple.Pair;
import vazkii.botania.api.BotaniaAPIClient;
import vazkii.botania.api.state.BotaniaStateProps;
import vazkii.botania.common.block.decor.IFloatingFlower;
import vazkii.botania.api.item.IFloatingFlower;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
import javax.vecmath.Matrix4f;
@@ -72,10 +72,8 @@ public class SpecialFlowerModel implements IModelCustomData {
builder.addAll(blockModels.values());
builder.addAll(itemModels.values());
// Force mini island model to be loaded and baked, for use elsewhere. See FloatingFlowerModel
for (IFloatingFlower.IslandType i : IFloatingFlower.IslandType.values()) {
builder.add(new ModelResourceLocation("botania:miniIsland", "variant=" + i.name().toLowerCase(Locale.ROOT)));
}
// Force island models to be loaded and baked. See FloatingFlowerModel.
builder.addAll(BotaniaAPIClient.getRegisteredIslandTypeModels().values());
return builder.build();
}
@@ -10,9 +10,12 @@
*/
package vazkii.botania.client.render.tile;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.client.resources.model.IBakedModel;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
@@ -41,12 +44,14 @@ public class RenderTileCocoon extends TileEntitySpecialRenderer<TileCocoon> {
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GlStateManager.color(1F, 1F, 1F, 1F);
GlStateManager.translate(d0, d1, d2);
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
GlStateManager.rotate(90F, 1F, 0F, 0F);
GlStateManager.translate(0.5F, -0.5F - 3F / 16F, -0.5F + 1F / 16F);
GlStateManager.rotate(rot, 0F, 1F, 0F);
model.render();
GlStateManager.translate(d0, d1, d2 + 1);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
GlStateManager.translate(0.5F, 0, 0F);
GlStateManager.rotate(rot, 1F, 0F, 0F); // todo 1.8 fixme looks a little weird compared to 1.7
GlStateManager.translate(-0.5F, 0, 0F);
IBlockState state = cocoon.getWorld().getBlockState(cocoon.getPos());
IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelForState(state);
Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightness(model, state, 1.0F, false);
GlStateManager.color(1F, 1F, 1F);
GlStateManager.enableRescaleNormal();
GlStateManager.popMatrix();
@@ -24,7 +24,7 @@ import net.minecraft.tileentity.TileEntity;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.model.FloatingFlowerModel;
import vazkii.botania.client.model.ModelMiniIsland;
import vazkii.botania.common.block.decor.IFloatingFlower;
import vazkii.botania.api.item.IFloatingFlower;
public class RenderTileFloatingFlower extends TileEntitySpecialRenderer {
@@ -43,18 +43,9 @@ public class RenderTileSkullOverride extends TileEntitySkullRenderer {
public void render(TileEntitySkull skull, float par1, float par2, float par3, EnumFacing par4, float par5, int par6, GameProfile gameProfile, int digProgress) {
boolean gaia = skull == null || skull instanceof TileGaiaHead;
if(par6 == 3 || gaia) {
ResourceLocation resourcelocation = DefaultPlayerSkin.getDefaultSkinLegacy();
if(gaia) {
Minecraft minecraft = Minecraft.getMinecraft();
if(gaia)
resourcelocation = minecraft.thePlayer.getLocationSkin();
else if(gameProfile != null) {
Map map = minecraft.getSkinManager().loadSkinFromCache(gameProfile);
if (map.containsKey(MinecraftProfileTexture.Type.SKIN)) {
resourcelocation = minecraft.getSkinManager().loadSkin((MinecraftProfileTexture)map.get(MinecraftProfileTexture.Type.SKIN), MinecraftProfileTexture.Type.SKIN);
}
}
ResourceLocation resourcelocation = minecraft.thePlayer.getLocationSkin();
bindTexture(resourcelocation);
GlStateManager.pushMatrix();
GlStateManager.disableCull();
@@ -81,13 +72,11 @@ public class RenderTileSkullOverride extends TileEntitySkullRenderer {
GlStateManager.enableRescaleNormal();
GlStateManager.scale(-1.0F, -1.0F, 1.0F);
GlStateManager.enableAlpha();
if(gaia)
ShaderHelper.useShader(ShaderHelper.doppleganger, RenderDoppleganger.defaultCallback);
ShaderHelper.useShader(ShaderHelper.doppleganger, RenderDoppleganger.defaultCallback);
modelSkull.render(null, 0F, 0F, 0F, par5, 0F, 0.0625F);
if(gaia)
ShaderHelper.releaseShader();
ShaderHelper.releaseShader();
GlStateManager.popMatrix();
} else super.renderSkull(par1, par2, par3, par4, par5, par6, gameProfile, digProgress);
}
@@ -10,31 +10,30 @@
*/
package vazkii.botania.client.render.tile;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.client.resources.model.IBakedModel;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.MinecraftForge;
import org.lwjgl.opengl.GL11;
import vazkii.botania.api.item.TinyPotatoRenderEvent;
import vazkii.botania.client.core.handler.ContributorFancinessHandler;
import vazkii.botania.client.core.handler.MiscellaneousIcons;
import vazkii.botania.client.core.helper.IconHelper;
import vazkii.botania.client.core.helper.ShaderHelper;
import vazkii.botania.client.core.proxy.ClientProxy;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.client.model.ModelTinyPotato;
import vazkii.botania.common.block.tile.TileTinyPotato;
@@ -42,290 +41,302 @@ import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.item.equipment.bauble.ItemFlightTiara;
public class RenderTileTinyPotato extends TileEntitySpecialRenderer<TileTinyPotato> {
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_TINY_POTATO);
private static final ResourceLocation textureGrayscale = new ResourceLocation(LibResources.MODEL_TINY_POTATO_GS);
private static final ResourceLocation textureHalloween = new ResourceLocation(LibResources.MODEL_TINY_POTATO_HALLOWEEN);
private static final ModelTinyPotato model = new ModelTinyPotato();
@Override
public void renderTileEntityAt(TileTinyPotato potato, double d0, double d1, double d2, float var8, int digProgress) {
public void renderTileEntityAt(TileTinyPotato potato, double x, double y, double z, float partialTicks, int destroyStage) {
if (potato != null && potato.getWorld() != null && !potato.getWorld().isBlockLoaded(potato.getPos(), false)) {
return;
}
GlStateManager.pushMatrix();
GlStateManager.enableRescaleNormal();
GlStateManager.color(1F, 1F, 1F, 1F);
GlStateManager.translate(d0, d1, d2);
GlStateManager.translate(x, y, z);
Minecraft mc = Minecraft.getMinecraft();
mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
mc.renderEngine.bindTexture(ClientProxy.dootDoot ? textureHalloween : texture);
String name = potato.name.toLowerCase();
boolean usedShader = false;
if(name.startsWith("gaia ")) {
if (name.startsWith("gaia ")) {
ShaderHelper.useShader(ShaderHelper.doppleganger);
name = name.substring(5);
usedShader = true;
} else if(name.startsWith("hot ")) {
} else if (name.startsWith("hot ")) {
ShaderHelper.useShader(ShaderHelper.halo);
name = name.substring(4);
usedShader = true;
} else if(name.startsWith("magic ")) {
} else if (name.startsWith("magic ")) {
ShaderHelper.useShader(ShaderHelper.enchanterRune);
name = name.substring(6);
usedShader = true;
} else if(name.startsWith("gold ")) {
} else if (name.startsWith("gold ")) {
ShaderHelper.useShader(ShaderHelper.gold);
name = name.substring(5);
usedShader = true;
} else if(name.startsWith("snoop ")) {
} else if (name.startsWith("snoop ")) {
ShaderHelper.useShader(ShaderHelper.terraPlateRune);
name = name.substring(6);
usedShader = true;
}
float jump = potato.jumpTicks;
if(jump > 0)
jump -= var8;
GlStateManager.translate(0.5F, 1.5F, 0.5F);
GlStateManager.scale(1F, -1F, -1F);
int meta = potato.getWorld() == null ? 3 : potato.getBlockMetadata();
float rotY = meta * 90F - 180F;
GlStateManager.rotate(rotY, 0F, 1F, 0F);
float up = (float) Math.abs(Math.sin(jump / 10 * Math.PI)) * 0.2F;
float jump = potato.jumpTicks;
if (jump > 0)
jump -= partialTicks;
float up = (float) -Math.abs(Math.sin(jump / 10 * Math.PI)) * 0.2F;
float rotZ = (float) Math.sin(jump / 10 * Math.PI) * 2;
GlStateManager.translate(0F, up, 0F);
GlStateManager.rotate(rotZ, 0F, 0F, 1F);
GlStateManager.pushMatrix();
if(name.equals("pahimar")) {
if (name.equals("pahimar")) {
GlStateManager.scale(1F, 0.3F, 1F);
//GlStateManager.translate(0F, 3.5F, 0F);
} else if(name.equals("kyle hyde")) {
// 1.8: handled using getActualState - mc.renderEngine.bindTexture(textureGrayscale);
} else if(name.equals("dinnerbone") || name.equals("grumm")) {
GlStateManager.translate(0F, 3.5F, 0F);
} else if (name.equals("kyle hyde"))
mc.renderEngine.bindTexture(textureGrayscale);
else if (name.equals("dinnerbone") || name.equals("grumm")) {
GlStateManager.rotate(180F, 0F, 0F, 1F);
//GlStateManager.translate(0F, -2.625F, 0F);
} else if(name.equals("aureylian"))
GlStateManager.translate(0F, -2.625F, 0F);
} else if (name.equals("aureylian"))
GlStateManager.color(1F, 0.5F, 1F);
IBlockState state = potato.getWorld().getBlockState(potato.getPos());
state = state.getBlock().getActualState(state, potato.getWorld(), potato.getPos());
IBakedModel bakedModel = mc.getBlockRendererDispatcher().getBlockModelShapes().getModelForState(state);
boolean render = !(name.equals("mami") || name.equals("soaryn") || name.equals("eloraam") && jump != 0);
if(render) {
GlStateManager.rotate(-90, 0, 1, 0);
mc.getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightness(bakedModel, potato.getWorld().getBlockState(potato.getPos()), 1.0F, false);
GlStateManager.rotate(90, 0, 1, 0);
//model.render();
}
if(name.equals("kingdaddydmac")) {
GlStateManager.translate(-0.5F, 0F, 0F);
mc.getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightness(bakedModel, potato.getWorld().getBlockState(potato.getPos()), 1.0F, false);
//model.render();
if (render)
model.render();
if (name.equals("kingdaddydmac")) {
GlStateManager.translate(0.5F, 0F, 0F);
model.render();
}
if(usedShader)
if (usedShader)
ShaderHelper.releaseShader();
GlStateManager.popMatrix();
if(!name.isEmpty()) {
if (!name.isEmpty()) {
GlStateManager.pushMatrix();
mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
ContributorFancinessHandler.firstStart();
// todo 1.8 refine all below
float scale = 1F / 4F;
GlStateManager.translate(0F, 1F, 0F);
GlStateManager.scale(scale, scale, scale);
if(name.equals("phi") || name.equals("vazkii")) {
if (name.equals("phi") || name.equals("vazkii")) {
GlStateManager.translate(0.45F, 0F, 0.4F);
GlStateManager.rotate(90F, 0F, 1F, 0F);
GlStateManager.rotate(20F, 1F, 0F, 1F);
renderIcon(MiscellaneousIcons.INSTANCE.phiFlowerIcon);
if(name.equals("vazkii")) {
if (name.equals("vazkii")) {
GlStateManager.rotate(-20F, 1F, 0F, 1F);
GlStateManager.scale(1.25F, 1.25F, 1.25F);
GlStateManager.rotate(180F, 0F, 0F, 1F);
GlStateManager.translate(-1.5F, -1.3F, -0.75F);
renderIcon(MiscellaneousIcons.INSTANCE.nerfBatIcon);
}
} else if(name.equals("skull kid")) {
} else if (name.equals("skull kid")) {
GlStateManager.scale(1.25F, 1.25F, 1.25F);
GlStateManager.rotate(180F, 0F, 0F, 1F);
GlStateManager.translate(-0.5F, -1.2F, -0.4F);
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.cosmetic, 1, 23), ItemCameraTransforms.TransformType.THIRD_PERSON);
} else if(name.equals("kamina")) {
GlStateManager.translate(0F, -0.7F, -0.4F);
renderItem(new ItemStack(ModItems.cosmetic, 1, 23));
} else if (name.equals("kamina")) {
GlStateManager.scale(1.25F, 1.25F, 1.25F);
GlStateManager.rotate(180F, 0F, 0F, 1F);
GlStateManager.translate(-0.5F, -1.1F, -0.4F);
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.cosmetic, 1, 26), ItemCameraTransforms.TransformType.THIRD_PERSON);
} else if(name.equals("haighyorkie")) {
GlStateManager.rotate(180F, 0F, 1F, 0F);
GlStateManager.translate(0F, -0.6F, 0.4F);
renderItem(new ItemStack(ModItems.cosmetic, 1, 26));
} else if (name.equals("haighyorkie")) {
GlStateManager.scale(1.25F, 1.25F, 1.25F);
GlStateManager.rotate(180F, 0F, 0F, 1F);
GlStateManager.rotate(90F, 0F, 1F, 0F);
GlStateManager.translate(-0.5F, -1.2F, -0.4F);
renderIcon(MiscellaneousIcons.INSTANCE.goldfishIcon);
} else if(name.equals("chitoge")) {
} else if (name.equals("chitoge")) {
GlStateManager.scale(1.25F, 1.25F, 1.25F);
GlStateManager.rotate(180F, 0F, 0F, 1F);
GlStateManager.translate(-0.5F, -0.7F, 0.1F);
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.cosmetic, 1, 7), ItemCameraTransforms.TransformType.THIRD_PERSON);
} else if(name.equals("direwolf20")) {
GlStateManager.rotate(180F, 0F, 1F, 0F);
GlStateManager.translate(0F, -0.2F, 0.1F);
renderItem(new ItemStack(ModItems.cosmetic, 1, 7));
} else if (name.equals("direwolf20")) {
GlStateManager.rotate(180F, 0F, 0F, 1F);
GlStateManager.translate(-0.5F, -2.2F, -0.5F);
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.cosmetic, 1, 0), ItemCameraTransforms.TransformType.THIRD_PERSON);
} else if(name.equals("doctor")) {
GlStateManager.rotate(180F, 0F, 1F, 0F);
GlStateManager.translate(0F, -1.7F, 0.5F);
renderItem(new ItemStack(ModItems.cosmetic));
} else if (name.equals("doctor")) {
GlStateManager.scale(1.25F, 1.25F, 1.25F);
GlStateManager.rotate(180F, 0F, 0F, 1F);
GlStateManager.translate(-0.5F, -1.15F, -0.4F);
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.cosmetic, 1, 25), ItemCameraTransforms.TransformType.THIRD_PERSON);
} else if(name.equals("snoo")) {
GlStateManager.rotate(180F, 0F, 1F, 0F);
GlStateManager.translate(0F, -0.65F, 0.4F);
renderItem(new ItemStack(ModItems.cosmetic, 1, 25));
} else if (name.equals("snoo")) {
GlStateManager.scale(1.25F, 1.25F, 1.25F);
GlStateManager.rotate(180F, 0F, 0F, 1F);
GlStateManager.translate(-0.5F, -0.7F, 0.1F);
GlStateManager.rotate(20F, 0F, 0F, 1F);
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.cosmetic, 1, 24), ItemCameraTransforms.TransformType.THIRD_PERSON);
} else if(name.equals("charlotte")) {
GlStateManager.rotate(180F, 0F, 1F, 0F);
GlStateManager.translate(0.2F, 0F, -0.05F);
GlStateManager.rotate(-20F, 0F, 0F, 1F);
renderItem(new ItemStack(ModItems.cosmetic, 1, 24));
} else if (name.equals("charlotte")) {
GlStateManager.scale(1.25F, 1.25F, 1.25F);
GlStateManager.rotate(180F, 0F, 0F, 1F);
GlStateManager.translate(-0.5F, -1.2F, -0.4F);
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.cosmetic, 1, 12), ItemCameraTransforms.TransformType.THIRD_PERSON);
} else if(name.equals("greg") || name.equals("gregorioust")) {
GlStateManager.rotate(180F, 0F, 1F, 0F);
GlStateManager.translate(0F, -0.7F, 0.4F);
renderItem(new ItemStack(ModItems.cosmetic, 1, 12));
} else if (name.equals("greg") || name.equals("gregorioust")) {
GlStateManager.scale(1.25F, 1.25F, 1.25F);
GlStateManager.rotate(180F, 0F, 0F, 1F);
GlStateManager.rotate(90F, 0F, 1F, 0F);
GlStateManager.translate(-0.5F, -1.5F, -0.4F);
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(Items.book, 1, 0), ItemCameraTransforms.TransformType.THIRD_PERSON);
GlStateManager.rotate(270F, 0F, 1F, 0F);
GlStateManager.translate(0F, -1F, 0.4F);
renderItem(new ItemStack(Items.book));
mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
GlStateManager.translate(0.5F, 0.5F, 0F);
GlStateManager.scale(0.3F, 0.3F, 0.3F);
mc.getBlockRendererDispatcher().renderBlockBrightness(Blocks.iron_ore.getDefaultState(), 1F);
} else if(name.equals("profmobius")) {
renderItem(new ItemStack(Blocks.iron_ore));
} else if (name.equals("profmobius")) {
GlStateManager.scale(1.25F, 1.25F, 1.25F);
GlStateManager.rotate(180F, 0F, 0F, 1F);
GlStateManager.rotate(90F, 0F, 1F, 0F);
GlStateManager.translate(-0.5F, -1.2F, -0.4F);
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(Items.bread, 1, 0), ItemCameraTransforms.TransformType.THIRD_PERSON);
} else if(name.equals("martysgames") || name.equals("marty")) {
GlStateManager.rotate(270F, 0F, 1F, 0F);
GlStateManager.translate(0F, -0.7F, 0.4F);
renderItem(new ItemStack(Items.bread));
} else if (name.equals("martysgames") || name.equals("marty")) {
GlStateManager.scale(0.7F, 0.7F, 0.7F);
GlStateManager.rotate(180F, 0F, 0F, 1F);
GlStateManager.translate(-0.75F, -2.4F, -0.7F);
GlStateManager.rotate(10F, 0F, 0F, 1F);
ItemStack renderStack = new ItemStack(ModItems.infiniteFruit, 1);
renderStack.setStackDisplayName("das boot");
Minecraft.getMinecraft().getRenderItem().renderItem(renderStack, ItemCameraTransforms.TransformType.THIRD_PERSON);
} else if(name.equals("tromped")) {
GlStateManager.rotate(180F, 0F, 1F, 0F);
GlStateManager.translate(0.3F, -1.8F, 0.7F);
GlStateManager.rotate(-15F, 0F, 0F, 1F);
renderItem(new ItemStack(ModItems.infiniteFruit, 1).setStackDisplayName("das boot"));
} else if (name.equals("tromped")) {
GlStateManager.scale(1.25F, 1.25F, 1.25F);
GlStateManager.rotate(180F, 0F, 0F, 1F);
GlStateManager.rotate(270F, 0F, 1F, 0F);
GlStateManager.translate(0F, -0.7F, 0.4F);
renderItem(new ItemStack(ModItems.cacophonium));
} else if (name.equals("kain vinosec")) {
GlStateManager.scale(1.25F, 1.25F, 1.25F);
GlStateManager.rotate(180F, 0F, 0F, 1F);
GlStateManager.rotate(180F, 0F, 1F, 0F);
GlStateManager.rotate(90F, 0F, 1F, 0F);
GlStateManager.translate(-0.5F, -1.2F, -0.4F);
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.cacophonium, 1, 0), ItemCameraTransforms.TransformType.THIRD_PERSON);
} else if(name.equals("kain vinosec")) {
GlStateManager.translate(-0.3F, -1F, 0.4F);
renderItem(new ItemStack(ModItems.recordGaia1));
GlStateManager.scale(0.5F, 0.5F, 0.5F);
GlStateManager.translate(0F, 0F, -0.85F);
renderItem(new ItemStack(ModItems.recordGaia2));
} else if (name.equals("mankrik")) {
GlStateManager.scale(1.25F, 1.25F, 1.25F);
GlStateManager.rotate(180F, 0F, 0F, 1F);
GlStateManager.rotate(90F, 0F, 1F, 0F);
GlStateManager.translate(-0.3F, -1.5F, -0.4F);
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.recordGaia1, 1, 0), ItemCameraTransforms.TransformType.THIRD_PERSON);
GlStateManager.translate(0F, 0F, 0.85F);
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.recordGaia2, 1, 0), ItemCameraTransforms.TransformType.THIRD_PERSON);
} else if(name.equals("mankrik")) {
GlStateManager.scale(1.25F, 1.25F, 1.25F);
GlStateManager.rotate(180F, 0F, 0F, 1F);
GlStateManager.translate(-0.5F, -0.2F, -0.1F);
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.cosmetic, 1, 31), ItemCameraTransforms.TransformType.THIRD_PERSON);
} else if(name.equals("kurumi")) {
GlStateManager.rotate(180F, 0F, 1F, 0F);
GlStateManager.translate(0F, 0.3F, 0.1F);
renderItem(new ItemStack(ModItems.cosmetic, 1, 31));
} else if (name.equals("kurumi")) {
GlStateManager.scale(0.4F, 0.4F, 0.4F);
GlStateManager.rotate(180F, 0F, 0F, 1F);
GlStateManager.translate(-0.9F, -2.5F, -1.3F);
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.cosmetic, 1, 17), ItemCameraTransforms.TransformType.THIRD_PERSON);
} else if(name.equals("ichun")) {
GlStateManager.rotate(180F, 0F, 1F, 0F);
GlStateManager.translate(0.4F, -2F, 1.3F);
renderItem(new ItemStack(ModItems.cosmetic, 1, 17));
} else if (name.equals("ichun")) {
GlStateManager.scale(1.25F, 1.25F, 1.25F);
GlStateManager.rotate(180F, 0F, 0F, 1F);
GlStateManager.translate(-0.5F, -1.2F, -0.4F);
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.cosmetic, 1, 15), ItemCameraTransforms.TransformType.THIRD_PERSON);
} else if(name.equals("wiiv") || name.equals("dylan4ever") || name.equals("dylankaiser")) {
GlStateManager.rotate(180F, 0F, 1F, 0F);
GlStateManager.translate(0F, -0.7F, 0.4F);
renderItem(new ItemStack(ModItems.cosmetic, 1, 15));
} else if (name.equals("wiiv") || name.equals("dylan4ever") || name.equals("dylankaiser")) {
GlStateManager.scale(1.5F, 1.5F, 1.5F);
GlStateManager.rotate(180F, 0F, 0F, 1F);
GlStateManager.rotate(90F, 0F, 1F, 0F);
GlStateManager.translate(-0.5F, -1.1F, -0.325F);
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(Items.painting, 1, 0), ItemCameraTransforms.TransformType.THIRD_PERSON);
} else if(name.equals("jibril")) {
GlStateManager.translate(-0.1F, -0.6F, -0.325F);
renderItem(new ItemStack(Items.painting));
} else if (name.equals("jibril")) {
GlStateManager.scale(1.5F, 1.5F, 1.5F);
GlStateManager.translate(0F, 0.7F, 0F);
GlStateManager.rotate(90F, 0F, 1F, 0F);
ItemFlightTiara.renderHalo(null, var8);
} else if(name.equals("nebris")) {
mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
ItemFlightTiara.renderHalo(null, partialTicks);
} else if (name.equals("nebris")) {
GlStateManager.scale(2F, 2F, 2F);
GlStateManager.rotate(180F, 1F, 0F, 0F);
mc.getBlockRendererDispatcher().renderBlockBrightness(Blocks.glowstone.getDefaultState(), 1F);
} else if(name.equals("ible")) {
mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
renderItem(new ItemStack(Blocks.glowstone));
} else if (name.equals("ible")) {
mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
GlStateManager.scale(1.2F, 1.2F, 1.2F);
GlStateManager.translate(0F, 0.7F, 0F);
GlStateManager.rotate(180F, 1F, 0F, 0F);
GlStateManager.translate(-0.5F, 0F, -0.5F);
GlStateManager.rotate(180F, 1F, 1F, 0F);
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
mc.getBlockRendererDispatcher().renderBlockBrightness(Blocks.portal.getDefaultState(), 1F);
} else if(name.equals("razz") || name.equals("razzleberryfox")) {
renderBlock(Blocks.portal);
} else if (name.equals("razz") || name.equals("razzleberryfox")) {
GlStateManager.scale(1.25F, 1.25F, 1.25F);
GlStateManager.rotate(180F, 0F, 0F, 1F);
GlStateManager.rotate(90F, 0F, 1F, 0F);
GlStateManager.translate(-0.5F, -1F, 0.45F);
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.cosmetic, 1, 8), ItemCameraTransforms.TransformType.THIRD_PERSON);
} else if(name.equals("etho") || name.equals("ethoslab")) {
GlStateManager.translate(0, -0.5F, 0.45F);
renderItem(new ItemStack(ModItems.cosmetic, 1, 8));
} else if (name.equals("etho") || name.equals("ethoslab")) {
GlStateManager.scale(1.25F, 1.25F, 1.25F);
GlStateManager.rotate(180F, 0F, 0F, 1F);
GlStateManager.rotate(180F, 0F, 1F, 0F);
GlStateManager.rotate(90F, 0F, 1F, 0F);
GlStateManager.translate(-0.5F, -1.2F, -0.4F);
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(Items.cookie, 1, 0), ItemCameraTransforms.TransformType.THIRD_PERSON);
} else if(name.equals("sethbling")) {
mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
GlStateManager.translate(0F, -0.7F, 0.4F);
renderItem(new ItemStack(Items.cookie));
} else if (name.equals("sethbling")) {
GlStateManager.scale(1.2F, 1.2F, 1.2F);
GlStateManager.translate(0F, 0.9F, 0F);
GlStateManager.translate(-0.5F, 1.4F, -0.5F);
GlStateManager.rotate(180F, 1F, 0F, 0F);
mc.getBlockRendererDispatcher().renderBlockBrightness(Blocks.command_block.getDefaultState(), 1F);
} else if(name.equals("bdoubleo100") || name.equals("bdoubleo")) {
mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
renderBlock(Blocks.command_block);
} else if (name.equals("bdoubleo100") || name.equals("bdoubleo")) {
GlStateManager.scale(1.25F, 1.25F, 1.25F);
GlStateManager.rotate(180F, 0F, 0F, 1F);
GlStateManager.translate(-1F, -1.1F, -0.1F);
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(Items.stick, 1, 0), ItemCameraTransforms.TransformType.THIRD_PERSON);
} else if(name.equals("kingdaddydmac")) {
GlStateManager.rotate(180F, 0F, 1F, 0F);
GlStateManager.translate(0.5F, -0.6F, 0.1F);
renderItem(new ItemStack(Items.stick));
} else if (name.equals("kingdaddydmac")) {
GlStateManager.scale(0.5F, 0.5F, 0.5F);
GlStateManager.rotate(180F, 0F, 0F, 1F);
GlStateManager.rotate(90F, 0F, 1F, 0F);
GlStateManager.translate(-0.3F, -2.5F, 1.075F);
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.manaRing, 1, 0), ItemCameraTransforms.TransformType.THIRD_PERSON);
GlStateManager.translate(0F, 0F, -4F);
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.manaRing, 1, 0), ItemCameraTransforms.TransformType.THIRD_PERSON);
GlStateManager.rotate(270F, 0F, 1F, 0F);
GlStateManager.translate(-0.3F, -2F, -1.075F);
renderItem(new ItemStack(ModItems.manaRing, 1, 0));
GlStateManager.scale(0.5F, 0.5F, 0.5F);
GlStateManager.translate(0F, 0F, 4F);
renderItem(new ItemStack(ModItems.manaRing, 1, 0));
GlStateManager.scale(0.8F, 0.8F, 0.8F);
GlStateManager.translate(-1.7F, -1.2F, -0.1F);
mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
GlStateManager.scale(1.5F, 1.5F, 1.5F);
GlStateManager.translate(1.5F, -0.5F, 0.7F);
mc.getBlockRendererDispatcher().renderBlockBrightness(Blocks.cake.getDefaultState(), 1.0F);
} else if(name.equals("sjin")) {
renderBlock(Blocks.cake);
} else if (name.equals("sjin")) {
GlStateManager.scale(1.25F, 1.25F, 1.25F);
GlStateManager.rotate(180F, 0F, 0F, 1F);
GlStateManager.translate(-0.5F, -1.27F, -0.4F);
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.cosmetic, 1, 27), ItemCameraTransforms.TransformType.THIRD_PERSON);
} else if(name.equals("martyn") || name.equals("inthelittlewood")) {
GlStateManager.rotate(180F, 0F, 1F, 0F);
GlStateManager.translate(0F, -0.77F, 0.4F);
renderItem(new ItemStack(ModItems.cosmetic, 1, 27));
} else if (name.equals("martyn") || name.equals("inthelittlewood")) {
GlStateManager.scale(1.25F, 1.25F, 1.25F);
GlStateManager.rotate(180F, 0F, 0F, 1F);
GlStateManager.translate(-0.5F, -0.45F, -0.1F);
GlStateManager.rotate(180F, 0F, 1F, 0F);
GlStateManager.translate(0F, 0.05F, 0.1F);
mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(Blocks.sapling, 1, 0), ItemCameraTransforms.TransformType.THIRD_PERSON);
}else if(ContributorFancinessHandler.flowerMap != null && ContributorFancinessHandler.flowerMap.containsKey(name)) {
renderItem(new ItemStack(Blocks.sapling, 0, 0));
} else if (ContributorFancinessHandler.flowerMap != null && ContributorFancinessHandler.flowerMap.containsKey(name)) {
ItemStack icon = ContributorFancinessHandler.flowerMap.get(name);
if(icon != null) {
if (icon != null) {
mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
GlStateManager.rotate(180F, 1F, 0F, 0F);
GlStateManager.translate(-0.5F, -0.5F, 0F);
GlStateManager.rotate(180F, 0F, 1F, 0F);
GlStateManager.translate(0F, 0F, 0F);
ShaderHelper.useShader(ShaderHelper.gold);
Minecraft.getMinecraft().getRenderItem().renderItem(icon, ItemCameraTransforms.TransformType.THIRD_PERSON);
renderItem(icon);
ShaderHelper.releaseShader();
}
}
@@ -333,15 +344,17 @@ public class RenderTileTinyPotato extends TileEntitySpecialRenderer<TileTinyPota
GlStateManager.popMatrix();
}
MinecraftForge.EVENT_BUS.post(new TinyPotatoRenderEvent(potato, potato.name, d0, d1, d2, var8));
MinecraftForge.EVENT_BUS.post(new TinyPotatoRenderEvent(potato, potato.name, x, y, z, partialTicks, destroyStage));
GlStateManager.rotate(-rotZ, 0F, 0F, 1F);
GlStateManager.rotate(-rotY, 0F, 1F, 0F);
GlStateManager.color(1F, 1F, 1F);
GlStateManager.scale(1F, -1F, -1F);
MovingObjectPosition pos = mc.objectMouseOver;
if(!name.isEmpty() && pos != null && potato.getPos().equals(pos.getBlockPos())) {
if (!name.isEmpty() && pos != null && pos.getBlockPos() != null && potato.getPos().equals(pos.getBlockPos())) {
GlStateManager.pushMatrix();
GlStateManager.translate(0.5F, 0.75F, 0.5F);
GlStateManager.translate(0F, -0.6F, 0F);
GlStateManager.rotate(-mc.getRenderManager().playerViewY, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(mc.getRenderManager().playerViewX, 1.0F, 0.0F, 0.0F);
float f = 1.6F;
@@ -353,30 +366,31 @@ public class RenderTileTinyPotato extends TileEntitySpecialRenderer<TileTinyPota
GlStateManager.enableBlend();
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
GlStateManager.disableTexture2D();
tessellator.getWorldRenderer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR);
worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
int i = mc.fontRendererObj.getStringWidth(potato.name) / 2;
tessellator.getWorldRenderer().pos(-i - 1, -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
tessellator.getWorldRenderer().pos(-i - 1, 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
tessellator.getWorldRenderer().pos(i + 1, 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
tessellator.getWorldRenderer().pos(i + 1, -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
worldrenderer.pos(-i - 1, -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
worldrenderer.pos(-i - 1, 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
worldrenderer.pos(i + 1, 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
worldrenderer.pos(i + 1, -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
tessellator.draw();
GlStateManager.enableTexture2D();
GlStateManager.depthMask(true);
mc.fontRendererObj.drawString(potato.name, -mc.fontRendererObj.getStringWidth(potato.name) / 2, 0, 0xFFFFFF);
if(name.equals("pahimar") || name.equals("soaryn")) {
if (name.equals("pahimar") || name.equals("soaryn")) {
GlStateManager.translate(0F, 14F, 0F);
String s = name.equals("pahimar") ? "[WIP]" : "(soon)";
GlStateManager.depthMask(false);
GlStateManager.enableBlend();
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GlStateManager.disableTexture2D();
tessellator.getWorldRenderer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR);
worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
i = mc.fontRendererObj.getStringWidth(s) / 2;
tessellator.getWorldRenderer().pos(-i - 1, -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
tessellator.getWorldRenderer().pos(-i - 1, 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
tessellator.getWorldRenderer().pos(i + 1, 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
tessellator.getWorldRenderer().pos(i + 1, -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
worldrenderer.pos(-i - 1, -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
worldrenderer.pos(-i - 1, 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
worldrenderer.pos(i + 1, 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
worldrenderer.pos(i + 1, -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
tessellator.draw();
GlStateManager.enableTexture2D();
GlStateManager.depthMask(true);
@@ -400,4 +414,12 @@ public class RenderTileTinyPotato extends TileEntitySpecialRenderer<TileTinyPota
float f3 = icon.getMaxV();
IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F);
}
public void renderItem(ItemStack stack) {
Minecraft.getMinecraft().getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.HEAD);
}
public void renderBlock(Block block) {
Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlockBrightness(block.getDefaultState(), 1.0F);
}
}
@@ -10,6 +10,17 @@
*/
package vazkii.botania.common;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.event.ClickEvent;
import net.minecraft.event.HoverEvent;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IChatComponent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent;
import vazkii.botania.common.core.handler.IMCHandler;
import vazkii.botania.common.core.handler.ManaNetworkHandler;
import vazkii.botania.common.core.proxy.CommonProxy;
@@ -63,7 +74,28 @@ public class Botania {
lightHelper = coloredLightsLoaded ? new LightHelperColored() : new LightHelperVanilla();
proxy.preInit(event);
MinecraftForge.EVENT_BUS.register(this);
}
@SubscribeEvent // todo temporary nag, remove when merging back into master
public void nagUnofficial(PlayerEvent.PlayerLoggedInEvent evt) {
EntityPlayer player = evt.player;
IChatComponent message = new ChatComponentTranslation("botaniamisc.unofficial.nag");
message.setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED).setUnderlined(true));
IChatComponent message2 = new ChatComponentTranslation("botaniamisc.unofficial.report");
message2.setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW));
IChatComponent url = new ChatComponentText("https://github.com/williewillus/Botania/issues");
url.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://github.com/williewillus/Botania/issues"));
url.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText("CLICK")));
player.addChatComponentMessage(message);
player.addChatComponentMessage(message2.appendSibling(url));
}
@EventHandler
public void init(FMLInitializationEvent event) {
proxy.init(event);
@@ -72,21 +72,6 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
);
}
@Override
public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List<AxisAlignedBB> list, Entity collidingEntity) {
if (collidingEntity instanceof EntityItem) {
float f = 1F / 16F * 2F;
// Todo 1.8 temporary hack to let items collide from the top. Figure out what changed to break this.
setBlockBounds(f, f, f, 1F - f, 0.65F, 1F -f);
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
setBlockBounds(f, f, f, 1F - f, 1F / 16F * 20F, 1F - f);
return;
} else {
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
}
}
@Override
public BlockState createBlockState() {
return new BlockState(this, BotaniaStateProps.ALTAR_VARIANT);
@@ -26,7 +26,9 @@ import net.minecraft.util.BlockPos;
import net.minecraft.world.Explosion;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.GameRegistry;
import vazkii.botania.common.block.tile.TileFakeAir;
import vazkii.botania.common.item.block.ItemBlockPool;
import vazkii.botania.common.lib.LibBlockNames;
public class BlockFakeAir extends BlockModContainer {
@@ -43,6 +45,17 @@ public class BlockFakeAir extends BlockModContainer {
return -1;
}
@Override
protected boolean shouldRegisterInNameSet() {
return false;
}
@Override
public Block setUnlocalizedName(String par1Str) {
GameRegistry.registerBlock(this, null, par1Str);
return super.setUnlocalizedName(par1Str);
}
@Override
public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block block) {
if(shouldRemove(world, pos))
@@ -44,7 +44,7 @@ import vazkii.botania.api.subtile.ISpecialFlower;
import vazkii.botania.api.wand.IWandHUD;
import vazkii.botania.api.wand.IWandable;
import vazkii.botania.common.block.decor.BlockFloatingFlower;
import vazkii.botania.common.block.decor.IFloatingFlower;
import vazkii.botania.api.item.IFloatingFlower;
import vazkii.botania.common.block.tile.TileFloatingSpecialFlower;
import vazkii.botania.common.block.tile.TileSpecialFlower;
import vazkii.botania.common.crafting.recipe.SpecialFloatingFlowerRecipe;
@@ -62,19 +62,19 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
GameRegistry.addRecipe(new SpecialFloatingFlowerRecipe());
RecipeSorter.register("botania:floatingSpecialFlower", SpecialFloatingFlowerRecipe.class, Category.SHAPELESS, "");
setDefaultState(((IExtendedBlockState) blockState.getBaseState())
.withProperty(BotaniaStateProps.ISLAND_TYPE, IFloatingFlower.IslandType.GRASS)
.withProperty(BotaniaStateProps.SUBTILE_ID, "daybloom")
.withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE)
.withProperty(ISLAND_TYPE, IFloatingFlower.IslandType.GRASS));
.withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE));
}
@Override
public BlockState createBlockState() {
return new ExtendedBlockState(this, new IProperty[] { ISLAND_TYPE, BotaniaStateProps.COLOR }, new IUnlistedProperty[] { BotaniaStateProps.SUBTILE_ID });
return new ExtendedBlockState(this, new IProperty[] { BotaniaStateProps.COLOR }, new IUnlistedProperty[] { BotaniaStateProps.SUBTILE_ID, BotaniaStateProps.ISLAND_TYPE });
}
@Override
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) {
state = getActualState(state, world, pos);
state = super.getExtendedState(state, world, pos);
TileEntity te = world.getTileEntity(pos);
if (te instanceof TileFloatingSpecialFlower) {
state = ((IExtendedBlockState) state).withProperty(BotaniaStateProps.SUBTILE_ID, ((TileFloatingSpecialFlower) te).subTileName);
@@ -39,7 +39,7 @@ public class BlockTeruTeruBozu extends BlockModContainer implements ILexiconable
}
@Override
public void onEntityCollidedWithBlock(World world, BlockPos pos, Entity e) {
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity e) {
if(!world.isRemote && e instanceof EntityItem) {
EntityItem item = (EntityItem) e;
ItemStack stack = item.getEntityItem();
@@ -10,12 +10,9 @@
*/
package vazkii.botania.common.block.decor;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.particle.EffectRenderer;
@@ -35,35 +32,37 @@ import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.property.ExtendedBlockState;
import net.minecraftforge.common.property.IExtendedBlockState;
import net.minecraftforge.common.property.IUnlistedProperty;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import thaumcraft.api.crafting.IInfusionStabiliser;
import vazkii.botania.api.internal.VanillaPacketDispatcher;
import vazkii.botania.api.item.IFloatingFlower;
import vazkii.botania.api.lexicon.ILexiconable;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.state.BotaniaStateProps;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.BlockModContainer;
import vazkii.botania.common.block.decor.IFloatingFlower.IslandType;
import vazkii.botania.api.item.IFloatingFlower.IslandType;
import vazkii.botania.common.block.tile.TileFloatingFlower;
import vazkii.botania.common.block.tile.TileFloatingSpecialFlower;
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 net.minecraftforge.fml.common.Optional;
import net.minecraftforge.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 {
// Island type (floating flowers)
// Not in BotaniaStateProps so we don't have to bundle IslandType in the API
public static final PropertyEnum<IslandType> ISLAND_TYPE = PropertyEnum.create("islandtype", IFloatingFlower.IslandType.class);
public BlockFloatingFlower() {
this(LibBlockNames.MINI_ISLAND);
}
@@ -77,9 +76,9 @@ public class BlockFloatingFlower extends BlockModContainer implements ILexiconab
float f = 0.1F;
setBlockBounds(f, f, f, 1F - f, 1F - f, 1F - f);
setDefaultState(blockState.getBaseState()
.withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE)
.withProperty(ISLAND_TYPE, IFloatingFlower.IslandType.GRASS));
setDefaultState(((IExtendedBlockState) blockState.getBaseState())
.withProperty(BotaniaStateProps.ISLAND_TYPE, IslandType.GRASS)
.withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE));
}
@Override
@@ -89,7 +88,7 @@ public class BlockFloatingFlower extends BlockModContainer implements ILexiconab
@Override
public BlockState createBlockState() {
return new BlockState(this, BotaniaStateProps.COLOR, ISLAND_TYPE);
return new ExtendedBlockState(this, new IProperty[] { BotaniaStateProps.COLOR }, new IUnlistedProperty[] { BotaniaStateProps.ISLAND_TYPE });
}
@Override
@@ -106,12 +105,13 @@ public class BlockFloatingFlower extends BlockModContainer implements ILexiconab
}
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) {
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) {
state = getActualState(state, world, pos);
TileEntity te = world.getTileEntity(pos);
if (te instanceof TileFloatingFlower) {
state = state.withProperty(ISLAND_TYPE, ((TileFloatingFlower) te).getIslandType());
state = ((IExtendedBlockState) state).withProperty(BotaniaStateProps.ISLAND_TYPE, ((TileFloatingFlower) te).getIslandType());
} else if (te instanceof TileFloatingSpecialFlower) {
state = state.withProperty(ISLAND_TYPE, ((TileFloatingSpecialFlower) te).getIslandType());
state = ((IExtendedBlockState) state).withProperty(BotaniaStateProps.ISLAND_TYPE, ((TileFloatingSpecialFlower) te).getIslandType());
}
return state;
}
@@ -211,8 +211,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;
}
@@ -1,65 +0,0 @@
/**
* 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 @ [Nov 17, 2014, 6:05:18 PM (GMT)]
*/
package vazkii.botania.common.block.decor;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.ResourceLocation;
import vazkii.botania.client.lib.LibResources;
import java.util.Locale;
public interface IFloatingFlower {
public ItemStack getDisplayStack();
public IslandType getIslandType();
public void setIslandType(IslandType type);
public static enum IslandType implements IStringSerializable {
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);
private IslandType(String s) {
res = new ResourceLocation(s);
}
private final ResourceLocation res;
public static IslandType ofType(String typeStr) {
for(IslandType type : IslandType.class.getEnumConstants())
if(type.toString().equals(typeStr))
return type;
return GRASS;
}
public ResourceLocation getResource() {
return res;
}
@Override
public String getName() {
return name().toLowerCase(Locale.ROOT);
}
}
}
@@ -55,6 +55,9 @@ public class BlockBellows extends BlockModContainer implements ILexiconable {
@Override
public IBlockState getStateFromMeta(int meta) {
if (meta < 2 || meta > 5) {
meta = 2;
}
return getDefaultState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.getFront(meta));
}
@@ -69,7 +69,7 @@ public class BlockForestDrum extends BlockMod implements IManaTrigger, ILexicona
@Override
public IBlockState getStateFromMeta(int meta) {
if (meta > DrumVariant.values().length) {
if (meta >= DrumVariant.values().length) {
meta = 0;
}
return getDefaultState().withProperty(BotaniaStateProps.DRUM_VARIANT, DrumVariant.values()[meta]);
@@ -88,7 +88,7 @@ public class SubTileHopperhock extends SubTileFunctional {
for(EnumFacing dir : EnumFacing.VALUES) {
BlockPos pos_ = pos.offset(dir);
IInventory inv = InventoryHelper.getInventory(supertile.getWorld(), pos_, dir);
IInventory inv = InventoryHelper.getInventory(supertile.getWorld(), pos_);
if(inv != null) {
List<ItemStack> filter = getFilterForInventory(inv, pos_, true);
boolean canAccept = canAcceptItem(stack, filter, filterType);
@@ -40,7 +40,7 @@ import vazkii.botania.api.subtile.ISubTileContainer;
import vazkii.botania.api.subtile.RadiusDescriptor;
import vazkii.botania.api.subtile.SubTileEntity;
import vazkii.botania.api.subtile.SubTileFunctional;
import vazkii.botania.common.block.decor.IFloatingFlower;
import vazkii.botania.api.item.IFloatingFlower;
import vazkii.botania.common.core.handler.ConfigHandler;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
import vazkii.botania.common.lexicon.LexiconData;
@@ -102,7 +102,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;
@@ -227,10 +227,9 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I
@Override
public void updateEntity() {
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.add(0, 1D / 16D * 20D, 0), pos.add(1, 1D / 16D * 21D,1)));
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.add(0, 1D / 16D * 20D, 0), pos.add(1, 1D / 16D * 32D, 1)));
boolean didChange = false;
for(EntityItem item : items)
didChange = collideEntityItem(item) || didChange;
@@ -92,7 +92,10 @@ public class TileCraftCrate extends TileOpenCrate {
@Override
public void updateEntity() {
if(!worldObj.isRemote && (craft(true) && canEject() || isFull()))
if (worldObj.isRemote)
return;
if(craft(true) && canEject() || isFull())
ejectAll();
int newSignal = 0;
@@ -12,6 +12,7 @@ package vazkii.botania.common.block.tile;
import java.util.List;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
@@ -20,6 +21,7 @@ import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.ITickable;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.WorldServer;
import vazkii.botania.api.state.BotaniaStateProps;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.item.equipment.tool.ToolCommons;
@@ -28,6 +30,9 @@ public class TileEnderEye extends TileMod {
@Override
public void updateEntity() {
if (worldObj.isRemote)
return;
boolean wasLooking = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED);
int range = 80;
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(pos.add(-range, -range, -range), pos.add(range, range, range)));
@@ -39,7 +44,7 @@ public class TileEnderEye extends TileMod {
continue;
MovingObjectPosition pos = ToolCommons.raytraceFromEntity(worldObj, player, true, 64);
if(pos != null && pos.getBlockPos().equals(getPos())) {
if(pos != null && pos.getBlockPos() != null && pos.getBlockPos().equals(getPos())) {
looking = true;
break;
}
@@ -52,8 +57,8 @@ public class TileEnderEye extends TileMod {
double x = getPos().getX() - 0.1 + Math.random() * 1.2;
double y = getPos().getY() - 0.1 + Math.random() * 1.2;
double z = getPos().getZ() - 0.1 + Math.random() * 1.2;
worldObj.spawnParticle(EnumParticleTypes.REDSTONE, x, y, z, 1, 0, 0);
((WorldServer) worldObj).spawnParticle(EnumParticleTypes.REDSTONE, false, x, y, z, 0, 1.0D, 0.0D, 0.0D, 1.0D);
}
}
@@ -15,7 +15,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import vazkii.botania.api.state.BotaniaStateProps;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.decor.IFloatingFlower;
import vazkii.botania.api.item.IFloatingFlower;
public class TileFloatingFlower extends TileMod implements IFloatingFlower {
@@ -12,7 +12,7 @@ package vazkii.botania.common.block.tile;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import vazkii.botania.common.block.decor.IFloatingFlower;
import vazkii.botania.api.item.IFloatingFlower;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
public class TileFloatingSpecialFlower extends TileSpecialFlower implements IFloatingFlower {
@@ -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;
}
}
@@ -20,6 +20,8 @@ public class TileForestEye extends TileMod {
@Override
public void updateEntity() {
if (worldObj.isRemote)
return;
int range = 6;
int entityCount = worldObj.getEntitiesWithinAABB(EntityAnimal.class, new AxisAlignedBB(pos.add(-range, -range, -range), pos.add(range + 1, range + 1, range + 1))).size();
if(entityCount != entities) {
@@ -52,8 +52,10 @@ public class TileHourglass extends TileSimpleInventory {
time = 0;
flip = !flip;
flipTicks = 4;
worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, true), 1 | 2);
worldObj.scheduleUpdate(pos, getBlockType(), getBlockType().tickRate(worldObj));
if (!worldObj.isRemote) {
worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, true), 1 | 2);
worldObj.scheduleUpdate(pos, getBlockType(), getBlockType().tickRate(worldObj));
}
}
timeFraction = (float) time / (float) totalTime;
} else {
@@ -22,6 +22,7 @@ import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ITickable;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.fml.common.registry.GameData;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.brew.Brew;
import vazkii.botania.api.internal.VanillaPacketDispatcher;
@@ -52,8 +53,8 @@ public class TileIncensePlate extends TileSimpleInventory implements ISidedInven
if(!worldObj.isRemote) {
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(pos.getX() + 0.5 - RANGE, pos.getY() + 0.5 - RANGE, pos.getZ() + 0.5 - RANGE, pos.getX() + 0.5 + RANGE, pos.getY() + 0.5 + RANGE, pos.getZ() + 0.5 + RANGE));
for(EntityPlayer player : players) {
PotionEffect currentEffect = player.getActivePotionEffect(Potion.potionTypes[effect.getPotionID()]);
boolean nightVision = effect.getPotionID() == Potion.nightVision.id;
PotionEffect currentEffect = player.getActivePotionEffect(GameData.getPotionRegistry().getObjectById(effect.getPotionID()));
boolean nightVision = effect.getPotionID() == Potion.nightVision.getId();
if(currentEffect == null || currentEffect.getDuration() < (nightVision ? 205 : 3)) {
PotionEffect applyEffect = new PotionEffect(effect.getPotionID(), nightVision ? 285 : 80, effect.getAmplifier(), true, true);
player.addPotionEffect(applyEffect);
@@ -35,7 +35,7 @@ public class TileManaFlame extends TileMod {
public void updateEntity() {
float c = 0.3F;
if(Math.random() < c) {
if(worldObj.isRemote && Math.random() < c) {
float v = 0.1F;
float r = (float) (color >> 16 & 0xFF) / 0xFF + (float) (Math.random() - 0.5) * v;
@@ -64,7 +64,7 @@ public class TileMod extends TileEntity implements ITickable {
@Override
public final void update() {
if (worldObj.isBlockLoaded(getPos(), false)) {
if (!isInvalid() && worldObj.isBlockLoaded(getPos(), false)) {
updateEntity();
} else {
System.out.println("Skipping a tick because our chunk unloaded");
@@ -42,6 +42,9 @@ public class TileOpenCrate extends TileSimpleInventory {
@Override
public void updateEntity() {
if (worldObj.isRemote)
return;
boolean redstone = false;
for(EnumFacing dir : EnumFacing.VALUES) {
int redstoneSide = worldObj.getRedstonePower(pos.offset(dir), dir);
@@ -73,8 +76,7 @@ public class TileOpenCrate extends TileSimpleInventory {
ObfuscationReflectionHelper.setPrivateValue(EntityItem.class, item, -200, LibObfuscation.AGE);
setInventorySlotContents(0, null);
if(!worldObj.isRemote)
worldObj.spawnEntityInWorld(item);
worldObj.spawnEntityInWorld(item);
}
public boolean onWanded(EntityPlayer player, ItemStack stack) {
@@ -16,6 +16,9 @@ public class TileTeruTeruBozu extends TileMod {
@Override
public void updateEntity() {
if (worldObj.isRemote)
return;
boolean isRaining = worldObj.isRaining();
if(isRaining && worldObj.rand.nextInt(9600) == 0)
worldObj.getWorldInfo().setRaining(false);
@@ -19,6 +19,7 @@ import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
import vazkii.botania.api.internal.VanillaPacketDispatcher;
import vazkii.botania.api.state.BotaniaStateProps;
import vazkii.botania.common.block.subtile.functional.SubTileExoflame;
import vazkii.botania.common.block.tile.TileMod;
@@ -115,9 +116,8 @@ public class TileBellows extends TileMod {
}
public TileEntity getLinkedTile() {
return null;
// EnumFacing side = ((EnumFacing) worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.CARDINALS));
// return worldObj.getTileEntity(getPos().offset(side));
EnumFacing side = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.CARDINALS);
return worldObj.getTileEntity(getPos().offset(side));
}
@Override
@@ -31,7 +31,7 @@ public class TileDistributor extends TileMod implements IManaReceiver {
validPools.clear();
for(EnumFacing dir : LibMisc.CARDINAL_DIRECTIONS) {
TileEntity tileAt = worldObj.getTileEntity(pos.offset(dir));
if(tileAt != null && tileAt instanceof IManaPool) {
if(tileAt != null && tileAt instanceof IManaPool && !tileAt.isInvalid()) {
IManaReceiver receiver = (IManaReceiver) tileAt;
if(!receiver.isFull())
validPools.add(receiver);
@@ -25,16 +25,14 @@ public class TileManaDetector extends TileMod implements IManaCollisionGhost {
@Override
public void updateEntity() {
if(!worldObj.isRemote) {
boolean state = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED);
boolean expectedState = worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos, pos.add(1, 1, 1)), Predicates.instanceOf(IManaBurst.class)).size() != 0;
if(state != expectedState)
worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, expectedState), 1 | 2);
boolean state = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED);
boolean expectedState = worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos, pos.add(1, 1, 1)), Predicates.instanceOf(IManaBurst.class)).size() != 0;
if(state != expectedState && !worldObj.isRemote)
worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, expectedState), 1 | 2);
if(expectedState)
for(int i = 0; i < 4; i++)
Botania.proxy.sparkleFX(getWorld(), pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), 1F, 0.2F, 0.2F, 0.7F + 0.5F * (float) Math.random(), 5);
}
if(expectedState)
for(int i = 0; i < 4; i++)
Botania.proxy.sparkleFX(getWorld(), pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), 1F, 0.2F, 0.2F, 0.7F + 0.5F * (float) Math.random(), 5);
}
@Override
@@ -36,6 +36,9 @@ public class TileTurntable extends TileMod {
@Override
public void updateEntity() {
if (worldObj.isRemote)
return;
boolean redstone = false;
for(EnumFacing dir : EnumFacing.VALUES) {
@@ -10,13 +10,13 @@
*/
package vazkii.botania.common.brew;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraftforge.fml.common.registry.GameData;
public class BrewModPotion extends BrewMod {
public BrewModPotion(String key, int cost, PotionEffect... effects) {
super(key, Potion.potionTypes[effects[0].getPotionID()].getLiquidColor(), cost, effects);
super(key, GameData.getPotionRegistry().getObjectById(effects[0].getPotionID()).getLiquidColor(), cost, effects);
}
}
@@ -12,6 +12,7 @@ package vazkii.botania.common.brew;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraftforge.fml.common.registry.GameData;
import vazkii.botania.api.brew.Brew;
import vazkii.botania.common.lib.LibBrewNames;
@@ -67,7 +68,7 @@ public class ModBrews {
public static void initTC() {
Potion warpWardPotion = null;
for(Potion potion : Potion.potionTypes)
for(Potion potion : GameData.getPotionRegistry().typeSafeIterable())
if(potion != null && potion.getName().equals("potion.warpward")) {
warpWardPotion = potion;
break;
@@ -31,8 +31,8 @@ public class ModPotions {
public static Potion clear;
public static void init() {
if(Potion.potionTypes.length < 256)
extendPotionArray();
// if(Potion.potionTypes.length < 256)
// extendPotionArray(); todo 1.8 this should be unnecessary thanks to potion registry
soulCross = new PotionSoulCross();
featherfeet = new PotionFeatherfeet();
@@ -101,7 +101,7 @@ public final class ConfigHandler {
public static int mushroomQuantity = 40;
private static boolean verifiedPotionArray = false;
private static int potionArrayLimit = 0;
private static int potionArrayLimit = 0; // todo 1.8 potion things should be unneeded thanks to potion registry
public static int potionIDSoulCross = 91;
public static int potionIDFeatherfeet = 92;
@@ -282,12 +282,12 @@ public final class ConfigHandler {
desc = "The quantity of Botania mushrooms to generate underground, in the world, defaults to 40, the lower the number the less patches generate.";
mushroomQuantity = loadPropInt("worldgen.mushroom.quantity", desc, mushroomQuantity);
potionIDSoulCross = loadPropPotionId(LibPotionNames.SOUL_CROSS, potionIDSoulCross);
potionIDFeatherfeet = loadPropPotionId(LibPotionNames.FEATHER_FEET, potionIDFeatherfeet);
potionIDEmptiness = loadPropPotionId(LibPotionNames.EMPTINESS, potionIDEmptiness);
potionIDBloodthirst = loadPropPotionId(LibPotionNames.BLOODTHIRST, potionIDBloodthirst);
potionIDAllure = loadPropPotionId(LibPotionNames.ALLURE, potionIDAllure);
potionIDClear = loadPropPotionId(LibPotionNames.CLEAR, potionIDClear);
// potionIDSoulCross = loadPropPotionId(LibPotionNames.SOUL_CROSS, potionIDSoulCross); todo 1.8 should be unneeded thanks to potion registry
// potionIDFeatherfeet = loadPropPotionId(LibPotionNames.FEATHER_FEET, potionIDFeatherfeet);
// potionIDEmptiness = loadPropPotionId(LibPotionNames.EMPTINESS, potionIDEmptiness);
// potionIDBloodthirst = loadPropPotionId(LibPotionNames.BLOODTHIRST, potionIDBloodthirst);
// potionIDAllure = loadPropPotionId(LibPotionNames.ALLURE, potionIDAllure);
// potionIDClear = loadPropPotionId(LibPotionNames.CLEAR, potionIDClear);
if(config.hasChanged())
config.save();
@@ -49,6 +49,7 @@ import net.minecraft.world.EnumDifficulty;
import net.minecraft.world.World;
import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.fml.common.registry.GameData;
import org.lwjgl.opengl.ARBShaderObjects;
import vazkii.botania.api.boss.IBotaniaBossWithShader;
@@ -578,7 +579,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
List<PotionEffect> remove = new ArrayList();
Collection<PotionEffect> active = player.getActivePotionEffects();
for(PotionEffect effect : active)
if(effect.getDuration() < 200 && effect.getIsAmbient() && !ReflectionHelper.<Boolean, Potion>getPrivateValue(Potion.class, Potion.potionTypes[effect.getPotionID()], LibObfuscation.IS_BAD_EFFECT))
if(effect.getDuration() < 200 && effect.getIsAmbient() && !GameData.getPotionRegistry().getObjectById(effect.getPotionID()).isBadEffect())
remove.add(effect);
active.removeAll(remove);
@@ -0,0 +1,18 @@
/**
* 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 @ [Jan 13, 2016, 6:02:31 PM (GMT)]
*/
package vazkii.botania.common.item;
import net.minecraft.item.ItemStack;
import vazkii.botania.api.item.IFloatingFlower.IslandType;
public interface IFloatingFlowerVariant {
public IslandType getIslandType(ItemStack stack);
}
@@ -2,10 +2,10 @@
* 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 @ [Sep 23, 2015, 11:40:51 PM (GMT)]
*/
package vazkii.botania.common.item;
@@ -31,9 +31,7 @@ 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.
// Copied from vanila skull itemBlock. Relevant edits are indicated.
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
{
@@ -123,6 +121,7 @@ public class ItemGaiaHead extends ItemMod {
return true;
}
}
}
@@ -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;
@@ -32,13 +33,13 @@ import vazkii.botania.api.state.BotaniaStateProps;
import vazkii.botania.api.state.enums.AltGrassVariant;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.decor.IFloatingFlower.IslandType;
import vazkii.botania.api.item.IFloatingFlower.IslandType;
import vazkii.botania.common.lib.LibItemNames;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.Phase;
public class ItemGrassSeeds extends ItemMod {
public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant {
private static Map<Integer, List<BlockSwapper>> blockSwappers = new HashMap();
@@ -153,10 +154,14 @@ public class ItemGrassSeeds extends ItemMod {
int dim = event.world.provider.getDimensionId();
if(blockSwappers.containsKey(dim)) {
List<BlockSwapper> swappers = blockSwappers.get(dim);
List<BlockSwapper> swappersSafe = new ArrayList(swappers);
for(BlockSwapper s : swappersSafe)
s.tick(swappers);
Iterator<BlockSwapper> iter = swappers.listIterator();
while(iter.hasNext()) {
BlockSwapper next = iter.next();
if(!next.tick())
iter.remove();
}
}
}
}
@@ -186,58 +191,128 @@ 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 {
/**
* The range of the block swapper, in blocks.
*/
public static final int RANGE = 3;
final World world;
final Random rand;
final IBlockState stateToSet;
BlockPos startCoords;
int ticksExisted = 0;
/**
* The range around which a block can spread in a single tick.
*/
public static final int TICK_RANGE = 1;
BlockSwapper(World world, BlockPos coords, IBlockState state) {
private final World world;
private final Random rand;
private final IBlockState stateToSet;
private BlockPos startCoords;
private int ticksExisted = 0;
/**
* 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 state The target blockstate to swap dirt and grass to.
*/
public BlockSwapper(World world, BlockPos coords, IBlockState state) {
this.world = world;
stateToSet = state;
rand = new Random(coords.hashCode());
startCoords = coords;
this.stateToSet = state;
this.rand = new Random(coords.hashCode());
this.startCoords = coords;
}
void tick(List<BlockSwapper> 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++) {
BlockPos pos = startCoords.add(i, 0, j);
IBlockState state = world.getBlockState(pos);
Block block = state.getBlock();
if(state == stateToSet) {
if(ticksExisted % 20 == 0) {
List<BlockPos> validCoords = new ArrayList();
for(int k = -1; k < 2; k++)
for(int l = -1; l < 2; l++) {
BlockPos pos1 = pos.add(k, 0, l);
IBlockState state1 = world.getBlockState(pos1);
if((state1.getBlock() == Blocks.dirt
&& state1.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT)
|| state1.getBlock() == Blocks.grass)
validCoords.add(pos1);
}
// Only make changes every 20 ticks
if(ticksExisted % 20 != 0) continue;
if(!validCoords.isEmpty() && !world.isRemote) {
BlockPos coords = validCoords.get(rand.nextInt(validCoords.size()));
world.setBlockState(coords, stateToSet, 1 | 2);
}
}
tickBlock(pos);
}
}
}
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 pos The positions to use.
*/
public void tickBlock(BlockPos pos) {
List<BlockPos> validCoords = new ArrayList<BlockPos>();
// 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(pos.add(xOffset, 0, zOffset)))
validCoords.add(pos.add(xOffset, 0, 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) {
BlockPos toSwap = validCoords.get(rand.nextInt(validCoords.size()));
world.setBlockState(toSwap, stateToSet, 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 pos The position to check.
* @return True if the position is valid to swap, false otherwise.
*/
public boolean isValidSwapPosition(BlockPos pos) {
IBlockState state = world.getBlockState(pos);
Block block = state.getBlock();
Block aboveBlock = world.getBlockState(pos.up()).getBlock();
// 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)
&& (block != Blocks.dirt || state.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT)
&& (aboveBlock.getLightOpacity(world, pos.up()) <= 1);
}
}
public static IslandType getIslandType(ItemStack stack) {
public IslandType getIslandType(ItemStack stack) {
return ISLAND_TYPES[Math.min(stack.getItemDamage(), ISLAND_TYPES.length - 1)];
}
@@ -18,12 +18,14 @@ import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.*;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.GameData;
import vazkii.botania.api.internal.IManaBurst;
import vazkii.botania.api.mana.BurstProperties;
import vazkii.botania.api.mana.ILaputaImmobile;
@@ -38,6 +40,7 @@ import vazkii.botania.common.lib.LibItemNames;
public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanetExcempt {
private static final String TAG_BLOCK = "_block";
private static final String TAG_BLOCK_NAME = "_blockname";
private static final String TAG_META = "_meta";
private static final String TAG_TILE = "_tile";
private static final String TAG_X = "_x";
@@ -72,7 +75,7 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet
@Override
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, BlockPos pos, EnumFacing side, float par8, float par9, float par10) {
if(pos.getY() < 160 && !par3World.provider.doesWaterVaporize()) {
if(!par3World.isRemote && pos.getY() < 160 && !par3World.provider.doesWaterVaporize()) {
par3World.playSound(pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D, "botania:laputaStart", 1.0F + par3World.rand.nextFloat(), par3World.rand.nextFloat() * 0.7F + 1.3F, false);
spawnBurstFirst(par3World, pos, par1ItemStack);
par1ItemStack.stackSize--;
@@ -130,7 +133,7 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet
world.playAuxSFX(2001, pos_, Block.getStateId(state));
ItemStack copyLens = new ItemStack(this, 1, lens.getItemDamage());
ItemNBTHelper.setInt(copyLens, TAG_BLOCK, id);
ItemNBTHelper.setString(copyLens, TAG_BLOCK_NAME, GameData.getBlockRegistry().getNameForObject(block).toString());
ItemNBTHelper.setInt(copyLens, TAG_META, block.getMetaFromState(state));
NBTTagCompound cmp = new NBTTagCompound();
if(tile != null)
@@ -224,8 +227,15 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet
BlockPos pos = new BlockPos(x, y, z);
if(entity.worldObj.isAirBlock(pos)) {
int id = ItemNBTHelper.getInt(lens, TAG_BLOCK, 0);
Block block = Block.getBlockById(id);
Block block = Blocks.air;
if (lens.hasTagCompound()) {
if (lens.getTagCompound().hasKey(TAG_BLOCK_NAME)) {
block = Block.getBlockFromName(ItemNBTHelper.getString(lens, TAG_BLOCK_NAME, ""));
} else if (lens.getTagCompound().hasKey(TAG_BLOCK)) {
// Attempt to read legacy tag (integer ID) if string block ID is absent
block = Block.getBlockById(ItemNBTHelper.getInt(lens, TAG_BLOCK, 0));
}
}
int meta = ItemNBTHelper.getInt(lens, TAG_META, 0);
TileEntity tile = null;
@@ -250,8 +260,8 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet
public boolean doParticles(IManaBurst burst, ItemStack stack) {
EntityThrowable entity = (EntityThrowable) burst;
ItemStack lens = burst.getSourceLens();
int id = ItemNBTHelper.getInt(lens, TAG_BLOCK, 0);
Block b = Block.getBlockById(id);
String id = ItemNBTHelper.getString(lens, TAG_BLOCK_NAME, "minecraft:air");
Block b = Block.getBlockFromName(id);
int meta = ItemNBTHelper.getInt(lens, TAG_META, 0);
entity.worldObj.spawnParticle(EnumParticleTypes.BLOCK_CRACK, entity.posX, entity.posY, entity.posZ, entity.motionX, entity.motionY, entity.motionZ, Block.getStateId(b.getStateFromMeta(meta)));
@@ -100,7 +100,7 @@ public class ItemSextant extends ItemMod {
if(!par3EntityPlayer.isSneaking()) {
MovingObjectPosition pos = ToolCommons.raytraceFromEntity(par2World, par3EntityPlayer, false, 128);
if(pos != null && pos.entityHit == null) {
if(pos != null && pos.entityHit == null && pos.getBlockPos() != null) {
if(!par2World.isRemote) {
ItemNBTHelper.setInt(par1ItemStack, TAG_SOURCE_X, pos.getBlockPos().getX());
ItemNBTHelper.setInt(par1ItemStack, TAG_SOURCE_Y, pos.getBlockPos().getY());
@@ -25,6 +25,7 @@ import net.minecraft.stats.Achievement;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.GameData;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.brew.Brew;
import vazkii.botania.api.brew.IBrewItem;
@@ -78,7 +79,7 @@ public abstract class ItemBrewBase extends ItemMod implements IBrewItem, IPickup
if(!world.isRemote) {
for(PotionEffect effect : getBrew(stack).getPotionEffects(stack)) {
PotionEffect newEffect = new PotionEffect(effect.getPotionID(), effect.getDuration(), effect.getAmplifier(), true, true);
Potion potion = Potion.potionTypes[newEffect.getPotionID()];
Potion potion = GameData.getPotionRegistry().getObjectById(effect.getPotionID());
if(potion.isInstant())
potion.affectEntity(player, player, player, newEffect.getAmplifier(), 1F);
else player.addPotionEffect(newEffect);
@@ -137,7 +138,7 @@ public abstract class ItemBrewBase extends ItemMod implements IBrewItem, IPickup
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) {
Brew brew = getBrew(stack);
for(PotionEffect effect : brew.getPotionEffects(stack)) {
Potion potion = Potion.potionTypes[effect.getPotionID()];
Potion potion = GameData.getPotionRegistry().getObjectById(effect.getPotionID());
EnumChatFormatting format = potion.isBadEffect() ? EnumChatFormatting.RED : EnumChatFormatting.GRAY;
list.add(format + StatCollector.translateToLocal(effect.getEffectName()) + (effect.getAmplifier() == 0 ? "" : " " + StatCollector.translateToLocal("botania.roman" + (effect.getAmplifier() + 1))) + EnumChatFormatting.GRAY + (potion.isInstant() ? "" : " (" + Potion.getDurationString(effect) + ")"));
}
@@ -21,6 +21,7 @@ import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import net.minecraftforge.fml.common.registry.GameData;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.brew.Brew;
import vazkii.botania.api.brew.IBrewContainer;
@@ -79,7 +80,7 @@ public class ItemIncenseStick extends ItemMod implements IBrewItem, IBrewContain
addStringToTooltip(EnumChatFormatting.LIGHT_PURPLE + String.format(StatCollector.translateToLocal("botaniamisc.brewOf"), StatCollector.translateToLocal(brew.getUnlocalizedName(stack))), list);
for(PotionEffect effect : brew.getPotionEffects(stack)) {
Potion potion = Potion.potionTypes[effect.getPotionID()];
Potion potion = GameData.getPotionRegistry().getObjectById(effect.getPotionID());
EnumChatFormatting format = potion.isBadEffect() ? EnumChatFormatting.RED : EnumChatFormatting.GRAY;
PotionEffect longEffect = new PotionEffect(effect.getPotionID(), effect.getDuration() * TIME_MULTIPLIER, effect.getAmplifier(), false, true);
addStringToTooltip(" " + format + StatCollector.translateToLocal(effect.getEffectName()) + (effect.getAmplifier() == 0 ? "" : " " + StatCollector.translateToLocal("botania.roman" + (effect.getAmplifier() + 1))) + EnumChatFormatting.GRAY + (potion.isInstant() ? "" : " (" + Potion.getDurationString(longEffect) + ")"), list);
@@ -106,7 +107,7 @@ public class ItemIncenseStick extends ItemMod implements IBrewItem, IBrewContain
@Override
public ItemStack getItemForBrew(Brew brew, ItemStack stack) {
if(!brew.canInfuseIncense() || brew.getPotionEffects(stack).size() != 1 || Potion.potionTypes[brew.getPotionEffects(stack).get(0).getPotionID()].isInstant())
if(!brew.canInfuseIncense() || brew.getPotionEffects(stack).size() != 1 || GameData.getPotionRegistry().getObjectById(brew.getPotionEffects(stack).get(0).getPotionID()).isInstant())
return null;
ItemStack brewStack = new ItemStack(this);
@@ -196,7 +196,7 @@ public class ItemBaubleCosmetic extends ItemBauble implements ICosmeticBauble {
break;
case 26:
faceTranslate();
GlStateManager.translate(-0.1F, -0.5F, 0F);
GlStateManager.translate(-0.1F, -0.4F, 0F);
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GlStateManager.color(1F, 1F, 1F, 0.7F);
@@ -205,7 +205,7 @@ public class ItemBaubleCosmetic extends ItemBauble implements ICosmeticBauble {
case 27:
faceTranslate();
scale(0.75F);
GlStateManager.translate(0.04F, -0.5F, 0F);
GlStateManager.translate(0.04F, -0.65F, 0F);
renderIcon(27);
break;
case 28:
@@ -28,6 +28,8 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import net.minecraftforge.client.event.RenderPlayerEvent;
import net.minecraftforge.fml.common.registry.FMLControlledNamespacedRegistry;
import net.minecraftforge.fml.common.registry.GameData;
import org.lwjgl.opengl.GL11;
import vazkii.botania.api.BotaniaAPI;
@@ -92,7 +94,7 @@ public class ItemBloodPendant extends ItemBauble implements IBrewContainer, IBre
addStringToTooltip(EnumChatFormatting.LIGHT_PURPLE + String.format(StatCollector.translateToLocal("botaniamisc.brewOf"), StatCollector.translateToLocal(brew.getUnlocalizedName(stack))), list);
for(PotionEffect effect : brew.getPotionEffects(stack)) {
Potion potion = Potion.potionTypes[effect.getPotionID()];
Potion potion = GameData.getPotionRegistry().getObjectById(effect.getPotionID());
EnumChatFormatting format = potion.isBadEffect() ? EnumChatFormatting.RED : EnumChatFormatting.GRAY;
addStringToTooltip(" " + format + StatCollector.translateToLocal(effect.getEffectName()) + (effect.getAmplifier() == 0 ? "" : " " + StatCollector.translateToLocal("botania.roman" + (effect.getAmplifier() + 1))), list);
}
@@ -112,7 +114,7 @@ public class ItemBloodPendant extends ItemBauble implements IBrewContainer, IBre
float cost = (float) brew.getManaCost(stack) / effect.getDuration() / (1 + effect.getAmplifier()) * 2.5F;
boolean doRand = cost < 1;
if(ManaItemHandler.requestManaExact(stack, eplayer, (int) Math.ceil(cost), false)) {
PotionEffect currentEffect = player.getActivePotionEffect(Potion.potionTypes[effect.getPotionID()]);
PotionEffect currentEffect = player.getActivePotionEffect(GameData.getPotionRegistry().getObjectById(effect.getPotionID()));
boolean nightVision = effect.getPotionID() == Potion.nightVision.id;
if(currentEffect == null || currentEffect.getDuration() < (nightVision ? 205 : 3)) {
PotionEffect applyEffect = new PotionEffect(effect.getPotionID(), nightVision ? 285 : 80, effect.getAmplifier(), true, true);
@@ -141,7 +143,8 @@ public class ItemBloodPendant extends ItemBauble implements IBrewContainer, IBre
@Override
public ItemStack getItemForBrew(Brew brew, ItemStack stack) {
if(!brew.canInfuseBloodPendant() || brew.getPotionEffects(stack).size() != 1 || Potion.potionTypes[brew.getPotionEffects(stack).get(0).getPotionID()].isInstant())
FMLControlledNamespacedRegistry<Potion> potionRegistry = GameData.getPotionRegistry();
if(!brew.canInfuseBloodPendant() || brew.getPotionEffects(stack).size() != 1 || potionRegistry.getObjectById(brew.getPotionEffects(stack).get(0).getPotionID()).isInstant())
return null;
ItemStack brewStack = new ItemStack(this);
@@ -66,7 +66,7 @@ public class ItemMonocle extends ItemBauble implements IBurstViewerBauble, ICosm
public static void renderHUD(ScaledResolution resolution, EntityPlayer player) {
Minecraft mc = Minecraft.getMinecraft();
MovingObjectPosition pos = mc.objectMouseOver;
if(pos == null)
if(pos == null || pos.getBlockPos() == null)
return;
Block block = player.worldObj.getBlockState(pos.getBlockPos()).getBlock();
int meta = block.getMetaFromState(player.worldObj.getBlockState(pos.getBlockPos())); // todo 1.8 use states
@@ -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);
@@ -43,7 +43,7 @@ public class ItemSwapRing extends ItemBauble {
MovingObjectPosition pos = ToolCommons.raytraceFromEntity(entity.worldObj, entity, true, 4.5F);
ToolType typeToFind = null;
if(player.isSwingInProgress && pos != null) {
if(player.isSwingInProgress && pos != null && pos.getBlockPos() != null) {
Block block = entity.worldObj.getBlockState(pos.getBlockPos()).getBlock();
if(block != null) {
@@ -38,7 +38,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;
@@ -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.enchantment.Enchantment;
@@ -37,9 +41,32 @@ import net.minecraftforge.fml.common.gameevent.TickEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.Phase;
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<Integer, List<BlockSwapper>> blockSwappers = new HashMap();
private static Map<Integer, List<BlockSwapper>> blockSwappers = new HashMap<Integer, List<BlockSwapper>>();
public ItemTerraAxe() {
super(BotaniaAPI.terrasteelToolMaterial, LibItemNames.TERRA_AXE);
@@ -69,8 +96,7 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker
@Override
public void breakOtherBlock(EntityPlayer player, ItemStack stack, BlockPos pos, BlockPos originPos, EnumFacing side) {
if(shouldBreak(player)) {
BlockPos coords = new BlockPos(pos);
addBlockSwapper(player.worldObj, player, stack, coords, coords, 32, false, true, new ArrayList());
addBlockSwapper(player.worldObj, player, stack, pos, 32, true);
}
}
@@ -85,82 +111,248 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker
int dim = event.world.provider.getDimensionId();
if(blockSwappers.containsKey(dim)) {
List<BlockSwapper> swappers = blockSwappers.get(dim);
List<BlockSwapper> 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<BlockSwapper> 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, BlockPos origCoords, BlockPos coords, int steps, boolean leaves, boolean force, List<String> posChecked) {
BlockSwapper swapper = new BlockSwapper(world, player, stack, origCoords, coords, steps, leaves, force, posChecked);
private static BlockSwapper addBlockSwapper(World world, EntityPlayer player, ItemStack stack, BlockPos origCoords, int steps, boolean leaves) {
BlockSwapper swapper = new BlockSwapper(world, player, stack, origCoords, steps, leaves);
int dim = world.provider.getDimensionId();
if(!blockSwappers.containsKey(dim))
blockSwappers.put(dim, new ArrayList());
blockSwappers.put(dim, new ArrayList<BlockSwapper>());
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 BlockPos origCoords;
final int steps;
final BlockPos coords;
final boolean leaves;
final boolean force;
final List<String> posChecked;
BlockSwapper(World world, EntityPlayer player, ItemStack stack, BlockPos origCoords, BlockPos coords, int steps, boolean leaves, boolean force, List<String> 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 BlockPos 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<SwapCandidate> candidateQueue;
/**
* The set of already swaps coordinates which do not have
* to be revisited.
*/
private Set<BlockPos> 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, BlockPos 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<SwapCandidate>();
this.completedCoords = new HashSet<BlockPos>();
// Add the origin to our candidate queue with the original range
candidateQueue.offer(new SwapCandidate(this.origin, this.range));
}
void tick() {
Block blockat = world.getBlockState(coords).getBlock();
if(!force && blockat.isAir(world, coords))
return;
ToolCommons.removeBlockWithDrops(player, stack, world, coords, origCoords, 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++) {
BlockPos pos = coords.add(i - 1, j - 1, k - 1);
String pstr = posStr(pos);
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,
origin,
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(BlockPos adj : adjacent(cand.coordinates)) {
Block block = world.getBlockState(adj).getBlock();
boolean isWood = block.isWood(world, adj);
boolean isLeaf = block.isLeaves(world, adj);
// 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<BlockPos> adjacent(BlockPos original) {
List<BlockPos> coords = new ArrayList<BlockPos>();
// 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.getBlockState(pos).getBlock();
boolean log = block.isWood(world, pos);
boolean leaf = block.isLeaves(world, pos);
if(log || leaf) {
int steps = this.steps - 1;
steps = leaf ? leaves ? steps : 3 : steps;
addBlockSwapper(world, player, stack, origCoords, pos, steps, leaf, false, posChecked);
posChecked.add(pstr);
}
coords.add(original.add(dx, dy, dz));
}
return coords;
}
String posStr(BlockPos pos) {
return pos.getX() + ":" + pos.getY() + ":" + pos.getZ();
/**
* 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<SwapCandidate> {
/**
* The location of this swap candidate.
*/
public BlockPos 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(BlockPos 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;
}
}
}
@@ -22,7 +22,7 @@ public class LensBounce extends Lens {
@Override
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) {
if(!isManaBlock && pos.entityHit == null) {
if(!isManaBlock && pos.entityHit == null && pos.getBlockPos() != null) {
BlockPos coords = burst.getBurstSourceBlockPos();
if(!coords.equals(pos.getBlockPos())) {
Vector3 currentMovementVec = new Vector3(entity.motionX, entity.motionY, entity.motionZ);
@@ -23,7 +23,7 @@ public class LensExplosive extends Lens {
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) {
if(!burst.isFake()) {
BlockPos coords = burst.getBurstSourceBlockPos();
if(!entity.worldObj.isRemote && pos.entityHit == null && !isManaBlock && !coords.equals(pos.getBlockPos()))
if(!entity.worldObj.isRemote && pos.entityHit == null && !isManaBlock && (pos.getBlockPos() == null || !coords.equals(pos.getBlockPos())))
entity.worldObj.createExplosion(entity, entity.posX, entity.posY, entity.posZ, burst.getMana() / 50F, true);
} else dead = false;
@@ -26,7 +26,7 @@ public class LensFire extends Lens {
@Override
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) {
BlockPos coords = burst.getBurstSourceBlockPos();
if(!coords.equals(pos.getBlockPos()) && !burst.isFake() && !isManaBlock) {
if(pos.getBlockPos() != null && !coords.equals(pos.getBlockPos()) && !burst.isFake() && !isManaBlock) {
EnumFacing dir = pos.sideHit;
BlockPos pos_ = pos.getBlockPos().offset(dir);
@@ -27,7 +27,7 @@ public class LensFirework extends Lens {
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) {
if(!burst.isFake()) {
BlockPos coords = burst.getBurstSourceBlockPos();
if(!entity.worldObj.isRemote && pos.entityHit == null && !isManaBlock && !pos.getBlockPos().equals(coords)) {
if(!entity.worldObj.isRemote && pos.entityHit == null && !isManaBlock && (pos.getBlockPos() == null || !pos.getBlockPos().equals(coords))) {
ItemStack fireworkStack = generateFirework(burst.getColor());
EntityFireworkRocket rocket = new EntityFireworkRocket(entity.worldObj, entity.posX, entity.posY, entity.posZ, fireworkStack);
@@ -26,7 +26,7 @@ public class LensLight extends Lens {
@Override
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) {
BlockPos coords = burst.getBurstSourceBlockPos();
if(!coords.equals(pos.getBlockPos()) && !burst.isFake() && !isManaBlock) {
if((pos.getBlockPos() == null || !coords.equals(pos.getBlockPos())) && !burst.isFake() && !isManaBlock) {
BlockPos pos_ = pos.getBlockPos().offset(pos.sideHit);
Block blockAt = entity.worldObj.getBlockState(pos.getBlockPos()).getBlock();
@@ -42,7 +42,7 @@ public class LensPaint extends Lens {
sheep.setFleeceColor(EnumDyeColor.byMetadata(storedColor == 16 ? sheep.worldObj.rand.nextInt(16) : storedColor));
}
dead = true;
} else {
} else if (pos.getBlockPos() != null) {
Block block = entity.worldObj.getBlockState(pos.getBlockPos()).getBlock();
if(BotaniaAPI.paintableBlocks.containsKey(block)) {
IBlockState state = entity.worldObj.getBlockState(pos.getBlockPos());
@@ -24,7 +24,7 @@ public class LensPiston extends Lens {
@Override
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) {
BlockPos coords = burst.getBurstSourceBlockPos();
if(!coords.equals(pos.getBlockPos()) && !burst.isFake() && !isManaBlock && !entity.worldObj.isRemote) {
if(pos.getBlockPos() != null && !coords.equals(pos.getBlockPos()) && !burst.isFake() && !isManaBlock && !entity.worldObj.isRemote) {
BlockPos pos_ = pos.getBlockPos().offset(pos.sideHit);
if(entity.worldObj.isAirBlock(pos_) || entity.worldObj.getBlockState(pos_).getBlock().isReplaceable(entity.worldObj, pos_)) {
@@ -26,7 +26,7 @@ public class LensRedirect extends Lens {
@Override
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) {
BlockPos coords = burst.getBurstSourceBlockPos();
if(!entity.worldObj.isRemote && pos.entityHit == null && coords.getY() != -1 && !pos.getBlockPos().equals(coords)) {
if(!entity.worldObj.isRemote && pos.entityHit == null && coords.getY() != -1 && (pos.getBlockPos() == null || !pos.getBlockPos().equals(coords))) {
TileEntity tile = entity.worldObj.getTileEntity(pos.getBlockPos());
if(tile != null && tile instanceof IRedirectable) {
if(!burst.isFake()) {
@@ -22,7 +22,7 @@ public class LensStorm extends Lens {
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) {
if(!burst.isFake()) {
BlockPos coords = burst.getBurstSourceBlockPos();
if(!entity.worldObj.isRemote && pos.entityHit == null && !isManaBlock && !coords.equals(pos.getBlockPos()))
if(!entity.worldObj.isRemote && pos.entityHit == null && !isManaBlock && (pos.getBlockPos() == null || !coords.equals(pos.getBlockPos())))
entity.worldObj.createExplosion(entity, entity.posX, entity.posY, entity.posZ, 5F, true);
} else dead = false;
@@ -22,7 +22,7 @@ public class LensWarp extends Lens {
@Override
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) {
if(burst.isFake())
if(burst.isFake() || pos.getBlockPos() == null)
return dead;
Block block = entity.worldObj.getBlockState(pos.getBlockPos()).getBlock();
@@ -23,7 +23,7 @@ public class LensWeight extends Lens {
@Override
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) {
if(!burst.isFake()) {
if(!burst.isFake() && pos.getBlockPos() != null) {
int harvestLevel = ConfigHandler.harvestLevelWeight;
Block block = entity.worldObj.getBlockState(pos.getBlockPos()).getBlock();
@@ -91,12 +91,12 @@ public class ItemLokiRing extends ItemRelicBauble implements IExtendedWireframeC
int cost = Math.min(cursorCount, (int) Math.pow(Math.E, cursorCount * 0.25));
if(heldItemStack == null && event.action == Action.RIGHT_CLICK_BLOCK && player.isSneaking()) {
if(originCoords.getY() == -1 && lookPos != null) {
if(originCoords.getY() == -1 && lookPos != null && lookPos.getBlockPos() != null) {
setOriginPos(lokiRing, lookPos.getBlockPos());
setCursorList(lokiRing, null);
if(player instanceof EntityPlayerMP)
PacketHandler.INSTANCE.sendTo(new PacketSyncBauble(player, slot), (EntityPlayerMP) player);
} else if(lookPos != null) {
} else if(lookPos != null && lookPos.getBlockPos() != null) {
if(originCoords.equals(lookPos.getBlockPos())) {
setOriginPos(lokiRing, new BlockPos(0, -1, 0));
if(player instanceof EntityPlayerMP)
@@ -120,7 +120,7 @@ public class ItemLokiRing extends ItemRelicBauble implements IExtendedWireframeC
}
}
}
} else if(heldItemStack != null && event.action == Action.RIGHT_CLICK_BLOCK && lookPos != null && player.isSneaking()) {
} else if(heldItemStack != null && event.action == Action.RIGHT_CLICK_BLOCK && lookPos != null && lookPos.getBlockPos() != null && player.isSneaking()) {
for(BlockPos cursor : cursors) {
BlockPos pos = lookPos.getBlockPos().add(cursor);
Item item = heldItemStack.getItem();
@@ -173,7 +173,7 @@ public class ItemLokiRing extends ItemRelicBauble implements IExtendedWireframeC
MovingObjectPosition lookPos = Minecraft.getMinecraft().objectMouseOver;
if(lookPos != null && !player.worldObj.isAirBlock(lookPos.getBlockPos()) && lookPos.entityHit == null) {
if(lookPos != null && lookPos.getBlockPos() != null && !player.worldObj.isAirBlock(lookPos.getBlockPos()) && lookPos.entityHit == null) {
List<BlockPos> list = getCursorList(stack);
BlockPos origin = getOriginPos(stack);
@@ -32,6 +32,7 @@ import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
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;
@@ -152,49 +153,55 @@ public class ItemExchangeRod extends ItemMod implements IManaUsingItem, IWirefra
}
}
public Boolean[][][] createMatrix(World world, ItemStack stack, IBlockState swapState, BlockPos pos, IBlockState targetState) {
public List<BlockPos> getBlocksToSwap(World world, ItemStack stack, IBlockState swapState, BlockPos pos, IBlockState targetState) {
// 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(targetState == null) {
targetState = world.getBlockState(pos);
}
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++) {
BlockPos pos_ = pos.add(i - effrange, j - effrange, k - effrange);
IBlockState state = world.getBlockState(pos_);
boolean invalid = !BlockCamo.isValidBlock(state.getBlock());
if(invalid)
matrix[i][j][k] = true;
else if(state == swapState || state != targetState)
matrix[i][j][k] = null;
else matrix[i][j][k] = false;
}
// Our result list
List<BlockPos> coordsList = new ArrayList<BlockPos>();
return matrix;
}
// 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++) {
BlockPos pos_ = pos.add(offsetX, offsetY, offsetZ);
public List<BlockPos> getBlocksToSwap(World world, ItemStack stack, IBlockState swapState, BlockPos pos, IBlockState targetState) {
List<BlockPos> coordsList = new ArrayList();
Boolean[][][] matrix = createMatrix(world, stack, swapState, pos, targetState);
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++) {
BlockPos pos_ = pos.add(i - effrange, j - effrange, k - effrange);
Boolean bool = matrix[i][j][k];
if(bool != null && !bool)
for(EnumFacing dir : EnumFacing.VALUES) {
Boolean obool = matrix[i + dir.getFrontOffsetX()][j + dir.getFrontOffsetY()][k + dir.getFrontOffsetZ()];
if(obool != null && obool) {
coordsList.add(pos_);
break;
}
IBlockState currentState = world.getBlockState(pos_);
// If this block is not our target, ignore it, as we don't need
// to consider replacing it
if(currentState != targetState)
continue;
// If this block is already the block we're swapping to,
// we don't need to swap again
if(currentState == swapState)
continue;
// Check to see if the block is visible on any side:
for(EnumFacing dir : EnumFacing.VALUES) {
BlockPos adjPos = pos_.offset(dir);
Block adjBlock = world.getBlockState(adjPos).getBlock();
// 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, adjPos, dir.getOpposite())) {
coordsList.add(pos_);
break;
}
}
}
return coordsList;
@@ -269,13 +276,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) {
@@ -378,7 +395,7 @@ public class ItemExchangeRod extends ItemMod implements IManaUsingItem, IWirefra
int meta = getBlockMeta(stack);
MovingObjectPosition pos = Minecraft.getMinecraft().objectMouseOver;
if(pos != null) {
if(pos != null && pos.getBlockPos() != null) {
BlockPos bPos = pos.getBlockPos();
Block targetBlock = null;
int targetMeta = 0;
@@ -66,7 +66,7 @@ public class ItemSmeltRod extends ItemMod implements IManaUsingItem {
MovingObjectPosition pos = ToolCommons.raytraceFromEntity(p.worldObj, p, false, 32);
if(pos != null) {
if(pos != null && pos.getBlockPos() != null) {
IBlockState state = p.worldObj.getBlockState(pos.getBlockPos());
ItemStack blockStack = new ItemStack(state.getBlock(), 1, state.getBlock().getMetaFromState(state));
@@ -1,4 +1,5 @@
{
"__comment": "The texture is split apart to facilitate efficient use of the atlas. Sorry for the clutter!",
"forge_marker": 1,
"defaults": {
"model": "botania:altar",
@@ -7,43 +8,203 @@
"variants": {
"variant": {
"default": { "textures": {
"all": "botania:model/altar",
"gobletbaseside": "botania:model/altar/default/gobletBase_sides",
"gobletbasetop": "botania:model/altar/default/gobletBase_top",
"gobletbasebottom": "botania:model/altar/default/gobletBase_bottom",
"gobletbase2side": "botania:model/altar/default/gobletBase2_sides",
"gobletbase2top": "botania:model/altar/default/gobletBase2_top",
"gobletbase2bottom": "botania:model/altar/default/gobletBase2_bottom",
"gobletbase3side": "botania:model/altar/default/gobletBase3_sides",
"gobletbase3top": "botania:model/altar/default/gobletBase3_top",
"gobletbase3bottom": "botania:model/altar/default/gobletBase3_bottom",
"gobletstandside": "botania:model/altar/default/gobletStand_sides",
"gobletstandtopbottom": "botania:model/altar/default/gobletStand_top_bottom",
"kelkbaseside": "botania:model/altar/default/kelkBase_sides",
"kelkbasetopbottom": "botania:model/altar/default/kelkBase_top_bottom",
"kelkbase2side": "botania:model/altar/default/kelkBase2_sides",
"kelkbase2top": "botania:model/altar/default/kelkBase2_top",
"kelkbase2bottom": "botania:model/altar/default/kelkBase2_bottom",
"kelkwall": "botania:model/altar/default/kelkWall",
"particle": "minecraft:blocks/cobblestone"
}},
"forest": { "textures": {
"all": "botania:model/altarMeta0",
"gobletbaseside": "botania:model/altar/forest/gobletBase_sides",
"gobletbasetop": "botania:model/altar/forest/gobletBase_top",
"gobletbasebottom": "botania:model/altar/forest/gobletBase_bottom",
"gobletbase2side": "botania:model/altar/forest/gobletBase2_sides",
"gobletbase2top": "botania:model/altar/forest/gobletBase2_top",
"gobletbase2bottom": "botania:model/altar/forest/gobletBase2_bottom",
"gobletbase3side": "botania:model/altar/forest/gobletBase3_sides",
"gobletbase3top": "botania:model/altar/forest/gobletBase3_top",
"gobletbase3bottom": "botania:model/altar/forest/gobletBase3_bottom",
"gobletstandside": "botania:model/altar/forest/gobletStand_sides",
"gobletstandtopbottom": "botania:model/altar/forest/gobletStand_top_bottom",
"kelkbaseside": "botania:model/altar/forest/kelkBase_sides",
"kelkbasetopbottom": "botania:model/altar/forest/kelkBase_top_bottom",
"kelkbase2side": "botania:model/altar/forest/kelkBase2_sides",
"kelkbase2top": "botania:model/altar/forest/kelkBase2_top",
"kelkbase2bottom": "botania:model/altar/forest/kelkBase2_bottom",
"kelkwall": "botania:model/altar/forest/kelkWall",
"particle": "botania:blocks/biomeStone0"
}},
"plains": { "textures": {
"all": "botania:model/altarMeta1",
"gobletbaseside": "botania:model/altar/plains/gobletBase_sides",
"gobletbasetop": "botania:model/altar/plains/gobletBase_top",
"gobletbasebottom": "botania:model/altar/plains/gobletBase_bottom",
"gobletbase2side": "botania:model/altar/plains/gobletBase2_sides",
"gobletbase2top": "botania:model/altar/plains/gobletBase2_top",
"gobletbase2bottom": "botania:model/altar/plains/gobletBase2_bottom",
"gobletbase3side": "botania:model/altar/plains/gobletBase3_sides",
"gobletbase3top": "botania:model/altar/plains/gobletBase3_top",
"gobletbase3bottom": "botania:model/altar/plains/gobletBase3_bottom",
"gobletstandside": "botania:model/altar/plains/gobletStand_sides",
"gobletstandtopbottom": "botania:model/altar/plains/gobletStand_top_bottom",
"kelkbaseside": "botania:model/altar/plains/kelkBase_sides",
"kelkbasetopbottom": "botania:model/altar/plains/kelkBase_top_bottom",
"kelkbase2side": "botania:model/altar/plains/kelkBase2_sides",
"kelkbase2top": "botania:model/altar/plains/kelkBase2_top",
"kelkbase2bottom": "botania:model/altar/plains/kelkBase2_bottom",
"kelkwall": "botania:model/altar/plains/kelkWall",
"particle": "botania:blocks/biomeStone1"
}},
"mountain": { "textures": {
"all": "botania:model/altarMeta2",
"gobletbaseside": "botania:model/altar/mountain/gobletBase_sides",
"gobletbasetop": "botania:model/altar/mountain/gobletBase_top",
"gobletbasebottom": "botania:model/altar/mountain/gobletBase_bottom",
"gobletbase2side": "botania:model/altar/mountain/gobletBase2_sides",
"gobletbase2top": "botania:model/altar/mountain/gobletBase2_top",
"gobletbase2bottom": "botania:model/altar/mountain/gobletBase2_bottom",
"gobletbase3side": "botania:model/altar/mountain/gobletBase3_sides",
"gobletbase3top": "botania:model/altar/mountain/gobletBase3_top",
"gobletbase3bottom": "botania:model/altar/mountain/gobletBase3_bottom",
"gobletstandside": "botania:model/altar/mountain/gobletStand_sides",
"gobletstandtopbottom": "botania:model/altar/mountain/gobletStand_top_bottom",
"kelkbaseside": "botania:model/altar/mountain/kelkBase_sides",
"kelkbasetopbottom": "botania:model/altar/mountain/kelkBase_top_bottom",
"kelkbase2side": "botania:model/altar/mountain/kelkBase2_sides",
"kelkbase2top": "botania:model/altar/mountain/kelkBase2_top",
"kelkbase2bottom": "botania:model/altar/mountain/kelkBase2_bottom",
"kelkwall": "botania:model/altar/mountain/kelkWall",
"particle": "botania:blocks/biomeStone2"
}},
"fungal": { "textures": {
"all": "botania:model/altarMeta3",
"gobletbaseside": "botania:model/altar/fungal/gobletBase_sides",
"gobletbasetop": "botania:model/altar/fungal/gobletBase_top",
"gobletbasebottom": "botania:model/altar/fungal/gobletBase_bottom",
"gobletbase2side": "botania:model/altar/fungal/gobletBase2_sides",
"gobletbase2top": "botania:model/altar/fungal/gobletBase2_top",
"gobletbase2bottom": "botania:model/altar/fungal/gobletBase2_bottom",
"gobletbase3side": "botania:model/altar/fungal/gobletBase3_sides",
"gobletbase3top": "botania:model/altar/fungal/gobletBase3_top",
"gobletbase3bottom": "botania:model/altar/fungal/gobletBase3_bottom",
"gobletstandside": "botania:model/altar/fungal/gobletStand_sides",
"gobletstandtopbottom": "botania:model/altar/fungal/gobletStand_top_bottom",
"kelkbaseside": "botania:model/altar/fungal/kelkBase_sides",
"kelkbasetopbottom": "botania:model/altar/fungal/kelkBase_top_bottom",
"kelkbase2side": "botania:model/altar/fungal/kelkBase2_sides",
"kelkbase2top": "botania:model/altar/fungal/kelkBase2_top",
"kelkbase2bottom": "botania:model/altar/fungal/kelkBase2_bottom",
"kelkwall": "botania:model/altar/fungal/kelkWall",
"particle": "botania:blocks/biomeStone3"
}},
"swamp": { "textures": {
"all": "botania:model/altarMeta4",
"gobletbaseside": "botania:model/altar/swamp/gobletBase_sides",
"gobletbasetop": "botania:model/altar/swamp/gobletBase_top",
"gobletbasebottom": "botania:model/altar/swamp/gobletBase_bottom",
"gobletbase2side": "botania:model/altar/swamp/gobletBase2_sides",
"gobletbase2top": "botania:model/altar/swamp/gobletBase2_top",
"gobletbase2bottom": "botania:model/altar/swamp/gobletBase2_bottom",
"gobletbase3side": "botania:model/altar/swamp/gobletBase3_sides",
"gobletbase3top": "botania:model/altar/swamp/gobletBase3_top",
"gobletbase3bottom": "botania:model/altar/swamp/gobletBase3_bottom",
"gobletstandside": "botania:model/altar/swamp/gobletStand_sides",
"gobletstandtopbottom": "botania:model/altar/swamp/gobletStand_top_bottom",
"kelkbaseside": "botania:model/altar/swamp/kelkBase_sides",
"kelkbasetopbottom": "botania:model/altar/swamp/kelkBase_top_bottom",
"kelkbase2side": "botania:model/altar/swamp/kelkBase2_sides",
"kelkbase2top": "botania:model/altar/swamp/kelkBase2_top",
"kelkbase2bottom": "botania:model/altar/swamp/kelkBase2_bottom",
"kelkwall": "botania:model/altar/swamp/kelkWall",
"particle": "botania:blocks/biomeStone4"
}},
"desert": { "textures": {
"all": "botania:model/altarMeta5",
"gobletbaseside": "botania:model/altar/desert/gobletBase_sides",
"gobletbasetop": "botania:model/altar/desert/gobletBase_top",
"gobletbasebottom": "botania:model/altar/desert/gobletBase_bottom",
"gobletbase2side": "botania:model/altar/desert/gobletBase2_sides",
"gobletbase2top": "botania:model/altar/desert/gobletBase2_top",
"gobletbase2bottom": "botania:model/altar/desert/gobletBase2_bottom",
"gobletbase3side": "botania:model/altar/desert/gobletBase3_sides",
"gobletbase3top": "botania:model/altar/desert/gobletBase3_top",
"gobletbase3bottom": "botania:model/altar/desert/gobletBase3_bottom",
"gobletstandside": "botania:model/altar/desert/gobletStand_sides",
"gobletstandtopbottom": "botania:model/altar/desert/gobletStand_top_bottom",
"kelkbaseside": "botania:model/altar/desert/kelkBase_sides",
"kelkbasetopbottom": "botania:model/altar/desert/kelkBase_top_bottom",
"kelkbase2side": "botania:model/altar/desert/kelkBase2_sides",
"kelkbase2top": "botania:model/altar/desert/kelkBase2_top",
"kelkbase2bottom": "botania:model/altar/desert/kelkBase2_bottom",
"kelkwall": "botania:model/altar/desert/kelkWall",
"particle": "botania:blocks/biomeStone5"
}},
"taiga": { "textures": {
"all": "botania:model/altarMeta6",
"gobletbaseside": "botania:model/altar/taiga/gobletBase_sides",
"gobletbasetop": "botania:model/altar/taiga/gobletBase_top",
"gobletbasebottom": "botania:model/altar/taiga/gobletBase_bottom",
"gobletbase2side": "botania:model/altar/taiga/gobletBase2_sides",
"gobletbase2top": "botania:model/altar/taiga/gobletBase2_top",
"gobletbase2bottom": "botania:model/altar/taiga/gobletBase2_bottom",
"gobletbase3side": "botania:model/altar/taiga/gobletBase3_sides",
"gobletbase3top": "botania:model/altar/taiga/gobletBase3_top",
"gobletbase3bottom": "botania:model/altar/taiga/gobletBase3_bottom",
"gobletstandside": "botania:model/altar/taiga/gobletStand_sides",
"gobletstandtopbottom": "botania:model/altar/taiga/gobletStand_top_bottom",
"kelkbaseside": "botania:model/altar/taiga/kelkBase_sides",
"kelkbasetopbottom": "botania:model/altar/taiga/kelkBase_top_bottom",
"kelkbase2side": "botania:model/altar/taiga/kelkBase2_sides",
"kelkbase2top": "botania:model/altar/taiga/kelkBase2_top",
"kelkbase2bottom": "botania:model/altar/taiga/kelkBase2_bottom",
"kelkwall": "botania:model/altar/taiga/kelkWall",
"particle": "botania:blocks/biomeStone6"
}},
"mesa": { "textures": {
"all": "botania:model/altarMeta7",
"gobletbaseside": "botania:model/altar/mesa/gobletBase_sides",
"gobletbasetop": "botania:model/altar/mesa/gobletBase_top",
"gobletbasebottom": "botania:model/altar/mesa/gobletBase_bottom",
"gobletbase2side": "botania:model/altar/mesa/gobletBase2_sides",
"gobletbase2top": "botania:model/altar/mesa/gobletBase2_top",
"gobletbase2bottom": "botania:model/altar/mesa/gobletBase2_bottom",
"gobletbase3side": "botania:model/altar/mesa/gobletBase3_sides",
"gobletbase3top": "botania:model/altar/mesa/gobletBase3_top",
"gobletbase3bottom": "botania:model/altar/mesa/gobletBase3_bottom",
"gobletstandside": "botania:model/altar/mesa/gobletStand_sides",
"gobletstandtopbottom": "botania:model/altar/mesa/gobletStand_top_bottom",
"kelkbaseside": "botania:model/altar/mesa/kelkBase_sides",
"kelkbasetopbottom": "botania:model/altar/mesa/kelkBase_top_bottom",
"kelkbase2side": "botania:model/altar/mesa/kelkBase2_sides",
"kelkbase2top": "botania:model/altar/mesa/kelkBase2_top",
"kelkbase2bottom": "botania:model/altar/mesa/kelkBase2_bottom",
"kelkwall": "botania:model/altar/mesa/kelkWall",
"particle": "botania:blocks/biomeStone7"
}},
"mossy": { "textures": {
"all": "botania:model/altarMossy",
"gobletbaseside": "botania:model/altar/mossy/gobletBase_sides",
"gobletbasetop": "botania:model/altar/mossy/gobletBase_top",
"gobletbasebottom": "botania:model/altar/mossy/gobletBase_bottom",
"gobletbase2side": "botania:model/altar/mossy/gobletBase2_sides",
"gobletbase2top": "botania:model/altar/mossy/gobletBase2_top",
"gobletbase2bottom": "botania:model/altar/mossy/gobletBase2_bottom",
"gobletbase3side": "botania:model/altar/mossy/gobletBase3_sides",
"gobletbase3top": "botania:model/altar/mossy/gobletBase3_top",
"gobletbase3bottom": "botania:model/altar/mossy/gobletBase3_bottom",
"gobletstandside": "botania:model/altar/mossy/gobletStand_sides",
"gobletstandtopbottom": "botania:model/altar/mossy/gobletStand_top_bottom",
"kelkbaseside": "botania:model/altar/mossy/kelkBase_sides",
"kelkbasetopbottom": "botania:model/altar/mossy/kelkBase_top_bottom",
"kelkbase2side": "botania:model/altar/mossy/kelkBase2_sides",
"kelkbase2top": "botania:model/altar/mossy/kelkBase2_top",
"kelkbase2bottom": "botania:model/altar/mossy/kelkBase2_bottom",
"kelkwall": "botania:model/altar/mossy/kelkWall",
"particle": "minecraft:blocks/cobblestone"
}}
}
@@ -0,0 +1,12 @@
{
"forge_marker": 1,
"defaults": {
"model": "botania:dummy",
"textures": {
"particle": "botania:blocks/livingwood0"
}
},
"variants": {
"normal": [{}]
}
}
@@ -0,0 +1,12 @@
{
"forge_marker": 1,
"defaults": {
"model": "botania:dummy",
"textures": {
"particle": "botania:blocks/livingwood0"
}
},
"variants": {
"normal": [{}]
}
}
@@ -0,0 +1,12 @@
{
"forge_marker": 1,
"defaults": {
"model": "botania:dummy",
"textures": {
"particle": "botania:blocks/livingrock0"
}
},
"variants": {
"normal": [{}]
}
}
@@ -0,0 +1,19 @@
{
"forge_marker": 1,
"defaults": {
"model": "botania:cocoon",
"textures": {
"bottom": "botania:model/cocoon_bottom",
"top": "botania:model/cocoon_top",
"north": "botania:model/cocoon_north",
"south": "botania:model/cocoon_south",
"west": "botania:model/cocoon_west",
"east": "botania:model/cocoon_east"
},
"transform": "forge:default-block"
},
"variants": {
"normal": [{}],
"inventory": [{}]
}
}
@@ -0,0 +1,12 @@
{
"forge_marker": 1,
"defaults": {
"model": "botania:dummy",
"textures": {
"particle": "botania:blocks/storage2"
}
},
"variants": {
"normal": [{}]
}
}
@@ -0,0 +1,12 @@
{
"forge_marker": 1,
"defaults": {
"model": "botania:dummy",
"textures": {
"particle": "botania:blocks/storage2"
}
},
"variants": {
"normal": [{}]
}
}
@@ -0,0 +1,12 @@
{
"forge_marker": 1,
"defaults": {
"model": "botania:dummy",
"textures": {
"particle": "minecraft:items/barrier"
}
},
"variants": {
"normal": [{}]
}
}
@@ -0,0 +1,12 @@
{
"forge_marker": 1,
"defaults": {
"model": "botania:dummy",
"textures": {
"particle": "minecraft:blocks/soul_sand"
}
},
"variants": {
"normal": [{}]
}
}
@@ -0,0 +1,12 @@
{
"forge_marker": 1,
"defaults": {
"model": "botania:dummy",
"textures": {
"particle": "botania:blocks/manaGlass"
}
},
"variants": {
"normal": [{}]
}
}
@@ -0,0 +1,12 @@
{
"forge_marker": 1,
"defaults": {
"model": "botania:dummy",
"textures": {
"particle": "botania:blocks/livingrock0"
}
},
"variants": {
"normal": [{}]
}
}
@@ -0,0 +1,12 @@
{
"forge_marker": 1,
"defaults": {
"model": "botania:dummy",
"textures": {
"particle": "minecraft:blocks/wool_colored_white"
}
},
"variants": {
"normal": [{}]
}
}
@@ -6,6 +6,10 @@ generator.botania-skyblock.info=Not recommended for botania newcomers
# Something that is not localized, translators, do NOT change this line.
botaniamisc.noloc=botaniamisc.noloc
# todo 1.8 remove when merging into master
botaniamisc.unofficial.nag=WARNING !!!!! This port of Botania is UNOFFICIAL! Do NOT report bugs to Vazkii!!!
botaniamisc.unofficial.report=Report issues to the porter HERE:
botaniamisc.nextPage=Next Page
botaniamisc.prevPage=Previous Page
botaniamisc.back=Back
+109 -14
View File
@@ -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.<br>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.<br>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.<br>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.<br>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.<br>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'.<br>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.<br>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.<br>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.<br>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.<br>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.<br>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.<br>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.<br>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.<br>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.<br>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
@@ -6,12 +6,12 @@
"from": [ 0.0, 0.0, 0.0 ],
"to": [ 16.0, 2.0, 16.0 ],
"faces": {
"west": { "texture": "#all", "uv": [ 0.0, 2.0, 2.0, 2.25 ] },
"south": { "texture": "#all", "uv": [ 2.0, 2.0, 4.0, 2.25 ] },
"east": { "texture": "#all", "uv": [ 4.0, 2.0, 6.0, 2.25 ] },
"north": { "texture": "#all", "uv": [ 6.0, 2.0, 8.0, 2.25 ] },
"up": { "texture": "#all", "uv": [ 2.0, 0, 4.0, 2.0 ] },
"down": { "texture": "#all", "uv": [ 4.0, 0, 6.0, 2.0 ], "cullface": "down" }
"west": { "texture": "#gobletbaseside", "uv": [ 0.0, 0.0, 16.0, 2.0 ] },
"south": { "texture": "#gobletbaseside", "uv": [ 0.0, 3.0, 16.0, 5.0 ] },
"east": { "texture": "#gobletbaseside", "uv": [ 0.0, 6.0, 16.0, 8.0 ] },
"north": { "texture": "#gobletbaseside", "uv": [ 0.0, 9.0, 16.0, 11.0 ] },
"up": { "texture": "#gobletbasetop", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
"down": { "texture": "#gobletbasebottom", "uv": [ 0.0, 0.0, 16.0, 16.0 ], "cullface": "down" }
}
},
{
@@ -19,11 +19,11 @@
"from": [ 1.0, 2.0, 1.0 ],
"to": [ 15.0, 3.0, 15.0 ],
"faces": {
"west": { "texture": "#all", "uv": [ 0.0, 4.0, 1.75, 4.125 ] },
"south": { "texture": "#all", "uv": [ 1.75, 4.0, 3.5, 4.125 ] },
"east": { "texture": "#all", "uv": [ 3.5, 4.0, 5.25, 4.125 ] },
"north": { "texture": "#all", "uv": [ 5.25, 4.0, 7.0, 4.125 ] },
"up": { "texture": "#all", "uv": [ 1.75, 2.25, 3.5, 4.0 ] }
"west": { "texture": "#gobletbase2side", "uv": [ 1.0, 0.0, 15.0, 1.0 ] },
"south": { "texture": "#gobletbase2side", "uv": [ 1.0, 2.0, 15.0, 3.0 ] },
"east": { "texture": "#gobletbase2side", "uv": [ 1.0, 4.0, 15.0, 5.0 ] },
"north": { "texture": "#gobletbase2side", "uv": [ 1.0, 6.0, 15.0, 7.0 ] },
"up": { "texture": "#gobletbase2top", "uv": [ 1.0, 1.0, 15.0, 15.0 ] }
}
},
{
@@ -31,11 +31,11 @@
"from": [ 2.0, 3.0, 2.0 ],
"to": [ 14.0, 4.0, 14.0 ],
"faces": {
"west": { "texture": "#all", "uv": [ 0.0, 5.625, 1.5, 5.75 ] },
"south": { "texture": "#all", "uv": [ 1.5, 5.625, 3.0, 5.75 ] },
"east": { "texture": "#all", "uv": [ 3.0, 5.625, 4.5, 5.75 ] },
"north": { "texture": "#all", "uv": [ 4.5, 5.625, 6.0, 5.75 ] },
"up": { "texture": "#all", "uv": [ 1.5, 4.125, 3.0, 5.625 ] }
"west": { "texture": "#gobletbase3side", "uv": [ 2.0, 0.0, 14.0, 1.0 ] },
"south": { "texture": "#gobletbase3side", "uv": [ 2.0, 2.0, 14.0, 3.0 ] },
"east": { "texture": "#gobletbase3side", "uv": [ 2.0, 4.0, 14.0, 5.0 ] },
"north": { "texture": "#gobletbase3side", "uv": [ 2.0, 6.0, 14.0, 7.0 ] },
"up": { "texture": "#gobletbase3top", "uv": [ 2.0, 2.0, 14.0, 14.0 ] }
}
},
{
@@ -43,10 +43,10 @@
"from": [ 5.0, 4.0, 5.0 ],
"to": [ 11.0, 12.0, 11.0 ],
"faces": {
"west": { "texture": "#all", "uv": [ 8.5, 0.75, 9.25, 1.75 ] },
"south": { "texture": "#all", "uv": [ 9.25, 0.75, 10.0, 1.75 ] },
"east": { "texture": "#all", "uv": [ 10.0, 0.75, 10.75, 1.75 ] },
"north": { "texture": "#all", "uv": [ 10.75, 0.75, 11.5, 1.75 ] }
"west": { "texture": "#gobletstandside", "uv": [ 2.0, 0.0, 14.0, 9.0 ] },
"south": { "texture": "#gobletstandside", "uv": [ 2.0, 0.0, 14.0, 9.0 ] },
"east": { "texture": "#gobletstandside", "uv": [ 2.0, 9.0, 14.0, 16.0 ] },
"north": { "texture": "#gobletstandside", "uv": [ 2.0, 9.0, 14.0, 16.0 ] }
}
},
{
@@ -54,11 +54,11 @@
"from": [ 4.0, 12.0, 4.0 ],
"to": [ 12.0, 13.0, 12.0 ],
"faces": {
"west": { "texture": "#all", "uv": [ 9.0, 6.625, 10.0, 6.75 ] },
"south": { "texture": "#all", "uv": [ 10.0, 6.625, 11.0, 6.75 ] },
"east": { "texture": "#all", "uv": [ 11.0, 6.625, 12.0, 6.75 ] },
"north": { "texture": "#all", "uv": [ 12.0, 6.625, 13.0, 6.75 ] },
"down": { "texture": "#all", "uv": [ 11.0, 5.625, 12.0, 6.625 ] }
"west": { "texture": "#kelkbaseside", "uv": [ 4.0, 0.0, 12.0, 1.0 ] },
"south": { "texture": "#kelkbaseside", "uv": [ 4.0, 2.0, 12.0, 3.0 ] },
"east": { "texture": "#kelkbaseside", "uv": [ 4.0, 4.0, 12.0, 5.0 ] },
"north": { "texture": "#kelkbaseside", "uv": [ 4.0, 6.0, 12.0, 7.0 ] },
"down": { "texture": "#kelkbasetopbottom", "uv": [ 9.0, 4.0, 16.0, 12.0 ] }
}
},
{
@@ -66,12 +66,12 @@
"from": [ 3.0, 13.0, 3.0 ],
"to": [ 13.0, 14.0, 13.0 ],
"faces": {
"west": { "texture": "#all", "uv": [ 9.0, 5.5, 10.25, 5.625 ] },
"south": { "texture": "#all", "uv": [ 10.25, 5.5, 11.5, 5.625 ] },
"east": { "texture": "#all", "uv": [ 11.5, 5.5, 12.75, 5.625 ] },
"north": { "texture": "#all", "uv": [ 12.75, 5.5, 14.0, 5.625 ] },
"up": { "texture": "#all", "uv": [ 10.25, 4.25, 11.5, 5.5 ] },
"down": { "texture": "#all", "uv": [ 11.5, 4.25, 12.75, 5.5 ] }
"west": { "texture": "#kelkbase2side", "uv": [ 3.0, 0.0, 13.0, 1.0 ] },
"south": { "texture": "#kelkbase2side", "uv": [ 3.0, 2.0, 13.0, 3.0 ] },
"east": { "texture": "#kelkbase2side", "uv": [ 3.0, 4.0, 13.0, 5.0 ] },
"north": { "texture": "#kelkbase2side", "uv": [ 3.0, 6.0, 13.0, 7.0 ] },
"up": { "texture": "#kelkbase2top", "uv": [ 3.0, 3.0, 13.0, 13.0 ] },
"down": { "texture": "#kelkbase2bottom", "uv": [ 3.0, 3.0, 13.0, 13.0 ] }
}
},
{
@@ -79,12 +79,12 @@
"from": [ 3.0, 14.0, 2.0 ],
"to": [ 13.0, 20.0, 3.0 ],
"faces": {
"west": { "texture": "#all", "uv": [ 11.75, 2.375, 11.875, 3.125 ] },
"north": { "texture": "#all", "uv": [ 11.875, 2.375, 13.125, 3.125 ] },
"south": { "texture": "#all", "uv": [ 13.125, 2.375, 14.375, 3.125 ] },
"east": { "texture": "#all", "uv": [ 14.375, 2.375, 14.5, 3.125 ] },
"up": { "texture": "#all", "uv": [ 11.875, 2.25, 13.125, 2.375 ] },
"down": { "texture": "#all", "uv": [ 13.125, 2.25, 14.375, 2.375 ] }
"west": { "texture": "#kelkwall", "uv": [ 0.0, 1.0, 1.0, 7.0 ] },
"north": { "texture": "#kelkwall", "uv": [ 1.0, 1.0, 11.0, 7.0 ] },
"south": { "texture": "#kelkwall", "uv": [ 1.0, 9.0, 11.0, 15.0 ] },
"east": { "texture": "#kelkwall", "uv": [ 11.0, 9.0, 12.0, 15.0 ] },
"up": { "texture": "#kelkwall", "uv": [ 1.0, 0.0, 11.0, 1.0 ] },
"down": { "texture": "#kelkwall", "uv": [ 1.0, 8.0, 11.0, 9.0 ] }
}
},
{
@@ -92,12 +92,12 @@
"from": [ 3.0, 14.0, 13.0 ],
"to": [ 13.0, 20.0, 14.0 ],
"faces": {
"west": { "texture": "#all", "uv": [ 11.75, 2.375, 11.875, 3.125] },
"north": { "texture": "#all", "uv": [ 11.875, 2.375, 13.125, 3.125 ] },
"south": { "texture": "#all", "uv": [ 13.125, 2.375, 14.375, 3.125 ] },
"east": { "texture": "#all", "uv": [ 14.375, 2.375, 14.5, 3.125 ] },
"up": { "texture": "#all", "uv": [ 11.875, 2.25, 13.125, 2.375 ] },
"down": { "texture": "#all", "uv": [ 13.125, 2.25, 14.375, 2.375 ] }
"west": { "texture": "#kelkwall", "uv": [ 0.0, 1.0, 1.0, 7.0 ] },
"north": { "texture": "#kelkwall", "uv": [ 1.0, 1.0, 11.0, 7.0 ] },
"south": { "texture": "#kelkwall", "uv": [ 1.0, 9.0, 11.0, 15.0 ] },
"east": { "texture": "#kelkwall", "uv": [ 11.0, 9.0, 12.0, 15.0 ] },
"up": { "texture": "#kelkwall", "uv": [ 1.0, 0.0, 11.0, 1.0 ] },
"down": { "texture": "#kelkwall", "uv": [ 1.0, 8.0, 11.0, 9.0 ] }
}
},
{
@@ -105,12 +105,12 @@
"from": [ 2.0, 14.0, 3.0 ],
"to": [ 3.0, 20.0, 13.0 ],
"faces": {
"west": { "texture": "#all", "uv": [ 9.0, 3.5, 10.25, 4.25 ] },
"south": { "texture": "#all", "uv": [ 10.25, 3.5, 10.375, 4.25 ] },
"north": { "texture": "#all", "uv": [ 10.375, 3.5, 10.5, 4.25 ] },
"east": { "texture": "#all", "uv": [ 10.5, 3.5, 11.75, 4.25 ] },
"up": { "texture": "#all", "uv": [ 10.25, 2.125, 10.375, 3.5 ] },
"down": { "texture": "#all", "uv": [ 10.375, 2.125, 10.5, 3.5 ] }
"north": { "texture": "#kelkwall", "uv": [ 0.0, 1.0, 1.0, 7.0 ] },
"west": { "texture": "#kelkwall", "uv": [ 1.0, 1.0, 11.0, 7.0 ] },
"east": { "texture": "#kelkwall", "uv": [ 1.0, 9.0, 11.0, 15.0 ] },
"south": { "texture": "#kelkwall", "uv": [ 11.0, 9.0, 12.0, 15.0 ] },
"up": { "texture": "#kelkwall", "uv": [ 13.0, 0.0, 14.0, 11.0 ] },
"down": { "texture": "#kelkwall", "uv": [ 14.0, 0.0, 15.0, 11.0 ] }
}
},
{
@@ -118,12 +118,12 @@
"from": [ 13.0, 14.0, 3.0 ],
"to": [ 14.0, 20.0, 13.0 ],
"faces": {
"west": { "texture": "#all", "uv": [ 9.0, 3.5, 10.25, 4.25 ] },
"south": { "texture": "#all", "uv": [ 10.25, 3.5, 10.375, 4.25 ] },
"north": { "texture": "#all", "uv": [ 10.375, 3.5, 10.5, 4.25 ] },
"east": { "texture": "#all", "uv": [ 10.5, 3.5, 11.75, 4.25 ] },
"up": { "texture": "#all", "uv": [ 10.25, 2.125, 10.375, 3.5 ] },
"down": { "texture": "#all", "uv": [ 10.375, 2.125, 10.5, 3.5 ] }
"north": { "texture": "#kelkwall", "uv": [ 0.0, 1.0, 1.0, 7.0 ] },
"west": { "texture": "#kelkwall", "uv": [ 1.0, 1.0, 11.0, 7.0 ] },
"east": { "texture": "#kelkwall", "uv": [ 1.0, 9.0, 11.0, 15.0 ] },
"south": { "texture": "#kelkwall", "uv": [ 11.0, 9.0, 12.0, 15.0 ] },
"up": { "texture": "#kelkwall", "uv": [ 13.0, 0.0, 14.0, 11.0 ] },
"down": { "texture": "#kelkwall", "uv": [ 14.0, 0.0, 15.0, 11.0 ] }
}
}
]
@@ -0,0 +1,20 @@
{
"textures": {
"particle": "#west"
},
"elements": [
{
"name": "Cube",
"from": [ 3.0, 0.0, 3.0 ],
"to": [ 13.0, 14.0, 13.0 ],
"faces": {
"west": { "texture": "#west", "uv": [ 3.0, 1.0, 13.0, 15.0 ] },
"north": { "texture": "#north", "uv": [ 3.0, 1.0, 13.0, 15.0 ] },
"south": { "texture": "#south", "uv": [ 3.0, 1.0, 13.0, 15.0 ] },
"east": { "texture": "#east", "uv": [ 3.0, 1.0, 13.0, 15.0 ] },
"up": { "texture": "#top", "uv": [ 3.0, 3.0, 13.0, 13.0 ] },
"down": { "texture": "#bottom", "uv": [ 3.0, 3.0, 13.0, 13.0 ], "cullface": "down" }
}
}
]
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 B

Loaded 100 of 129 files, more files were not shown because too many files have changed in this diff. Show more