Projects >> Tribu >>e4fc52e00ff8d60d77495f7defd546fc6ea32f31

Chunk
Conflicting content
	@EventHandler(priority = EventPriority.NORMAL)
	public void onCreatureSpawn(CreatureSpawnEvent event) {
<<<<<<< HEAD
		// is Inside level check if plugin is running
=======
		if(!plugin.isCorrectWorld(event.getEntity().getWorld())) return; //world check
>>>>>>> f0c4caa4a5a542974b18c40dc0389de68cd0c702
		if (plugin.isInsideLevel(event.getLocation()) && !plugin.getSpawner().justSpawned()) {
			event.setCancelled(true);
		}
Solution content
	@EventHandler(priority = EventPriority.NORMAL)
	public void onCreatureSpawn(CreatureSpawnEvent event) {
		if (plugin.isInsideLevel(event.getLocation()) && !plugin.getSpawner().justSpawned()) {
			event.setCancelled(true);
		}
File
TribuEntityListener.java
Developer's decision
None
Kind of conflict
Comment
If statement
Chunk
Conflicting content
	@EventHandler(priority = EventPriority.HIGHEST)
	public void onEntityDamage(EntityDamageEvent dam) {
<<<<<<< HEAD
		if(plugin.isRunning())
		{
			if (dam.isCancelled()) {
				return;
			}
			if (dam.getEntity() instanceof Player) {
				Player p = (Player) dam.getEntity();
				if (plugin.isPlaying(p)) {
					if (p.getHealth() - dam.getDamage() <= 0) {
						dam.setCancelled(true);
=======
		if (dam.isCancelled()) {
			return;
		}
		if(!plugin.isCorrectWorld(dam.getEntity().getWorld())) return; //world check
		if (dam.getEntity() instanceof Player) {
			Player p = (Player) dam.getEntity();
			if(plugin.isRunning())
			{
				if (plugin.isPlaying(p)) {
					if (p.getHealth() - dam.getDamage() <= 0) {
						dam.setCancelled(true);
						p.teleport(plugin.getLevel().getDeathSpawn());
						p.setHealth(1);
>>>>>>> f0c4caa4a5a542974b18c40dc0389de68cd0c702
						if (!plugin.config().PlayersDontLooseItem)
						{
							for(ItemStack is : p.getInventory())
Solution content
	@EventHandler(priority = EventPriority.HIGHEST)
	public void onEntityDamage(EntityDamageEvent dam) {
		if(!dam.isCancelled() && plugin.isRunning())
		{
			
			if (dam.getEntity() instanceof Player) {
				Player p = (Player) dam.getEntity();
				if (plugin.isPlaying(p)) {
					if (p.getHealth() - dam.getDamage() <= 0) {
						dam.setCancelled(true);
						if (!plugin.config().PlayersDontLooseItem)
						{
							for(ItemStack is : p.getInventory())
File
TribuEntityListener.java
Developer's decision
Manual
Kind of conflict
Cast expression
Comment
If statement
Method invocation
Variable
Chunk
Conflicting content
						{
							for(ItemStack is : p.getInventory())
							{
<<<<<<< HEAD
								if(is != null)
									p.getLocation().getWorld().dropItemNaturally(p.getLocation(), is.clone());
							}
							p.getInventory().clear();
						}
						plugin.messagePlayers(String.format(plugin.getLocale("Message.Died"),p.getName()));
						p.teleport(plugin.getLevel().getDeathSpawn());
						p.setHealth(1);
=======
								p.getLocation().getWorld().dropItemNaturally(p.getLocation(), is);
							}
							p.getInventory().clear();
						}
						
>>>>>>> f0c4caa4a5a542974b18c40dc0389de68cd0c702
						plugin.setDead(p);
					}
				} else
Solution content
						{
							for(ItemStack is : p.getInventory())
							{
								if(is != null)
									p.getLocation().getWorld().dropItemNaturally(p.getLocation(), is.clone());
							}
							p.getInventory().clear();
						}
						plugin.messagePlayers(String.format(plugin.getLocale("Message.Died"),p.getName()));
						p.teleport(plugin.getLevel().getDeathSpawn());
						p.setHealth(1);
						plugin.setDead(p);
					}
				} else
File
TribuEntityListener.java
Developer's decision
Version 1
Kind of conflict
If statement
Method invocation
Chunk
Conflicting content
			}
			if (dam.getEntity() instanceof CraftTribuZombie) {
					}
				} else
					plugin.restoreInventory(p);
<<<<<<< HEAD
=======
			}
		}
		if (dam.getEntity() instanceof CraftTribuZombie) {
			if (dam.getCause().equals(DamageCause.FIRE_TICK) && plugin.config().ZombiesFireResistant) {
				dam.setCancelled(true);
				dam.getEntity().setFireTicks(0);
				return;
>>>>>>> f0c4caa4a5a542974b18c40dc0389de68cd0c702
				if (dam.getCause().equals(DamageCause.FIRE_TICK) && plugin.config().ZombiesFireResistant) {
Solution content
				} else
					}
					plugin.restoreInventory(p);
			}
			if (dam.getEntity() instanceof CraftTribuZombie) {
				if (dam.getCause().equals(DamageCause.FIRE_TICK) && plugin.config().ZombiesFireResistant) {
File
TribuEntityListener.java
Developer's decision
Version 1
Kind of conflict
If statement
Method invocation
Return statement
Chunk
Conflicting content
	@EventHandler
	public void onEntityDeath(EntityDeathEvent event) {
<<<<<<< HEAD

		if(plugin.isRunning())
		{
			if (event.getEntity() instanceof Player) {
				Player player = (Player) event.getEntity();
				plugin.setDead(player);
	
				if (plugin.config().PlayersDontLooseItem)
=======
		if(!plugin.isCorrectWorld(event.getEntity().getWorld())) return; //world check
		if (event.getEntity() instanceof Player) {
			Player player = (Player) event.getEntity();
			plugin.setDead(player);

			if (plugin.config().PlayersDontLooseItem)
			{
				plugin.keepTempInv((Player) event.getEntity(), event.getDrops().toArray(new ItemStack[] {}));
				event.getDrops().clear();
			}

		} else if (event.getEntity() instanceof CraftTribuZombie) {
			CraftTribuZombie zombie = (CraftTribuZombie) event.getEntity();

			HashMap rewards=new HashMap();
			String rewardMethod=plugin.config().StatsRewardMethod;
			boolean onlyForAlive=plugin.config().StatsRewardOnlyAlive;
			float baseMoney=(float)plugin.config().StatsOnZombieKillMoney;
			float basePoint=(float)plugin.config().StatsOnZombieKillPoints;
			if(rewardMethod.equalsIgnoreCase("Last"))
				rewards.put(zombie.getLastAttacker(),1f);
			else if(rewardMethod.equalsIgnoreCase("First"))
				rewards.put(zombie.getFirstAttacker(),1f);
			else if(rewardMethod.equalsIgnoreCase("Best"))
				rewards.put(zombie.getBestAttacker(),1f);
			else if(rewardMethod.equalsIgnoreCase("Percentage"))
				rewards.putAll(zombie.getAttackersPercentage());
			else if(rewardMethod.equalsIgnoreCase("All"))
				for(Player p : plugin.getPlayers())
>>>>>>> f0c4caa4a5a542974b18c40dc0389de68cd0c702
				{
					plugin.keepTempInv((Player) event.getEntity(), event.getDrops().toArray(new ItemStack[] {}));
					event.getDrops().clear();
Solution content
	@EventHandler
	public void onEntityDeath(EntityDeathEvent event) {

		if(plugin.isRunning())
		{
			if (event.getEntity() instanceof Player) {
				Player player = (Player) event.getEntity();
				plugin.setDead(player);
	
				if (plugin.config().PlayersDontLooseItem)
				{
					plugin.keepTempInv((Player) event.getEntity(), event.getDrops().toArray(new ItemStack[] {}));
					event.getDrops().clear();
File
TribuEntityListener.java
Developer's decision
Version 1
Kind of conflict
Cast expression
Comment
For statement
If statement
Method invocation
Variable