mirror of
https://github.com/GTNewHorizons/Baubles-Expanded.git
synced 2026-11-21 04:22:17 +00:00
1 parent
d9c2bfe583
commit
97ebb51fc9
5 files changed
+30
-7
No files matched your search
@@ -20,13 +20,13 @@ import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
|
||||
@Mod(modid = Baubles.MODID, name = Baubles.MODNAME, version = Baubles.VERSION, dependencies="required-after:Forge@[10.13.0.1177,);")
|
||||
@Mod(modid = Baubles.MODID, name = Baubles.MODNAME, version = Baubles.VERSION, dependencies="required-after:Forge@[10.13.2,);")
|
||||
|
||||
public class Baubles {
|
||||
|
||||
public static final String MODID = "Baubles";
|
||||
public static final String MODNAME = "Baubles";
|
||||
public static final String VERSION = "1.0.1.8";
|
||||
public static final String VERSION = "1.0.1.9";
|
||||
|
||||
@SidedProxy(clientSide = "baubles.client.ClientProxy", serverSide = "baubles.common.CommonProxy")
|
||||
public static CommonProxy proxy;
|
||||
|
||||
@@ -3,6 +3,7 @@ package baubles.common.container;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
@@ -14,7 +15,6 @@ import net.minecraft.util.MathHelper;
|
||||
import baubles.api.BaubleType;
|
||||
import baubles.api.IBauble;
|
||||
import baubles.common.Baubles;
|
||||
import baubles.common.lib.PlayerHandler;
|
||||
import baubles.common.network.PacketHandler;
|
||||
import baubles.common.network.PacketSyncBauble;
|
||||
|
||||
@@ -267,6 +267,25 @@ public class InventoryBaubles implements IInventory {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void dropItemsAt(ArrayList<EntityItem> drops, Entity e) {
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
if (this.stackList[i] != null) {
|
||||
EntityItem ei = new EntityItem(e.worldObj,
|
||||
e.posX, e.posY + e.getEyeHeight(), e.posZ,
|
||||
this.stackList[i].copy());
|
||||
ei.delayBeforeCanPickup = 40;
|
||||
float f1 = e.worldObj.rand.nextFloat() * 0.5F;
|
||||
float f2 = e.worldObj.rand.nextFloat() * (float) Math.PI * 2.0F;
|
||||
ei.motionX = (double) (-MathHelper.sin(f2) * f1);
|
||||
ei.motionZ = (double) (MathHelper.cos(f2) * f1);
|
||||
ei.motionY = 0.20000000298023224D;
|
||||
drops.add(ei);
|
||||
this.stackList[i] = null;
|
||||
syncSlotToClients(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void syncSlotToClients(int slot) {
|
||||
try {
|
||||
|
||||
@@ -43,8 +43,8 @@ public class EventHandlerEntity {
|
||||
&& !event.entity.worldObj.isRemote
|
||||
&& !event.entity.worldObj.getGameRules()
|
||||
.getGameRuleBooleanValue("keepInventory")) {
|
||||
PlayerHandler.getPlayerBaubles(event.entityPlayer).dropItems(
|
||||
event.drops);
|
||||
PlayerHandler.getPlayerBaubles(event.entityPlayer).dropItemsAt(
|
||||
event.drops,event.entityPlayer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user