0 errors. This is it, the first building build of Mekanism for 1.7.2, and also the most buggy build of Mekanism to date most likely.
(I remembered to update the obfuscated reflections, so there's that)
This commit is contained in:
parent
4446e14ba3
commit
5b611c9cdb
8 changed files with 30 additions and 22 deletions
|
@ -197,7 +197,7 @@ public class ClientProxy extends CommonProxy
|
|||
@Override
|
||||
public void registerSound(Object obj)
|
||||
{
|
||||
if(MekanismClient.enableSounds && Minecraft.getMinecraft().sndManager.sndSystem != null)
|
||||
if(MekanismClient.enableSounds && MekanismClient.audioHandler != null)
|
||||
{
|
||||
synchronized(MekanismClient.audioHandler.sounds)
|
||||
{
|
||||
|
@ -209,7 +209,7 @@ public class ClientProxy extends CommonProxy
|
|||
@Override
|
||||
public void unregisterSound(TileEntity tileEntity)
|
||||
{
|
||||
if(MekanismClient.enableSounds && Minecraft.getMinecraft().sndManager.sndSystem != null)
|
||||
if(MekanismClient.enableSounds && MekanismClient.audioHandler != null)
|
||||
{
|
||||
synchronized(MekanismClient.audioHandler.sounds)
|
||||
{
|
||||
|
@ -234,7 +234,7 @@ public class ClientProxy extends CommonProxy
|
|||
entityplayer.openContainer.windowId = windowId;
|
||||
}
|
||||
else {
|
||||
FMLClientHandler.instance().getClient().sndManager.playSoundFX("random.chestopen", 1.0F, 1.0F);
|
||||
SoundHandler.playSound("random.chestopen");
|
||||
ItemStack stack = entityplayer.getCurrentEquippedItem();
|
||||
|
||||
if(stack != null && stack.getItem() instanceof IElectricChest && MachineType.get(stack) == MachineType.ELECTRIC_CHEST)
|
||||
|
|
|
@ -92,7 +92,7 @@ public class ClientTickHandler
|
|||
|
||||
public void tickStart()
|
||||
{
|
||||
if(!preloadedSounds && mc.sndManager.sndSystem != null && MekanismClient.enableSounds)
|
||||
if(!preloadedSounds && MekanismClient.enableSounds && MekanismClient.audioHandler != null)
|
||||
{
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
|
|
|
@ -17,10 +17,12 @@ import mekanism.api.Coord4D;
|
|||
import mekanism.client.HolidayManager;
|
||||
import mekanism.client.MekanismClient;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.ObfuscatedNames;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.client.audio.SoundCategory;
|
||||
import net.minecraft.client.gui.GuiOptions;
|
||||
import net.minecraft.client.audio.SoundManager;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -47,7 +49,7 @@ public class SoundHandler
|
|||
/** The current base volume Minecraft is using. */
|
||||
public float masterVolume = 0;
|
||||
|
||||
public Minecraft mc = Minecraft.getMinecraft();
|
||||
public static Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
/**
|
||||
* SoundHandler -- a class that handles all Sounds used by Mekanism.
|
||||
|
@ -82,7 +84,7 @@ public class SoundHandler
|
|||
|
||||
System.out.println("[Mekanism] Preloaded " + listings.size() + " object sounds.");
|
||||
|
||||
listings = listFiles(corePath.replace("%20", " ").replace(".jar!", ".jar").replace("file:", ""), "assets/mekanism/sounds/etc");
|
||||
/*listings = listFiles(corePath.replace("%20", " ").replace(".jar!", ".jar").replace("file:", ""), "assets/mekanism/sounds/etc");
|
||||
|
||||
for(String s : listings)
|
||||
{
|
||||
|
@ -94,7 +96,7 @@ public class SoundHandler
|
|||
mc.sndManager.addSound("mekanism:etc/" + s);
|
||||
}
|
||||
|
||||
System.out.println("[Mekanism] Initialized " + listings.size() + " sound effects.");
|
||||
System.out.println("[Mekanism] Initialized " + listings.size() + " sound effects.");*/
|
||||
|
||||
if(MekanismClient.holidays)
|
||||
{
|
||||
|
@ -322,12 +324,17 @@ public class SoundHandler
|
|||
|
||||
public static SoundSystem getSoundSystem()
|
||||
{
|
||||
return Minecraft.getMinecraft().sndManager.sndSystem;
|
||||
try {
|
||||
SoundManager manager = (SoundManager)MekanismUtils.getPrivateValue(mc.getSoundHandler(), SoundManager.class, ObfuscatedNames.SoundHandler_sndManager);
|
||||
return (SoundSystem)MekanismUtils.getPrivateValue(manager, SoundSystem.class, ObfuscatedNames.SoundManager_sndSystem);
|
||||
} catch(Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static void playSound(String sound)
|
||||
{
|
||||
Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation(sound), 1.0F));
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation(sound), 1.0F));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
|
|
@ -1309,7 +1309,7 @@ public class Mekanism
|
|||
new MultipartMekanism();
|
||||
|
||||
//Packet registrations
|
||||
packetPipeline.initalise();
|
||||
packetPipeline.initialize();
|
||||
|
||||
//Load proxy
|
||||
proxy.registerRenderInformation();
|
||||
|
@ -1334,7 +1334,7 @@ public class Mekanism
|
|||
|
||||
OreDictManager.init();
|
||||
|
||||
packetPipeline.postInitialise();
|
||||
packetPipeline.postInitialize();
|
||||
|
||||
logger.info("Hooking complete.");
|
||||
}
|
||||
|
|
|
@ -7,11 +7,11 @@ public final class ObfuscatedNames
|
|||
public static String[] AbstractClientPlayer_downloadImageCape = new String[] {"downloadImageCape", "field_110315_c", "c"};
|
||||
public static String[] AbstractClientPlayer_locationCape = new String[] {"locationCape", "field_110313_e", "e"};
|
||||
public static String[] AbstractClientPlayer_getDownloadImage = new String[] {"getDownloadImage", "func_110301_a", "a"};
|
||||
public static String[] GuiContainer_drawCreativeTabHoveringText = new String[] {"drawCreativeTabHoveringText", "func_74190_a", "a"};
|
||||
public static String[] GuiContainer_xSize = new String[] {"xSize", "field_74194_b", "c"};
|
||||
public static String[] GuiContainer_ySize = new String[] {"ySize", "field_74195_c", "d"};
|
||||
public static String[] GuiScreen_fontRenderer = new String[] {"fontRenderer", "field_73886_k", "o"};
|
||||
public static String[] GuiContainer_guiLeft = new String[] {"guiLeft", "field_74198_m"};
|
||||
public static String[] GuiContainer_guiTop = new String[] {"guiTop", "field_74197_n"};
|
||||
public static String[] GuiContainer_xSize = new String[] {"xSize", "field_146999_f", "c"};
|
||||
public static String[] GuiContainer_ySize = new String[] {"ySize", "field_147000_g", "d"};
|
||||
public static String[] GuiContainer_guiLeft = new String[] {"guiLeft", "field_147003_i"};
|
||||
public static String[] GuiContainer_guiTop = new String[] {"guiTop", "field_147009_r"};
|
||||
public static String[] NetHandlerPlayServer_floatingTickCount = new String[] {"floatingTickCount", "field_147365_f"};
|
||||
public static String[] SoundHandler_sndManager = new String[] {"sndManager", "field_147694_f"};
|
||||
public static String[] SoundManager_sndSystem = new String[] {"sndSystem", "field_148620_e"};
|
||||
}
|
|
@ -267,7 +267,7 @@ public class EntityRobit extends EntityCreature implements IInventory, ISustaine
|
|||
onItemPickup(item, item.getEntityItem().stackSize);
|
||||
item.setDead();
|
||||
|
||||
SoundHandler.playSound("random.pop", 1.0F, ((rand.nextFloat() - rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
|
||||
playSound("random.pop", 1.0F, ((rand.nextFloat() - rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -286,7 +286,7 @@ public class EntityRobit extends EntityCreature implements IInventory, ISustaine
|
|||
item.setDead();
|
||||
}
|
||||
|
||||
SoundHandler.playSound("random.pop", 1.0F, ((rand.nextFloat() - rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
|
||||
playSound("random.pop", 1.0F, ((rand.nextFloat() - rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -137,7 +137,7 @@ public class PacketPipeline extends MessageToMessageCodec<FMLProxyPacket, Mekani
|
|||
}
|
||||
|
||||
// Method to call from FMLInitializationEvent
|
||||
public void initalise()
|
||||
public void initialize()
|
||||
{
|
||||
channels = NetworkRegistry.INSTANCE.newChannel("Mekanism", this);
|
||||
registerPackets();
|
||||
|
@ -176,7 +176,7 @@ public class PacketPipeline extends MessageToMessageCodec<FMLProxyPacket, Mekani
|
|||
// Method to call from FMLPostInitializationEvent
|
||||
// Ensures that packet discriminators are common between server and client
|
||||
// by using logical sorting
|
||||
public void postInitialise()
|
||||
public void postInitialize()
|
||||
{
|
||||
if(isPostInitialised)
|
||||
{
|
||||
|
|
|
@ -64,6 +64,7 @@ public class PacketTileEntity extends MekanismPacket
|
|||
if(tileEntity instanceof ITileNetwork)
|
||||
{
|
||||
((ITileNetwork)tileEntity).handlePacketData(storedBuffer);
|
||||
storedBuffer.release();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue