Skip to content

Commit

Permalink
Separate BlueSlime and King Slime into separate entities + baseclass
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Nov 29, 2014
1 parent 345704f commit d089455
Show file tree
Hide file tree
Showing 10 changed files with 582 additions and 609 deletions.
6 changes: 0 additions & 6 deletions src/main/java/tconstruct/armor/TinkerArmorEvents.java
Expand Up @@ -35,12 +35,6 @@ public void onLivingDrop (LivingDropsEvent event)

if (event.entityLiving instanceof IBossDisplayData)
{
if (event.entityLiving instanceof BlueSlime)
{
BlueSlime slime = (BlueSlime) event.entityLiving;
if (slime.getSlimeSize() < 8)
return;
}
String entityName = event.entityLiving.getClass().getSimpleName().toLowerCase();
if (entityName.contains("entitynpc") || entityName.contains("entitycustomnpc"))
return;
Expand Down
12 changes: 9 additions & 3 deletions src/main/java/tconstruct/blocks/slime/SlimeFluid.java
Expand Up @@ -10,6 +10,8 @@
import net.minecraftforge.fluids.*;
import tconstruct.world.TinkerWorld;
import tconstruct.world.entity.BlueSlime;
import tconstruct.world.entity.KingBlueSlime;
import tconstruct.world.entity.SlimeBase;

public class SlimeFluid extends BlockFluidClassic
{
Expand Down Expand Up @@ -46,9 +48,13 @@ public void updateTick (World world, int x, int y, int z, Random rand)
super.updateTick(world, x, y, z, rand);
if (rand.nextInt(100) == 0 && world.getBlockMetadata(x, y, z) == 0 && world.checkNoEntityCollision(AxisAlignedBB.getBoundingBox(x - 1, y - 1, z - 1, x + 2, y + 2, z + 2)))
{
BlueSlime entityslime = new BlueSlime(world);
entityslime.setPosition((double) x + 0.5D, (double) y + 1.5D, (double) z + 0.5D);
world.spawnEntityInWorld(entityslime);
SlimeBase slime;
if(rand.nextInt(300) == 0)
slime = new KingBlueSlime(world);
else
slime = new BlueSlime(world);
slime.setPosition((double) x + 0.5D, (double) y + 1.5D, (double) z + 0.5D);
world.spawnEntityInWorld(slime);
}
}

Expand Down
13 changes: 8 additions & 5 deletions src/main/java/tconstruct/tools/items/TitleIcon.java
Expand Up @@ -15,7 +15,9 @@
import tconstruct.client.TProxyClient;
import tconstruct.library.tools.ToolCore;
import tconstruct.world.entity.BlueSlime;
import tconstruct.world.entity.KingBlueSlime;

// spawn egg.
public class TitleIcon extends Item
{
int[] primaryColor = { 0x66BBE8, 0x66BBE8 };
Expand All @@ -29,6 +31,7 @@ public TitleIcon()
{
super();
this.setCreativeTab(CreativeTabs.tabMisc);
this.setHasSubtypes(true);
}

@Override
Expand Down Expand Up @@ -135,7 +138,7 @@ public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int
spawnEntity(posX, posY, posZ, new BlueSlime(world), world, player);
break;
case 1:
spawnBossSlime(posX, posY, posZ, new BlueSlime(world), world, player);
spawnBossSlime(posX, posY, posZ, new KingBlueSlime(world), world, player);
break;
}
if (!player.capabilities.isCreativeMode)
Expand Down Expand Up @@ -168,8 +171,8 @@ public static EntityLiving activateSpawnEgg (ItemStack stack, World world, doubl
spawnEntity(posX, posY, posZ, entity, world);
break;
case 1:
entity = new BlueSlime(world);
spawnBossSlime(posX, posY, posZ, new BlueSlime(world), world);
entity = new KingBlueSlime(world);
spawnBossSlime(posX, posY, posZ, new KingBlueSlime(world), world);
break;
}
return entity;
Expand Down Expand Up @@ -197,7 +200,7 @@ public static void spawnEntity (double x, double y, double z, Entity entity, Wor
}
}

public static void spawnBossSlime (double x, double y, double z, BlueSlime entity, World world, EntityPlayer player)
public static void spawnBossSlime (double x, double y, double z, KingBlueSlime entity, World world, EntityPlayer player)
{
if (!world.isRemote)
{
Expand All @@ -208,7 +211,7 @@ public static void spawnBossSlime (double x, double y, double z, BlueSlime entit
}
}

public static void spawnBossSlime (double x, double y, double z, BlueSlime entity, World world)
public static void spawnBossSlime (double x, double y, double z, KingBlueSlime entity, World world)
{
if (!world.isRemote)
{
Expand Down
1 change: 1 addition & 0 deletions src/main/java/tconstruct/world/TinkerWorld.java
Expand Up @@ -269,6 +269,7 @@ public void createEntities ()
// TConstruct.instance, 32, 5, true);

EntityRegistry.registerModEntity(BlueSlime.class, "EdibleSlime", 12, TConstruct.instance, 64, 5, true);
EntityRegistry.registerModEntity(KingBlueSlime.class, "KingSlime", 14, TConstruct.instance, 64, 5, true);
// EntityRegistry.registerModEntity(MetalSlime.class, "MetalSlime", 13,
// TConstruct.instance, 64, 5, true);

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/tconstruct/world/TinkerWorldProxyClient.java
Expand Up @@ -35,7 +35,9 @@ void registerRenderer ()
RenderingRegistry.registerBlockHandler(new SlimePadRender());

// Entities
RenderingRegistry.registerEntityRenderingHandler(BlueSlime.class, new SlimeRender(new ModelSlime(16), new ModelSlime(0), 0.25F));
SlimeRender slimeRender = new SlimeRender(new ModelSlime(16), new ModelSlime(0), 0.25F);
RenderingRegistry.registerEntityRenderingHandler(BlueSlime.class, slimeRender);
RenderingRegistry.registerEntityRenderingHandler(KingBlueSlime.class, slimeRender);
RenderingRegistry.registerEntityRenderingHandler(CartEntity.class, new CartRender());

VillagerRegistry.instance().registerVillagerSkin(78943, new ResourceLocation("tinker", "textures/mob/villagertools.png"));
Expand Down

0 comments on commit d089455

Please sign in to comment.