More cleaning

This commit is contained in:
Vincent Lee committed 2019-03-14 23:54:32 -05:00
1 parent db6da27ce1
commit 37c64a1688
14 files changed
+92 -185

No files matched your search

@@ -11,6 +11,7 @@
package vazkii.botania.api.item;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUseContext;
import net.minecraft.util.math.BlockPos;
import vazkii.botania.api.subtile.SubTileEntity;
@@ -20,15 +21,8 @@ import vazkii.botania.api.subtile.SubTileEntity;
public interface IFlowerPlaceable {
/**
* Gets the state to be placed, return null to not place anything.
* @param ctx The placement context, aiming downwards towards the downward neighbor position
* @return Whether the block was placed successfully
*/
public IBlockState getBlockToPlaceByFlower(ItemStack stack, SubTileEntity flower, BlockPos pos);
/**
* Called after the block is placed.
* @param stack The stack that was placed.
* @param flower The flower doing the placing.
* @param pos The position that was placed at.
*/
public void onBlockPlacedByFlower(ItemStack stack, SubTileEntity flower, BlockPos pos);
boolean tryPlace(SubTileEntity flower, ItemUseContext ctx);
}
@@ -17,7 +17,7 @@ import vazkii.botania.api.BotaniaAPI;
public class RecipeMiniFlower extends RecipeManaInfusion {
public RecipeMiniFlower(ResourceLocation flower, ResourceLocation mini, int mana) {
public RecipeMiniFlower(ResourceLocation mini, ResourceLocation flower, int mana) {
super(BotaniaAPI.internalHandler.getSubTileAsStack(flower), Ingredient.fromStacks(BotaniaAPI.internalHandler.getSubTileAsStack(mini)), mana);
setCatalyst(RecipeManaInfusion.alchemyState);
}
@@ -25,7 +25,7 @@ public class RecipeMiniFlower extends RecipeManaInfusion {
@Override
public boolean matches(ItemStack stack) {
ResourceLocation key = BotaniaAPI.internalHandler.getStackSubTileKey(stack);
ResourceLocation input = getInput() instanceof ResourceLocation ? (ResourceLocation) getInput() : BotaniaAPI.internalHandler.getStackSubTileKey((ItemStack) getInput());
ResourceLocation input = BotaniaAPI.internalHandler.getStackSubTileKey(getInput().getMatchingStacks()[0]);
return key != null && key.equals(input);
}
@@ -28,6 +28,7 @@ import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.config.ModConfig;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent;
import net.minecraftforge.fml.event.server.FMLServerAboutToStartEvent;
import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
import net.minecraftforge.fml.event.server.FMLServerStoppingEvent;
@@ -49,7 +50,6 @@ import vazkii.botania.common.brew.ModBrews;
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.ConfigHandler;
import vazkii.botania.common.core.handler.IMCHandler;
import vazkii.botania.common.core.handler.InternalMethodHandler;
@@ -89,7 +89,6 @@ import vazkii.botania.common.entity.EntityManaBurst;
import vazkii.botania.common.entity.EntityPinkWither;
import vazkii.botania.common.entity.EntitySignalFlare;
import vazkii.botania.common.entity.EntitySpark;
import vazkii.botania.common.entity.ModEntities;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibMisc;
import vazkii.botania.common.network.GuiHandler;
@@ -126,7 +125,6 @@ public class Botania {
private void commonSetup(FMLCommonSetupEvent event) {
gardenOfGlassLoaded = ModList.get().isLoaded("gardenofglass");
thaumcraftLoaded = ModList.get().isLoaded("thaumcraft");
bcApiLoaded = ModList.get().isLoaded("buildcraftlib");
bloodMagicLoaded = ModList.get().isLoaded("bloodmagic"); // Psh, noob
@@ -149,6 +147,14 @@ public class Botania {
ModCraftingRecipes.init();
LexiconData.init();
if(Botania.thaumcraftLoaded) {
if(ConfigHandler.COMMON.enableThaumcraftAspects.get()) {
// todo 1.13 MinecraftForge.EVENT_BUS.register(TCAspects.class);
}
ModBrews.initTC();
ModBrewRecipes.initTC();
}
MinecraftForge.EVENT_BUS.register(ManaNetworkHandler.instance);
MinecraftForge.EVENT_BUS.register(TileCorporeaIndex.getInputHandler());
MinecraftForge.EVENT_BUS.register(new LootHandler());
@@ -180,36 +186,29 @@ public class Botania {
RecipeSerializers.register(PhantomInkRecipe.SERIALIZER);
RecipeSerializers.register(SpellClothRecipe.SERIALIZER);
RecipeSerializers.register(TerraPickTippingRecipe.SERIALIZER);
ModBlocks.addDispenserBehaviours();
});
}
/* todo 1.13
public void init(FMLInitializationEvent event) {
NetworkRegistry.INSTANCE.registerGuiHandler(Botania.instance, new GuiHandler());
MinecraftForge.TERRAIN_GEN_BUS.register(BiomeDecorationHandler.class);
FMLInterModComms.sendMessage("projecte", "interdictionblacklist", EntityManaBurst.class.getCanonicalName());
for(Block b : new Block[]{ ModBlocks.manaGlass, ModBlocks.elfGlass, ModBlocks.bifrostPerm })
FMLInterModComms.sendMessage("chiselsandbits", "ignoreblocklogic", b.getRegistryName().toString());
if(Botania.thaumcraftLoaded) {
if(ConfigHandler.COMMON.enableThaumcraftAspects.get()) {
// todo 1.13 MinecraftForge.EVENT_BUS.register(TCAspects.class);
}
ModBrews.initTC();
ModBrewRecipes.initTC();
}
/* todo 1.13
if(Botania.bcApiLoaded)
new StatementAPIPlugin();
*/
}
*/
public void postInit(FMLPostInitializationEvent event) {
// todo 1.13 move everything here to where it belongs
private void loadComplete(FMLLoadCompleteEvent event) {
if(Botania.thaumcraftLoaded) {
try {
@SuppressWarnings("unchecked")
@@ -218,7 +217,6 @@ public class Botania {
} catch (ClassNotFoundException ignored) {}
}
ModBlocks.addDispenserBehaviours();
LexiconData.postInit();
int words = 0;
@@ -235,15 +233,14 @@ public class Botania {
// Overriding the internal method handler will break everything as it changes regularly.
// So just don't be a moron and don't override it. Thanks.
public void serverAboutToStart(FMLServerAboutToStartEvent event) {
private void serverAboutToStart(FMLServerAboutToStartEvent event) {
String clname = BotaniaAPI.internalHandler.getClass().getName();
String expect = "vazkii.botania.common.core.handler.InternalMethodHandler";
if(!clname.equals(expect)) {
new IllegalAccessError("The Botania API internal method handler has been overriden. "
throw new IllegalAccessError("The Botania API internal method handler has been overriden. "
+ "This will cause crashes and compatibility issues, and that's why it's marked as"
+ " \"Do not Override\". Whoever had the brilliant idea of overriding it needs to go"
+ " back to elementary school and learn to read. (Expected classname: " + expect + ", Actual classname: " + clname + ")").printStackTrace();
FMLCommonHandler.instance().exitJava(1, true);
+ " back to elementary school and learn to read. (Expected classname: " + expect + ", Actual classname: " + clname + ")");
}
}
@@ -258,14 +255,12 @@ public class Botania {
ManaNetworkHandler.instance.clear();
}
@EventHandler
public void handleIMC(FMLInterModComms.IMCEvent event) {
IMCHandler.processMessages(event.getMessages());
}
private int countWords(String s) {
/* todo 1.13
String s1 = I18n.translateToLocal(s);
return s1.split("\\s+").length;
*/
return 0;
}
private void registerDefaultEntityBlacklist() {
@@ -58,6 +58,7 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
super(EnumDyeColor.WHITE, props);
}
/* todo 1.13
@Nonnull
@Override
public BlockStateContainer createBlockState() {
@@ -74,6 +75,7 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
}
return state;
}
*/
@Override
public int getLightValue(@Nonnull IBlockState state, IWorldReader world, @Nonnull BlockPos pos) {
@@ -12,11 +12,7 @@ package vazkii.botania.common.block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.statemap.StateMap;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -26,7 +22,6 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ChunkCache;
import net.minecraft.world.Explosion;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.IBlockReader;
@@ -34,7 +29,6 @@ import net.minecraft.world.IWorldReader;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.common.property.ExtendedBlockState;
import net.minecraftforge.common.property.IExtendedBlockState;
import net.minecraftforge.common.property.IUnlistedProperty;
import net.minecraftforge.api.distmarker.Dist;
@@ -71,6 +65,7 @@ public class BlockPlatform extends BlockCamo implements ILexiconable, IWandable,
this.variant = v;
}
/* todo 1.13
@Nonnull
@Override
public BlockStateContainer createBlockState() {
@@ -93,32 +88,23 @@ public class BlockPlatform extends BlockCamo implements ILexiconable, IWandable,
}
}
@Override
public void addCollisionBoxToList(IBlockState state, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull AxisAlignedBB par5AxisAlignedBB, @Nonnull List<AxisAlignedBB> stacks, Entity par7Entity, boolean isActualState) {
if(variant == Variant.INFRANGIBLE || variant == Variant.ABSTRUSE && par7Entity != null && par7Entity.posY > pos.getY() + 0.9 && (!(par7Entity instanceof EntityPlayer) || !par7Entity.isSneaking()))
super.addCollisionBoxToList(state, world, pos, par5AxisAlignedBB, stacks, par7Entity, isActualState);
}
*/
@Override
public boolean canRenderInLayer(IBlockState state, @Nonnull BlockRenderLayer layer) {
return true;
}
@Override
public void addCollisionBoxToList(IBlockState state, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull AxisAlignedBB par5AxisAlignedBB, @Nonnull List<AxisAlignedBB> stacks, Entity par7Entity, boolean isActualState) {
if(variant == Variant.INFRANGIBLE || variant == Variant.ABSTRUSE && par7Entity != null && par7Entity.posY > pos.getY() + 0.9 && (!(par7Entity instanceof EntityPlayer) || !par7Entity.isSneaking()))
super.addCollisionBoxToList(state, world, pos, par5AxisAlignedBB, stacks, par7Entity, isActualState);
}
@Override
public float getBlockHardness(IBlockState state, World world, BlockPos pos) {
return variant == Variant.INFRANGIBLE ? -1F : super.getBlockHardness(state, world, pos);
}
@Override
public boolean canEntityDestroy(IBlockState state, IBlockReader world, BlockPos pos, Entity entity) {
return variant != Variant.INFRANGIBLE;
}
@Override
public float getExplosionResistance(IBlockState state, IWorldReader world, BlockPos pos, @Nullable Entity exploder, Explosion explosion) {
return variant != Variant.INFRANGIBLE ? super.getExplosionResistance(state, world, pos, exploder, explosion) : Float.MAX_VALUE;
}
@Nonnull
@Override
public TileEntity createTileEntity(@Nonnull IBlockState state, @Nonnull IBlockReader world) {
@@ -479,7 +479,7 @@ public final class ModBlocks {
builder = Block.Properties.create(Material.WOOD).hardnessAndResistance(2, 5).sound(SoundType.WOOD);
register(r, new BlockPlatform(BlockPlatform.Variant.ABSTRUSE, builder), LibBlockNames.PLATFORM_ABSTRUSE);
register(r, new BlockPlatform(BlockPlatform.Variant.SPECTRAL, builder), LibBlockNames.PLATFORM_SPECTRAL);
register(r, new BlockPlatform(BlockPlatform.Variant.INFRANGIBLE, builder), LibBlockNames.PLATFORM_INFRANGIBLE);
register(r, new BlockPlatform(BlockPlatform.Variant.INFRANGIBLE, Block.Properties.create(Material.WOOD).hardnessAndResistance(-1, Float.MAX_VALUE).sound(SoundType.WOOD)), LibBlockNames.PLATFORM_INFRANGIBLE);
register(r, new BlockAlfPortal(Block.Properties.create(Material.WOOD).hardnessAndResistance(10).sound(SoundType.WOOD)), LibBlockNames.ALF_PORTAL);
builder = Block.Properties.create(Material.WOOD).hardnessAndResistance(2).sound(SoundType.WOOD);
@@ -741,7 +741,7 @@ public final class ModBlocks {
r.register(new ItemBlockMod(redStringFertilizer, props).setRegistryName(redStringFertilizer.getRegistryName()));
r.register(new ItemBlockMod(redStringComparator, props).setRegistryName(redStringComparator.getRegistryName()));
r.register(new ItemBlockMod(redStringRelay, props).setRegistryName(redStringRelay.getRegistryName()));
r.register(new ItemBlockFloatingSpecialFlower(floatingSpecialFlower).setRegistryName(floatingSpecialFlower.getRegistryName()));
r.register(new ItemBlockFloatingSpecialFlower(floatingSpecialFlower, props).setRegistryName(floatingSpecialFlower.getRegistryName()));
r.register(new ItemBlockMod(prism, props).setRegistryName(prism.getRegistryName()));
r.register(new ItemBlockMod(enchantedSoil, props).setRegistryName(enchantedSoil.getRegistryName()));
r.register(new ItemBlockMod(petalBlockWhite, props).setRegistryName(petalBlockWhite.getRegistryName()));
@@ -80,6 +80,7 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable {
return BlockRenderLayer.CUTOUT;
}
/* todo 1.13
@Nonnull
@Override
public BlockStateContainer createBlockState() {
@@ -98,6 +99,7 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable {
}
return state;
}
*/
@OnlyIn(Dist.CLIENT)
@Override
@@ -13,23 +13,20 @@ package vazkii.botania.common.block.subtile.functional;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemBlockSpecial;
import net.minecraft.item.ItemPiston;
import net.minecraft.item.ItemRedstone;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUseContext;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.fml.relauncher.ReflectionHelper;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import org.lwjgl.opengl.GL11;
@@ -68,18 +65,10 @@ public class SubTileRannuncarpus extends SubTileFunctional {
return;
if(ticksExisted % 10 == 0) {
IBlockState filter = getUnderlyingBlock();
boolean scanned = false;
List<BlockPos> validPositions = new ArrayList<>();
int rangePlace = getRange();
int rangePlaceY = getRangeY();
BlockPos pos = supertile.getPos();
List<EntityItem> items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE_Y, -RANGE), supertile.getPos().add(RANGE + 1, RANGE_Y + 1, RANGE + 1)));
List<BlockPos> validPositions = getCandidatePositions();
int slowdown = getSlowdownFactor();
for(EntityItem item : items) {
if(item.age < 60 + slowdown || !item.isAlive() || item.getItem().isEmpty())
continue;
@@ -87,62 +76,27 @@ public class SubTileRannuncarpus extends SubTileFunctional {
ItemStack stack = item.getItem();
Item stackItem = stack.getItem();
if(stackItem instanceof ItemBlock || stackItem instanceof IFlowerPlaceable) {
if(!scanned) {
for(BlockPos pos_ : BlockPos.getAllInBox(pos.add(-rangePlace, -rangePlaceY, -rangePlace), pos.add(rangePlace, rangePlaceY, rangePlace))) {
IBlockState stateAbove = supertile.getWorld().getBlockState(pos_.up());
Block blockAbove = stateAbove.getBlock();
BlockPos up = pos_.up();
if(filter == supertile.getWorld().getBlockState(pos_)
&& (blockAbove.isAir(stateAbove, supertile.getWorld(), up)
|| blockAbove.isReplaceable(supertile.getWorld(), up)))
validPositions.add(up);
}
scanned = true;
}
if(!validPositions.isEmpty()) {
BlockPos coords = validPositions.get(supertile.getWorld().rand.nextInt(validPositions.size()));
ItemUseContext ctx = new ItemUseContext(supertile.getWorld(), null, stack, coords, EnumFacing.UP, 0, 0, 0);
IBlockState stateToPlace = null;
if(stackItem instanceof IFlowerPlaceable)
stateToPlace = ((IFlowerPlaceable) stackItem).getBlockToPlaceByFlower(stack, this, coords);
if(stackItem instanceof ItemBlock) {
int blockMeta = stackItem.getMetadata(stack.getItemDamage());
if(stackItem instanceof ItemPiston) // Workaround because the blockMeta ItemPiston gives crashes getStateFromMeta
blockMeta = 0;
stateToPlace = ((ItemBlock) stackItem).getBlock().getStateFromMeta(blockMeta);
boolean success = false;
if(stackItem instanceof IFlowerPlaceable) {
success = ((IFlowerPlaceable) stackItem).tryPlace(this, ctx);
} if(stackItem instanceof ItemBlock) {
success = stack.onItemUse(ctx) == EnumActionResult.SUCCESS;
}
if(stateToPlace != null) {
if(stateToPlace.getBlock().canPlaceBlockAt(supertile.getWorld(), coords)) {
supertile.getWorld().setBlockState(coords, stateToPlace, 1 | 2);
if(ConfigHandler.COMMON.blockBreakParticles.get())
supertile.getWorld().playEvent(2001, coords, Block.getStateId(stateToPlace));
validPositions.remove(coords);
ItemBlock.setTileEntityNBT(supertile.getWorld(), null, coords, stack);
TileEntity tile = supertile.getWorld().getTileEntity(coords);
if(tile != null && tile instanceof ISubTileContainer) {
ISubTileContainer container = (ISubTileContainer) tile;
ResourceLocation subtileName = ItemBlockSpecialFlower.getType(stack);
container.setSubTile(subtileName);
SubTileEntity subtile = container.getSubTile();
subtile.onBlockPlacedBy(supertile.getWorld(), coords, supertile.getWorld().getBlockState(coords), null, stack);
}
if(stackItem instanceof IFlowerPlaceable)
((IFlowerPlaceable) stackItem).onBlockPlacedByFlower(stack, this, coords);
stack.shrink(1);
if(mana > 1)
mana--;
return;
if(success) {
/* todo 1.13 no easy way to find out where it eventually got placed
if(ConfigHandler.COMMON.blockBreakParticles.get()) {
supertile.getWorld().playEvent(2001, coords, Block.getStateId(stateToPlace));
}
*/
validPositions.remove(coords);
if(mana > 1)
mana--;
return;
}
}
}
@@ -154,6 +108,20 @@ public class SubTileRannuncarpus extends SubTileFunctional {
return supertile.getWorld().getBlockState(supertile.getPos().down(supertile instanceof IFloatingFlower ? 1 : 2));
}
private List<BlockPos> getCandidatePositions() {
int rangePlace = getRange();
int rangePlaceY = getRangeY();
BlockPos pos = supertile.getPos();
IBlockState filter = getUnderlyingBlock();
List<BlockPos> ret = new ArrayList<>();
for (BlockPos pos_ : BlockPos.getAllInBox(pos.add(-rangePlace, -rangePlaceY, -rangePlace), pos.add(rangePlace, rangePlaceY, rangePlace))) {
if (filter == supertile.getWorld().getBlockState(pos_))
ret.add(pos_);
}
return ret;
}
@Override
public boolean acceptsRedstone() {
return true;
@@ -14,6 +14,7 @@ import net.minecraft.init.MobEffects;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.registries.ForgeRegistries;
import vazkii.botania.api.brew.Brew;
import vazkii.botania.common.lib.LibBrewNames;
@@ -68,7 +69,7 @@ public class ModBrews {
}
public static void initTC() {
Potion warpWardPotion = Potion.REGISTRY.getObject(new ResourceLocation("thaumcraft:warpward"));
Potion warpWardPotion = ForgeRegistries.POTIONS.getValue(new ResourceLocation("thaumcraft:warpward"));
if(warpWardPotion != null)
warpWard = new BrewMod(LibBrewNames.WARP_WARD, 0xFBBDFF, 25000, new PotionEffect(warpWardPotion, 12000, 0)).setNotBloodPendantInfusable();
@@ -1,40 +0,0 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under the
* Botania License: http://botaniamod.net/license.php
*
* File Created @ [Jan 19, 2014, 10:16:49 PM (GMT)]
*/
package vazkii.botania.common.core.handler;
import net.minecraft.block.Block;
import net.minecraft.block.BlockDoublePlant;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.event.terraingen.DecorateBiomeEvent;
import net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType;
import net.minecraftforge.fml.common.eventhandler.Event.Result;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import vazkii.botania.api.item.IFlowerlessBiome;
import vazkii.botania.api.item.IFlowerlessWorld;
import vazkii.botania.api.state.BotaniaStateProps;
import vazkii.botania.common.block.BlockModFlower;
import vazkii.botania.common.block.ModBlocks;
public final class BiomeDecorationHandler {
private BiomeDecorationHandler() {}
@SubscribeEvent(priority = EventPriority.LOWEST)
public static void onWorldDecoration(DecorateBiomeEvent.Decorate event) {
BlockPos pos = event.getPlacementPos() != null ? event.getPlacementPos() : event.getChunkPos().getBlock(0, 0, 0);
if((event.getResult() == Result.ALLOW || event.getResult() == Result.DEFAULT) && event.getType() == EventType.FLOWERS) {
}
}
}
@@ -19,15 +19,15 @@ import javax.annotation.Nonnull;
public class ItemBlockFloatingSpecialFlower extends ItemBlockSpecialFlower {
public ItemBlockFloatingSpecialFlower(Block block1) {
super(block1);
public ItemBlockFloatingSpecialFlower(Block block, Properties props) {
super(block, props);
}
@Nonnull
@Override
public ITextComponent getDisplayName(@Nonnull ItemStack stack) {
String flowerName = getTranslationKey(stack);
return new TextComponentTranslation("botaniamisc.floatingPrefix").appendSibling(new TextComponentTranslation(flowerName));
ITextComponent flowerName = stack.getDisplayName();
return new TextComponentTranslation("botaniamisc.floatingPrefix").appendSibling(flowerName);
}
}
@@ -519,11 +519,4 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub
GlStateManager.color4f(1F, 1F, 1F, 1F);
mc.textureManager.bindTexture(Gui.ICONS);
}
@OnlyIn(Dist.CLIENT)
@Override
public void registerModels() {
ModelHandler.registerItemAllMeta(this, WING_TYPES + 1);
}
}
@@ -16,6 +16,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.shapes.VoxelShape;
import vazkii.botania.api.internal.IManaBurst;
import vazkii.botania.api.mana.IDirectioned;
import vazkii.botania.api.mana.IThrottledPacket;
@@ -34,9 +35,12 @@ public class LensRedirect extends Lens {
Vector3 tileVec = Vector3.fromTileEntityCenter(tile);
Vector3 sourceVec = new Vector3(coords.getX() + 0.5, coords.getY() + 0.5, coords.getZ() + 0.5);
AxisAlignedBB axis = entity.world.getBlockState(coords).getCollisionBoundingBox(entity.world, coords).offset(coords);
if(axis == null)
AxisAlignedBB axis;
VoxelShape collideShape = entity.world.getBlockState(coords).getCollisionShape(entity.world, coords);
if(collideShape.isEmpty())
axis = new AxisAlignedBB(coords, coords.add(1, 1, 1));
else axis = collideShape.getBoundingBox(); // todo 1.13 more granular collisions?
if(!sourceVec.isInside(axis))
sourceVec = new Vector3(axis.minX + (axis.maxX - axis.minX) / 2, axis.minY + (axis.maxY - axis.minY) / 2, axis.minZ + (axis.maxZ - axis.minZ) / 2);