mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-10-26 22:34:08 +00:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9edde0a4dc | ||
|
|
abd62c1076 | ||
|
|
8e709b0190 | ||
|
|
a16181c480 |
No files matched your search
@@ -2,10 +2,10 @@
|
||||
* This class was created by <Vazkii/ChickenBones>. 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 @ [Feb 3, 2014, 9:05:38 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.client.core.handler;
|
||||
@@ -67,14 +67,13 @@ public class LightningHandler {
|
||||
profiler.endStartSection("lightning");
|
||||
|
||||
float frame = event.partialTicks;
|
||||
Entity entity = Minecraft.getMinecraft().thePlayer;
|
||||
TextureManager render = Minecraft.getMinecraft().renderEngine;
|
||||
|
||||
interpPosX = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * frame;
|
||||
interpPosY = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * frame;
|
||||
interpPosZ = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * frame;
|
||||
|
||||
Entity viewEntity = Minecraft.getMinecraft().renderViewEntity;
|
||||
interpPosX = viewEntity.lastTickPosX + (viewEntity.posX - viewEntity.lastTickPosX) * frame;
|
||||
interpPosY = viewEntity.lastTickPosY + (viewEntity.posY - viewEntity.lastTickPosY) * frame;
|
||||
interpPosZ = viewEntity.lastTickPosZ + (viewEntity.posZ - viewEntity.lastTickPosZ) * frame;
|
||||
|
||||
scratchView.set(viewEntity.posX, viewEntity.posY + viewEntity.getEyeHeight(), viewEntity.posZ);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
@@ -501,4 +500,4 @@ public class LightningHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -87,8 +87,8 @@ public class SkyblockSkyRenderer extends IRenderHandler {
|
||||
float f6;
|
||||
|
||||
float insideVoid = 0;
|
||||
if(mc.thePlayer.posY <= -2)
|
||||
insideVoid = (float) Math.min(1F, -(mc.thePlayer.posY + 2) / 30F);
|
||||
if(viewEntity.posY <= -2)
|
||||
insideVoid = (float) Math.min(1F, -(viewEntity.posY + 2) / 30F);
|
||||
|
||||
f1 = Math.max(0F, f1 - insideVoid);
|
||||
f2 = Math.max(0F, f2 - insideVoid);
|
||||
|
||||
@@ -22,13 +22,15 @@ import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.passive.EntityCow;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.IShearable;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
import net.minecraftforge.common.util.FakePlayerFactory;
|
||||
import vazkii.botania.api.internal.IManaBurst;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
@@ -121,22 +123,32 @@ public class BlockForestDrum extends BlockMod implements IManaTrigger, ILexicona
|
||||
List<EntityLiving> shearables = new ArrayList<>();
|
||||
ItemStack stack = new ItemStack(this, 1, 1);
|
||||
|
||||
FakePlayer milker = FakePlayerFactory.getMinecraft((WorldServer) world);
|
||||
for(EntityLiving entity : entities) {
|
||||
if(entity instanceof IShearable && ((IShearable) entity).isShearable(stack, world, (int) entity.posX, (int) entity.posY, (int) entity.posZ)) {
|
||||
shearables.add(entity);
|
||||
} else if(entity instanceof EntityCow) {
|
||||
List<EntityItem> items = world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(entity.posX, entity.posY, entity.posZ, entity.posX + entity.width, entity.posY + entity.height, entity.posZ + entity.width));
|
||||
} else if(entity instanceof EntityCow cow) {
|
||||
List<EntityItem> items = world.getEntitiesWithinAABB(EntityItem.class, entity.boundingBox.copy().expand(0.5, 0.5, 0.5));
|
||||
for(EntityItem item : items) {
|
||||
ItemStack itemstack = item.getEntityItem();
|
||||
if(itemstack != null && itemstack.getItem() == Items.bucket && !world.isRemote) {
|
||||
if(itemstack != null && !cow.isBreedingItem(itemstack) && !world.isRemote) {
|
||||
while(itemstack.stackSize > 0) {
|
||||
EntityItem ent = entity.entityDropItem(new ItemStack(Items.milk_bucket), 1.0F);
|
||||
ItemStack copy = itemstack.copy();
|
||||
copy.stackSize = 1;
|
||||
milker.inventory.mainInventory[0] = copy;
|
||||
cow.interact(milker);
|
||||
if (milker.inventory.mainInventory[0] == null) {
|
||||
itemstack.stackSize--;
|
||||
break;
|
||||
} else if (milker.inventory.mainInventory[0].getItem() == itemstack.getItem()) {
|
||||
break;
|
||||
}
|
||||
EntityItem ent = entity.entityDropItem(milker.inventory.mainInventory[0], 1.0F);
|
||||
ent.motionY += world.rand.nextFloat() * 0.05F;
|
||||
ent.motionX += (world.rand.nextFloat() - world.rand.nextFloat()) * 0.1F;
|
||||
ent.motionZ += (world.rand.nextFloat() - world.rand.nextFloat()) * 0.1F;
|
||||
itemstack.stackSize--;
|
||||
}
|
||||
item.setDead();
|
||||
if (itemstack.stackSize == 0) item.setDead();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,6 +101,7 @@ public class SubTileEntropinnyum extends SubTileGenerating {
|
||||
if (world.isRemote || mana != 0 || !(Math.abs(supertile.xCoord - posX) <= RANGE && Math.abs(supertile.yCoord - posY) <= RANGE && Math.abs(supertile.zCoord - posZ) <= RANGE)) {
|
||||
return false;
|
||||
}
|
||||
if (explosionSource == null) return false;
|
||||
|
||||
explosionSource.setDead();
|
||||
mana += getMaxMana();
|
||||
|
||||
@@ -21,14 +21,16 @@ import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemBlockModSlab extends ItemSlab {
|
||||
private final String unlocalizedName;
|
||||
|
||||
public ItemBlockModSlab(Block blockSlab) {
|
||||
super(blockSlab, ((BlockModSlab)blockSlab).getSingleBlock(), ((BlockModSlab)blockSlab).getFullBlock(), false);
|
||||
unlocalizedName = blockSlab.getUnlocalizedName().replace("tile.", "tile.botania:");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return field_150939_a.getUnlocalizedName().replaceAll("tile.", "tile.botania:");
|
||||
return unlocalizedName;
|
||||
}
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> infoList, boolean advanced) {
|
||||
|
||||
Reference in new issue
Block a user