Add Force Flasks
This commit is contained in:
parent
98f0e0628f
commit
c7aff74bcf
24 changed files with 3712 additions and 33 deletions
|
@ -6,15 +6,14 @@ import cpw.mods.fml.common.event.FMLInitializationEvent;
|
|||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import ley.modding.dartcraft.block.BlockPowerOre;
|
||||
import ley.modding.dartcraft.block.Blocks;
|
||||
import ley.modding.dartcraft.entity.*;
|
||||
import ley.modding.dartcraft.event.EventHandler;
|
||||
import ley.modding.dartcraft.internal.Registry;
|
||||
import ley.modding.dartcraft.entity.EntityColdChicken;
|
||||
import ley.modding.dartcraft.entity.EntityColdCow;
|
||||
import ley.modding.dartcraft.entity.EntityColdPig;
|
||||
import ley.modding.dartcraft.item.BaseItem;
|
||||
import ley.modding.dartcraft.item.ItemEntityBottle;
|
||||
import ley.modding.dartcraft.item.ItemForceFlask;
|
||||
import ley.modding.dartcraft.item.Items;
|
||||
import ley.modding.dartcraft.item.tool.ItemForceMitts;
|
||||
import ley.modding.dartcraft.item.tool.ItemForcePickaxe;
|
||||
|
@ -33,7 +32,6 @@ public class Dartcraft {
|
|||
|
||||
@Mod.Instance
|
||||
public static Dartcraft instance = new Dartcraft();
|
||||
public static DartcraftClient client = new DartcraftClient();
|
||||
public static IRegistry registry;
|
||||
@SidedProxy(serverSide = "ley.modding.dartcraft.proxy.CommonProxy", clientSide = "ley.modding.dartcraft.proxy.ClientProxy")
|
||||
public static CommonProxy proxy;
|
||||
|
@ -47,10 +45,6 @@ public class Dartcraft {
|
|||
|
||||
@Mod.EventHandler
|
||||
public void init(FMLInitializationEvent e) {
|
||||
// TODO: use proxys
|
||||
if (e.getSide() == Side.CLIENT)
|
||||
client.init();
|
||||
|
||||
registry = new Registry();
|
||||
Items.forcegem = registry.registerItem(new BaseItem("forcegem"));
|
||||
Items.forceingot = registry.registerItem(new BaseItem("forceingot"));
|
||||
|
@ -60,12 +54,16 @@ public class Dartcraft {
|
|||
Items.forcemitts = registry.registerItem(new ItemForceMitts());
|
||||
Items.forcepickaxe = registry.registerItem(new ItemForcePickaxe());
|
||||
Items.forceshears = registry.registerItem(new ItemForceShears());
|
||||
Items.forceflask = registry.registerItem(new ItemForceFlask());
|
||||
Items.entitybottle = registry.registerItem(new ItemEntityBottle());
|
||||
Blocks.powerore = registry.registerBlock(new BlockPowerOre());
|
||||
|
||||
proxy.init();
|
||||
int entityId = 0;
|
||||
EntityRegistry.registerModEntity(EntityColdChicken.class, "coldChicken", entityId++, Dartcraft.instance, 40, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityColdCow.class, "coldCow", entityId++, Dartcraft.instance, 40, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityColdPig.class, "coldPig", entityId++, Dartcraft.instance, 40, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityBottle.class, "entityBottleItem", entityId++, Dartcraft.instance, 40, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityFlyingFlask.class, "entityFlyingFlask", entityId++, Dartcraft.instance, 40, 1, true);
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
package ley.modding.dartcraft;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import ley.modding.dartcraft.client.renderer.entity.RenderColdAnimal;
|
||||
import ley.modding.dartcraft.entity.EntityColdChicken;
|
||||
import ley.modding.dartcraft.entity.EntityColdCow;
|
||||
import ley.modding.dartcraft.entity.EntityColdPig;
|
||||
import net.minecraft.client.model.ModelChicken;
|
||||
import net.minecraft.client.model.ModelCow;
|
||||
import net.minecraft.client.model.ModelPig;
|
||||
|
||||
class DartcraftClient {
|
||||
public void init() {
|
||||
renderEntities();
|
||||
}
|
||||
|
||||
public void renderEntities() {
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityColdChicken.class, new RenderColdAnimal(new ModelChicken(), 0.6f, "textures/entity/coldChicken.png"));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityColdCow.class, new RenderColdAnimal(new ModelCow(), 0.6f, "textures/entity/coldCow.png"));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityColdPig.class, new RenderColdAnimal(new ModelPig(), 0.6f, "textures/entity/coldPig.png"));
|
||||
}
|
||||
}
|
|
@ -8,5 +8,4 @@ public interface IBottleRenderable {
|
|||
|
||||
void setEntityItem(ItemStack var1);
|
||||
|
||||
void sendDescriptionPacket();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
package ley.modding.dartcraft.client.renderer.entity;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ley.modding.dartcraft.Dartcraft;
|
||||
import ley.modding.dartcraft.api.IBottleRenderable;
|
||||
import ley.modding.dartcraft.client.renderer.item.RenderItemForceFlask;
|
||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||
import net.minecraftforge.client.model.IModelCustom;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderEntityBottle extends RenderLiving {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(Dartcraft.MODID, "bottle.png");
|
||||
|
||||
private static IModelCustom bottle = AdvancedModelLoader.loadModel(new ResourceLocation(Dartcraft.MODID, "models/bottle.obj"));
|
||||
|
||||
public RenderEntityBottle() {
|
||||
super(null, 0.2F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRender(Entity entity, double par2, double par4, double par6, float par8, float par9) {
|
||||
if (entity instanceof IBottleRenderable) {
|
||||
ItemStack stack = ((IBottleRenderable)entity).getEntityItem();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(par2, par4 + 0.25D, par6);
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
RenderItemForceFlask.instance.renderItem(IItemRenderer.ItemRenderType.ENTITY, stack, new Object[0]);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
protected ResourceLocation getEntityTexture(Entity entity) {
|
||||
return texture;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,230 @@
|
|||
package ley.modding.dartcraft.client.renderer.item;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ley.modding.dartcraft.Dartcraft;
|
||||
import ley.modding.dartcraft.entity.EntityBottle;
|
||||
import ley.modding.dartcraft.item.ItemEntityBottle;
|
||||
import ley.modding.dartcraft.util.EntityUtils;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||
import net.minecraftforge.client.model.IModelCustom;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderItemForceFlask implements IItemRenderer {
|
||||
|
||||
private static RenderItem renderer = new RenderItem();
|
||||
|
||||
private IModelCustom bottle = AdvancedModelLoader.loadModel(new ResourceLocation(Dartcraft.MODID, "models/bottle.obj"));
|
||||
|
||||
private IModelCustom liquid = AdvancedModelLoader.loadModel(new ResourceLocation(Dartcraft.MODID, "models/liquid.obj"));
|
||||
|
||||
public static RenderItemForceFlask instance = new RenderItemForceFlask();
|
||||
|
||||
public boolean handleRenderType(ItemStack item, IItemRenderer.ItemRenderType type) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean shouldUseRenderHelper(IItemRenderer.ItemRenderType type, ItemStack item, IItemRenderer.ItemRendererHelper helper) {
|
||||
return (type == IItemRenderer.ItemRenderType.INVENTORY || type == IItemRenderer.ItemRenderType.ENTITY);
|
||||
}
|
||||
|
||||
public void renderItem(IItemRenderer.ItemRenderType type, ItemStack item, Object... data) {
|
||||
FontRenderer fontRenderer = (Minecraft.getMinecraft()).fontRenderer;
|
||||
Entity entity = null;
|
||||
GL11.glPushMatrix();
|
||||
if (item != null && item.getItem() instanceof ItemEntityBottle && item.hasTagCompound())
|
||||
try {
|
||||
if (item.getItemDamage() == 0) {
|
||||
EntityLivingBase entityLivingBase = null;
|
||||
NBTTagCompound comp = (NBTTagCompound)item.getTagCompound().copy();
|
||||
Entity temp = null;
|
||||
if (comp.hasKey("CanPickUpLoot")) {
|
||||
temp = EntityList.createEntityFromNBT(comp, (World)(Minecraft.getMinecraft()).theWorld);
|
||||
} else {
|
||||
temp = EntityUtils.getEntity(comp.getString("id"));
|
||||
}
|
||||
if (temp instanceof EntityLivingBase)
|
||||
entityLivingBase = (EntityLivingBase)temp;
|
||||
if (entityLivingBase != null && (Dartcraft.proxy.getClientInstance()).theWorld != null) {
|
||||
entityLivingBase.setWorld((World)(Dartcraft.proxy.getClientInstance()).theWorld);
|
||||
entityLivingBase.setLocationAndAngles(0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
|
||||
}
|
||||
entity = entityLivingBase;
|
||||
} else if (item.getItemDamage() == 1) {
|
||||
EntityItem entityItem = new EntityItem((World)(Dartcraft.proxy.getClientInstance()).theWorld);
|
||||
entityItem.setLocationAndAngles(0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
|
||||
entityItem.hoverStart = 1.0F;
|
||||
entityItem.setEntityItemStack(new ItemStack(Blocks.brick_block));
|
||||
entity = entityItem;
|
||||
}
|
||||
} catch (Exception e) {}
|
||||
float value = 0.0F;
|
||||
float angle = 0.0F;
|
||||
float scale = 0.0F;
|
||||
scale(type);
|
||||
if (type == IItemRenderer.ItemRenderType.INVENTORY && (entity instanceof net.minecraft.entity.monster.EntityEnderman || entity instanceof net.minecraft.entity.monster.EntitySpider || entity instanceof net.minecraft.entity.monster.EntityCaveSpider))
|
||||
entity = null;
|
||||
if (entity != null) {
|
||||
float coef = 1.0F;
|
||||
if (entity instanceof net.minecraft.entity.monster.EntitySilverfish || entity instanceof net.minecraft.entity.passive.EntityOcelot || entity instanceof net.minecraft.entity.passive.EntityWolf)
|
||||
coef = 2.5F;
|
||||
scale = 8.0F * ((((Entity)entity).height > ((Entity)entity).width * coef) ? (1.3F / ((Entity)entity).height) : (0.5F / ((Entity)entity).width));
|
||||
value = -((Entity)entity).height;
|
||||
angle = 0.0F;
|
||||
if (entity instanceof net.minecraft.entity.passive.EntityPig)
|
||||
scale = 6.5F / ((Entity)entity).height;
|
||||
if (entity instanceof EntityBottle) {
|
||||
scale = 30.0F;
|
||||
value += 1.5F;
|
||||
}
|
||||
if (entity instanceof net.minecraft.entity.passive.EntityAnimal) {
|
||||
int age = item.getTagCompound().getInteger("Age");
|
||||
if (age < 0) {
|
||||
scale /= 2.0F;
|
||||
value -= ((Entity)entity).height * 0.5F;
|
||||
}
|
||||
}
|
||||
if (type == IItemRenderer.ItemRenderType.INVENTORY)
|
||||
angle = 45.0F;
|
||||
if (type == IItemRenderer.ItemRenderType.EQUIPPED_FIRST_PERSON)
|
||||
angle = 90.0F;
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
GL11.glTranslatef(0.0F, value, 0.0F);
|
||||
GL11.glRotatef(angle, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
try {
|
||||
boolean shouldRender = (type != IItemRenderer.ItemRenderType.INVENTORY);
|
||||
if (!shouldRender) {
|
||||
Minecraft mc = Dartcraft.proxy.getClientInstance();
|
||||
EntityClientPlayerMP entityClientPlayerMP = (mc != null) ? mc.thePlayer : null;
|
||||
boolean found = false;
|
||||
if (entityClientPlayerMP != null && ((EntityPlayer)entityClientPlayerMP).inventory != null && ((EntityPlayer)entityClientPlayerMP).inventory.mainInventory != null)
|
||||
for (int i = 0; i < 9; i++) {
|
||||
ItemStack invStack = ((EntityPlayer)entityClientPlayerMP).inventory.mainInventory[i];
|
||||
if (invStack != null && invStack == item) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
shouldRender = true;
|
||||
}
|
||||
if (shouldRender) {
|
||||
Render render = RenderManager.instance.getEntityRenderObject((Entity)entity);
|
||||
if (render != null && entity != null)
|
||||
render.doRender((Entity)entity, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
|
||||
}
|
||||
} catch (Exception e) {}
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
scale(type);
|
||||
} else if (item != null && item.getItemDamage() > 0) {
|
||||
Dartcraft.proxy.bindTexture("liquid.png");
|
||||
GL11.glEnable(3042);
|
||||
float alpha = 1.0F;
|
||||
switch (item.getItemDamage()) {
|
||||
case 6:
|
||||
GL11.glColor4f(0.0F, 0.5F, 1.0F, alpha);
|
||||
break;
|
||||
case 5:
|
||||
GL11.glColor4f(1.0F, 0.0F, 0.0F, alpha);
|
||||
break;
|
||||
case 4:
|
||||
GL11.glColor4f(0.0627F, 0.7176F, 0.4863F, alpha);
|
||||
break;
|
||||
case 2:
|
||||
GL11.glColor4f(1.0F, 1.0F, 0.0F, alpha);
|
||||
break;
|
||||
}
|
||||
scale = 7.0F;
|
||||
float yScale = 1.0F;
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
if (type == IItemRenderer.ItemRenderType.ENTITY) {
|
||||
GL11.glRotatef(0.44999766F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(168.90388F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glTranslatef(0.0F, 0.65270597F, 0.0F);
|
||||
} else if (type == IItemRenderer.ItemRenderType.EQUIPPED || type == IItemRenderer.ItemRenderType.EQUIPPED_FIRST_PERSON) {
|
||||
GL11.glRotatef(185.40428F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(6.599979F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glTranslatef(0.0F, 0.65270597F, 0.0F);
|
||||
} else if (type == IItemRenderer.ItemRenderType.INVENTORY) {
|
||||
GL11.glRotatef(184.65428F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(6.749961F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glTranslatef(0.0F, 0.65270597F, 0.0F);
|
||||
}
|
||||
GL11.glTranslatef(0.0F, 1.0F - yScale, 0.0F);
|
||||
GL11.glScalef(1.0F, yScale, 1.0F);
|
||||
this.liquid.renderAll();
|
||||
GL11.glDisable(3042);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
scale(type);
|
||||
}
|
||||
GL11.glEnable(3042);
|
||||
GL11.glBlendFunc(770, 771);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Dartcraft.proxy.bindTexture("bottle.png");
|
||||
this.bottle.renderAll();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
private void scale(IItemRenderer.ItemRenderType type) {
|
||||
float value = 0.0F;
|
||||
float angle = 0.0F;
|
||||
float angle2 = 0.0F;
|
||||
float scale = 0.0F;
|
||||
value = ((Entity)(Minecraft.getMinecraft()).thePlayer).rotationYaw * 2.0F;
|
||||
angle = ((Entity)(Minecraft.getMinecraft()).thePlayer).rotationPitch * 2.0F;
|
||||
angle2 = ((EntityLivingBase)(Minecraft.getMinecraft()).thePlayer).rotationYawHead * 2.0F;
|
||||
if (Keyboard.isKeyDown(50));
|
||||
if (type == IItemRenderer.ItemRenderType.INVENTORY) {
|
||||
scale = 0.04557239F;
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
GL11.glRotatef(1950.6F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(1950.6F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(-178.5F, 0.0F, 1.0F, 0.0F);
|
||||
}
|
||||
if (type == IItemRenderer.ItemRenderType.EQUIPPED) {
|
||||
value = 0.5F;
|
||||
angle = -30.0F;
|
||||
scale = 0.036F;
|
||||
GL11.glTranslatef(0.35F, 0.65F, -0.1F);
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
GL11.glRotatef(angle, 1.0F, 0.0F, -1.0F);
|
||||
}
|
||||
if (type == IItemRenderer.ItemRenderType.EQUIPPED_FIRST_PERSON) {
|
||||
value = 0.5F;
|
||||
angle = 180.0F;
|
||||
scale = 0.025F;
|
||||
GL11.glTranslatef(value, value, -0.1F);
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
}
|
||||
if (type == IItemRenderer.ItemRenderType.ENTITY) {
|
||||
value = 0.5F;
|
||||
angle = 180.0F;
|
||||
scale = 0.035F;
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
185
src/main/java/ley/modding/dartcraft/entity/EntityBottle.java
Normal file
185
src/main/java/ley/modding/dartcraft/entity/EntityBottle.java
Normal file
|
@ -0,0 +1,185 @@
|
|||
package ley.modding.dartcraft.entity;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ley.modding.dartcraft.Dartcraft;
|
||||
import ley.modding.dartcraft.api.IBottleRenderable;
|
||||
import ley.modding.dartcraft.item.ItemEntityBottle;
|
||||
import ley.modding.dartcraft.item.Items;
|
||||
import ley.modding.dartcraft.util.EntityUtils;
|
||||
import ley.modding.dartcraft.util.ItemUtils;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityBottle extends EntityLivingBase implements IBottleRenderable {
|
||||
|
||||
private int timeout;
|
||||
|
||||
public EntityBottle(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
public EntityBottle(World world, double x, double y, double z, ItemStack contents) {
|
||||
super(world);
|
||||
setPosition(x, y, z);
|
||||
setEntityItem(contents);
|
||||
setSize(0.2F, 0.2F);
|
||||
}
|
||||
|
||||
protected void entityInit() {
|
||||
super.entityInit();
|
||||
((Entity)this).getDataWatcher().addObject(12, new ItemStack(Items.entitybottle));
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound comp) {
|
||||
super.writeToNBT(comp);
|
||||
ItemStack contents = getEntityItem();
|
||||
if (contents != null)
|
||||
comp.setTag("bottleContents", (NBTBase)contents.writeToNBT(new NBTTagCompound()));
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound comp) {
|
||||
super.readFromNBT(comp);
|
||||
if (comp.hasKey("bottleContents"))
|
||||
setEntityItem(ItemStack.loadItemStackFromNBT(comp
|
||||
.getCompoundTag("bottleContents")));
|
||||
}
|
||||
|
||||
public void writeEntityToNBT(NBTTagCompound comp) {}
|
||||
|
||||
public void readEntityFromNBT(NBTTagCompound comp) {}
|
||||
|
||||
public void onLivingUpdate() {
|
||||
super.onLivingUpdate();
|
||||
this.timeout--;
|
||||
if (!Dartcraft.proxy.isSimulating(((Entity)this).worldObj)) {
|
||||
if (this.timeout <= 0)
|
||||
this.timeout = 40;
|
||||
} else {
|
||||
ItemStack contents = getEntityItem();
|
||||
if (contents != null && contents.getItem() instanceof ItemEntityBottle && this.timeout <= 0) {
|
||||
this.timeout = 40;
|
||||
NBTTagCompound comp = contents.getTagCompound();
|
||||
if (comp.hasKey("Fire") && comp.getShort("Fire") > 0)
|
||||
comp.setShort("Fire", (short)-1);
|
||||
if (comp.hasKey("FallDistance") && comp.getFloat("FallDistance") > 0.0F)
|
||||
comp.setFloat("FallDistance", 0.0F);
|
||||
short maxHealth = 0;
|
||||
Entity temp = EntityList.createEntityFromNBT((NBTTagCompound)comp.copy(), ((Entity)this).worldObj);
|
||||
EntityLivingBase bottled = null;
|
||||
if (temp instanceof EntityLivingBase)
|
||||
bottled = (EntityLivingBase)temp;
|
||||
try {
|
||||
maxHealth = (short)(int)bottled.getAttributeMap().getAttributeInstanceByName("generic.maxHealth").getAttributeValue();
|
||||
} catch (Exception e) {}
|
||||
if (maxHealth > 0 && comp.hasKey("Health") && comp.getShort("Health") < maxHealth)
|
||||
comp.setShort("Health", (short)(comp.getShort("Health") + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getBottledName() {
|
||||
String name = "";
|
||||
ItemStack bottleStack = null;
|
||||
int iterations = 0;
|
||||
try {
|
||||
ItemStack contents = getEntityItem();
|
||||
bottleStack = (contents != null) ? contents.copy() : null;
|
||||
if (bottleStack != null) {
|
||||
Entity entity = EntityList.createEntityFromNBT(bottleStack.getTagCompound(), ((Entity)this).worldObj);
|
||||
while (entity instanceof EntityBottle) {
|
||||
EntityBottle bottle = (EntityBottle)entity;
|
||||
bottleStack = bottle.getEntityItem();
|
||||
entity = EntityList.createEntityFromNBT(bottleStack.getTagCompound(), ((Entity)this).worldObj);
|
||||
iterations++;
|
||||
}
|
||||
switch (iterations) {
|
||||
case 0:
|
||||
name = name + "Twice ";
|
||||
break;
|
||||
case 1:
|
||||
name = name + "Thrice ";
|
||||
break;
|
||||
default:
|
||||
name = name + (iterations + 2) + "x ";
|
||||
break;
|
||||
}
|
||||
name = name + "Bottled " + bottleStack.getTagCompound().getString("dartName");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return "Bottled Something";
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
public boolean canBePushed() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void dealFireDamage(int damage) {}
|
||||
|
||||
public boolean attackEntityFrom(DamageSource source, float amount) {
|
||||
if (((Entity)this).isDead || !Dartcraft.proxy.isSimulating(((Entity)this).worldObj))
|
||||
return false;
|
||||
if (source.getEntity() != null && source.getEntity() instanceof EntityPlayer &&
|
||||
!source.isProjectile()) {
|
||||
ItemStack contents = getEntityItem();
|
||||
if (contents != null) {
|
||||
if (!contents.hasTagCompound())
|
||||
contents.setTagCompound(new NBTTagCompound());
|
||||
contents.getTagCompound().setBoolean("wasDropped", true);
|
||||
}
|
||||
((Entity)this).worldObj.playSoundAtEntity((Entity)this, "dartcraft:bottle", 2.0F,
|
||||
EntityUtils.randomPitch());
|
||||
ItemUtils.dropItem(contents, ((Entity)this).worldObj, ((Entity)this).posX, ((Entity)this).posY, ((Entity)this).posZ);
|
||||
setDead();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onCollideWithPlayer(EntityPlayer player) {}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean canRenderOnFire() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setFire(int time) {}
|
||||
|
||||
public ItemStack getHeldItem() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setCurrentItemOrArmor(int i, ItemStack itemstack) {}
|
||||
|
||||
public ItemStack[] getLastActiveItems() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public ItemStack getEntityItem() {
|
||||
return ((Entity)this).getDataWatcher().getWatchableObjectItemStack(12);
|
||||
}
|
||||
|
||||
public void setEntityItem(ItemStack stack) {
|
||||
((Entity)this).getDataWatcher().updateObject(12, stack);
|
||||
try {
|
||||
String foundName = stack.getTagCompound().getString("id");
|
||||
getEntityData().setString("name", foundName);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (Dartcraft.proxy.isSimulating(((Entity)this).worldObj));
|
||||
}
|
||||
|
||||
public ItemStack getEquipmentInSlot(int slot) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,147 @@
|
|||
package ley.modding.dartcraft.entity;
|
||||
|
||||
import ley.modding.dartcraft.Dartcraft;
|
||||
import ley.modding.dartcraft.api.IBottleRenderable;
|
||||
import ley.modding.dartcraft.item.Items;
|
||||
import ley.modding.dartcraft.util.EntityUtils;
|
||||
import ley.modding.dartcraft.util.ItemUtils;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityFlyingFlask extends EntityThrowable implements IBottleRenderable {
|
||||
|
||||
public EntityLivingBase contained;
|
||||
|
||||
private boolean creative = false;
|
||||
|
||||
private boolean capture = false;
|
||||
|
||||
public EntityFlyingFlask(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
public EntityFlyingFlask(World world, double x, double y, double z) {
|
||||
super(world, x, y, z);
|
||||
}
|
||||
|
||||
public EntityFlyingFlask(World world, EntityLivingBase thrower, ItemStack flaskStack) {
|
||||
super(world, thrower);
|
||||
try {
|
||||
if (thrower instanceof EntityPlayer && ((EntityPlayer)thrower).capabilities.isCreativeMode)
|
||||
this.creative = true;
|
||||
if (flaskStack != null) {
|
||||
NBTTagCompound comp = (NBTTagCompound)flaskStack.getTagCompound().copy();
|
||||
Entity entity = EntityList.createEntityFromNBT(comp, world);
|
||||
NBTTagCompound dartTag = EntityUtils.getModComp(entity);
|
||||
dartTag.removeTag("time");
|
||||
dartTag.removeTag("timeTime");
|
||||
dartTag.setInteger("timeImmune", 10);
|
||||
this.contained = (EntityLivingBase)entity;
|
||||
} else {
|
||||
this.capture = true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
protected void entityInit() {
|
||||
super.entityInit();
|
||||
((Entity)this).getDataWatcher().addObject(12, new ItemStack(Items.entitybottle));
|
||||
}
|
||||
|
||||
protected void onImpact(MovingObjectPosition pos) {
|
||||
if (Dartcraft.proxy.isSimulating(((Entity)this).worldObj)) {
|
||||
if (this.contained != null) {
|
||||
this.contained.setPosition(((Entity)this).posX, ((Entity)this).posY, ((Entity)this).posZ);
|
||||
((Entity)this).worldObj.spawnEntityInWorld((Entity)this.contained);
|
||||
if (!this.creative) {
|
||||
ItemStack flaskStack = new ItemStack(Items.forceflask);
|
||||
ItemUtils.dropItem(flaskStack, ((Entity)this).worldObj, ((Entity)this).posX, ((Entity)this).posY, ((Entity)this).posZ);
|
||||
}
|
||||
((Entity)this).worldObj.playSoundAtEntity((Entity)this, "random.pop", 1.0F,
|
||||
EntityUtils.randomPitch());
|
||||
} else if (this.capture) {
|
||||
if (!bottleEntity(pos.entityHit)) {
|
||||
((Entity)this).worldObj.playSoundAtEntity((Entity)this, "random.pop", 1.0F,
|
||||
EntityUtils.randomPitch());
|
||||
ItemUtils.dropItem(new ItemStack(Items.forceflask), ((Entity)this).worldObj, ((Entity)this).posX, ((Entity)this).posY, ((Entity)this).posZ);
|
||||
}
|
||||
}
|
||||
setDead();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean bottleEntity(Entity entity) {
|
||||
try {
|
||||
if (entity == null)
|
||||
return false;
|
||||
EntityLivingBase victim = null;
|
||||
if (entity instanceof EntityLivingBase)
|
||||
victim = (EntityLivingBase)entity;
|
||||
if (victim != null && !((Entity)victim).isDead && victim.getHealth() > 0.0F) {
|
||||
boolean nope = false;
|
||||
/*boolean whitelisted = !Config.entityWhitelist;
|
||||
if (!whitelisted && PluginBottles.whitelist != null)
|
||||
for (String check : PluginBottles.whitelist) {
|
||||
if (check != null && check.equals(victim.getClass().getCanonicalName())) {
|
||||
whitelisted = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!whitelisted)
|
||||
nope = true;*/
|
||||
if (victim instanceof EntityPlayer || victim instanceof EntityBottle)
|
||||
nope = true;
|
||||
if (!nope && (victim instanceof net.minecraft.entity.monster.EntityMob || victim instanceof net.minecraft.entity.monster.EntityGhast)) {
|
||||
float maxHealth = 0.0F;
|
||||
try {
|
||||
maxHealth = (float)victim.getAttributeMap().getAttributeInstanceByName("generic.maxHealth").getAttributeValue();
|
||||
} catch (Exception e) {}
|
||||
float ratio = victim.getHealth() / maxHealth;
|
||||
float limit = 0.25F;
|
||||
if (ratio >= limit && maxHealth >= 5.0F)
|
||||
nope = true;
|
||||
NBTTagCompound dartTag = EntityUtils.getModComp(entity);
|
||||
dartTag.removeTag("time");
|
||||
dartTag.removeTag("timeTime");
|
||||
dartTag.setInteger("timeImmune", 5);
|
||||
}
|
||||
if (nope) {
|
||||
((Entity)this).worldObj.playSoundAtEntity((Entity)victim, "dartcraft:nope", 2.0F,
|
||||
EntityUtils.randomPitch());
|
||||
return false;
|
||||
}
|
||||
ItemStack bottleStack = EntityUtils.bottleEntity((Entity)victim);
|
||||
((Entity)this).worldObj.playSoundAtEntity((Entity)victim, "dartcraft:swipe", 2.0F,
|
||||
EntityUtils.randomPitch());
|
||||
((Entity)this).worldObj.removeEntity((Entity)victim);
|
||||
victim = null;
|
||||
ItemUtils.dropItem(bottleStack, ((Entity)this).worldObj, ((Entity)this).posX, ((Entity)this).posY, ((Entity)this).posZ);
|
||||
}
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack getEntityItem() {
|
||||
return ((Entity)this).getDataWatcher().getWatchableObjectItemStack(12);
|
||||
}
|
||||
|
||||
public void setEntityItem(ItemStack stack) {
|
||||
((Entity)this).getDataWatcher().updateObject(12, stack);
|
||||
try {
|
||||
getEntityData().setString("name", stack.getTagCompound().getString("id"));
|
||||
} catch (Exception e) {}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,118 @@
|
|||
package ley.modding.dartcraft.event;
|
||||
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import ley.modding.dartcraft.Dartcraft;
|
||||
import ley.modding.dartcraft.item.Items;
|
||||
import ley.modding.dartcraft.util.EntityUtils;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityAgeable;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.monster.*;
|
||||
import net.minecraft.entity.passive.*;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
|
||||
public class EntityBottleHandler {
|
||||
|
||||
@EventHandler
|
||||
public void handleTaggedPickup(EntityItemPickupEvent event) {
|
||||
try {
|
||||
if (((PlayerEvent)event).entityPlayer == null || event.item == null || event.item.getEntityItem() == null)
|
||||
return;
|
||||
boolean trigger = false;
|
||||
if (event.item.getEntityItem().getItem() == Items.entitybottle)
|
||||
if (meshBottles(((PlayerEvent)event).entityPlayer, event.item.getEntityItem())) {
|
||||
event.setCanceled(true);
|
||||
trigger = true;
|
||||
}
|
||||
if (Dartcraft.proxy.isSimulating(((Entity)((PlayerEvent)event).entityPlayer).worldObj) && trigger) {
|
||||
((Entity)((PlayerEvent)event).entityPlayer).worldObj.playSoundAtEntity((Entity)((PlayerEvent)event).entityPlayer, "random.pop", 0.25F,
|
||||
EntityUtils.randomPitch());
|
||||
((Entity)((PlayerEvent)event).entityPlayer).worldObj.removeEntity((Entity)event.item);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean meshBottles(EntityPlayer player, ItemStack item) {
|
||||
try {
|
||||
EntityLivingBase entityOne = (EntityLivingBase)EntityList.createEntityFromNBT(item
|
||||
.getTagCompound(), null);
|
||||
if (!getHandleEntity((Entity)entityOne))
|
||||
return false;
|
||||
String nameOne = entityOne.getClass().getCanonicalName();
|
||||
ItemStack[] equipOne = new ItemStack[5];
|
||||
int color = 0;
|
||||
boolean child = false;
|
||||
boolean villager = false;
|
||||
String owner = "";
|
||||
String nameTagName = entityOne.getEntityData().getString("nameTagName");
|
||||
if (entityOne instanceof EntitySheep)
|
||||
color = ((EntitySheep)entityOne).getFleeceColor();
|
||||
if (entityOne instanceof EntityAgeable && ((EntityAgeable)entityOne).isChild())
|
||||
child = true;
|
||||
if (entityOne instanceof EntityZombie && ((EntityZombie)entityOne).isChild())
|
||||
child = true;
|
||||
if (entityOne instanceof EntityZombie && ((EntityZombie)entityOne).isVillager())
|
||||
villager = true;
|
||||
if (entityOne instanceof EntityTameable) {
|
||||
EntityLivingBase owningEntity = ((EntityTameable) entityOne).getOwner();
|
||||
owner = (owningEntity != null) ? owningEntity.getCommandSenderName() : null;
|
||||
}
|
||||
int i;
|
||||
for (i = 0; i < 5; i++) {
|
||||
equipOne[i] = entityOne.getEquipmentInSlot(i);
|
||||
if (equipOne[i] != null && (!(entityOne instanceof EntityPigZombie) || i != 0 || equipOne[i]
|
||||
.getItem() != net.minecraft.init.Items.golden_sword))
|
||||
return false;
|
||||
}
|
||||
for (i = 0; i < player.inventory.mainInventory.length; i++) {
|
||||
ItemStack invStack = player.inventory.mainInventory[i];
|
||||
if (invStack != null && invStack.getItem() == Items.entitybottle && invStack
|
||||
.hasTagCompound() && invStack.stackSize < invStack.getMaxStackSize()) {
|
||||
EntityLivingBase entityTwo = (EntityLivingBase)EntityList.createEntityFromNBT(invStack
|
||||
.getTagCompound(), null);
|
||||
if (nameOne.equals(entityTwo.getClass().getCanonicalName()))
|
||||
if (!(entityTwo instanceof EntitySheep) || ((EntitySheep)entityTwo).getFleeceColor() == color)
|
||||
if (!(entityTwo instanceof EntityAgeable) || ((EntityAgeable)entityTwo).isChild() == child)
|
||||
if (!(entityTwo instanceof EntityZombie) || ((EntityZombie)entityTwo).isChild() == child)
|
||||
if (!(entityTwo instanceof EntityZombie) || ((EntityZombie)entityTwo).isVillager() == villager)
|
||||
if (!(entityTwo instanceof EntityTameable) || ((EntityTameable)entityTwo).getOwner()
|
||||
.equals(owner)) {
|
||||
for (int j = 0; j < 5; j++) {
|
||||
ItemStack checkStack = entityTwo.getEquipmentInSlot(j);
|
||||
if (checkStack != null && (!(entityOne instanceof EntityPigZombie) || j != 0 || checkStack
|
||||
.getItem() != net.minecraft.init.Items.golden_sword))
|
||||
return false;
|
||||
}
|
||||
invStack.stackSize++;
|
||||
invStack.animationsToGo = 10;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static boolean getHandleEntity(Entity entity) {
|
||||
try {
|
||||
String name = entity.getClass().getCanonicalName();
|
||||
Class[] accepted = {
|
||||
EntityCow.class, EntityChicken.class, EntitySheep.class, EntityPig.class, EntityWolf.class, EntityZombie.class, EntityEnderman.class, EntityGhast.class, EntityBlaze.class, EntityPigZombie.class,
|
||||
EntitySkeleton.class };
|
||||
for (Class check : accepted) {
|
||||
if (name.equals(check.getCanonicalName()))
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
249
src/main/java/ley/modding/dartcraft/item/ItemEntityBottle.java
Normal file
249
src/main/java/ley/modding/dartcraft/item/ItemEntityBottle.java
Normal file
|
@ -0,0 +1,249 @@
|
|||
package ley.modding.dartcraft.item;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ley.modding.dartcraft.Dartcraft;
|
||||
import ley.modding.dartcraft.entity.EntityBottle;
|
||||
import ley.modding.dartcraft.entity.EntityFlyingFlask;
|
||||
import ley.modding.dartcraft.util.EntityUtils;
|
||||
import ley.modding.dartcraft.util.ItemUtils;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.entity.monster.EntitySkeleton;
|
||||
import net.minecraft.entity.passive.EntityChicken;
|
||||
import net.minecraft.entity.passive.EntityCow;
|
||||
import net.minecraft.entity.passive.EntityPig;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemEntityBottle extends Item {
|
||||
|
||||
public static final int ENTITY_META = 0;
|
||||
|
||||
public static final int AREA_META = 1;
|
||||
|
||||
public static final int CHECK_TIME = 40;
|
||||
|
||||
public ItemEntityBottle() {
|
||||
setCreativeTab(Dartcraft.tab);
|
||||
setMaxStackSize(64);
|
||||
setUnlocalizedName("entitybottle");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean thing) {
|
||||
if (stack.hasTagCompound()) {
|
||||
NBTTagCompound comp = (NBTTagCompound)stack.getTagCompound().copy();
|
||||
if (stack.getItemDamage() == 0) {
|
||||
Entity entity = null;
|
||||
if (comp.hasKey("CanPickUpLoot"))
|
||||
entity = EntityList.createEntityFromNBT(comp, ((Entity)player).worldObj);
|
||||
if (comp != null && comp.hasKey("dartName")) {
|
||||
String name = null;
|
||||
if (entity instanceof EntityBottle)
|
||||
name = ((EntityBottle)entity).getBottledName();
|
||||
if (name != null) {
|
||||
list.clear();
|
||||
list.add(name);
|
||||
}
|
||||
}
|
||||
} else if (stack.getItemDamage() == 1) {
|
||||
if (comp.hasKey("specialID")) {
|
||||
if (comp.getString("specialID").equals("fountain"))
|
||||
list.add("Fairy Fountain");
|
||||
if (comp.getString("specialID").equals("darthome"))
|
||||
list.add("Dart Home");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String retrieveName(String name) {
|
||||
if (name.contains("entity.Cat.name"))
|
||||
return "Cat";
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
if (!stack.hasTagCompound())
|
||||
return super.getItemStackDisplayName(stack);
|
||||
if (stack.getItemDamage() == 0) {
|
||||
String name = stack.getTagCompound().getString("dartName");
|
||||
NBTTagCompound comp = (NBTTagCompound)stack.getTagCompound().copy();
|
||||
if (name.equals("entity.DartCraft.entityBeeSwarm.name"))
|
||||
return "Flask of Angry Bees";
|
||||
if (name.equals("entity.DartCraft.entityFairy.name"))
|
||||
return "Bottled Fairy";
|
||||
if (name != null && !name.equals(""))
|
||||
return "" + name;
|
||||
} else if (stack.getItemDamage() == 1) {
|
||||
return "Bottled Area";
|
||||
}
|
||||
return super.getItemStackDisplayName(stack);
|
||||
}
|
||||
|
||||
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) {
|
||||
if (stack == null || !Dartcraft.proxy.isSimulating(world))
|
||||
return;
|
||||
if (stack.getItemDamage() == 0) {
|
||||
if (stack.hasTagCompound())
|
||||
stack.getTagCompound().setInteger("timeout", stack.getTagCompound().getInteger("timeout") + 1);
|
||||
if (stack.hasTagCompound() && stack.getTagCompound().hasKey("wasDropped"))
|
||||
stack.getTagCompound().removeTag("wasDropped");
|
||||
if (stack != null && stack.getItem() instanceof ItemEntityBottle && stack.hasTagCompound() && stack
|
||||
.getTagCompound().getInteger("timeout") >= 40) {
|
||||
stack.getTagCompound().setInteger("timeout", 0);
|
||||
NBTTagCompound comp = stack.getTagCompound();
|
||||
String name = comp.getString("dartName");
|
||||
if (name != null && name.equals("Creeper")) {
|
||||
boolean bane = (comp.hasKey("ForgeData") && comp.getCompoundTag("ForgeData").hasKey("DartCraft") && comp.getCompoundTag("ForgeData").getCompoundTag("DartCraft").getBoolean("baned"));
|
||||
if (!bane && entity instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer)entity;
|
||||
world.createExplosion((Entity)new EntityCreeper(world), ((Entity)player).posX, ((Entity)player).posY, ((Entity)player).posZ, 0.25F, false);
|
||||
comp.setBoolean("dartToDestroy", true);
|
||||
for (int i = 0; i < player.inventory.mainInventory.length; i++) {
|
||||
ItemStack tempStack = player.inventory.mainInventory[i];
|
||||
if (tempStack != null && tempStack.getItem() instanceof ItemEntityBottle && tempStack
|
||||
.hasTagCompound() && tempStack.getTagCompound().hasKey("dartToDestroy") && tempStack
|
||||
.getTagCompound().getBoolean("dartToDestroy")) {
|
||||
//player.inventory.setInventorySlotContents(i, new ItemStack(PAItems.resource, CommonProxy.rand.nextInt(3) + 1, 3));
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (comp.hasKey("Fire") && comp.getShort("Fire") > 0)
|
||||
comp.setShort("Fire", (short)-1);
|
||||
if (comp.hasKey("FallDistance") && comp.getFloat("FallDistance") > 0.0F)
|
||||
comp.setFloat("FallDistance", 0.0F);
|
||||
short maxHealth = 0;
|
||||
Entity temp = EntityList.createEntityFromNBT((NBTTagCompound)comp.copy(), world);
|
||||
EntityLivingBase bottled = null;
|
||||
if (temp instanceof EntityLivingBase)
|
||||
bottled = (EntityLivingBase)temp;
|
||||
try {
|
||||
maxHealth = (short)(int)bottled.getAttributeMap().getAttributeInstanceByName("generic.maxHealth").getAttributeValue();
|
||||
} catch (Exception e) {}
|
||||
if (maxHealth > 0 && comp.hasKey("Health") && comp.getShort("Health") < maxHealth)
|
||||
comp.setShort("Health", (short)(comp.getShort("Health") + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) {
|
||||
try {
|
||||
if (!Dartcraft.proxy.isSimulating(world) || stack == null || stack
|
||||
.getItemDamage() == 1);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
try {
|
||||
if (stack.getItemDamage() == 0) {
|
||||
boolean thrown = player.isSneaking();
|
||||
if (Dartcraft.proxy.isSimulating(world))
|
||||
if (!thrown) {
|
||||
spawnEntity(world, player, stack);
|
||||
} else {
|
||||
EntityFlyingFlask flask = new EntityFlyingFlask(world, (EntityLivingBase)player, stack);
|
||||
world.spawnEntityInWorld((Entity)flask);
|
||||
flask.setEntityItem(stack.copy());
|
||||
world.playSoundAtEntity((Entity)player, "random.bow", 1.0F,
|
||||
EntityUtils.randomPitch());
|
||||
}
|
||||
stack.stackSize--;
|
||||
if (!thrown) {
|
||||
if (stack.stackSize > 0) {
|
||||
if (!player.inventory.addItemStackToInventory(new ItemStack(Items.forceflask)))
|
||||
if (Dartcraft.proxy.isSimulating(world))
|
||||
ItemUtils.dropItem(new ItemStack(Items.forceflask), world, ((Entity)player).posX, ((Entity)player).posY, ((Entity)player).posZ);
|
||||
return stack;
|
||||
}
|
||||
return new ItemStack(Items.forceflask);
|
||||
}
|
||||
} else if (stack.getItemDamage() == 1) {
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
|
||||
private void spawnEntity(World world, EntityPlayer player, ItemStack stack) {
|
||||
if (stack != null && stack.hasTagCompound()) {
|
||||
NBTTagCompound comp = (NBTTagCompound)stack.getTagCompound().copy();
|
||||
Entity entity = EntityList.createEntityFromNBT(comp, world);
|
||||
if (entity != null && entity instanceof EntityLivingBase) {
|
||||
double xIncr = (-MathHelper.sin(((Entity)player).rotationYaw / 180.0F * 3.1415927F) * MathHelper.cos(((Entity)player).rotationPitch / 180.0F * 3.1415927F));
|
||||
double yIncr = -MathHelper.sin(((Entity)player).rotationPitch / 180.0F * 3.1415927F);
|
||||
double zIncr = (MathHelper.cos(((Entity)player).rotationYaw / 180.0F * 3.1415927F) * MathHelper.cos(((Entity)player).rotationPitch / 180.0F * 3.1415927F));
|
||||
double x = ((Entity)player).posX + xIncr * 2.0D;
|
||||
double y = ((Entity)player).posY;
|
||||
double z = ((Entity)player).posZ + zIncr * 2.0D;
|
||||
EntityLivingBase restored = (EntityLivingBase)entity;
|
||||
restored.setPosition(x, y, z);
|
||||
NBTTagCompound dartTag = EntityUtils.getModComp((Entity)restored);
|
||||
dartTag.removeTag("time");
|
||||
dartTag.removeTag("timeTime");
|
||||
dartTag.setInteger("timeImmune", 10);
|
||||
world.spawnEntityInWorld((Entity)restored);
|
||||
world.playSoundAtEntity((Entity)player, "dartcraft:bottle", 2.0F,
|
||||
EntityUtils.randomPitch());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasCustomEntity(ItemStack stack) {
|
||||
if (stack == null || !stack.hasTagCompound())
|
||||
return false;
|
||||
return ((!stack.getTagCompound().getBoolean("wasDropped") && stack.getItemDamage() == 0) || (
|
||||
!stack.getTagCompound().hasKey("specialID") && stack.getItemDamage() == 1 && stack.stackSize < 2));
|
||||
}
|
||||
|
||||
public Entity createEntity(World world, Entity entity, ItemStack stack) {
|
||||
if (stack == null || !stack.hasTagCompound())
|
||||
return null;
|
||||
try {
|
||||
if (stack.getItemDamage() == 0) {
|
||||
EntityBottle item = new EntityBottle(world, entity.posX, entity.posY, entity.posZ, stack);
|
||||
((Entity)item).motionX = entity.motionX;
|
||||
((Entity)item).motionY = entity.motionY;
|
||||
((Entity)item).motionZ = entity.motionZ;
|
||||
return (Entity)item;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item par1, CreativeTabs tabs, List list) {
|
||||
try {
|
||||
list.add(EntityUtils.bottleEntity((Entity)new EntityCow(null)));
|
||||
list.add(EntityUtils.bottleEntity((Entity)new EntityPig(null)));
|
||||
list.add(EntityUtils.bottleEntity((Entity)new EntityChicken(null)));
|
||||
EntitySkeleton skeleton = new EntitySkeleton(null);
|
||||
skeleton.setSkeletonType(1);
|
||||
list.add(EntityUtils.bottleEntity((Entity)skeleton));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
294
src/main/java/ley/modding/dartcraft/item/ItemForceFlask.java
Normal file
294
src/main/java/ley/modding/dartcraft/item/ItemForceFlask.java
Normal file
|
@ -0,0 +1,294 @@
|
|||
package ley.modding.dartcraft.item;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ley.modding.dartcraft.Dartcraft;
|
||||
import ley.modding.dartcraft.entity.EntityBottle;
|
||||
import ley.modding.dartcraft.entity.EntityFlyingFlask;
|
||||
import ley.modding.dartcraft.event.EntityBottleHandler;
|
||||
import ley.modding.dartcraft.util.EntityUtils;
|
||||
import ley.modding.dartcraft.util.ItemUtils;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemForceFlask extends Item {
|
||||
|
||||
public static final int EMPTY_META = 0;
|
||||
|
||||
public static final int MILK_META = 1;
|
||||
|
||||
public static final int FORCE_META = 2;
|
||||
|
||||
public static final int CHATEAU_META = 3;
|
||||
|
||||
public static final int GREEN_META = 4;
|
||||
|
||||
public static final int RED_META = 5;
|
||||
|
||||
public static final int BLUE_META = 6;
|
||||
|
||||
public static final float FLASK_AMOUNT = 250.0F;
|
||||
|
||||
public static final float DRINK_AMOUNT = 1.0F;
|
||||
|
||||
public ItemForceFlask() {
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
setUnlocalizedName("forceflask");
|
||||
setCreativeTab(Dartcraft.tab);
|
||||
setMaxStackSize(64);
|
||||
setContainerItem(this);
|
||||
}
|
||||
|
||||
public boolean doesContainerItemLeaveCraftingGrid(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public ItemStack getContainerItemStack(ItemStack stack) {
|
||||
if (stack != null)
|
||||
if (stack.hasTagCompound() && stack.getTagCompound().getBoolean("triedCraft"))
|
||||
return new ItemStack(Blocks.glass);
|
||||
return new ItemStack(this, 1, 0);
|
||||
}
|
||||
|
||||
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) {
|
||||
try {
|
||||
if (Dartcraft.proxy.isSimulating(world) && stack != null && entity != null && entity instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer)entity;
|
||||
if (stack.getItemDamage() == 2 || stack.getItemDamage() == 1) {
|
||||
if (!stack.hasTagCompound())
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
if (stack.getTagCompound().hasKey("triedCraft") && stack.getTagCompound()
|
||||
.getBoolean("triedCraft"))
|
||||
stack.getTagCompound().removeTag("triedCraft");
|
||||
} else if (stack.getItemDamage() != 0 || stack.stackSize == 0) {
|
||||
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
String name = "item.forceflask_";
|
||||
if (stack != null)
|
||||
switch (stack.getItemDamage()) {
|
||||
case 0:
|
||||
name = name + "empty";
|
||||
break;
|
||||
case 1:
|
||||
name = name + "milk";
|
||||
break;
|
||||
case 4:
|
||||
name = name + "potion_green";
|
||||
break;
|
||||
case 6:
|
||||
name = name + "potion_blue";
|
||||
break;
|
||||
case 5:
|
||||
name = name + "potion_red";
|
||||
break;
|
||||
case 3:
|
||||
name = name + "potion_chateau";
|
||||
break;
|
||||
case 2:
|
||||
name = name + "potion_force";
|
||||
break;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase entity) {
|
||||
try {
|
||||
if (stack.getItemDamage() == 0)
|
||||
if (entity instanceof net.minecraft.entity.passive.EntityCow) {
|
||||
player.swingItem();
|
||||
if (stack.stackSize == 1)
|
||||
stack.setItemDamage(1);
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public EnumAction getItemUseAction(ItemStack stack) {
|
||||
try {
|
||||
switch (stack.getItemDamage()) {
|
||||
case 1:
|
||||
case 5:
|
||||
case 4:
|
||||
case 2:
|
||||
case 6:
|
||||
case 3:
|
||||
return EnumAction.drink;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return EnumAction.none;
|
||||
}
|
||||
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
try {
|
||||
if (stack.getItemDamage() == 0 && player.isSneaking()) {
|
||||
if (Dartcraft.proxy.isSimulating(world)) {
|
||||
EntityFlyingFlask flask = new EntityFlyingFlask(world, (EntityLivingBase)player, null);
|
||||
world.spawnEntityInWorld((Entity)flask);
|
||||
world.playSoundAtEntity((Entity)player, "random.bow", 1.0F,
|
||||
EntityUtils.randomPitch());
|
||||
}
|
||||
stack.stackSize--;
|
||||
return stack;
|
||||
}
|
||||
NBTTagCompound dartTag = EntityUtils.getModComp((Entity)player);
|
||||
if ((stack.getItemDamage() >= 32 && stack.hasTagCompound() && stack
|
||||
.getTagCompound().getFloat("amount") >= 1.0F) || stack.getItemDamage() == 1)
|
||||
player.setItemInUse(stack, getMaxItemUseDuration(stack));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
|
||||
public int getMaxItemUseDuration(ItemStack stack) {
|
||||
try {
|
||||
switch (stack.getItemDamage()) {
|
||||
case 1:
|
||||
return 16;
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
return 32;
|
||||
}
|
||||
if (stack.getItemDamage() >= 32)
|
||||
return 32;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public ItemStack onEaten(ItemStack stack, World world, EntityPlayer player) {
|
||||
if (stack == null || world == null || player == null)
|
||||
return stack;
|
||||
NBTTagCompound dartTag = EntityUtils.getModComp((Entity)player);
|
||||
boolean server = Dartcraft.proxy.isSimulating(((Entity)player).worldObj);
|
||||
if (dartTag.hasKey("lastPotion"))
|
||||
return stack;
|
||||
if (dartTag.hasKey("combatTime"))
|
||||
return stack;
|
||||
if (stack != null) {
|
||||
int meta = stack.getItemDamage();
|
||||
switch (meta) {
|
||||
case 1:
|
||||
if (server) {
|
||||
player.clearActivePotions();
|
||||
player.heal(4.0F);
|
||||
world.playSoundAtEntity((Entity)player, "dartcraft:heart", 1.0F, 1.0F);
|
||||
return reduceContainer(player, stack);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
|
||||
private ItemStack reduceContainer(EntityPlayer player, ItemStack stack) {
|
||||
try {
|
||||
stack.stackSize--;
|
||||
if (stack.stackSize <= 0) {
|
||||
player.setCurrentItemOrArmor(0, new ItemStack(this));
|
||||
stack = new ItemStack(this);
|
||||
} else {
|
||||
player.inventory.addItemStackToInventory(new ItemStack(this));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
|
||||
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
|
||||
if (!Dartcraft.proxy.isSimulating(((Entity)player).worldObj) || stack == null || stack
|
||||
.getItemDamage() != 0)
|
||||
return true;
|
||||
World world = ((Entity)player).worldObj;
|
||||
EntityLivingBase victim = null;
|
||||
if (entity instanceof EntityLivingBase)
|
||||
victim = (EntityLivingBase)entity;
|
||||
if (victim != null && !((Entity)victim).isDead && victim.getHealth() > 0.0F) {
|
||||
boolean nope = false;
|
||||
//TODO Whitelist
|
||||
/*boolean whitelisted = !Config.entityWhitelist;
|
||||
if (!whitelisted && PluginBottles.whitelist != null)
|
||||
for (String check : PluginBottles.whitelist) {
|
||||
if (check != null && check.equals(victim.getClass().getCanonicalName())) {
|
||||
whitelisted = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!whitelisted)
|
||||
nope = true;*/
|
||||
if (victim instanceof EntityPlayer || victim instanceof EntityBottle)
|
||||
nope = true;
|
||||
if (!nope && (victim instanceof net.minecraft.entity.monster.EntityMob || victim instanceof net.minecraft.entity.monster.EntityGhast)) {
|
||||
float maxHealth = 0.0F;
|
||||
try {
|
||||
maxHealth = (float)victim.getAttributeMap().getAttributeInstanceByName("generic.maxHealth").getAttributeValue();
|
||||
} catch (Exception e) {}
|
||||
float ratio = victim.getHealth() / maxHealth;
|
||||
float limit = 0.25F;
|
||||
if (ratio >= limit && maxHealth >= 5.0F)
|
||||
nope = true;
|
||||
NBTTagCompound dartTag = EntityUtils.getModComp((Entity)victim);
|
||||
if (player.capabilities.isCreativeMode)
|
||||
nope = false;
|
||||
dartTag.removeTag("time");
|
||||
dartTag.removeTag("timeTime");
|
||||
dartTag.setInteger("timeImmune", 5);
|
||||
}
|
||||
if (nope) {
|
||||
world.playSoundAtEntity((Entity) victim, "dartcraft:nope", 2.0F,
|
||||
EntityUtils.randomPitch());
|
||||
return true;
|
||||
}
|
||||
ItemStack bottleStack = EntityUtils.bottleEntity((Entity)victim);
|
||||
world.playSoundAtEntity((Entity)victim, "dartcraft:swipe", 2.0F,
|
||||
EntityUtils.randomPitch());
|
||||
world.removeEntity((Entity)victim);
|
||||
victim = null;
|
||||
stack.stackSize--;
|
||||
if (stack.stackSize <= 0) {
|
||||
player.setCurrentItemOrArmor(0, bottleStack);
|
||||
} else if (!EntityBottleHandler.meshBottles(player, bottleStack)) {
|
||||
if (!player.inventory.addItemStackToInventory(bottleStack))
|
||||
if (Dartcraft.proxy.isSimulating(world))
|
||||
ItemUtils.dropItem(bottleStack, world, ((Entity)player).posX, ((Entity)player).posY, ((Entity)player).posZ);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item meta, CreativeTabs tabs, List itemList) {
|
||||
int[] toAdd = { 0, 1, 2, 4, 5, 6 };
|
||||
for (int i : toAdd)
|
||||
itemList.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
}
|
|
@ -12,5 +12,7 @@ public class Items {
|
|||
public static Item forceshears;
|
||||
public static Item forcepickaxe;
|
||||
public static Item forcemitts;
|
||||
public static Item forceflask;
|
||||
public static Item entitybottle;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,18 @@
|
|||
package ley.modding.dartcraft.proxy;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import ley.modding.dartcraft.Dartcraft;
|
||||
import ley.modding.dartcraft.client.renderer.entity.RenderColdAnimal;
|
||||
import ley.modding.dartcraft.client.renderer.entity.RenderEntityBottle;
|
||||
import ley.modding.dartcraft.client.renderer.item.RenderItemForceFlask;
|
||||
import ley.modding.dartcraft.entity.*;
|
||||
import ley.modding.dartcraft.item.Items;
|
||||
import net.minecraft.client.model.ModelChicken;
|
||||
import net.minecraft.client.model.ModelCow;
|
||||
import net.minecraft.client.model.ModelPig;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
|
||||
public class ClientProxy extends CommonProxy {
|
||||
|
||||
|
@ -8,4 +20,21 @@ public class ClientProxy extends CommonProxy {
|
|||
return world != null && !world.isRemote;
|
||||
}
|
||||
|
||||
public void bindTexture(String texture) {
|
||||
if (texture != null)
|
||||
getClientInstance().getTextureManager().bindTexture(new ResourceLocation(Dartcraft.MODID, texture));
|
||||
}
|
||||
|
||||
public void init() {
|
||||
super.init();
|
||||
MinecraftForgeClient.registerItemRenderer(Items.forceflask, RenderItemForceFlask.instance);
|
||||
MinecraftForgeClient.registerItemRenderer(Items.entitybottle, RenderItemForceFlask.instance);
|
||||
RenderEntityBottle bottleRenderer = new RenderEntityBottle();
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBottle.class, bottleRenderer);
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityFlyingFlask.class, bottleRenderer);
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityColdChicken.class, new RenderColdAnimal(new ModelChicken(), 0.6f, "textures/entity/coldChicken.png"));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityColdCow.class, new RenderColdAnimal(new ModelCow(), 0.6f, "textures/entity/coldCow.png"));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityColdPig.class, new RenderColdAnimal(new ModelPig(), 0.6f, "textures/entity/coldPig.png"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,11 +1,17 @@
|
|||
package ley.modding.dartcraft.proxy;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class CommonProxy {
|
||||
|
||||
public static Random rand = new Random();
|
||||
|
||||
public void sendChatToPlayer(EntityPlayer player, String message) {
|
||||
player.addChatMessage(new ChatComponentText(message));
|
||||
}
|
||||
|
@ -14,4 +20,15 @@ public class CommonProxy {
|
|||
return true;
|
||||
}
|
||||
|
||||
public Minecraft getClientInstance() {
|
||||
return FMLClientHandler.instance().getClient();
|
||||
}
|
||||
|
||||
public void bindTexture(String texture) {
|
||||
}
|
||||
|
||||
public void init() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
84
src/main/java/ley/modding/dartcraft/util/EntityUtils.java
Normal file
84
src/main/java/ley/modding/dartcraft/util/EntityUtils.java
Normal file
|
@ -0,0 +1,84 @@
|
|||
package ley.modding.dartcraft.util;
|
||||
|
||||
import ley.modding.dartcraft.Dartcraft;
|
||||
import ley.modding.dartcraft.item.Items;
|
||||
import ley.modding.dartcraft.proxy.CommonProxy;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.*;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
|
||||
public class EntityUtils {
|
||||
|
||||
public static NBTTagCompound getModComp(Entity entity) {
|
||||
if (entity == null || entity.getEntityData() == null)
|
||||
return new NBTTagCompound();
|
||||
NBTTagCompound comp = entity.getEntityData().hasKey(Dartcraft.MODID) ? entity.getEntityData().getCompoundTag(Dartcraft.MODID) : null;
|
||||
if (comp == null) {
|
||||
entity.getEntityData().setTag(Dartcraft.MODID, (NBTBase)new NBTTagCompound());
|
||||
comp = entity.getEntityData().getCompoundTag(Dartcraft.MODID);
|
||||
}
|
||||
return comp;
|
||||
}
|
||||
|
||||
public static ItemStack bottleEntity(Entity victim) {
|
||||
try {
|
||||
String entityName = EntityList.getEntityString(victim);
|
||||
if (victim == null || entityName == null)
|
||||
return null;
|
||||
ItemStack bottleStack = new ItemStack(Items.entitybottle);
|
||||
NBTTagCompound bottleComp = new NBTTagCompound();
|
||||
victim.writeToNBT(bottleComp);
|
||||
bottleComp.removeTag("OnGround");
|
||||
bottleComp.removeTag("PersistenceRequired");
|
||||
bottleComp.removeTag("Dimension");
|
||||
bottleComp.removeTag("PortalCooldown");
|
||||
bottleComp.removeTag("UUIDLeast");
|
||||
bottleComp.removeTag("UUIDMost");
|
||||
bottleComp.removeTag("DropChances");
|
||||
bottleComp.removeTag("Motion");
|
||||
bottleComp.removeTag("Pos");
|
||||
bottleComp.removeTag("Rotation");
|
||||
NBTTagDouble dummyDouble = new NBTTagDouble(0.0D);
|
||||
NBTTagFloat dummyFloat = new NBTTagFloat(0.0F);
|
||||
NBTTagList motion = new NBTTagList();
|
||||
motion.appendTag(dummyDouble.copy());
|
||||
motion.appendTag(dummyDouble.copy());
|
||||
motion.appendTag(dummyDouble.copy());
|
||||
NBTTagList rot = new NBTTagList();
|
||||
rot.appendTag(dummyFloat.copy());
|
||||
rot.appendTag(dummyFloat.copy());
|
||||
bottleComp.setTag("Pos", motion.copy());
|
||||
bottleComp.setTag("Motion", motion.copy());
|
||||
bottleComp.setTag("Rotation", rot.copy());
|
||||
bottleComp.setString("id", entityName);
|
||||
bottleComp.setString("dartName", victim.getCommandSenderName());
|
||||
bottleStack.setTagCompound(bottleComp);
|
||||
return bottleStack;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static Entity getEntity(String name) {
|
||||
try {
|
||||
Class entityClass = (Class) EntityList.stringToClassMapping.get(name);
|
||||
if (entityClass != null) {
|
||||
Constructor<Entity> constructor = entityClass.getConstructor(new Class[] { World.class });
|
||||
Entity entity = constructor.newInstance(new Object[] { null });
|
||||
return entity;
|
||||
}
|
||||
} catch (Exception e) {}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static float randomPitch() {
|
||||
return CommonProxy.rand.nextFloat() * 0.25F + 0.85F;
|
||||
}
|
||||
|
||||
|
||||
}
|
40
src/main/java/ley/modding/dartcraft/util/ItemUtils.java
Normal file
40
src/main/java/ley/modding/dartcraft/util/ItemUtils.java
Normal file
|
@ -0,0 +1,40 @@
|
|||
package ley.modding.dartcraft.util;
|
||||
|
||||
import ley.modding.dartcraft.Dartcraft;
|
||||
import ley.modding.dartcraft.proxy.CommonProxy;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemUtils {
|
||||
|
||||
public static void dropItem(ItemStack stack, World world, double x, double y, double z) {
|
||||
if (stack != null && world != null && Dartcraft.proxy.isSimulating(world)) {
|
||||
float xRand = CommonProxy.rand.nextFloat() * 0.2F + 0.1F;
|
||||
float yRand = CommonProxy.rand.nextFloat() * 0.8F + 0.1F;
|
||||
float zRand = CommonProxy.rand.nextFloat() * 0.2F + 0.1F;
|
||||
while (stack.stackSize > 0) {
|
||||
int randInt = CommonProxy.rand.nextInt(21) + 10;
|
||||
if (randInt > stack.stackSize)
|
||||
randInt = stack.stackSize;
|
||||
stack.stackSize -= randInt;
|
||||
EntityItem droppedItem = new EntityItem(world, ((float)x + xRand), ((float)y + yRand), ((float)z + zRand), new ItemStack(stack.getItem(), randInt, stack.getItemDamage()));
|
||||
if (stack.hasTagCompound())
|
||||
droppedItem.getEntityItem().setTagCompound((NBTTagCompound) stack
|
||||
.getTagCompound().copy());
|
||||
float modifier = 0.025F;
|
||||
((Entity)droppedItem)
|
||||
.motionX = ((float)CommonProxy.rand.nextGaussian() * modifier);
|
||||
((Entity)droppedItem)
|
||||
.motionY = ((float)CommonProxy.rand.nextGaussian() * modifier + 0.2F);
|
||||
((Entity)droppedItem)
|
||||
.motionZ = ((float)CommonProxy.rand.nextGaussian() * modifier);
|
||||
droppedItem.delayBeforeCanPickup = 10;
|
||||
world.spawnEntityInWorld((Entity)droppedItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
BIN
src/main/resources/assets/dartcraft/bottle.png
Normal file
BIN
src/main/resources/assets/dartcraft/bottle.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
|
@ -5,5 +5,11 @@ item.forcestick.name=Force Stick
|
|||
item.forceshard.name=Force Shard
|
||||
item.forcemitts.name=Force Mitts
|
||||
item.forceshears.name=Force Shears
|
||||
item.forceflask_empty.name=Force Flask
|
||||
item.forceflask_milk.name=Milk Flask
|
||||
item.forceflask_potion_force.name=Liquid Force Flask
|
||||
item.forceflask_potion_green.name=Green Liquid Flask
|
||||
item.forceflask_potion_blue.name=Blue Liquid Flask
|
||||
item.forceflask_potion_red.name=Red Liquid Flask
|
||||
|
||||
itemGroup.dartcraft=Dartcraft
|
||||
|
|
BIN
src/main/resources/assets/dartcraft/liquid.png
Normal file
BIN
src/main/resources/assets/dartcraft/liquid.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 52 KiB |
1924
src/main/resources/assets/dartcraft/models/bottle.obj
Normal file
1924
src/main/resources/assets/dartcraft/models/bottle.obj
Normal file
File diff suppressed because it is too large
Load diff
330
src/main/resources/assets/dartcraft/models/liquid.obj
Normal file
330
src/main/resources/assets/dartcraft/models/liquid.obj
Normal file
|
@ -0,0 +1,330 @@
|
|||
# Blender v2.66 (sub 1) OBJ File: 'liquid.blend'
|
||||
# www.blender.org
|
||||
mtllib liquid.mtl
|
||||
o Cylinder
|
||||
v 0.000000 -1.000000 -1.000000
|
||||
v 0.000000 1.000000 -1.000000
|
||||
v 0.195090 -1.000000 -0.980785
|
||||
v 0.195090 1.000000 -0.980785
|
||||
v 0.382683 -1.000000 -0.923880
|
||||
v 0.382683 1.000000 -0.923880
|
||||
v 0.555570 -1.000000 -0.831470
|
||||
v 0.555570 1.000000 -0.831470
|
||||
v 0.707107 -1.000000 -0.707107
|
||||
v 0.707107 1.000000 -0.707107
|
||||
v 0.831470 -1.000000 -0.555570
|
||||
v 0.831470 1.000000 -0.555570
|
||||
v 0.923880 -1.000000 -0.382683
|
||||
v 0.923880 1.000000 -0.382683
|
||||
v 0.980785 -1.000000 -0.195090
|
||||
v 0.980785 1.000000 -0.195090
|
||||
v 1.000000 -1.000000 -0.000000
|
||||
v 1.000000 1.000000 -0.000000
|
||||
v 0.980785 -1.000000 0.195090
|
||||
v 0.980785 1.000000 0.195090
|
||||
v 0.923880 -1.000000 0.382683
|
||||
v 0.923880 1.000000 0.382683
|
||||
v 0.831470 -1.000000 0.555570
|
||||
v 0.831470 1.000000 0.555570
|
||||
v 0.707107 -1.000000 0.707107
|
||||
v 0.707107 1.000000 0.707107
|
||||
v 0.555570 -1.000000 0.831470
|
||||
v 0.555570 1.000000 0.831470
|
||||
v 0.382683 -1.000000 0.923880
|
||||
v 0.382683 1.000000 0.923880
|
||||
v 0.195090 -1.000000 0.980785
|
||||
v 0.195090 1.000000 0.980785
|
||||
v -0.000000 -1.000000 1.000000
|
||||
v -0.000000 1.000000 1.000000
|
||||
v -0.195091 -1.000000 0.980785
|
||||
v -0.195091 1.000000 0.980785
|
||||
v -0.382684 -1.000000 0.923879
|
||||
v -0.382684 1.000000 0.923879
|
||||
v -0.555571 -1.000000 0.831469
|
||||
v -0.555571 1.000000 0.831469
|
||||
v -0.707107 -1.000000 0.707106
|
||||
v -0.707107 1.000000 0.707106
|
||||
v -0.831470 -1.000000 0.555570
|
||||
v -0.831470 1.000000 0.555570
|
||||
v -0.923880 -1.000000 0.382683
|
||||
v -0.923880 1.000000 0.382683
|
||||
v -0.980785 -1.000000 0.195089
|
||||
v -0.980785 1.000000 0.195089
|
||||
v -1.000000 -1.000000 -0.000001
|
||||
v -1.000000 1.000000 -0.000001
|
||||
v -0.980785 -1.000000 -0.195091
|
||||
v -0.980785 1.000000 -0.195091
|
||||
v -0.923879 -1.000000 -0.382684
|
||||
v -0.923879 1.000000 -0.382684
|
||||
v -0.831469 -1.000000 -0.555571
|
||||
v -0.831469 1.000000 -0.555571
|
||||
v -0.707106 -1.000000 -0.707108
|
||||
v -0.707106 1.000000 -0.707108
|
||||
v -0.555569 -1.000000 -0.831470
|
||||
v -0.555569 1.000000 -0.831470
|
||||
v -0.382682 -1.000000 -0.923880
|
||||
v -0.382682 1.000000 -0.923880
|
||||
v -0.195089 -1.000000 -0.980786
|
||||
v -0.195089 1.000000 -0.980786
|
||||
vt 0.445414 0.665488
|
||||
vt 0.444393 0.332433
|
||||
vt 0.477038 0.332333
|
||||
vt 0.478059 0.665388
|
||||
vt 0.509055 0.332234
|
||||
vt 0.510077 0.665289
|
||||
vt 0.539216 0.332142
|
||||
vt 0.540237 0.665197
|
||||
vt 0.566359 0.332059
|
||||
vt 0.567381 0.665114
|
||||
vt 0.589443 0.331988
|
||||
vt 0.307526 0.666119
|
||||
vt 0.308547 0.999174
|
||||
vt 0.281404 0.999257
|
||||
vt 0.280382 0.666202
|
||||
vt 0.251244 0.999349
|
||||
vt 0.250222 0.666294
|
||||
vt 0.219226 0.999448
|
||||
vt 0.218204 0.666393
|
||||
vt 0.186581 0.999548
|
||||
vt 0.185559 0.666493
|
||||
vt 0.154563 0.999646
|
||||
vt 0.153541 0.666591
|
||||
vt 0.124403 0.999738
|
||||
vt 0.123381 0.666683
|
||||
vt 0.097260 0.999822
|
||||
vt 0.097260 0.665762
|
||||
vt 0.096238 0.332707
|
||||
vt 0.123381 0.332624
|
||||
vt 0.124403 0.665679
|
||||
vt 0.153541 0.332531
|
||||
vt 0.154563 0.665586
|
||||
vt 0.185559 0.332433
|
||||
vt 0.186581 0.665488
|
||||
vt 0.218204 0.332333
|
||||
vt 0.219226 0.665388
|
||||
vt 0.251244 0.665289
|
||||
vt 0.250222 0.332234
|
||||
vt 0.281404 0.665197
|
||||
vt 0.280382 0.332142
|
||||
vt 0.308548 0.665114
|
||||
vt 0.307526 0.332059
|
||||
vt 0.331631 0.665043
|
||||
vt 0.825193 0.331988
|
||||
vt 0.826214 0.665043
|
||||
vt 0.798049 0.332071
|
||||
vt 0.799071 0.665126
|
||||
vt 0.767889 0.332164
|
||||
vt 0.768911 0.665219
|
||||
vt 0.735871 0.332262
|
||||
vt 0.736893 0.665317
|
||||
vt 0.703226 0.332362
|
||||
vt 0.704248 0.665417
|
||||
vt 0.671208 0.332460
|
||||
vt 0.672230 0.665515
|
||||
vt 0.641048 0.332553
|
||||
vt 0.642070 0.665608
|
||||
vt 0.613905 0.332636
|
||||
vt 0.614926 0.665691
|
||||
vt 0.590821 0.332707
|
||||
vt 0.333010 0.665833
|
||||
vt 0.331988 0.332778
|
||||
vt 0.356093 0.665762
|
||||
vt 0.355071 0.332707
|
||||
vt 0.383237 0.665679
|
||||
vt 0.060260 0.037177
|
||||
vt 0.087404 0.019040
|
||||
vt 0.037177 0.060260
|
||||
vt 0.413397 0.665586
|
||||
vt 0.412375 0.332531
|
||||
vt 0.382215 0.332624
|
||||
vt 0.338357 0.214245
|
||||
vt 0.331988 0.182227
|
||||
vt 0.350849 0.244405
|
||||
vt 0.590464 0.665043
|
||||
vt 0.096238 0.666767
|
||||
vt 0.330609 0.331988
|
||||
vt 0.591843 0.665762
|
||||
vt 0.117564 0.006547
|
||||
vt 0.149582 0.000178
|
||||
vt 0.182227 0.000178
|
||||
vt 0.214245 0.006547
|
||||
vt 0.244405 0.019040
|
||||
vt 0.271549 0.037177
|
||||
vt 0.294633 0.060260
|
||||
vt 0.312770 0.087404
|
||||
vt 0.325262 0.117564
|
||||
vt 0.331631 0.149582
|
||||
vt 0.331631 0.182227
|
||||
vt 0.325262 0.214245
|
||||
vt 0.312770 0.244406
|
||||
vt 0.294633 0.271549
|
||||
vt 0.271549 0.294633
|
||||
vt 0.244406 0.312770
|
||||
vt 0.214245 0.325262
|
||||
vt 0.182227 0.331631
|
||||
vt 0.149582 0.331631
|
||||
vt 0.117564 0.325262
|
||||
vt 0.087404 0.312770
|
||||
vt 0.060260 0.294633
|
||||
vt 0.037177 0.271549
|
||||
vt 0.019040 0.244406
|
||||
vt 0.006547 0.214245
|
||||
vt 0.000178 0.182227
|
||||
vt 0.000178 0.149582
|
||||
vt 0.006547 0.117564
|
||||
vt 0.019040 0.087404
|
||||
vt 0.331988 0.149582
|
||||
vt 0.338357 0.117564
|
||||
vt 0.350849 0.087404
|
||||
vt 0.368986 0.060260
|
||||
vt 0.392070 0.037177
|
||||
vt 0.419213 0.019040
|
||||
vt 0.449374 0.006547
|
||||
vt 0.481392 0.000178
|
||||
vt 0.514037 0.000178
|
||||
vt 0.546055 0.006547
|
||||
vt 0.576215 0.019040
|
||||
vt 0.603359 0.037177
|
||||
vt 0.626442 0.060260
|
||||
vt 0.644579 0.087404
|
||||
vt 0.657072 0.117564
|
||||
vt 0.663441 0.149582
|
||||
vt 0.663441 0.182227
|
||||
vt 0.657072 0.214245
|
||||
vt 0.644579 0.244406
|
||||
vt 0.626442 0.271549
|
||||
vt 0.603359 0.294633
|
||||
vt 0.576215 0.312770
|
||||
vt 0.546055 0.325262
|
||||
vt 0.514037 0.331631
|
||||
vt 0.481391 0.331631
|
||||
vt 0.449373 0.325262
|
||||
vt 0.419213 0.312769
|
||||
vt 0.392070 0.294633
|
||||
vt 0.368986 0.271549
|
||||
usemtl None
|
||||
s off
|
||||
f 1/1 2/2 4/3
|
||||
f 3/4 4/3 6/5
|
||||
f 5/6 6/5 8/7
|
||||
f 7/8 8/7 10/9
|
||||
f 9/10 10/9 12/11
|
||||
f 11/12 12/13 14/14
|
||||
f 13/15 14/14 16/16
|
||||
f 15/17 16/16 18/18
|
||||
f 17/19 18/18 20/20
|
||||
f 19/21 20/20 22/22
|
||||
f 21/23 22/22 24/24
|
||||
f 23/25 24/24 26/26
|
||||
f 25/27 26/28 28/29
|
||||
f 27/30 28/29 30/31
|
||||
f 29/32 30/31 32/33
|
||||
f 31/34 32/33 34/35
|
||||
f 33/36 34/35 35/37
|
||||
f 35/37 36/38 37/39
|
||||
f 37/39 38/40 39/41
|
||||
f 39/41 40/42 41/43
|
||||
f 41/44 42/45 43/46
|
||||
f 43/46 44/47 45/48
|
||||
f 45/48 46/49 47/50
|
||||
f 47/50 48/51 49/52
|
||||
f 49/52 50/53 51/54
|
||||
f 51/54 52/55 53/56
|
||||
f 53/56 54/57 55/58
|
||||
f 55/58 56/59 57/60
|
||||
f 57/61 58/62 59/63
|
||||
f 59/63 60/64 61/65
|
||||
f 4/66 2/67 6/68
|
||||
f 63/69 64/70 1/1
|
||||
f 61/65 62/71 63/69
|
||||
f 1/72 3/73 63/74
|
||||
f 3/4 1/1 4/3
|
||||
f 5/6 3/4 6/5
|
||||
f 7/8 5/6 8/7
|
||||
f 9/10 7/8 10/9
|
||||
f 11/75 9/10 12/11
|
||||
f 13/15 11/12 14/14
|
||||
f 15/17 13/15 16/16
|
||||
f 17/19 15/17 18/18
|
||||
f 19/21 17/19 20/20
|
||||
f 21/23 19/21 22/22
|
||||
f 23/25 21/23 24/24
|
||||
f 25/76 23/25 26/26
|
||||
f 27/30 25/27 28/29
|
||||
f 29/32 27/30 30/31
|
||||
f 31/34 29/32 32/33
|
||||
f 33/36 31/34 34/35
|
||||
f 34/35 36/38 35/37
|
||||
f 36/38 38/40 37/39
|
||||
f 38/40 40/42 39/41
|
||||
f 40/42 42/77 41/43
|
||||
f 42/45 44/47 43/46
|
||||
f 44/47 46/49 45/48
|
||||
f 46/49 48/51 47/50
|
||||
f 48/51 50/53 49/52
|
||||
f 50/53 52/55 51/54
|
||||
f 52/55 54/57 53/56
|
||||
f 54/57 56/59 55/58
|
||||
f 56/59 58/78 57/60
|
||||
f 58/62 60/64 59/63
|
||||
f 60/64 62/71 61/65
|
||||
f 2/67 64/79 6/68
|
||||
f 64/79 62/80 6/68
|
||||
f 62/80 60/81 6/68
|
||||
f 60/81 58/82 6/68
|
||||
f 58/82 56/83 6/68
|
||||
f 56/83 54/84 6/68
|
||||
f 54/84 52/85 6/68
|
||||
f 52/85 50/86 6/68
|
||||
f 50/86 48/87 6/68
|
||||
f 48/87 46/88 6/68
|
||||
f 46/88 44/89 6/68
|
||||
f 44/89 42/90 6/68
|
||||
f 42/90 40/91 6/68
|
||||
f 40/91 38/92 6/68
|
||||
f 38/92 36/93 6/68
|
||||
f 36/93 34/94 6/68
|
||||
f 34/94 32/95 6/68
|
||||
f 32/95 30/96 6/68
|
||||
f 30/96 28/97 6/68
|
||||
f 28/97 26/98 6/68
|
||||
f 26/98 24/99 6/68
|
||||
f 24/99 22/100 6/68
|
||||
f 22/100 20/101 6/68
|
||||
f 20/101 18/102 6/68
|
||||
f 18/102 16/103 6/68
|
||||
f 16/103 14/104 6/68
|
||||
f 14/104 12/105 6/68
|
||||
f 12/105 10/106 8/107
|
||||
f 6/68 12/105 8/107
|
||||
f 64/70 2/2 1/1
|
||||
f 62/71 64/70 63/69
|
||||
f 3/73 5/108 63/74
|
||||
f 5/108 7/109 63/74
|
||||
f 7/109 9/110 63/74
|
||||
f 9/110 11/111 63/74
|
||||
f 11/111 13/112 63/74
|
||||
f 13/112 15/113 63/74
|
||||
f 15/113 17/114 63/74
|
||||
f 17/114 19/115 63/74
|
||||
f 19/115 21/116 63/74
|
||||
f 21/116 23/117 63/74
|
||||
f 23/117 25/118 63/74
|
||||
f 25/118 27/119 63/74
|
||||
f 27/119 29/120 63/74
|
||||
f 29/120 31/121 63/74
|
||||
f 31/121 33/122 63/74
|
||||
f 33/122 35/123 63/74
|
||||
f 35/123 37/124 63/74
|
||||
f 37/124 39/125 63/74
|
||||
f 39/125 41/126 63/74
|
||||
f 41/126 43/127 63/74
|
||||
f 43/127 45/128 63/74
|
||||
f 45/128 47/129 63/74
|
||||
f 47/129 49/130 63/74
|
||||
f 49/130 51/131 63/74
|
||||
f 51/131 53/132 63/74
|
||||
f 53/132 55/133 63/74
|
||||
f 55/133 57/134 63/74
|
||||
f 57/134 59/135 61/136
|
||||
f 63/74 57/134 61/136
|
5
src/main/resources/assets/dartcraft/sounds.json
Normal file
5
src/main/resources/assets/dartcraft/sounds.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"bottle": {"category": "master","sounds": [{"name": "bottle","stream": false}]},
|
||||
"swipe": {"category": "master","sounds": [{"name": "swipe","stream": false}]},
|
||||
"nope": {"category": "master","sounds": [{"name": "nope","stream": false}]}
|
||||
}
|
BIN
src/main/resources/assets/dartcraft/sounds/bottle.ogg
Normal file
BIN
src/main/resources/assets/dartcraft/sounds/bottle.ogg
Normal file
Binary file not shown.
BIN
src/main/resources/assets/dartcraft/sounds/nope.ogg
Normal file
BIN
src/main/resources/assets/dartcraft/sounds/nope.ogg
Normal file
Binary file not shown.
BIN
src/main/resources/assets/dartcraft/sounds/swipe.ogg
Normal file
BIN
src/main/resources/assets/dartcraft/sounds/swipe.ogg
Normal file
Binary file not shown.
Loading…
Reference in a new issue