Simplify GG handling of music

This commit is contained in:
Vincent Lee committed 2017-01-23 15:36:12 -06:00
1 parent 8dc94ba27c
commit e707ce1330
4 files changed
+8 -25

No files matched your search

@@ -379,17 +379,6 @@ public class ClientProxy implements IProxy {
return s;
}
@Override
public void playRecordClientSided(World world, BlockPos pos, ItemRecord record) {
Minecraft mc = Minecraft.getMinecraft();
if(record == null)
world.playEvent(null, 1010, pos, 0);
else {
world.playEvent(null, 1010, pos, Item.getIdFromItem(record));
mc.ingameGUI.setRecordPlayingMessage(record.getRecordNameLocal());
}
}
@Override
public long getWorldElapsedTicks() {
return ClientTickHandler.ticksInGame;
@@ -40,8 +40,6 @@ public interface IProxy {
boolean openWikiPage(World world, Block block, RayTraceResult pos);
void playRecordClientSided(World world, BlockPos pos, ItemRecord record);
void setMultiblock(World world, int x, int y, int z, double radius, Block block);
void removeSextantMultiblock();
@@ -79,9 +79,6 @@ public class ServerProxy implements IProxy {
return false;
}
@Override
public void playRecordClientSided(World world, BlockPos pos, ItemRecord record) {}
@Override
public void setMultiblock(World world, int x, int y, int z, double radius, Block block) {}
@@ -21,6 +21,7 @@ import java.util.stream.Collectors;
import javax.annotation.Nonnull;
import net.minecraft.entity.monster.EntityWitherSkeleton;
import net.minecraft.item.Item;
import org.lwjgl.opengl.ARBShaderObjects;
import com.google.common.base.Optional;
@@ -133,8 +134,7 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss {
private static final List<String> CHEATY_BLOCKS = Arrays.asList("OpenBlocks:beartrap",
"ThaumicTinkerer:magnet");
private static boolean isPlayingMusic = false;
private boolean isPlayingMusic = false;
private boolean spawnLandmines = false;
private boolean spawnPixies = false;
private boolean anyWithArmor = false;
@@ -496,8 +496,7 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss {
@Override
public void setDead() {
Botania.proxy.removeBoss(this);
BlockPos source = getSource();
Botania.proxy.playRecordClientSided(world, source, null);
world.playEvent(1010, getSource(), 0);
isPlayingMusic = false;
super.setDead();
}
@@ -538,11 +537,6 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss {
Botania.proxy.wispFX(x, y, z, r, g, b, 0.5F, (float) (Math.random() - 0.5F) * m, (float) (Math.random() - 0.5F) * mv, (float) (Math.random() - 0.5F) * m);
}
if(world.isRemote && !isPlayingMusic && !isDead && !getPlayersAround().isEmpty()) {
Botania.proxy.playRecordClientSided(world, source, (ItemRecord) (isHardMode() ? ModItems.recordGaia2 : ModItems.recordGaia1));
isPlayingMusic = true;
}
EntityPlayer player = Botania.proxy.getClientPlayer();
player.capabilities.isFlying = player.capabilities.isFlying && player.capabilities.isCreativeMode;
@@ -573,6 +567,11 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss {
return;
}
if(!isPlayingMusic && !isDead && !getPlayersAround().isEmpty()) {
world.playEvent(1010, source, Item.getIdFromItem(isHardMode() ? ModItems.recordGaia2 : ModItems.recordGaia1));
isPlayingMusic = true;
}
dataManager.set(BOSSINFO_ID, Optional.of(bossInfo.getUniqueId()));
bossInfo.setPercent(getHealth() / getMaxHealth());