mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 10:55:17 +00:00
Merge master
This commit is contained in:
commit
eaaa55fdb0
254 files changed
+8593
-1893
No files matched your search
@@ -217,33 +217,19 @@ public final class BotaniaAPI {
|
||||
addOreWeightNether("oreOnyx", 500); // SimpleOres 2
|
||||
addOreWeightNether("oreHaditeCoal", 500); // Hadite
|
||||
|
||||
registerModWiki("Minecraft", new SimpleWikiProvider("Minecraft Wiki", "http://minecraft.gamepedia.com/%s"));
|
||||
registerModWiki("minecraft", new SimpleWikiProvider("Minecraft Wiki", "https://minecraft.gamepedia.com/%s"));
|
||||
|
||||
IWikiProvider technicWiki = new SimpleWikiProvider("Technic Wiki", "http://wiki.technicpack.net/%s");
|
||||
IWikiProvider mekanismWiki = new SimpleWikiProvider("Mekanism Wiki", "http://wiki.aidancbrady.com/wiki/%s");
|
||||
IWikiProvider buildcraftWiki = new SimpleWikiProvider("BuildCraft Wiki", "http://www.mod-buildcraft.com/wiki/doku.php?id=%s");
|
||||
|
||||
registerModWiki("Mekanism", mekanismWiki);
|
||||
registerModWiki("MekanismGenerators", mekanismWiki);
|
||||
registerModWiki("MekanismTools", mekanismWiki);
|
||||
registerModWiki("EnderIO", new SimpleWikiProvider("EnderIO Wiki", "http://wiki.enderio.com/%s"));
|
||||
registerModWiki("TropiCraft", new SimpleWikiProvider("Tropicraft Wiki", "http://wiki.tropicraft.net/wiki/%s"));
|
||||
registerModWiki("RandomThings", new SimpleWikiProvider("Random Things Wiki", "http://randomthingsminecraftmod.wikispaces.com/%s"));
|
||||
registerModWiki("Witchery", new SimpleWikiProvider("Witchery Wiki", "https://sites.google.com/site/witcherymod/%s", "-", true));
|
||||
registerModWiki("AppliedEnergistics2", new SimpleWikiProvider("AE2 Wiki", "http://ae-mod.info/%s"));
|
||||
registerModWiki("BigReactors", technicWiki);
|
||||
registerModWiki("BuildCraft|Core", buildcraftWiki);
|
||||
registerModWiki("BuildCraft|Builders", buildcraftWiki);
|
||||
registerModWiki("BuildCraft|Energy", buildcraftWiki);
|
||||
registerModWiki("BuildCraft|Factory", buildcraftWiki);
|
||||
registerModWiki("BuildCraft|Silicon", buildcraftWiki);
|
||||
registerModWiki("BuildCraft|Transport", buildcraftWiki);
|
||||
registerModWiki("ArsMagica2", new SimpleWikiProvider("ArsMagica2 Wiki", "http://wiki.arsmagicamod.com/wiki/%s"));
|
||||
registerModWiki("PneumaticCraft", new SimpleWikiProvider("PneumaticCraft Wiki", "http://www.minemaarten.com/wikis/pneumaticcraft-wiki/pneumaticcraft-wiki-%s"));
|
||||
registerModWiki("StevesCarts2", new SimpleWikiProvider("Steve's Carts Wiki", "http://stevescarts2.wikispaces.com/%s"));
|
||||
registerModWiki("GanysSurface", new SimpleWikiProvider("Gany's Surface Wiki", "http://ganys-surface.wikia.com/wiki/%s"));
|
||||
registerModWiki("GanysNether", new SimpleWikiProvider("Gany's Nether Wiki", "http://ganys-nether.wikia.com/wiki/%s"));
|
||||
registerModWiki("GanysEnd", new SimpleWikiProvider("Gany's End Wiki", "http://ganys-end.wikia.com/wiki/%s"));
|
||||
registerModWiki("mekanism", mekanismWiki);
|
||||
registerModWiki("mekanismgenerators", mekanismWiki);
|
||||
registerModWiki("mekanismtools", mekanismWiki);
|
||||
registerModWiki("enderio", new SimpleWikiProvider("EnderIO Wiki", "http://wiki.enderio.com/%s"));
|
||||
registerModWiki("tropicraft", new SimpleWikiProvider("Tropicraft Wiki", "http://wiki.tropicraft.net/wiki/%s"));
|
||||
registerModWiki("randomthings", new SimpleWikiProvider("Random Things Wiki", "https://lumien.net/rtwiki/blocks/%s/", "-", true));
|
||||
registerModWiki("appliedenergistics2", new SimpleWikiProvider("AE2 Wiki", "http://ae-mod.info/%s"));
|
||||
registerModWiki("bigreactors", technicWiki);
|
||||
|
||||
registerPaintableBlock(Blocks.STAINED_GLASS, BlockStainedGlass.COLOR);
|
||||
registerPaintableBlock(Blocks.STAINED_GLASS_PANE, BlockStainedGlassPane.COLOR);
|
||||
@@ -673,11 +659,11 @@ public final class BotaniaAPI {
|
||||
if(stack.isEmpty())
|
||||
return "";
|
||||
|
||||
return "i_" + stack.getItem().getUnlocalizedName() + "@" + stack.getItemDamage();
|
||||
return "i_" + stack.getItem().getTranslationKey() + "@" + stack.getItemDamage();
|
||||
}
|
||||
|
||||
private static String getMagnetKey(Block block, int meta) {
|
||||
return "bm_" + block.getUnlocalizedName() + "@" + meta;
|
||||
return "bm_" + block.getTranslationKey() + "@" + meta;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -57,7 +57,7 @@ public final class BotaniaAPIClient {
|
||||
* @param model A path to a blockstate json and variant to be used the block. The item model will be drawn from the same blockstate json, from variant "inventory"
|
||||
*/
|
||||
public static void registerSubtileModel(ResourceLocation subTileName, ModelResourceLocation model) {
|
||||
registerSubtileModel(subTileName, model, new ModelResourceLocation(model.getResourceDomain() + ":" + model.getResourcePath(), "inventory"));
|
||||
registerSubtileModel(subTileName, model, new ModelResourceLocation(model.getNamespace() + ":" + model.getPath(), "inventory"));
|
||||
}
|
||||
|
||||
// Convenience overloads for the above two calls
|
||||
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
@@ -297,4 +298,13 @@ public final class CorporeaHelper {
|
||||
public static String stripControlCodes(String str) {
|
||||
return patternControlCode.matcher(str).replaceAll("");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the comparator strength for a corporea request that corporea crystal cubes and retainers use, following the usual "each step up requires double the items" formula.
|
||||
*/
|
||||
public static int signalStrengthForRequestSize(int requestSize) {
|
||||
if(requestSize <= 0) return 0;
|
||||
else if (requestSize >= 16384) return 15;
|
||||
else return Math.min(15, MathHelper.log2(requestSize) + 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* This class was created by <quaternary>. 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.corporea;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
||||
/**
|
||||
* CorporeaIndexRequestEvent is fired when a player attempts to request an item from a corporea index.
|
||||
* If the event is cancelled, the request will not be performed.
|
||||
* */
|
||||
@Cancelable
|
||||
public class CorporeaIndexRequestEvent extends Event {
|
||||
public final EntityPlayerMP requester;
|
||||
public String request;
|
||||
public int requestCount;
|
||||
public ICorporeaSpark indexSpark;
|
||||
|
||||
public CorporeaIndexRequestEvent(EntityPlayerMP requester, String request, int requestCount, ICorporeaSpark indexSpark) {
|
||||
this.requester = requester;
|
||||
this.request = request;
|
||||
this.requestCount = requestCount;
|
||||
this.indexSpark = indexSpark;
|
||||
}
|
||||
}
|
||||
@@ -65,7 +65,7 @@ public final class LexiconRecipeMappings {
|
||||
if(stack.hasTagCompound() && stack.getItem() instanceof IRecipeKeyProvider)
|
||||
return ((IRecipeKeyProvider) stack.getItem()).getKey(stack);
|
||||
|
||||
return stack.getUnlocalizedName() + (forceIgnore || ignoreMeta(stack) ? "" : "~" + stack.getItemDamage());
|
||||
return stack.getTranslationKey() + (forceIgnore || ignoreMeta(stack) ? "" : "~" + stack.getItemDamage());
|
||||
}
|
||||
|
||||
public static boolean ignoreMeta(ItemStack stack) {
|
||||
|
||||
@@ -299,7 +299,7 @@ public final class ManaItemHandler {
|
||||
* @return The amount of mana received from the request.
|
||||
*/
|
||||
public static int requestManaForTool(ItemStack stack, EntityPlayer player, int manaToGet, boolean remove) {
|
||||
float multiplier = Math.max(0F, 1F - getFullDiscountForTools(player));
|
||||
float multiplier = Math.max(0F, 1F - getFullDiscountForTools(player, stack));
|
||||
int cost = (int) (manaToGet * multiplier);
|
||||
return (int) (requestMana(stack, player, cost, remove) / multiplier);
|
||||
}
|
||||
@@ -313,7 +313,7 @@ public final class ManaItemHandler {
|
||||
* @return If the request was succesful.
|
||||
*/
|
||||
public static boolean requestManaExactForTool(ItemStack stack, EntityPlayer player, int manaToGet, boolean remove) {
|
||||
float multiplier = Math.max(0F, 1F - getFullDiscountForTools(player));
|
||||
float multiplier = Math.max(0F, 1F - getFullDiscountForTools(player, stack));
|
||||
int cost = (int) (manaToGet * multiplier);
|
||||
return requestManaExact(stack, player, cost, remove);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@API(owner = "botania", apiVersion = "89", provides = "BotaniaAPI")
|
||||
@API(owner = "botania", apiVersion = "92", provides = "BotaniaAPI")
|
||||
package vazkii.botania.api;
|
||||
import net.minecraftforge.fml.common.API;
|
||||
|
||||
@@ -14,12 +14,17 @@ import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.api.item.IPetalApothecary;
|
||||
|
||||
/**
|
||||
* Have an Item implement this to allow it to be used in the Petal Apothecary.
|
||||
* An Item or Block that implements this interface can have a special particle color in the Petal Apothecary.
|
||||
* TODO (breaking change): Rename to something more like "ISpecialApothecary", since now all items can go in the Apothecary
|
||||
*/
|
||||
public interface IFlowerComponent {
|
||||
|
||||
public boolean canFit(ItemStack stack, IPetalApothecary apothecary);
|
||||
|
||||
//TODO remove 1.13, unused, all items can go in the Petal Apothecary
|
||||
@Deprecated
|
||||
public default boolean canFit(ItemStack stack, IPetalApothecary apothecary) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getParticleColor(ItemStack stack);
|
||||
|
||||
}
|
||||
@@ -55,14 +55,9 @@ public class RecipeBrew {
|
||||
for(int j = 0; j < inputsMissing.size(); j++) {
|
||||
Object input = inputsMissing.get(j);
|
||||
if(input instanceof String) {
|
||||
List<ItemStack> validStacks = OreDictionary.getOres((String) input);
|
||||
boolean found = false;
|
||||
for(ItemStack ostack : validStacks) {
|
||||
ItemStack cstack = ostack.copy();
|
||||
if(cstack.getItemDamage() == Short.MAX_VALUE)
|
||||
cstack.setItemDamage(stack.getItemDamage());
|
||||
|
||||
if(stack.isItemEqual(cstack)) {
|
||||
for(ItemStack ostack : OreDictionary.getOres((String) input, false)) {
|
||||
if(OreDictionary.itemMatches(ostack, stack, false)) {
|
||||
oredictIndex = j;
|
||||
found = true;
|
||||
break;
|
||||
|
||||
@@ -44,11 +44,7 @@ public class RecipeElvenTrade {
|
||||
List<ItemStack> validStacks = OreDictionary.getOres((String) input);
|
||||
boolean found = false;
|
||||
for(ItemStack ostack : validStacks) {
|
||||
ItemStack cstack = ostack.copy();
|
||||
if(cstack.getItemDamage() == Short.MAX_VALUE)
|
||||
cstack.setItemDamage(stack.getItemDamage());
|
||||
|
||||
if(stack.isItemEqual(cstack)) {
|
||||
if(OreDictionary.itemMatches(ostack, stack, false)) {
|
||||
if(!stacksToRemove.contains(stack))
|
||||
stacksToRemove.add(stack);
|
||||
oredictIndex = j;
|
||||
|
||||
@@ -35,22 +35,12 @@ public class RecipeManaInfusion {
|
||||
|
||||
public boolean matches(ItemStack stack) {
|
||||
if(input instanceof ItemStack) {
|
||||
ItemStack inputCopy = ((ItemStack) input).copy();
|
||||
if(inputCopy.getItemDamage() == Short.MAX_VALUE)
|
||||
inputCopy.setItemDamage(stack.getItemDamage());
|
||||
|
||||
return stack.isItemEqual(inputCopy);
|
||||
return OreDictionary.itemMatches((ItemStack) input, stack, false);
|
||||
}
|
||||
|
||||
if(input instanceof String) {
|
||||
List<ItemStack> validStacks = OreDictionary.getOres((String) input);
|
||||
|
||||
for(ItemStack ostack : validStacks) {
|
||||
ItemStack cstack = ostack.copy();
|
||||
if(cstack.getItemDamage() == Short.MAX_VALUE)
|
||||
cstack.setItemDamage(stack.getItemDamage());
|
||||
|
||||
if(stack.isItemEqual(cstack))
|
||||
for(ItemStack ostack : OreDictionary.getOres((String) input, false)) {
|
||||
if(OreDictionary.itemMatches(ostack, stack, false))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ package vazkii.botania.api.recipe;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
@@ -49,14 +50,9 @@ public class RecipePetals {
|
||||
for(int j = 0; j < inputsMissing.size(); j++) {
|
||||
Object input = inputsMissing.get(j);
|
||||
if(input instanceof String) {
|
||||
List<ItemStack> validStacks = OreDictionary.getOres((String) input);
|
||||
boolean found = false;
|
||||
for(ItemStack ostack : validStacks) {
|
||||
ItemStack cstack = ostack.copy();
|
||||
if(cstack.getItemDamage() == Short.MAX_VALUE)
|
||||
cstack.setItemDamage(stack.getItemDamage());
|
||||
|
||||
if(stack.isItemEqual(cstack)) {
|
||||
for(ItemStack ostack : OreDictionary.getOres((String) input, false)) {
|
||||
if(OreDictionary.itemMatches(ostack, stack, false)) {
|
||||
oredictIndex = j;
|
||||
found = true;
|
||||
break;
|
||||
@@ -66,7 +62,7 @@ public class RecipePetals {
|
||||
|
||||
if(found)
|
||||
break;
|
||||
} else if(input instanceof ItemStack && simpleAreStacksEqual((ItemStack) input, stack)) {
|
||||
} else if(input instanceof ItemStack && compareStacks((ItemStack) input, stack)) {
|
||||
stackIndex = j;
|
||||
break;
|
||||
}
|
||||
@@ -82,8 +78,20 @@ public class RecipePetals {
|
||||
return inputsMissing.isEmpty();
|
||||
}
|
||||
|
||||
private boolean simpleAreStacksEqual(ItemStack stack, ItemStack stack2) {
|
||||
return stack.getItem() == stack2.getItem() && stack.getItemDamage() == stack2.getItemDamage();
|
||||
private boolean compareStacks(ItemStack recipe, ItemStack supplied) {
|
||||
if(recipe.getItem() == supplied.getItem() && recipe.getItemDamage() == supplied.getItemDamage()) {
|
||||
//check that the user supplied nbt tag is a superset of the recipe item nbt tag
|
||||
//if the recipe doesn't have an NBT tag, the user supplied one doesn't matter, it is a superset
|
||||
if(!recipe.hasTagCompound()) return true;
|
||||
//if the recipe does have an NBT tag but the user supplied doesn't, also no way it's a superset
|
||||
if(!supplied.hasTagCompound()) return false;
|
||||
|
||||
NBTTagCompound mergedNBT = supplied.getTagCompound().copy();
|
||||
mergedNBT.merge(recipe.getTagCompound());
|
||||
return supplied.getTagCompound().equals(mergedNBT);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public List<Object> getInputs() {
|
||||
|
||||
@@ -26,7 +26,6 @@ import java.util.Map;
|
||||
public class RecipePureDaisy {
|
||||
|
||||
public static final int DEFAULT_TIME = 150;
|
||||
private static final Map<String, List<ItemStack>> oreMap = new HashMap<>();
|
||||
|
||||
private final Object input;
|
||||
private final IBlockState outputState;
|
||||
@@ -64,21 +63,10 @@ public class RecipePureDaisy {
|
||||
if(stack.isEmpty())
|
||||
return false;
|
||||
|
||||
List<ItemStack> ores;
|
||||
if(oreMap.containsKey(entry))
|
||||
ores = oreMap.get(entry);
|
||||
else {
|
||||
ores = OreDictionary.getOres(entry);
|
||||
oreMap.put(entry, ores);
|
||||
}
|
||||
|
||||
for(ItemStack ostack : ores) {
|
||||
ItemStack cstack = ostack.copy();
|
||||
if(cstack.getItemDamage() == Short.MAX_VALUE)
|
||||
cstack.setItemDamage(stack.getItemDamage());
|
||||
|
||||
if(stack.isItemEqual(cstack))
|
||||
for(ItemStack ostack : OreDictionary.getOres(entry, false)) {
|
||||
if(OreDictionary.itemMatches(ostack, stack, false)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -21,6 +21,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
@@ -38,6 +39,7 @@ import java.util.List;
|
||||
* a no parameter constructor.
|
||||
*/
|
||||
public class SubTileEntity {
|
||||
public static final ResourceLocation DING_SOUND_EVENT = new ResourceLocation("botania", "ding");
|
||||
|
||||
protected TileEntity supertile;
|
||||
|
||||
|
||||
@@ -18,14 +18,14 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.SoundEvent;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.internal.IManaNetwork;
|
||||
import vazkii.botania.api.mana.IManaPool;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
@@ -137,7 +137,9 @@ public class SubTileFunctional extends SubTileEntity {
|
||||
return false;
|
||||
|
||||
knownMana = mana;
|
||||
player.world.playSound(null, player.posX, player.posY, player.posZ, ModSounds.ding, SoundCategory.PLAYERS, 0.1F, 1F);
|
||||
SoundEvent evt = ForgeRegistries.SOUND_EVENTS.getValue(DING_SOUND_EVENT);
|
||||
if(evt != null)
|
||||
player.playSound(evt, 0.1F, 1F);
|
||||
|
||||
return super.onWanded(player, wand);
|
||||
}
|
||||
|
||||
@@ -22,15 +22,16 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.SoundEvent;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.internal.IManaNetwork;
|
||||
import vazkii.botania.api.mana.IManaCollector;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.List;
|
||||
@@ -94,8 +95,13 @@ public class SubTileGenerating extends SubTileEntity {
|
||||
if(supertile.getWorld().isRemote) {
|
||||
double particleChance = 1F - (double) mana / (double) getMaxMana() / 3.5F;
|
||||
Color color = new Color(getColor());
|
||||
if(Math.random() > particleChance)
|
||||
BotaniaAPI.internalHandler.sparkleFX(supertile.getWorld(), supertile.getPos().getX() + 0.3 + Math.random() * 0.5, supertile.getPos().getY() + 0.5 + Math.random() * 0.5, supertile.getPos().getZ() + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5);
|
||||
if(Math.random() > particleChance) {
|
||||
Vec3d offset = getWorld().getBlockState(getPos()).getOffset(getWorld(), getPos());
|
||||
double x = getPos().getX() + offset.x;
|
||||
double y = getPos().getY() + offset.y;
|
||||
double z = getPos().getZ() + offset.z;
|
||||
BotaniaAPI.internalHandler.sparkleFX(supertile.getWorld(), x + 0.3 + Math.random() * 0.5, y + 0.5 + Math.random() * 0.5, z + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5);
|
||||
}
|
||||
}
|
||||
|
||||
boolean passive = isPassiveFlower();
|
||||
@@ -224,7 +230,9 @@ public class SubTileGenerating extends SubTileEntity {
|
||||
sync();
|
||||
|
||||
knownMana = mana;
|
||||
player.world.playSound(null, player.posX, player.posY, player.posZ, ModSounds.ding, SoundCategory.PLAYERS, 0.1F, 1F);
|
||||
SoundEvent evt = ForgeRegistries.SOUND_EVENTS.getValue(DING_SOUND_EVENT);
|
||||
if(evt != null)
|
||||
player.playSound(evt, 0.1F, 1F);
|
||||
|
||||
return super.onWanded(player, wand);
|
||||
}
|
||||
|
||||
@@ -18,13 +18,13 @@ import java.util.Map;
|
||||
|
||||
public class WikiHooks {
|
||||
|
||||
private static final IWikiProvider FALLBACK_PROVIDER = new SimpleWikiProvider("FTB Wiki", "http://ftb.gamepedia.com/%s");
|
||||
private static final IWikiProvider FALLBACK_PROVIDER = new SimpleWikiProvider("FTB Wiki", "https://ftb.gamepedia.com/%s");
|
||||
|
||||
private static final Map<String, IWikiProvider> modWikis = new HashMap<>();
|
||||
|
||||
public static IWikiProvider getWikiFor(Block block) {
|
||||
ResourceLocation mod = Block.REGISTRY.getNameForObject(block);
|
||||
return getWikiFor(mod == null ? "" : mod.getResourceDomain().toLowerCase());
|
||||
return getWikiFor(mod == null ? "" : mod.getNamespace().toLowerCase());
|
||||
}
|
||||
|
||||
public static IWikiProvider getWikiFor(String mod) {
|
||||
|
||||
@@ -13,11 +13,13 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraftforge.fml.relauncher.ReflectionHelper;
|
||||
import net.minecraftforge.registries.IRegistryDelegate;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.brew.Brew;
|
||||
import vazkii.botania.api.brew.IBrewItem;
|
||||
import vazkii.botania.api.mana.BurstProperties;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.BlockCamo;
|
||||
@@ -152,8 +154,8 @@ public final class ColorHandler {
|
||||
return Minecraft.getMinecraft().getItemColors().colorMultiplier(lens, t);
|
||||
|
||||
if(t == 2) {
|
||||
EntityManaBurst burst = ((ItemManaGun) s.getItem()).getBurst(Minecraft.getMinecraft().player, s, false);
|
||||
Color color = new Color(burst == null ? 0x20FF20 : burst.getColor());
|
||||
BurstProperties props = ((ItemManaGun) s.getItem()).getBurstProps(Minecraft.getMinecraft().player, s, false, EnumHand.MAIN_HAND);
|
||||
Color color = new Color(props.color);
|
||||
|
||||
float mul = (float) (Math.sin((double) ClientTickHandler.ticksInGame / 5) * 0.15F);
|
||||
int c = (int) (255 * mul);
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
/**
|
||||
* This class was created by <Hubry>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
* <p>
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
* <p>
|
||||
* File Created @ [July 04, 2018, 19:16:14 (GMT)]
|
||||
*/
|
||||
package vazkii.botania.client.core.handler;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.event.GuiScreenEvent.KeyboardInputEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import vazkii.botania.api.corporea.CorporeaHelper;
|
||||
import vazkii.botania.client.core.proxy.ClientProxy;
|
||||
import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@Mod.EventBusSubscriber(modid = LibMisc.MOD_ID, value = Side.CLIENT)
|
||||
public class CorporeaInputHandler {
|
||||
|
||||
/** Replaced in JEIBotaniaPlugin when JEI's loaded to provide stacks from the JEI item panel. */
|
||||
public static Supplier<ItemStack> jeiPanelSupplier = () -> ItemStack.EMPTY;
|
||||
|
||||
/** Filter for usable guis to handle requests. Added to in JEIBotaniaPlugin */
|
||||
public static Predicate<GuiScreen> supportedGuiFilter = gui -> gui instanceof GuiContainer;
|
||||
|
||||
@SubscribeEvent
|
||||
public static void buttonPressed(KeyboardInputEvent.Post event) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if(mc.world == null || !supportedGuiFilter.test(mc.currentScreen)
|
||||
|| Keyboard.getEventKey() != ClientProxy.CORPOREA_REQUEST.getKeyCode()
|
||||
|| !Keyboard.getEventKeyState()
|
||||
|| Keyboard.isRepeatEvent()
|
||||
|| TileCorporeaIndex.InputHandler.getNearbyIndexes(mc.player).isEmpty())
|
||||
return;
|
||||
|
||||
ItemStack stack = getStackUnderMouse();
|
||||
if(stack != null && !stack.isEmpty()) {
|
||||
int count = 1;
|
||||
int max = stack.getMaxStackSize();
|
||||
|
||||
if(GuiScreen.isShiftKeyDown()) {
|
||||
count = max;
|
||||
if(GuiScreen.isCtrlKeyDown())
|
||||
count /= 4;
|
||||
} else if(GuiScreen.isCtrlKeyDown())
|
||||
count = max / 2;
|
||||
|
||||
if(count > 0) {
|
||||
String name = CorporeaHelper.stripControlCodes(stack.getDisplayName());
|
||||
String full = count + " " + name;
|
||||
|
||||
mc.ingameGUI.getChatGUI().addToSentMessages(full);
|
||||
mc.player.sendChatMessage(full);
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static ItemStack getStackUnderMouse() {
|
||||
GuiScreen screen = Minecraft.getMinecraft().currentScreen;
|
||||
if(screen instanceof GuiContainer) {
|
||||
Slot slotUnderMouse = ((GuiContainer) screen).getSlotUnderMouse();
|
||||
if(slotUnderMouse != null)
|
||||
return slotUnderMouse.getStack();
|
||||
}
|
||||
return jeiPanelSupplier.get();
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,6 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.GuiChat;
|
||||
import net.minecraft.client.gui.GuiIngame;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
@@ -35,7 +34,6 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.relauncher.ReflectionHelper;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.items.CapabilityItemHandler;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
@@ -71,7 +69,6 @@ import vazkii.botania.common.item.equipment.bauble.ItemDodgeRing;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemFlightTiara;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemMonocle;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.List;
|
||||
@@ -88,7 +85,7 @@ public final class HUDHandler {
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||
public static void onDrawScreenPre(RenderGameOverlayEvent.Pre event) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
Profiler profiler = mc.mcProfiler;
|
||||
Profiler profiler = mc.profiler;
|
||||
|
||||
if(event.getType() == ElementType.HEALTH) {
|
||||
profiler.startSection("botania-hud");
|
||||
@@ -120,7 +117,7 @@ public final class HUDHandler {
|
||||
@SubscribeEvent
|
||||
public static void onDrawScreenPost(RenderGameOverlayEvent.Post event) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
Profiler profiler = mc.mcProfiler;
|
||||
Profiler profiler = mc.profiler;
|
||||
ItemStack main = mc.player.getHeldItemMainhand();
|
||||
ItemStack offhand = mc.player.getHeldItemOffhand();
|
||||
|
||||
@@ -265,7 +262,7 @@ public final class HUDHandler {
|
||||
|
||||
private static void renderWandModeDisplay(ItemStack stack, ScaledResolution res) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
Profiler profiler = mc.mcProfiler;
|
||||
Profiler profiler = mc.profiler;
|
||||
|
||||
profiler.startSection("wandMode");
|
||||
int ticks = mc.ingameGUI.remainingHighlightTicks;
|
||||
@@ -317,7 +314,7 @@ public final class HUDHandler {
|
||||
|
||||
private static void renderPoolRecipeHUD(ScaledResolution res, TilePool tile, ItemStack stack) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
Profiler profiler = mc.mcProfiler;
|
||||
Profiler profiler = mc.profiler;
|
||||
|
||||
profiler.startSection("poolRecipe");
|
||||
RecipeManaInfusion recipe = TilePool.getMatchingRecipe(stack, tile.getWorld().getBlockState(tile.getPos().down()));
|
||||
@@ -349,7 +346,7 @@ public final class HUDHandler {
|
||||
|
||||
private static void renderCrystalCubeHUD(ScaledResolution res, TileCorporeaCrystalCube tile) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
Profiler profiler = mc.mcProfiler;
|
||||
Profiler profiler = mc.profiler;
|
||||
|
||||
profiler.startSection("crystalCube");
|
||||
ItemStack target = tile.getRequestTarget();
|
||||
@@ -376,7 +373,7 @@ public final class HUDHandler {
|
||||
private static void drawLexiconHUD(ItemStack stack, IBlockState state, RayTraceResult pos, ScaledResolution res) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
Block block = state.getBlock();
|
||||
Profiler profiler = mc.mcProfiler;
|
||||
Profiler profiler = mc.profiler;
|
||||
|
||||
profiler.startSection("lexicon");
|
||||
FontRenderer font = mc.fontRenderer;
|
||||
@@ -401,7 +398,7 @@ public final class HUDHandler {
|
||||
}
|
||||
}
|
||||
|
||||
if(!draw && pos.entityHit == null) {
|
||||
if(!ConfigHandler.lexicaOfflineMode && !draw && pos.entityHit == null) {
|
||||
profiler.startSection("wikiLookup");
|
||||
if(!block.isAir(state, mc.world, pos.getBlockPos()) && !(block instanceof BlockLiquid)) {
|
||||
IWikiProvider provider = WikiHooks.getWikiFor(block);
|
||||
|
||||
@@ -111,7 +111,7 @@ public final class ItemsRemainingRenderHandler {
|
||||
int count = 0;
|
||||
for(int i = 0; i < player.inventory.getSizeInventory(); i++) {
|
||||
ItemStack stack = player.inventory.getStackInSlot(i);
|
||||
if(!stack.isEmpty() && pattern.matcher(stack.getUnlocalizedName()).find())
|
||||
if(!stack.isEmpty() && pattern.matcher(stack.getTranslationKey()).find())
|
||||
count += stack.getCount();
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public class LightningHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onRenderWorldLast(RenderWorldLastEvent event) {
|
||||
Profiler profiler = Minecraft.getMinecraft().mcProfiler;
|
||||
Profiler profiler = Minecraft.getMinecraft().profiler;
|
||||
|
||||
profiler.startSection("botania-particles");
|
||||
ParticleRenderDispatcher.dispatch();
|
||||
|
||||
@@ -14,14 +14,19 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraftforge.client.event.ModelBakeEvent;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import org.apache.commons.lang3.text.WordUtils;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.client.model.FloatingFlowerModel;
|
||||
import vazkii.botania.client.model.GunModel;
|
||||
import vazkii.botania.client.model.LexiconModel;
|
||||
import vazkii.botania.client.model.PlatformModel;
|
||||
import vazkii.botania.common.integration.buildcraft.TriggerManaLevel;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemFlightTiara;
|
||||
import vazkii.botania.common.item.relic.ItemKingKey;
|
||||
|
||||
import java.util.EnumMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class MiscellaneousIcons {
|
||||
|
||||
public static final MiscellaneousIcons INSTANCE = new MiscellaneousIcons();
|
||||
@@ -48,7 +53,7 @@ public class MiscellaneousIcons {
|
||||
|
||||
public TextureAtlasSprite[] sparkUpgradeIcons;
|
||||
public TextureAtlasSprite[] kingKeyWeaponIcons;
|
||||
// todo buildcraft public final Map<TriggerManaLevel.State, TextureAtlasSprite> manaLevelTriggerIcons = Maps.newEnumMap(TriggerManaLevel.State.class);
|
||||
public final Map<TriggerManaLevel.State, TextureAtlasSprite> manaLevelTriggerIcons = new EnumMap<>(TriggerManaLevel.State.class);
|
||||
public TextureAtlasSprite[] tiaraWingIcons;
|
||||
public TextureAtlasSprite[] thirdEyeLayers;
|
||||
|
||||
@@ -146,9 +151,9 @@ public class MiscellaneousIcons {
|
||||
manaDetectorIcon = IconHelper.forName(evt.getMap(), "triggers/manaDetector", "items");
|
||||
runeAltarTriggerIcon = IconHelper.forName(evt.getMap(), "triggers/runeAltarCanCraft", "items");
|
||||
|
||||
/*for (TriggerManaLevel.State s : TriggerManaLevel.State.values()) { todo buildcraft
|
||||
for (TriggerManaLevel.State s : TriggerManaLevel.State.values()) {
|
||||
manaLevelTriggerIcons.put(s, IconHelper.forName(evt.getMap(), "triggers/mana" + WordUtils.capitalizeFully(s.name()), "items"));
|
||||
}*/
|
||||
}
|
||||
|
||||
tiaraWingIcons = new TextureAtlasSprite[ItemFlightTiara.WING_TYPES];
|
||||
for (int i = 0; i < tiaraWingIcons.length; i++) {
|
||||
|
||||
@@ -135,7 +135,7 @@ public final class ModelHandler {
|
||||
}
|
||||
|
||||
public static void registerItemAllMeta(Item item, int range) {
|
||||
registerItemMetas(item, range, i -> item.getRegistryName().getResourcePath());
|
||||
registerItemMetas(item, range, i -> item.getRegistryName().getPath());
|
||||
}
|
||||
|
||||
public static void registerItemAppendMeta(Item item, int maxExclusive, String loc) {
|
||||
|
||||
@@ -106,9 +106,9 @@ public final class RedStringRenderer {
|
||||
double freq = 20;
|
||||
double ampl = (0.15 * (Math.sin(l * 2F) * 0.5 + 0.5) + 0.1) * sizeAlpha;
|
||||
double randMul = 0.05;
|
||||
double x = xpos + Math.sin(l * freq) * ampl * Math.abs(Math.abs(dir.getFrontOffsetX()) - 1) + rand * randMul;
|
||||
double y = ypos + Math.cos(l * freq) * ampl * Math.abs(Math.abs(dir.getFrontOffsetY()) - 1) + rand * randMul;
|
||||
double z = zpos + (dir.getFrontOffsetY() == 0 ? Math.sin(l * freq) : Math.cos(l * freq)) * ampl * Math.abs(Math.abs(dir.getFrontOffsetZ()) - 1) + rand * randMul;
|
||||
double x = xpos + Math.sin(l * freq) * ampl * Math.abs(Math.abs(dir.getXOffset()) - 1) + rand * randMul;
|
||||
double y = ypos + Math.cos(l * freq) * ampl * Math.abs(Math.abs(dir.getYOffset()) - 1) + rand * randMul;
|
||||
double z = zpos + (dir.getYOffset() == 0 ? Math.sin(l * freq) : Math.cos(l * freq)) * ampl * Math.abs(Math.abs(dir.getZOffset()) - 1) + rand * randMul;
|
||||
|
||||
tess.getBuffer().pos(x, y, z).endVertex();
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ public final class TooltipAdditionDisplayHandler {
|
||||
drawManaBar(stack, (IManaTooltipDisplay) stack.getItem(), tooltipX, tooltipY, width, height);
|
||||
|
||||
EntryData data = LexiconRecipeMappings.getDataForStack(stack);
|
||||
if(data != null) {
|
||||
if(mc.player != null && data != null) {
|
||||
int lexSlot = -1;
|
||||
ItemStack lexiconStack = ItemStack.EMPTY;
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.client.renderer.entity.RenderSnowball;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityItemStackRenderer;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -26,6 +27,7 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.model.animation.AnimationTESR;
|
||||
import net.minecraftforge.client.settings.KeyConflictContext;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.client.registry.ClientRegistry;
|
||||
import net.minecraftforge.fml.client.registry.RenderingRegistry;
|
||||
@@ -34,6 +36,7 @@ import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import vazkii.botania.api.boss.IBotaniaBoss;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.lexicon.multiblock.IMultiblockRenderHook;
|
||||
@@ -102,6 +105,7 @@ import vazkii.botania.common.item.ItemSextant.MultiblockSextant;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemMonocle;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import java.awt.Desktop;
|
||||
import java.io.File;
|
||||
@@ -132,9 +136,11 @@ public class ClientProxy implements IProxy {
|
||||
EMPTY_MODEL.setVisible(false);
|
||||
}
|
||||
|
||||
public static final KeyBinding CORPOREA_REQUEST = new KeyBinding("nei.options.keys.gui.botania_corporea_request", KeyConflictContext.GUI, Keyboard.KEY_C, LibMisc.MOD_NAME);
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
PersistentVariableHelper.setCacheFile(new File(Minecraft.getMinecraft().mcDataDir, "BotaniaVars.dat"));
|
||||
PersistentVariableHelper.setCacheFile(new File(Minecraft.getMinecraft().gameDir, "BotaniaVars.dat"));
|
||||
try {
|
||||
PersistentVariableHelper.load();
|
||||
PersistentVariableHelper.save();
|
||||
@@ -170,6 +176,8 @@ public class ClientProxy implements IProxy {
|
||||
}
|
||||
|
||||
TileEntityItemStackRenderer.instance = new RenderTilePylon.ForwardingTEISR(TileEntityItemStackRenderer.instance);
|
||||
|
||||
ClientRegistry.registerKeyBinding(ClientProxy.CORPOREA_REQUEST);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -277,6 +285,8 @@ public class ClientProxy implements IProxy {
|
||||
|
||||
@Override
|
||||
public boolean openWikiPage(World world, Block block, RayTraceResult pos) {
|
||||
if(ConfigHandler.lexicaOfflineMode)
|
||||
return false;
|
||||
IWikiProvider wiki = WikiHooks.getWikiFor(block);
|
||||
String url = wiki.getWikiURL(world, pos, Minecraft.getMinecraft().player);
|
||||
if(url != null && !url.isEmpty()) {
|
||||
|
||||
@@ -30,7 +30,7 @@ public final class ParticleRenderDispatcher {
|
||||
public static void dispatch() {
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
|
||||
Profiler profiler = Minecraft.getMinecraft().mcProfiler;
|
||||
Profiler profiler = Minecraft.getMinecraft().profiler;
|
||||
|
||||
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
|
||||
GlStateManager.depthMask(false);
|
||||
|
||||
@@ -8,14 +8,20 @@
|
||||
*/
|
||||
package vazkii.botania.client.integration.jei;
|
||||
|
||||
import mezz.jei.api.IJeiRuntime;
|
||||
import mezz.jei.api.IModPlugin;
|
||||
import mezz.jei.api.IModRegistry;
|
||||
import mezz.jei.api.IRecipesGui;
|
||||
import mezz.jei.api.ISubtypeRegistry;
|
||||
import mezz.jei.api.JEIPlugin;
|
||||
import mezz.jei.api.recipe.IRecipeCategoryRegistration;
|
||||
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.recipe.RecipeBrew;
|
||||
import vazkii.botania.api.recipe.RecipeElvenTrade;
|
||||
@@ -23,6 +29,7 @@ import vazkii.botania.api.recipe.RecipeManaInfusion;
|
||||
import vazkii.botania.api.recipe.RecipePetals;
|
||||
import vazkii.botania.api.recipe.RecipePureDaisy;
|
||||
import vazkii.botania.api.recipe.RecipeRuneAltar;
|
||||
import vazkii.botania.client.core.handler.CorporeaInputHandler;
|
||||
import vazkii.botania.client.gui.crafting.ContainerCraftingHalo;
|
||||
import vazkii.botania.client.integration.jei.brewery.BreweryRecipeCategory;
|
||||
import vazkii.botania.client.integration.jei.brewery.BreweryRecipeWrapper;
|
||||
@@ -31,6 +38,10 @@ import vazkii.botania.client.integration.jei.elventrade.ElvenTradeRecipeCategory
|
||||
import vazkii.botania.client.integration.jei.elventrade.ElvenTradeRecipeWrapper;
|
||||
import vazkii.botania.client.integration.jei.manapool.ManaPoolRecipeCategory;
|
||||
import vazkii.botania.client.integration.jei.manapool.ManaPoolRecipeWrapper;
|
||||
import vazkii.botania.client.integration.jei.orechid.OrechidIgnemRecipeCategory;
|
||||
import vazkii.botania.client.integration.jei.orechid.OrechidIgnemRecipeWrapper;
|
||||
import vazkii.botania.client.integration.jei.orechid.OrechidRecipeCategory;
|
||||
import vazkii.botania.client.integration.jei.orechid.OrechidRecipeWrapper;
|
||||
import vazkii.botania.client.integration.jei.petalapothecary.PetalApothecaryRecipeCategory;
|
||||
import vazkii.botania.client.integration.jei.petalapothecary.PetalApothecaryRecipeWrapper;
|
||||
import vazkii.botania.client.integration.jei.puredaisy.PureDaisyRecipeCategory;
|
||||
@@ -42,8 +53,14 @@ import vazkii.botania.common.crafting.recipe.SpecialFloatingFlowerRecipe;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.item.brew.ItemBrewBase;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static vazkii.botania.common.lib.LibBlockNames.SUBTILE_ORECHID;
|
||||
import static vazkii.botania.common.lib.LibBlockNames.SUBTILE_ORECHID_IGNEM;
|
||||
import static vazkii.botania.common.lib.LibBlockNames.SUBTILE_PUREDAISY;
|
||||
|
||||
@JEIPlugin
|
||||
public class JEIBotaniaPlugin implements IModPlugin {
|
||||
@@ -52,6 +69,10 @@ public class JEIBotaniaPlugin implements IModPlugin {
|
||||
public void registerItemSubtypes(@Nonnull ISubtypeRegistry subtypeRegistry) {
|
||||
subtypeRegistry.registerSubtypeInterpreter(Item.getItemFromBlock(ModBlocks.specialFlower), stack -> ItemBlockSpecialFlower.getType(stack).toString());
|
||||
subtypeRegistry.registerSubtypeInterpreter(Item.getItemFromBlock(ModBlocks.floatingSpecialFlower), stack -> ItemBlockSpecialFlower.getType(stack).toString());
|
||||
subtypeRegistry.registerSubtypeInterpreter(ModItems.brewVial, ItemBrewBase::getSubtype);
|
||||
subtypeRegistry.registerSubtypeInterpreter(ModItems.brewFlask, ItemBrewBase::getSubtype);
|
||||
subtypeRegistry.registerSubtypeInterpreter(ModItems.incenseStick, ItemBrewBase::getSubtype);
|
||||
subtypeRegistry.registerSubtypeInterpreter(ModItems.bloodPendant, ItemBrewBase::getSubtype);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -62,8 +83,16 @@ public class JEIBotaniaPlugin implements IModPlugin {
|
||||
new RunicAltarRecipeCategory(registry.getJeiHelpers().getGuiHelper()), // Runic must come before petals. See williewillus/Botania#172
|
||||
new PetalApothecaryRecipeCategory(registry.getJeiHelpers().getGuiHelper()),
|
||||
new ElvenTradeRecipeCategory(registry.getJeiHelpers().getGuiHelper()),
|
||||
new ManaPoolRecipeCategory(registry.getJeiHelpers().getGuiHelper())
|
||||
);
|
||||
new ManaPoolRecipeCategory(registry.getJeiHelpers().getGuiHelper()),
|
||||
new OrechidRecipeCategory(registry.getJeiHelpers().getGuiHelper()),
|
||||
new OrechidIgnemRecipeCategory(registry.getJeiHelpers().getGuiHelper())
|
||||
);
|
||||
}
|
||||
|
||||
public static boolean doesOreExist(String key) {
|
||||
return OreDictionary.doesOreNameExist(key)
|
||||
&& OreDictionary.getOres(key).stream()
|
||||
.anyMatch(s -> s.getItem() instanceof ItemBlock);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -83,6 +112,23 @@ public class JEIBotaniaPlugin implements IModPlugin {
|
||||
registry.addRecipes(BotaniaAPI.runeAltarRecipes, RunicAltarRecipeCategory.UID);
|
||||
registry.addRecipes(BotaniaAPI.manaInfusionRecipes, ManaPoolRecipeCategory.UID);
|
||||
|
||||
registry.addRecipes(
|
||||
BotaniaAPI.oreWeights.entrySet().stream()
|
||||
.filter(e -> doesOreExist(e.getKey()))
|
||||
.map(OrechidRecipeWrapper::new)
|
||||
.sorted()
|
||||
.collect(Collectors.toList()),
|
||||
OrechidRecipeCategory.UID);
|
||||
|
||||
registry.addRecipes(
|
||||
BotaniaAPI.oreWeightsNether.entrySet().stream()
|
||||
.filter(e -> doesOreExist(e.getKey()))
|
||||
.map(OrechidIgnemRecipeWrapper::new)
|
||||
.sorted()
|
||||
.collect(Collectors.toList()),
|
||||
OrechidIgnemRecipeCategory.UID);
|
||||
|
||||
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.brewery), BreweryRecipeCategory.UID);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.alfPortal), ElvenTradeRecipeCategory.UID);
|
||||
|
||||
@@ -102,8 +148,12 @@ public class JEIBotaniaPlugin implements IModPlugin {
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.mesaAltar), PetalApothecaryRecipeCategory.UID);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.mossyAltar), PetalApothecaryRecipeCategory.UID);
|
||||
|
||||
registry.addRecipeCatalyst(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_PUREDAISY), PureDaisyRecipeCategory.UID);
|
||||
registry.addRecipeCatalyst(ItemBlockSpecialFlower.ofType(new ItemStack(ModBlocks.floatingSpecialFlower), LibBlockNames.SUBTILE_PUREDAISY), PureDaisyRecipeCategory.UID);
|
||||
registry.addRecipeCatalyst(ItemBlockSpecialFlower.ofType(SUBTILE_ORECHID), OrechidRecipeCategory.UID);
|
||||
registry.addRecipeCatalyst(ItemBlockSpecialFlower.ofType(new ItemStack(ModBlocks.floatingSpecialFlower), SUBTILE_ORECHID), OrechidRecipeCategory.UID);
|
||||
registry.addRecipeCatalyst(ItemBlockSpecialFlower.ofType(SUBTILE_ORECHID_IGNEM), OrechidIgnemRecipeCategory.UID);
|
||||
registry.addRecipeCatalyst(ItemBlockSpecialFlower.ofType(new ItemStack(ModBlocks.floatingSpecialFlower), SUBTILE_ORECHID_IGNEM), OrechidIgnemRecipeCategory.UID);
|
||||
registry.addRecipeCatalyst(ItemBlockSpecialFlower.ofType(SUBTILE_PUREDAISY), PureDaisyRecipeCategory.UID);
|
||||
registry.addRecipeCatalyst(ItemBlockSpecialFlower.ofType(new ItemStack(ModBlocks.floatingSpecialFlower), SUBTILE_PUREDAISY), PureDaisyRecipeCategory.UID);
|
||||
|
||||
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.runeAltar), RunicAltarRecipeCategory.UID);
|
||||
@@ -113,4 +163,20 @@ public class JEIBotaniaPlugin implements IModPlugin {
|
||||
registry.getRecipeTransferRegistry().addRecipeTransferHandler(ContainerCraftingHalo.class, VanillaRecipeCategoryUid.CRAFTING, 1, 9, 10, 36);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRuntimeAvailable(IJeiRuntime jeiRuntime) {
|
||||
CorporeaInputHandler.jeiPanelSupplier = () -> {
|
||||
Object o = jeiRuntime.getIngredientListOverlay().getIngredientUnderMouse();
|
||||
|
||||
if(o == null && Minecraft.getMinecraft().currentScreen == jeiRuntime.getRecipesGui())
|
||||
o = jeiRuntime.getRecipesGui().getIngredientUnderMouse();
|
||||
|
||||
if(o instanceof ItemStack)
|
||||
return (ItemStack) o;
|
||||
return ItemStack.EMPTY;
|
||||
};
|
||||
|
||||
CorporeaInputHandler.supportedGuiFilter = gui -> gui instanceof GuiContainer || gui instanceof IRecipesGui;
|
||||
}
|
||||
|
||||
}
|
||||
+19
-5
@@ -13,17 +13,16 @@ import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IFocus;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class BreweryRecipeCategory implements IRecipeCategory {
|
||||
@@ -68,9 +67,11 @@ public class BreweryRecipeCategory implements IRecipeCategory {
|
||||
return;
|
||||
|
||||
List<List<ItemStack>> inputs = ingredients.getInputs(ItemStack.class);
|
||||
List<List<ItemStack>> outputs = ingredients.getOutputs(ItemStack.class);
|
||||
IFocus<?> focus = recipeLayout.getFocus();
|
||||
|
||||
recipeLayout.getItemStacks().init(0, true, 39, 41);
|
||||
recipeLayout.getItemStacks().set(0, inputs.get(0));
|
||||
recipeLayout.getItemStacks().set(0, getItemMatchingFocus(focus, IFocus.Mode.OUTPUT, outputs.get(0), inputs.get(0)));
|
||||
|
||||
int index = 1, posX = 60;
|
||||
for(int i = 1; i < inputs.size(); i++) {
|
||||
@@ -82,6 +83,19 @@ public class BreweryRecipeCategory implements IRecipeCategory {
|
||||
}
|
||||
|
||||
recipeLayout.getItemStacks().init(7, false, 87, 41);
|
||||
recipeLayout.getItemStacks().set(7, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
recipeLayout.getItemStacks().set(7, getItemMatchingFocus(focus, IFocus.Mode.INPUT, inputs.get(0), outputs.get(0)));
|
||||
}
|
||||
|
||||
/**
|
||||
* If an item in this recipe is focused, returns the corresponding item instead of all the containers/results.
|
||||
*/
|
||||
private List<ItemStack> getItemMatchingFocus(IFocus<?> focus, IFocus.Mode mode, List<ItemStack> focused, List<ItemStack> other) {
|
||||
if(focus != null && focus.getMode() == mode) {
|
||||
ItemStack focusStack = (ItemStack) focus.getValue();
|
||||
for(int i = 0; i < focused.size(); i++)
|
||||
if(focusStack.isItemEqual(focused.get(i)))
|
||||
return Collections.singletonList(other.get(i));
|
||||
}
|
||||
return other;
|
||||
}
|
||||
}
|
||||
+21
-8
@@ -11,35 +11,48 @@ package vazkii.botania.client.integration.jei.brewery;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import vazkii.botania.api.recipe.RecipeBrew;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class BreweryRecipeWrapper implements IRecipeWrapper {
|
||||
|
||||
private final List<List<ItemStack>> input;
|
||||
private final List<ItemStack> output;
|
||||
|
||||
private static final List<ItemStack> inputs = Arrays.asList(new ItemStack(ModItems.vial),
|
||||
new ItemStack(ModItems.flask), new ItemStack(ModItems.incenseStick), new ItemStack(ModItems.bloodPendant));
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public BreweryRecipeWrapper(RecipeBrew recipeBrew) {
|
||||
ImmutableList.Builder<List<ItemStack>> builder = ImmutableList.builder();
|
||||
builder.add(ImmutableList.of(new ItemStack(ModItems.vial), new ItemStack(ModItems.flask)));
|
||||
ImmutableList.Builder<List<ItemStack>> inputBuilder = ImmutableList.builder();
|
||||
ImmutableList.Builder<ItemStack> outputBuilder = ImmutableList.builder();
|
||||
ImmutableList.Builder<ItemStack> containers = ImmutableList.builder();
|
||||
|
||||
for(ItemStack stack : inputs) {
|
||||
ItemStack brewed = recipeBrew.getOutput(stack);
|
||||
if(!brewed.isEmpty()) {
|
||||
containers.add(stack);
|
||||
outputBuilder.add(brewed);
|
||||
}
|
||||
}
|
||||
inputBuilder.add(containers.build());
|
||||
|
||||
for(Object o : recipeBrew.getInputs()) {
|
||||
if(o instanceof ItemStack) {
|
||||
builder.add(ImmutableList.of((ItemStack) o));
|
||||
inputBuilder.add(ImmutableList.of((ItemStack) o));
|
||||
}
|
||||
if(o instanceof String) {
|
||||
builder.add(OreDictionary.getOres((String) o));
|
||||
inputBuilder.add(OreDictionary.getOres((String) o));
|
||||
}
|
||||
}
|
||||
|
||||
input = builder.build();
|
||||
output = ImmutableList.of(recipeBrew.getOutput(new ItemStack(ModItems.vial)).copy(), recipeBrew.getOutput(new ItemStack(ModItems.flask)).copy());
|
||||
input = inputBuilder.build();
|
||||
output = outputBuilder.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
/**
|
||||
* This class was created by <codewarrior0>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
* <p/>
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*/
|
||||
package vazkii.botania.client.integration.jei.orechid;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class OrechidIgnemRecipeCategory implements IRecipeCategory {
|
||||
|
||||
public static final String UID = "botania.orechid_ignem";
|
||||
private final IDrawableStatic background;
|
||||
private final String localizedName;
|
||||
private final IDrawableStatic overlay;
|
||||
|
||||
public OrechidIgnemRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createBlankDrawable(168, 64);
|
||||
localizedName = I18n.format("botania.nei.orechidIgnem");
|
||||
overlay = guiHelper.createDrawable(new ResourceLocation("botania", "textures/gui/pureDaisyOverlay.png"),
|
||||
0, 0, 64, 46);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return UID;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return localizedName;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
final IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
|
||||
|
||||
itemStacks.init(0, true, 40, 12);
|
||||
itemStacks.set(0, ingredients.getInputs(ItemStack.class).get(0));
|
||||
|
||||
itemStacks.init(1, true, 70, 12);
|
||||
itemStacks.set(1, ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_ORECHID_IGNEM));
|
||||
|
||||
itemStacks.init(2, true, 99, 12);
|
||||
itemStacks.set(2, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(@Nonnull Minecraft minecraft) {
|
||||
GlStateManager.enableAlpha();
|
||||
GlStateManager.enableBlend();
|
||||
overlay.draw(minecraft, 48, 0);
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.disableAlpha();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getModName() {
|
||||
return LibMisc.MOD_NAME;
|
||||
}
|
||||
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* This class was created by <codewarrior0>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
* <p/>
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*/
|
||||
package vazkii.botania.client.integration.jei.orechid;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class OrechidIgnemRecipeWrapper extends OrechidRecipeWrapper {
|
||||
|
||||
public OrechidIgnemRecipeWrapper(Map.Entry<String, Integer> entry) {
|
||||
super(entry);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ItemStack getInputStack() {
|
||||
return new ItemStack(Blocks.NETHERRACK, 64);
|
||||
}
|
||||
|
||||
public Map<String, Integer> getOreWeights() {
|
||||
return BotaniaAPI.oreWeightsNether;
|
||||
}
|
||||
|
||||
}
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
/**
|
||||
* This class was created by <codewarrior0>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
* <p/>
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*/
|
||||
package vazkii.botania.client.integration.jei.orechid;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class OrechidRecipeCategory implements IRecipeCategory {
|
||||
|
||||
public static final String UID = "botania.orechid";
|
||||
private final IDrawableStatic background;
|
||||
private final String localizedName;
|
||||
private final IDrawableStatic overlay;
|
||||
|
||||
public OrechidRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createBlankDrawable(168, 64);
|
||||
localizedName = I18n.format("botania.nei.orechid");
|
||||
overlay = guiHelper.createDrawable(new ResourceLocation("botania", "textures/gui/pureDaisyOverlay.png"),
|
||||
0, 0, 64, 46);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return UID;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return localizedName;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
final IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
|
||||
|
||||
itemStacks.init(0, true, 40, 12);
|
||||
itemStacks.set(0, ingredients.getInputs(ItemStack.class).get(0));
|
||||
|
||||
itemStacks.init(1, true, 70, 12);
|
||||
itemStacks.set(1, ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_ORECHID));
|
||||
|
||||
itemStacks.init(2, true, 99, 12);
|
||||
itemStacks.set(2, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(@Nonnull Minecraft minecraft) {
|
||||
GlStateManager.enableAlpha();
|
||||
GlStateManager.enableBlend();
|
||||
overlay.draw(minecraft, 48, 0);
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.disableAlpha();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getModName() {
|
||||
return LibMisc.MOD_NAME;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
/**
|
||||
* This class was created by <codewarrior0>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
* <p/>
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*/
|
||||
package vazkii.botania.client.integration.jei.orechid;
|
||||
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.ingredients.VanillaTypes;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static vazkii.botania.client.integration.jei.JEIBotaniaPlugin.doesOreExist;
|
||||
|
||||
public class OrechidRecipeWrapper implements IRecipeWrapper, Comparable<OrechidRecipeWrapper> {
|
||||
|
||||
private final int weight;
|
||||
private final List<List<ItemStack>> outputStacks;
|
||||
|
||||
protected ItemStack getInputStack() {
|
||||
return new ItemStack(Blocks.STONE, 64);
|
||||
}
|
||||
|
||||
public OrechidRecipeWrapper(Map.Entry<String, Integer> entry) {
|
||||
this.weight = entry.getValue();
|
||||
|
||||
final int amount = Math.max(1, Math.round((float) weight * 64 / getTotalOreWeight()));
|
||||
|
||||
// Shouldn't ever return an empty list since the ore weight
|
||||
// list is filtered to only have ores with ItemBlocks
|
||||
List<ItemStack> stackList = OreDictionary.getOres(entry.getKey()).stream()
|
||||
.filter(s -> s.getItem() instanceof ItemBlock)
|
||||
.map(ItemStack::copy)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
stackList.forEach(s -> s.setCount(amount));
|
||||
|
||||
outputStacks = Collections.singletonList(stackList);
|
||||
}
|
||||
|
||||
public Map<String, Integer> getOreWeights() {
|
||||
return BotaniaAPI.oreWeights;
|
||||
}
|
||||
|
||||
private float getTotalOreWeight() {
|
||||
return (getOreWeights().entrySet().stream()
|
||||
.filter(e -> doesOreExist(e.getKey()))
|
||||
.map(Map.Entry::getValue)
|
||||
.reduce(Integer::sum)).orElse(weight * 64 * 64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getIngredients(IIngredients ingredients) {
|
||||
ingredients.setInput(VanillaTypes.ITEM, getInputStack());
|
||||
ingredients.setOutputLists(VanillaTypes.ITEM, outputStacks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(OrechidRecipeWrapper o) {
|
||||
return Integer.compare(o.weight, weight);
|
||||
}
|
||||
}
|
||||
@@ -46,9 +46,8 @@ public class PlatformModel implements IBakedModel {
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<BakedQuad> getQuads(IBlockState state, EnumFacing side, long rand) {
|
||||
// rendering the item form
|
||||
if(state == null)
|
||||
return original.getQuads(state, side, rand);
|
||||
return ImmutableList.of();
|
||||
|
||||
if(!(state.getBlock() instanceof BlockPlatform))
|
||||
return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel().getQuads(state, side, rand);
|
||||
|
||||
@@ -135,10 +135,10 @@ public class SpecialFlowerModel implements IModel {
|
||||
|
||||
@Override
|
||||
public boolean accepts(ResourceLocation modelLocation) {
|
||||
return modelLocation.getResourceDomain().equals("botania_special") && (
|
||||
modelLocation.getResourcePath().equals("specialflower") ||
|
||||
modelLocation.getResourcePath().equals("models/block/specialflower") ||
|
||||
modelLocation.getResourcePath().equals("models/item/specialflower"));
|
||||
return modelLocation.getNamespace().equals("botania_special") && (
|
||||
modelLocation.getPath().equals("specialflower") ||
|
||||
modelLocation.getPath().equals("models/block/specialflower") ||
|
||||
modelLocation.getPath().equals("models/item/specialflower"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -37,7 +37,7 @@ public class RenderTileGaiaHead extends TileEntitySkullRenderer {
|
||||
|
||||
// Null-safe copy of super
|
||||
renderSkull((float)x, (float)y, (float)z,
|
||||
skull == null ? EnumFacing.NORTH : EnumFacing.getFront(skull.getBlockMetadata() & 7),
|
||||
skull == null ? EnumFacing.NORTH : EnumFacing.byIndex(skull.getBlockMetadata() & 7),
|
||||
skull == null ? 0 : skull.getSkullRotation() * 360 / 16.0F,
|
||||
3, null, digProgress, partialTicks);
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ import vazkii.botania.client.model.ModelTinyPotato;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.TileTinyPotato;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.block.ItemBlockTinyPotato;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemBaubleCosmetic;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemFlightTiara;
|
||||
|
||||
@@ -172,44 +173,61 @@ public class RenderTileTinyPotato extends TileEntitySpecialRenderer<TileTinyPota
|
||||
}
|
||||
|
||||
boolean block = stack.getItem() instanceof ItemBlock;
|
||||
boolean mySon = stack.getItem() instanceof ItemBlockTinyPotato;
|
||||
|
||||
switch(side) {
|
||||
case UP:
|
||||
if(block)
|
||||
if(mySon)
|
||||
GlStateManager.translate(0F, 0.6F, 0.5F);
|
||||
else if(block)
|
||||
GlStateManager.translate(0F, 0.3F, 0.5F);
|
||||
GlStateManager.translate(0F, -0.5F, -0.4F);
|
||||
break;
|
||||
case DOWN:
|
||||
GlStateManager.translate(0, -2.3, -0.88);
|
||||
if(block)
|
||||
if(mySon)
|
||||
GlStateManager.translate(0, .65, 0.6);
|
||||
else if(block)
|
||||
GlStateManager.translate(0, 1, 0.6);
|
||||
break;
|
||||
case NORTH:
|
||||
GlStateManager.translate(0, -1.9, 0.02);
|
||||
if(block)
|
||||
if(mySon)
|
||||
GlStateManager.translate(0, 1, 0.6);
|
||||
else if(block)
|
||||
GlStateManager.translate(0, 1, 0.6);
|
||||
break;
|
||||
case SOUTH:
|
||||
GlStateManager.translate(0, -1.6, -0.89);
|
||||
if(block)
|
||||
GlStateManager.translate(0, 1, 0.6);
|
||||
if(mySon)
|
||||
GlStateManager.translate(0, 1.4, 0.5);
|
||||
else if(block)
|
||||
GlStateManager.translate(0, 1.0, 0.5);
|
||||
break;
|
||||
case EAST:
|
||||
if(block)
|
||||
if(mySon)
|
||||
GlStateManager.translate(-0.4F, 0.65F, 0F);
|
||||
else if(block)
|
||||
GlStateManager.translate(-0.4F, 0.8F, 0F);
|
||||
else GlStateManager.rotate(-90F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(-0.3F, -1.9F, 0.04F);
|
||||
break;
|
||||
case WEST:
|
||||
if(block)
|
||||
if(mySon)
|
||||
GlStateManager.translate(1F, 0.65F, 1F);
|
||||
else if(block)
|
||||
GlStateManager.translate(1F, 0.8F, 1F);
|
||||
else GlStateManager.rotate(-90F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(-0.3F, -1.9F, -0.92F);
|
||||
break;
|
||||
}
|
||||
|
||||
if(block)
|
||||
if (mySon)
|
||||
GlStateManager.scale(1.1, 1.1, 1.1);
|
||||
else if(block)
|
||||
GlStateManager.scale(0.5, 0.5, 0.5);
|
||||
if(block && side != EnumFacing.NORTH)
|
||||
GlStateManager.rotate(180F, 0, 1, 0);
|
||||
renderItem(stack);
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
package vazkii.botania.common;
|
||||
|
||||
import net.minecraft.advancements.CriteriaTriggers;
|
||||
import net.minecraft.advancements.ICriterionTrigger;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.MultiPartEntityPart;
|
||||
import net.minecraft.entity.boss.EntityDragon;
|
||||
@@ -38,7 +38,6 @@ import net.minecraftforge.fml.common.event.FMLServerAboutToStartEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent;
|
||||
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||
import net.minecraftforge.fml.relauncher.ReflectionHelper;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
@@ -49,22 +48,17 @@ import vazkii.botania.common.advancements.*;
|
||||
import vazkii.botania.common.block.ModBanners;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.ModMultiblocks;
|
||||
import vazkii.botania.common.block.subtile.generating.SubTileNarslimmus;
|
||||
import vazkii.botania.common.block.tile.TileLightRelay;
|
||||
import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex;
|
||||
import vazkii.botania.common.brew.ModBrews;
|
||||
import vazkii.botania.common.core.command.CommandDownloadLatest;
|
||||
import vazkii.botania.common.core.command.CommandOpen;
|
||||
import vazkii.botania.common.core.command.CommandShare;
|
||||
import vazkii.botania.common.core.command.CommandSkyblockSpread;
|
||||
import vazkii.botania.common.core.handler.BiomeDecorationHandler;
|
||||
import vazkii.botania.common.core.handler.CommonTickHandler;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.core.handler.IMCHandler;
|
||||
import vazkii.botania.common.core.handler.InternalMethodHandler;
|
||||
import vazkii.botania.common.core.handler.ManaNetworkHandler;
|
||||
import vazkii.botania.common.core.handler.PixieHandler;
|
||||
import vazkii.botania.common.core.handler.SheddingHandler;
|
||||
import vazkii.botania.common.core.loot.LootHandler;
|
||||
import vazkii.botania.common.core.proxy.IProxy;
|
||||
import vazkii.botania.common.crafting.ModBrewRecipes;
|
||||
@@ -90,6 +84,8 @@ import vazkii.botania.common.fixers.AttachedWills;
|
||||
import vazkii.botania.common.fixers.CraftyCrateTE;
|
||||
import vazkii.botania.common.fixers.FlattenItems;
|
||||
import vazkii.botania.common.fixers.FlattenNBT;
|
||||
import vazkii.botania.common.integration.buildcraft.StatementAPIPlugin;
|
||||
import vazkii.botania.common.integration.thaumcraft.TCAspects;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
import vazkii.botania.common.network.GuiHandler;
|
||||
@@ -97,15 +93,13 @@ import vazkii.botania.common.network.PacketHandler;
|
||||
import vazkii.botania.common.world.SkyblockWorldEvents;
|
||||
import vazkii.botania.common.world.WorldTypeSkyblock;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
@Mod(modid = LibMisc.MOD_ID, name = LibMisc.MOD_NAME, version = LibMisc.VERSION, dependencies = LibMisc.DEPENDENCIES, guiFactory = LibMisc.GUI_FACTORY)
|
||||
public class Botania {
|
||||
|
||||
public static boolean gardenOfGlassLoaded = false;
|
||||
|
||||
public static boolean thaumcraftLoaded = false;
|
||||
public static boolean bcTriggersLoaded = false;
|
||||
public static boolean bcApiLoaded = false;
|
||||
public static boolean bloodMagicLoaded = false;
|
||||
public static boolean coloredLightsLoaded = false;
|
||||
public static boolean etFuturumLoaded = false;
|
||||
@@ -125,7 +119,7 @@ public class Botania {
|
||||
gardenOfGlassLoaded = Loader.isModLoaded("gardenofglass");
|
||||
|
||||
thaumcraftLoaded = Loader.isModLoaded("thaumcraft");
|
||||
bcTriggersLoaded = ModAPIManager.INSTANCE.hasAPI("BuildCraftAPI|statements");
|
||||
bcApiLoaded = Loader.isModLoaded("buildcraftlib");
|
||||
bloodMagicLoaded = Loader.isModLoaded("bloodmagic"); // Psh, noob
|
||||
coloredLightsLoaded = Loader.isModLoaded("easycoloredlights");
|
||||
etFuturumLoaded = Loader.isModLoaded("etfuturum");
|
||||
@@ -180,21 +174,30 @@ public class Botania {
|
||||
if(Botania.gardenOfGlassLoaded)
|
||||
MinecraftForge.EVENT_BUS.register(SkyblockWorldEvents.class);
|
||||
|
||||
FMLInterModComms.sendMessage("ProjectE", "interdictionblacklist", EntityManaBurst.class.getCanonicalName());
|
||||
FMLInterModComms.sendMessage("projecte", "interdictionblacklist", EntityManaBurst.class.getCanonicalName());
|
||||
|
||||
/*if(Botania.bcTriggersLoaded) todo buildcraft
|
||||
new StatementAPIPlugin();*/
|
||||
for(Block b : new Block[]{ ModBlocks.manaGlass, ModBlocks.elfGlass, ModBlocks.bifrostPerm })
|
||||
FMLInterModComms.sendMessage("chiselsandbits", "ignoreblocklogic", b.getRegistryName().toString());
|
||||
|
||||
if(Botania.thaumcraftLoaded) {
|
||||
if(ConfigHandler.enableThaumcraftAspects) {
|
||||
MinecraftForge.EVENT_BUS.register(TCAspects.class);
|
||||
}
|
||||
ModBrews.initTC();
|
||||
ModBrewRecipes.initTC();
|
||||
}
|
||||
|
||||
if(Botania.bcApiLoaded)
|
||||
new StatementAPIPlugin();
|
||||
proxy.init(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
if(Botania.thaumcraftLoaded) {
|
||||
ModBrews.initTC();
|
||||
ModBrewRecipes.initTC();
|
||||
try {
|
||||
@SuppressWarnings("unchecked")
|
||||
Class<? extends Entity> clazz = (Class<? extends Entity>) Class.forName("thaumcraft.common.lib.aura.EntityAuraNode");
|
||||
Class<? extends Entity> clazz = (Class<? extends Entity>) Class.forName("thaumcraft.common.entities.EntityFluxRift");
|
||||
BotaniaAPI.blacklistEntityFromGravityRod(clazz);
|
||||
} catch (ClassNotFoundException ignored) {}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ public class BlockAlfPortal extends BlockMod implements IWandable, ILexiconable
|
||||
@Override
|
||||
public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, BlockPos pos, EnumFacing side) {
|
||||
boolean did = ((TileAlfPortal) world.getTileEntity(pos)).onWanded();
|
||||
if(!world.isRemote && did) {
|
||||
if(!world.isRemote && did && player instanceof EntityPlayerMP) {
|
||||
AlfPortalTrigger.INSTANCE.trigger((EntityPlayerMP) player, (WorldServer) world, pos, stack);
|
||||
}
|
||||
return did;
|
||||
|
||||
@@ -88,7 +88,7 @@ public class BlockAltar extends BlockMod implements ILexiconable {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
public BlockRenderLayer getRenderLayer() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ public class BlockAltar extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity) {
|
||||
public void onEntityCollision(World world, BlockPos pos, IBlockState state, Entity entity) {
|
||||
if(!world.isRemote && entity instanceof EntityItem) {
|
||||
TileAltar tile = (TileAltar) world.getTileEntity(pos);
|
||||
if(tile.collideEntityItem((EntityItem) entity))
|
||||
|
||||
@@ -151,12 +151,12 @@ public class BlockAnimatedTorch extends BlockMod implements IWandable, IManaTrig
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockDestroyedByPlayer(World world, BlockPos pos, IBlockState state) {
|
||||
public void onPlayerDestroy(World world, BlockPos pos, IBlockState state) {
|
||||
// TE is already gone so best we can do is just notify everyone
|
||||
for(EnumFacing side : EnumFacing.VALUES) {
|
||||
world.notifyNeighborsOfStateChange(pos.offset(side), this, false);
|
||||
}
|
||||
super.onBlockDestroyedByPlayer(world, pos, state);
|
||||
super.onPlayerDestroy(world, pos, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -83,7 +83,7 @@ public class BlockAvatar extends BlockMod implements ILexiconable {
|
||||
if (meta < 2 || meta > 5) {
|
||||
meta = 2;
|
||||
}
|
||||
return getDefaultState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.getFront(meta));
|
||||
return getDefaultState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.byIndex(meta));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -72,7 +72,7 @@ public class BlockBifrostPerm extends BlockMod implements ILexiconable {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
public BlockRenderLayer getRenderLayer() {
|
||||
return BlockRenderLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ public class BlockCacophonium extends BlockMod {
|
||||
|
||||
@Override
|
||||
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block, BlockPos fromPos) {
|
||||
boolean power = world.isBlockIndirectlyGettingPowered(pos) > 0 || world.isBlockIndirectlyGettingPowered(pos.up()) > 0;
|
||||
boolean power = world.getRedstonePowerFromNeighbors(pos) > 0 || world.getRedstonePowerFromNeighbors(pos.up()) > 0;
|
||||
boolean powered = state.getValue(BotaniaStateProps.POWERED);
|
||||
|
||||
if(power && !powered) {
|
||||
|
||||
@@ -73,7 +73,7 @@ public class BlockCocoon extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity e) {
|
||||
public void onEntityCollision(World world, BlockPos pos, IBlockState state, Entity e) {
|
||||
if(!world.isRemote && e instanceof EntityItem) {
|
||||
EntityItem item = (EntityItem) e;
|
||||
ItemStack stack = item.getItem();
|
||||
@@ -87,8 +87,6 @@ public class BlockCocoon extends BlockMod implements ILexiconable {
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing s, float xs, float ys, float zs) {
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
Item item = stack.getItem();
|
||||
|
||||
return addStack(world, pos, stack, player.capabilities.isCreativeMode);
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ public class BlockFelPumpkin extends BlockMod implements ILexiconable {
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return getDefaultState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.getHorizontal(meta));
|
||||
return getDefaultState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.byHorizontalIndex(meta));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -42,7 +42,7 @@ public class BlockGaiaHead extends BlockSkull implements IModelRegister {
|
||||
|
||||
public BlockGaiaHead() {
|
||||
setRegistryName(new ResourceLocation(LibMisc.MOD_ID, LibBlockNames.GAIA_HEAD));
|
||||
setUnlocalizedName(LibBlockNames.GAIA_HEAD);
|
||||
setTranslationKey(LibBlockNames.GAIA_HEAD);
|
||||
setHardness(1.0F);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public class BlockGhostRail extends BlockRailBase implements ILexiconable, IMode
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.RAIL_DIRECTION, EnumRailDirection.NORTH_SOUTH));
|
||||
setRegistryName(new ResourceLocation(LibMisc.MOD_ID, LibBlockNames.GHOST_RAIL));
|
||||
setUnlocalizedName(LibBlockNames.GHOST_RAIL);
|
||||
setTranslationKey(LibBlockNames.GHOST_RAIL);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -66,7 +66,7 @@ public class BlockIncensePlate extends BlockMod implements ILexiconable {
|
||||
if (meta < 2 || meta > 5) {
|
||||
meta = 2;
|
||||
}
|
||||
return getDefaultState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.getFront(meta));
|
||||
return getDefaultState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.byIndex(meta));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -89,7 +89,7 @@ public class BlockLightLauncher extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block, BlockPos fromPos) {
|
||||
boolean power = world.isBlockIndirectlyGettingPowered(pos) > 0|| world.isBlockIndirectlyGettingPowered(pos.up()) > 0;
|
||||
boolean power = world.getRedstonePowerFromNeighbors(pos) > 0|| world.getRedstonePowerFromNeighbors(pos.up()) > 0;
|
||||
boolean powered = state.getValue(BotaniaStateProps.POWERED);
|
||||
|
||||
if(power && !powered) {
|
||||
|
||||
@@ -30,7 +30,7 @@ public abstract class BlockMod extends Block implements IModelRegister {
|
||||
|
||||
public BlockMod(Material par2Material, String name) {
|
||||
super(par2Material);
|
||||
setUnlocalizedName(name);
|
||||
setTranslationKey(name);
|
||||
setRegistryName(new ResourceLocation(LibMisc.MOD_ID, name));
|
||||
if(registerInCreative())
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
|
||||
@@ -63,7 +63,7 @@ public abstract class BlockModDoubleFlower extends BlockDoublePlant implements I
|
||||
String name = LibBlockNames.DOUBLE_FLOWER + (second ? 2 : 1);
|
||||
setDefaultState(pickDefaultState());
|
||||
setRegistryName(new ResourceLocation(LibMisc.MOD_ID, name));
|
||||
setUnlocalizedName(name);
|
||||
setTranslationKey(name);
|
||||
setHardness(0F);
|
||||
setTickRandomly(false);
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
|
||||
@@ -26,6 +26,7 @@ import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
@@ -55,7 +56,7 @@ public class BlockModFlower extends BlockFlower implements ILexiconable, IGrowab
|
||||
}
|
||||
|
||||
protected BlockModFlower(String name) {
|
||||
setUnlocalizedName(name);
|
||||
setTranslationKey(name);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE).withProperty(type, EnumFlowerType.POPPY));
|
||||
setRegistryName(new ResourceLocation(LibMisc.MOD_ID, name));
|
||||
setHardness(0F);
|
||||
@@ -124,9 +125,13 @@ public class BlockModFlower extends BlockFlower implements ILexiconable, IGrowab
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = hex & 0xFF;
|
||||
Vec3d offset = state.getOffset(world, pos);
|
||||
double x = pos.getX() + offset.x;
|
||||
double y = pos.getY() + offset.y;
|
||||
double z = pos.getZ() + offset.z;
|
||||
|
||||
if(rand.nextDouble() < ConfigHandler.flowerParticleFrequency)
|
||||
Botania.proxy.sparkleFX(pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5);
|
||||
Botania.proxy.sparkleFX(x + 0.3 + rand.nextFloat() * 0.5, y + 0.5 + rand.nextFloat() * 0.5, z + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -221,7 +221,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
|
||||
world.setBlockState(pos.offset(dir), ModBlocks.pistonRelay.getDefaultState());
|
||||
else if(!world.isRemote) {
|
||||
ItemStack stack = new ItemStack(ModBlocks.pistonRelay);
|
||||
world.spawnEntity(new EntityItem(world, x + dir.getFrontOffsetX(), y + dir.getFrontOffsetY(), z + dir.getFrontOffsetZ(), stack));
|
||||
world.spawnEntity(new EntityItem(world, x + dir.getXOffset(), y + dir.getYOffset(), z + dir.getZOffset(), stack));
|
||||
}
|
||||
checkedCoords.add(s);
|
||||
newPos = new DimWithPos(world.provider.getDimension(), pos.offset(dir));
|
||||
@@ -237,7 +237,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
|
||||
TileEntity tile = world.getTileEntity(pos2);
|
||||
Material mat = srcState.getMaterial();
|
||||
|
||||
if(!sticky && tile == null && mat.getMobilityFlag() == EnumPushReaction.NORMAL && srcState.getBlockHardness(world, pos2) != -1 && !srcState.getBlock().isAir(srcState, world, pos2)) {
|
||||
if(!sticky && tile == null && mat.getPushReaction() == EnumPushReaction.NORMAL && srcState.getBlockHardness(world, pos2) != -1 && !srcState.getBlock().isAir(srcState, world, pos2)) {
|
||||
Material destMat = world.getBlockState(pos2.offset(dir)).getMaterial();
|
||||
if(world.isAirBlock(pos2.offset(dir)) || destMat.isReplaceable()) {
|
||||
world.setBlockState(pos2, Blocks.AIR.getDefaultState());
|
||||
|
||||
@@ -35,7 +35,7 @@ public class BlockSolidVines extends BlockVine implements ILexiconable {
|
||||
|
||||
public BlockSolidVines() {
|
||||
setRegistryName(new ResourceLocation(LibMisc.MOD_ID, LibBlockNames.SOLID_VINE));
|
||||
setUnlocalizedName(LibBlockNames.SOLID_VINE);
|
||||
setTranslationKey(LibBlockNames.SOLID_VINE);
|
||||
setHardness(0.5F);
|
||||
setSoundType(SoundType.PLANT);
|
||||
setCreativeTab(null);
|
||||
|
||||
@@ -91,7 +91,7 @@ public class BlockSparkChanger extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block, BlockPos fromPos) {
|
||||
boolean power = world.isBlockIndirectlyGettingPowered(pos) > 0 || world.isBlockIndirectlyGettingPowered(pos.up()) > 0;
|
||||
boolean power = world.getRedstonePowerFromNeighbors(pos) > 0 || world.getRedstonePowerFromNeighbors(pos.up()) > 0;
|
||||
boolean powered = state.getValue(BotaniaStateProps.POWERED);
|
||||
|
||||
if(power && !powered) {
|
||||
|
||||
@@ -122,7 +122,7 @@ public class BlockSpecialFlower extends BlockFlower implements ISpecialFlower, I
|
||||
protected BlockSpecialFlower() {
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE).withProperty(type, EnumFlowerType.POPPY));
|
||||
setRegistryName(new ResourceLocation(LibMisc.MOD_ID, LibBlockNames.SPECIAL_FLOWER));
|
||||
setUnlocalizedName(LibBlockNames.SPECIAL_FLOWER);
|
||||
setTranslationKey(LibBlockNames.SPECIAL_FLOWER);
|
||||
setHardness(0.1F);
|
||||
setSoundType(SoundType.PLANT);
|
||||
setTickRandomly(false);
|
||||
|
||||
@@ -54,7 +54,7 @@ public class BlockTeruTeruBozu extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity e) {
|
||||
public void onEntityCollision(World world, BlockPos pos, IBlockState state, Entity e) {
|
||||
if(!world.isRemote && e instanceof EntityItem) {
|
||||
EntityItem item = (EntityItem) e;
|
||||
ItemStack stack = item.getItem();
|
||||
|
||||
@@ -33,20 +33,7 @@ import vazkii.botania.common.block.corporea.BlockCorporeaFunnel;
|
||||
import vazkii.botania.common.block.corporea.BlockCorporeaIndex;
|
||||
import vazkii.botania.common.block.corporea.BlockCorporeaInterceptor;
|
||||
import vazkii.botania.common.block.corporea.BlockCorporeaRetainer;
|
||||
import vazkii.botania.common.block.decor.BlockBlaze;
|
||||
import vazkii.botania.common.block.decor.BlockBuriedPetals;
|
||||
import vazkii.botania.common.block.decor.BlockAzulejo;
|
||||
import vazkii.botania.common.block.decor.BlockElfGlass;
|
||||
import vazkii.botania.common.block.decor.BlockFloatingFlower;
|
||||
import vazkii.botania.common.block.decor.BlockManaFlame;
|
||||
import vazkii.botania.common.block.decor.BlockManaGlass;
|
||||
import vazkii.botania.common.block.decor.BlockModMushroom;
|
||||
import vazkii.botania.common.block.decor.BlockPetalBlock;
|
||||
import vazkii.botania.common.block.decor.BlockShimmerrock;
|
||||
import vazkii.botania.common.block.decor.BlockShimmerwoodPlanks;
|
||||
import vazkii.botania.common.block.decor.BlockShinyFlower;
|
||||
import vazkii.botania.common.block.decor.BlockStarfield;
|
||||
import vazkii.botania.common.block.decor.BlockTinyPotato;
|
||||
import vazkii.botania.common.block.decor.*;
|
||||
import vazkii.botania.common.block.dispenser.BehaviourFelPumpkin;
|
||||
import vazkii.botania.common.block.dispenser.BehaviourPoolMinecart;
|
||||
import vazkii.botania.common.block.dispenser.BehaviourWand;
|
||||
@@ -538,7 +525,7 @@ public final class ModBlocks {
|
||||
r.register(new ItemBlockMod(pump).setRegistryName(pump.getRegistryName()));
|
||||
r.register(new ItemBlockWithMetadataAndName(doubleFlower1).setRegistryName(doubleFlower1.getRegistryName()));
|
||||
r.register(new ItemBlockWithMetadataAndName(doubleFlower2).setRegistryName(doubleFlower2.getRegistryName()));
|
||||
r.register(new ItemBlockMod(blazeBlock).setRegistryName(blazeBlock.getRegistryName()));
|
||||
r.register(new ItemBlockBlaze(blazeBlock).setRegistryName(blazeBlock.getRegistryName()));
|
||||
r.register(new ItemBlockMod(corporeaInterceptor).setRegistryName(corporeaInterceptor.getRegistryName()));
|
||||
r.register(new ItemBlockMod(corporeaCrystalCube).setRegistryName(corporeaCrystalCube.getRegistryName()));
|
||||
r.register(new ItemBlockMod(incensePlate).setRegistryName(incensePlate.getRegistryName()));
|
||||
@@ -714,7 +701,7 @@ public final class ModBlocks {
|
||||
|
||||
for(Class innerClazz : clazz.getDeclaredClasses())
|
||||
if(innerClazz.getSimpleName().equals("Mini"))
|
||||
BotaniaAPI.registerMiniSubTile(new ResourceLocation(key.getResourceDomain(), key.getResourcePath() + "Chibi"), innerClazz, key);
|
||||
BotaniaAPI.registerMiniSubTile(new ResourceLocation(key.getNamespace(), key.getPath() + "Chibi"), innerClazz, key);
|
||||
}
|
||||
|
||||
private static void registerTile(Class<? extends TileEntity> clazz, String key) {
|
||||
|
||||
@@ -128,7 +128,7 @@ public class BlockCorporeaCrystalCube extends BlockCorporeaBase implements ILexi
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) {
|
||||
return ((TileCorporeaCrystalCube) world.getTileEntity(pos)).compValue;
|
||||
return ((TileCorporeaCrystalCube) world.getTileEntity(pos)).getComparatorValue();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -57,7 +57,7 @@ public class BlockCorporeaFunnel extends BlockCorporeaBase implements ILexiconab
|
||||
|
||||
@Override
|
||||
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block, BlockPos fromPos) {
|
||||
boolean power = world.isBlockIndirectlyGettingPowered(pos) > 0 || world.isBlockIndirectlyGettingPowered(pos.up()) > 0;
|
||||
boolean power = world.getRedstonePowerFromNeighbors(pos) > 0 || world.getRedstonePowerFromNeighbors(pos.up()) > 0;
|
||||
boolean powered = state.getValue(BotaniaStateProps.POWERED);
|
||||
|
||||
if(power && !powered) {
|
||||
|
||||
@@ -58,7 +58,7 @@ public class BlockCorporeaRetainer extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block, BlockPos fromPos) {
|
||||
boolean power = world.isBlockIndirectlyGettingPowered(pos) > 0 || world.isBlockIndirectlyGettingPowered(pos.up()) > 0;
|
||||
boolean power = world.getRedstonePowerFromNeighbors(pos) > 0 || world.getRedstonePowerFromNeighbors(pos.up()) > 0;
|
||||
boolean powered = state.getValue(BotaniaStateProps.POWERED);
|
||||
|
||||
if(power && !powered) {
|
||||
@@ -75,7 +75,7 @@ public class BlockCorporeaRetainer extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) {
|
||||
return ((TileCorporeaRetainer) world.getTileEntity(pos)).hasPendingRequest() ? 15 : 0;
|
||||
return ((TileCorporeaRetainer) world.getTileEntity(pos)).getComparatorValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,22 +13,16 @@ package vazkii.botania.common.block.decor;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.IFuelHandler;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.BlockMod;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class BlockBlaze extends BlockMod implements ILexiconable, IFuelHandler {
|
||||
public class BlockBlaze extends BlockMod implements ILexiconable {
|
||||
|
||||
public BlockBlaze() {
|
||||
super(Material.IRON, LibBlockNames.BLAZE_BLOCK);
|
||||
@@ -36,17 +30,10 @@ public class BlockBlaze extends BlockMod implements ILexiconable, IFuelHandler {
|
||||
setResistance(10F);
|
||||
setSoundType(SoundType.METAL);
|
||||
setLightLevel(1F);
|
||||
GameRegistry.registerFuelHandler(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) {
|
||||
return LexiconData.blazeBlock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBurnTime(ItemStack fuel) {
|
||||
return fuel.getItem() == Item.getItemFromBlock(this) ? TileEntityFurnace.getItemBurnTime(new ItemStack(Items.BLAZE_ROD)) * (Botania.gardenOfGlassLoaded ? 5 : 10) : 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -92,8 +92,9 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable, IInfu
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
public BlockRenderLayer getRenderLayer() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,12 +31,12 @@ import net.minecraftforge.fml.common.Optional;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.BlockMod;
|
||||
import vazkii.botania.common.block.tile.TileManaFlame;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.world.WorldTypeSkyblock;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Random;
|
||||
@@ -98,7 +98,7 @@ public class BlockManaFlame extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing s, float xs, float ys, float zs) {
|
||||
if(WorldTypeSkyblock.isWorldSkyblock(world)) {
|
||||
if(Botania.gardenOfGlassLoaded) {
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
if(!stack.isEmpty() && stack.getItem() == Item.getItemFromBlock(Blocks.SAPLING) && !player.inventory.hasItemStack(new ItemStack(ModItems.lexicon))) {
|
||||
if(!world.isRemote) {
|
||||
|
||||
@@ -64,7 +64,7 @@ public class BlockManaGlass extends BlockMod implements ILexiconable {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
public BlockRenderLayer getRenderLayer() {
|
||||
return BlockRenderLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ public class BlockModMushroom extends BlockMushroom implements IInfusionStabilis
|
||||
|
||||
public BlockModMushroom() {
|
||||
setRegistryName(new ResourceLocation(LibMisc.MOD_ID, LibBlockNames.MUSHROOM));
|
||||
setUnlocalizedName(LibBlockNames.MUSHROOM);
|
||||
setTranslationKey(LibBlockNames.MUSHROOM);
|
||||
setLightLevel(0.2F);
|
||||
setHardness(0F);
|
||||
setSoundType(SoundType.PLANT);
|
||||
@@ -162,11 +162,6 @@ public class BlockModMushroom extends BlockMushroom implements IInfusionStabilis
|
||||
ModelHandler.registerCustomItemblock(this, EnumDyeColor.values().length, i -> "mushroom_" + EnumDyeColor.byMetadata(i).getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFit(ItemStack stack, IPetalApothecary apothecary) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getParticleColor(ItemStack stack) {
|
||||
return EnumDyeColor.byMetadata(stack.getItemDamage()).colorValue;
|
||||
|
||||
@@ -57,7 +57,7 @@ public class BlockStarfield extends BlockMod implements ILexiconable {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
public BlockRenderLayer getRenderLayer() {
|
||||
return BlockRenderLayer.CUTOUT_MIPPED;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package vazkii.botania.common.block.decor;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.item.block.ItemBlockMod;
|
||||
|
||||
public class ItemBlockBlaze extends ItemBlockMod {
|
||||
public ItemBlockBlaze(Block block) {
|
||||
super(block);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemBurnTime(ItemStack stack) {
|
||||
return TileEntityFurnace.getItemBurnTime(new ItemStack(Items.BLAZE_ROD))
|
||||
* (Botania.gardenOfGlassLoaded ? 5 : 10);
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,10 @@ package vazkii.botania.common.block.decor.biomestone;
|
||||
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
@@ -49,12 +53,9 @@ public class BlockBiomeStoneA extends BlockBiomeStone {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState state) {
|
||||
int meta = getMetaFromState(state);
|
||||
if (meta < 8) {
|
||||
meta += 8; // Drop cobblestone variant
|
||||
}
|
||||
return meta;
|
||||
public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
int cobbleMeta = getMetaFromState(state) | 0x8;
|
||||
drops.add(new ItemStack(this, 1, cobbleMeta));
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -27,7 +27,7 @@ public class BlockAlfglassPane extends BlockModPane {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
public BlockRenderLayer getRenderLayer() {
|
||||
return BlockRenderLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ public class BlockBifrostPane extends BlockModPane {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
public BlockRenderLayer getRenderLayer() {
|
||||
return BlockRenderLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ public class BlockManaglassPane extends BlockModPane {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
public BlockRenderLayer getRenderLayer() {
|
||||
return BlockRenderLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,9 +30,9 @@ public class BlockModPane extends BlockPane implements IModelRegister {
|
||||
public BlockModPane(Block source) {
|
||||
super(Material.GLASS, false);
|
||||
// Backward compat don't kill me
|
||||
String name = source.getUnlocalizedName().replaceAll("tile.", "") + "Pane";
|
||||
String name = source.getTranslationKey().replaceAll("tile.", "") + "Pane";
|
||||
setRegistryName(new ResourceLocation(LibMisc.MOD_ID, name));
|
||||
setUnlocalizedName(name);
|
||||
setTranslationKey(name);
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
setHardness(0.3F);
|
||||
setSoundType(SoundType.GLASS);
|
||||
|
||||
@@ -7,7 +7,7 @@ public abstract class BlockLivingSlab extends BlockModSlab {
|
||||
final IBlockState sourceState;
|
||||
|
||||
public BlockLivingSlab(boolean full, IBlockState state) {
|
||||
super(full, state.getMaterial(), state.getBlock().getUnlocalizedName().replaceAll("tile.", "") + state.getBlock().getMetaFromState(state) + "Slab" + (full ? "Full" : ""));
|
||||
super(full, state.getMaterial(), state.getBlock().getTranslationKey().replaceAll("tile.", "") + state.getBlock().getMetaFromState(state) + "Slab" + (full ? "Full" : ""));
|
||||
setSoundType(state.getBlock().getSoundType());
|
||||
sourceState = state;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public abstract class BlockModSlab extends BlockSlab implements ILexiconable, IM
|
||||
public BlockModSlab(boolean full, Material mat, String name) {
|
||||
super(mat);
|
||||
this.name = name;
|
||||
setUnlocalizedName(name);
|
||||
setTranslationKey(name);
|
||||
setRegistryName(new ResourceLocation(LibMisc.MOD_ID, name));
|
||||
doubleSlab = full;
|
||||
if(!full) {
|
||||
@@ -101,7 +101,7 @@ public abstract class BlockModSlab extends BlockSlab implements ILexiconable, IM
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUnlocalizedName(int i) {
|
||||
public String getTranslationKey(int i) {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import net.minecraft.block.state.IBlockState;
|
||||
public class BlockLivingStairs extends BlockModStairs {
|
||||
|
||||
public BlockLivingStairs(IBlockState state) {
|
||||
super(state, state.getBlock().getUnlocalizedName().replaceAll("tile.", "") + state.getBlock().getMetaFromState(state) + "Stairs");
|
||||
super(state, state.getBlock().getTranslationKey().replaceAll("tile.", "") + state.getBlock().getMetaFromState(state) + "Stairs");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -24,7 +24,7 @@ public class BlockModStairs extends BlockStairs implements ILexiconable, IModelR
|
||||
public BlockModStairs(IBlockState state, String name) {
|
||||
super(state);
|
||||
setRegistryName(new ResourceLocation(LibMisc.MOD_ID, name));
|
||||
setUnlocalizedName(name);
|
||||
setTranslationKey(name);
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
useNeighborBrightness = true;
|
||||
}
|
||||
|
||||
@@ -38,9 +38,9 @@ public abstract class BlockModWall extends BlockWall implements ILexiconable, IM
|
||||
public BlockModWall(Block block, int meta) {
|
||||
super(block);
|
||||
// For backward compat don't kill me
|
||||
String name = block.getUnlocalizedName().replaceAll("tile.", "") + meta + "Wall";
|
||||
String name = block.getTranslationKey().replaceAll("tile.", "") + meta + "Wall";
|
||||
setRegistryName(name);
|
||||
setUnlocalizedName(name);
|
||||
setTranslationKey(name);
|
||||
setDefaultState(pickDefaultState());
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
}
|
||||
|
||||
@@ -32,9 +32,9 @@ public class BehaviourPoolMinecart extends BehaviorDefaultDispenseItem {
|
||||
public ItemStack dispenseStack(IBlockSource source, ItemStack stack) {
|
||||
World world = source.getWorld();
|
||||
EnumFacing enumfacing = world.getBlockState(source.getBlockPos()).getValue(BlockDispenser.FACING);
|
||||
double d0 = source.getX() + enumfacing.getFrontOffsetX() * 1.125F;
|
||||
double d1 = source.getY() + enumfacing.getFrontOffsetY() * 1.125F;
|
||||
double d2 = source.getZ() + enumfacing.getFrontOffsetZ() * 1.125F;
|
||||
double d0 = source.getX() + enumfacing.getXOffset() * 1.125F;
|
||||
double d1 = source.getY() + enumfacing.getYOffset() * 1.125F;
|
||||
double d2 = source.getZ() + enumfacing.getZOffset() * 1.125F;
|
||||
BlockPos pos = source.getBlockPos().offset(enumfacing);
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
double d3;
|
||||
|
||||
@@ -72,7 +72,7 @@ public class BlockBellows extends BlockMod implements ILexiconable {
|
||||
if (meta < 2 || meta > 5) {
|
||||
meta = 2;
|
||||
}
|
||||
return getDefaultState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.getFront(meta));
|
||||
return getDefaultState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.byIndex(meta));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -87,8 +87,10 @@ public class BlockBrewery extends BlockMod implements ILexiconable, IWandHUD {
|
||||
TileBrewery brew = (TileBrewery) world.getTileEntity(pos);
|
||||
|
||||
if(player.isSneaking()) {
|
||||
if(brew.recipe == null && !state.getValue(BotaniaStateProps.POWERED))
|
||||
if(brew.recipe == null && !state.getValue(BotaniaStateProps.POWERED)) {
|
||||
InventoryHelper.withdrawFromInventory(brew, player);
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
if(!stack.isEmpty())
|
||||
|
||||
@@ -138,10 +138,10 @@ public class BlockPool extends BlockMod implements IWandHUD, IWandable, ILexicon
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity par5Entity) {
|
||||
if(par5Entity instanceof EntityItem) {
|
||||
public void onEntityCollision(World world, BlockPos pos, IBlockState state, Entity entity) {
|
||||
if(entity instanceof EntityItem) {
|
||||
TilePool tile = (TilePool) world.getTileEntity(pos);
|
||||
if(tile.collideEntityItem((EntityItem) par5Entity))
|
||||
if(tile.collideEntityItem((EntityItem) entity))
|
||||
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class BlockPrism extends BlockMod implements IManaTrigger, ILexiconable,
|
||||
@Nonnull
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
public BlockRenderLayer getRenderLayer() {
|
||||
return BlockRenderLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ public class BlockPrism extends BlockMod implements IManaTrigger, ILexiconable,
|
||||
|
||||
@Override
|
||||
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block, BlockPos fromPos) {
|
||||
boolean power = world.isBlockIndirectlyGettingPowered(pos) > 0 || world.isBlockIndirectlyGettingPowered(pos.up()) > 0;
|
||||
boolean power = world.getRedstonePowerFromNeighbors(pos) > 0 || world.getRedstonePowerFromNeighbors(pos.up()) > 0;
|
||||
boolean powered = state.getValue(BotaniaStateProps.POWERED);
|
||||
|
||||
if(!world.isRemote) {
|
||||
|
||||
@@ -77,7 +77,7 @@ public class BlockPump extends BlockMod implements ILexiconable {
|
||||
if (meta < 2 || meta > 5) {
|
||||
meta = 2;
|
||||
}
|
||||
return getDefaultState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.getFront(meta));
|
||||
return getDefaultState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.byIndex(meta));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -60,7 +60,7 @@ public abstract class BlockRedString extends BlockMod implements ILexiconable {
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return getDefaultState().withProperty(BotaniaStateProps.FACING, EnumFacing.getFront(meta));
|
||||
return getDefaultState().withProperty(BotaniaStateProps.FACING, EnumFacing.byIndex(meta));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -56,13 +56,13 @@ public class BlockRedStringDispenser extends BlockRedString {
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
boolean powered = (meta & 8) != 0;
|
||||
meta &= -9;
|
||||
EnumFacing facing = EnumFacing.getFront(meta);
|
||||
EnumFacing facing = EnumFacing.byIndex(meta);
|
||||
return getDefaultState().withProperty(BotaniaStateProps.FACING, facing).withProperty(BotaniaStateProps.POWERED, powered);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block, BlockPos fromPos) {
|
||||
boolean power = world.isBlockIndirectlyGettingPowered(pos) > 0 || world.isBlockIndirectlyGettingPowered(pos.up()) > 0;
|
||||
boolean power = world.getRedstonePowerFromNeighbors(pos) > 0 || world.getRedstonePowerFromNeighbors(pos.up()) > 0;
|
||||
boolean powered = state.getValue(BotaniaStateProps.POWERED);
|
||||
|
||||
if(power && !powered) {
|
||||
|
||||
@@ -63,7 +63,7 @@ public class BlockRedStringInterceptor extends BlockRedString {
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
boolean powered = (meta & 8) != 0;
|
||||
meta &= -9;
|
||||
EnumFacing facing = EnumFacing.getFront(meta);
|
||||
EnumFacing facing = EnumFacing.byIndex(meta);
|
||||
return getDefaultState().withProperty(BotaniaStateProps.FACING, facing).withProperty(BotaniaStateProps.POWERED, powered);
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,9 @@ public class SubTilePureDaisy extends SubTileEntity {
|
||||
BlockPos coords = supertile.getPos().add(acoords);
|
||||
World world = supertile.getWorld();
|
||||
if(!world.isAirBlock(coords)) {
|
||||
world.profiler.startSection("findRecipe");
|
||||
RecipePureDaisy recipe = findRecipe(coords);
|
||||
world.profiler.endSection();
|
||||
|
||||
if(recipe != null) {
|
||||
if (ticksRemaining[positionAt] == -1)
|
||||
|
||||
@@ -41,7 +41,7 @@ public class SubTileDaffomill extends SubTileFunctional {
|
||||
super.onUpdate();
|
||||
|
||||
if(supertile.getWorld().rand.nextInt(4) == 0)
|
||||
Botania.proxy.wispFX(supertile.getPos().getX() + Math.random(), supertile.getPos().getY() + Math.random(), supertile.getPos().getZ() + Math.random(), 0.05F, 0.05F, 0.05F, 0.25F + (float) Math.random() * 0.15F, orientation.getFrontOffsetX() * 0.1F, orientation.getFrontOffsetY() * 0.1F, orientation.getFrontOffsetZ() * 0.1F);
|
||||
Botania.proxy.wispFX(supertile.getPos().getX() + Math.random(), supertile.getPos().getY() + Math.random(), supertile.getPos().getZ() + Math.random(), 0.05F, 0.05F, 0.05F, 0.25F + (float) Math.random() * 0.15F, orientation.getXOffset() * 0.1F, orientation.getYOffset() * 0.1F, orientation.getZOffset() * 0.1F);
|
||||
|
||||
if(windTicks == 0 && mana > 0) {
|
||||
windTicks = 20;
|
||||
@@ -56,9 +56,9 @@ public class SubTileDaffomill extends SubTileFunctional {
|
||||
int slowdown = getSlowdownFactor();
|
||||
for(EntityItem item : items) {
|
||||
if(!item.isDead && item.age >= slowdown) {
|
||||
item.motionX += orientation.getFrontOffsetX() * 0.05;
|
||||
item.motionY += orientation.getFrontOffsetY() * 0.05;
|
||||
item.motionZ += orientation.getFrontOffsetZ() * 0.05;
|
||||
item.motionX += orientation.getXOffset() * 0.05;
|
||||
item.motionY += orientation.getYOffset() * 0.05;
|
||||
item.motionZ += orientation.getZOffset() * 0.05;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -154,7 +154,7 @@ public class SubTileDaffomill extends SubTileFunctional {
|
||||
public void readFromPacketNBT(NBTTagCompound cmp) {
|
||||
super.readFromPacketNBT(cmp);
|
||||
|
||||
orientation = EnumFacing.getFront(cmp.getInteger(TAG_ORIENTATION) + 2); // retain compat with 1.7 saves
|
||||
orientation = EnumFacing.byIndex(cmp.getInteger(TAG_ORIENTATION) + 2); // retain compat with 1.7 saves
|
||||
windTicks = cmp.getInteger(TAG_WIND_TICKS);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ public class SubTileFallenKanade extends SubTileFunctional {
|
||||
List<EntityPlayer> players = supertile.getWorld().getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1)));
|
||||
for(EntityPlayer player : players) {
|
||||
if(player.getActivePotionEffect(MobEffects.REGENERATION) == null && mana >= COST) {
|
||||
player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 60, 2, true, true));
|
||||
player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 59, 2, true, true));
|
||||
mana -= COST;
|
||||
did = true;
|
||||
}
|
||||
|
||||
+15
-16
@@ -15,6 +15,8 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.EntityAIAttackMelee;
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
import net.minecraft.entity.ai.EntityAIHurtByTarget;
|
||||
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
|
||||
import net.minecraft.entity.ai.EntityAITasks.EntityAITaskEntry;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
@@ -62,36 +64,33 @@ public class SubTileHeiseiDream extends SubTileFunctional {
|
||||
EntityLivingBase target = entity.getAttackTarget();
|
||||
boolean did = false;
|
||||
|
||||
if(target == null || !(target instanceof IMob)) {
|
||||
if(!(target instanceof IMob)) {
|
||||
IMob newTarget;
|
||||
do newTarget = mobs.get(entity.world.rand.nextInt(mobs.size()));
|
||||
while(newTarget == entity);
|
||||
|
||||
if(newTarget instanceof EntityLiving) {
|
||||
List<EntityAITaskEntry> entries = new ArrayList<>(entity.tasks.taskEntries);
|
||||
entries.addAll(new ArrayList<>(entity.targetTasks.taskEntries));
|
||||
entity.setAttackTarget(null);
|
||||
|
||||
for(EntityAITaskEntry entry : entries)
|
||||
if(entry.action instanceof EntityAINearestAttackableTarget) {
|
||||
messWithGetTargetAI((EntityAINearestAttackableTarget) entry.action, (EntityLiving) newTarget);
|
||||
did = true;
|
||||
} else if(entry.action instanceof EntityAIAttackMelee) {
|
||||
did = true;
|
||||
// Move any EntityAIHurtByTarget to highest priority
|
||||
for (EntityAITaskEntry entry : entity.targetTasks.taskEntries) {
|
||||
if (entry.action instanceof EntityAIHurtByTarget) {
|
||||
// Concurrent modification OK since we break out of the loop
|
||||
entity.targetTasks.removeTask(entry.action);
|
||||
entity.targetTasks.addTask(-1, entry.action);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(did)
|
||||
entity.setAttackTarget((EntityLiving) newTarget);
|
||||
// Now set revenge target, which EntityAIHurtByTarget will pick up
|
||||
entity.setRevengeTarget((EntityLiving) newTarget);
|
||||
did = true;
|
||||
}
|
||||
}
|
||||
|
||||
return did;
|
||||
}
|
||||
|
||||
private static void messWithGetTargetAI(EntityAINearestAttackableTarget aiEntry, EntityLivingBase target) {
|
||||
aiEntry.targetClass = Entity.class;
|
||||
aiEntry.targetEntitySelector = e -> e == target; // todo will this leak target?
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toBlockPos(), RANGE);
|
||||
|
||||
@@ -84,7 +84,7 @@ public class SubTileHopperhock extends SubTileFunctional {
|
||||
List<ItemStack> filter = getFilterForInventory(pos_, true);
|
||||
boolean canAccept = canAcceptItem(stack, filter, filterType);
|
||||
|
||||
ItemStack simulate = ItemHandlerHelper.insertItem(inv.handler, stack.copy(), true);
|
||||
ItemStack simulate = ItemHandlerHelper.insertItem(inv.handler, stack, true);
|
||||
int availablePut = stack.getCount() - simulate.getCount();
|
||||
|
||||
canAccept &= availablePut > 0;
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.subtile.functional;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockStone;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.state.pattern.BlockStateMatcher;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -105,10 +107,9 @@ public class SubTileOrechid extends SubTileFunctional {
|
||||
private BlockPos getCoordsToPut() {
|
||||
List<BlockPos> possibleCoords = new ArrayList<>();
|
||||
|
||||
Block source = getSourceBlock();
|
||||
for(BlockPos pos : BlockPos.getAllInBox(getPos().add(-RANGE, -RANGE_Y, -RANGE), getPos().add(RANGE, RANGE_Y, RANGE))) {
|
||||
IBlockState state = supertile.getWorld().getBlockState(pos);
|
||||
if(state.getBlock().isReplaceableOreGen(state, supertile.getWorld(), pos, BlockStateMatcher.forBlock(source)))
|
||||
if(state.getBlock().isReplaceableOreGen(state, supertile.getWorld(), pos, getReplaceMatcher()))
|
||||
possibleCoords.add(pos);
|
||||
}
|
||||
|
||||
@@ -125,8 +126,8 @@ public class SubTileOrechid extends SubTileFunctional {
|
||||
return BotaniaAPI.oreWeights;
|
||||
}
|
||||
|
||||
public Block getSourceBlock() {
|
||||
return Blocks.STONE;
|
||||
public Predicate<IBlockState> getReplaceMatcher() {
|
||||
return state -> state.getBlock() == Blocks.STONE && state.getValue(BlockStone.VARIANT) == BlockStone.EnumType.STONE;
|
||||
}
|
||||
|
||||
public int getCost() {
|
||||
|
||||
+5
-3
@@ -10,7 +10,9 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.subtile.functional;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.init.Blocks;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
@@ -24,7 +26,7 @@ public class SubTileOrechidIgnem extends SubTileOrechid {
|
||||
|
||||
@Override
|
||||
public boolean canOperate() {
|
||||
return supertile.getWorld().provider.doesWaterVaporize();
|
||||
return supertile.getWorld().provider.isNether();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -33,8 +35,8 @@ public class SubTileOrechidIgnem extends SubTileOrechid {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getSourceBlock() {
|
||||
return Blocks.NETHERRACK;
|
||||
public Predicate<IBlockState> getReplaceMatcher() {
|
||||
return state -> state.getBlock() == Blocks.NETHERRACK;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -46,7 +46,7 @@ public class SubTileEndoflame extends SubTileGenerating {
|
||||
|
||||
if(getWorld().isRemote) {
|
||||
if(burnTime > 0 && supertile.getWorld().rand.nextInt(10) == 0) {
|
||||
Vec3d offset = getWorld().getBlockState(getPos()).getOffset(getWorld(), getPos()).addVector(0.4, 0.7, 0.4);
|
||||
Vec3d offset = getWorld().getBlockState(getPos()).getOffset(getWorld(), getPos()).add(0.4, 0.7, 0.4);
|
||||
supertile.getWorld().spawnParticle(EnumParticleTypes.FLAME, supertile.getPos().getX() + offset.x + Math.random() * 0.2, supertile.getPos().getY() + offset.y, supertile.getPos().getZ() + offset.z + Math.random() * 0.2, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -45,6 +45,7 @@ public class SubTileEntropinnyum extends SubTileGenerating {
|
||||
sync();
|
||||
|
||||
getWorld().addBlockEvent(getPos(), supertile.getBlockType(), EXPLODE_EFFECT_EVENT, tnt.getEntityId());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ public class SubTileGourmaryllis extends SubTileGenerating {
|
||||
} else if(cooldown % munchInterval == 0) {
|
||||
getWorld().playSound(null, supertile.getPos(), SoundEvents.ENTITY_GENERIC_EAT, SoundCategory.BLOCKS, 0.5f, 1);
|
||||
|
||||
Vec3d offset = getWorld().getBlockState(getPos()).getOffset(getWorld(), getPos()).addVector(0.4, 0.6, 0.4);
|
||||
Vec3d offset = getWorld().getBlockState(getPos()).getOffset(getWorld(), getPos()).add(0.4, 0.6, 0.4);
|
||||
|
||||
((WorldServer) supertile.getWorld()).spawnParticle(EnumParticleTypes.ITEM_CRACK, supertile.getPos().getX()+offset.x, supertile.getPos().getY()+offset.y, supertile.getPos().getZ()+offset.z, 10, 0.1D, 0.1D, 0.1D, 0.03D, Item.getIdFromItem(lastFood.getItem()), lastFood.getItemDamage());
|
||||
}
|
||||
|
||||
Loaded 100 of 254 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user