use of net.minecraft.client.multiplayer.WorldClient in project ClaySoldiersMod by SanAndreasP.
the class ClientProxy method swingSoldierArm.
@Override
public void swingSoldierArm(byte[] data, Player player) {
WorldClient world = (WorldClient) ((EntityPlayer) player).worldObj;
Entity entity = world.getEntityByID(getEntityIdFromByteArray(data));
if (entity != null && entity instanceof EntityClayMan)
((EntityClayMan) entity).swingArm();
}
use of net.minecraft.client.multiplayer.WorldClient in project Random-Things by lumien231.
the class MessageLightRedirector method onMessage.
@Override
public void onMessage(MessageContext context) {
WorldClient worldObj = Minecraft.getMinecraft().world;
if (worldObj != null && worldObj.provider.getDimension() == dimension && worldObj.isBlockLoaded(pos)) {
for (EnumFacing facing : EnumFacing.VALUES) {
if (!(worldObj.getBlockState(pos.offset(facing)).getBlock() instanceof BlockLightRedirector)) {
IBlockState state = worldObj.getBlockState(pos.offset(facing));
worldObj.notifyBlockUpdate(pos.offset(facing), state, state, 3);
}
}
}
}
use of net.minecraft.client.multiplayer.WorldClient in project FoamFix by asiekierka.
the class ProxyClient method onWorldUnload.
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onWorldUnload(WorldEvent.Unload event) {
if (FoamFixShared.config.clClearCachesOnUnload && event.getWorld() instanceof WorldClient && REGION_CACHE_GETTER != null) {
try {
LoadingCache cache = (LoadingCache) (REGION_CACHE_GETTER.invoke());
cache.invalidateAll();
cache.cleanUp();
} catch (Throwable t) {
t.printStackTrace();
}
}
}
use of net.minecraft.client.multiplayer.WorldClient in project Galacticraft by micdoodle8.
the class AsteroidsEventHandlerClient method onClientTick.
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onClientTick(ClientTickEvent event) {
Minecraft minecraft = Minecraft.getMinecraft();
WorldClient world = minecraft.theWorld;
if (world != null) {
if (world.provider instanceof WorldProviderAsteroids) {
if (world.provider.getSkyRenderer() == null) {
world.provider.setSkyRenderer(new SkyProviderAsteroids((IGalacticraftWorldProvider) world.provider));
}
if (world.provider.getCloudRenderer() == null) {
world.provider.setCloudRenderer(new CloudRenderer());
}
}
}
}
use of net.minecraft.client.multiplayer.WorldClient in project Galacticraft by micdoodle8.
the class EventHandlerGC method overrideSkyColor.
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void overrideSkyColor(FogColors event) {
// Disable any night vision effects on the sky, if the planet has no atmosphere
if (event.entity instanceof EntityLivingBase && ((EntityLivingBase) event.entity).isPotionActive(Potion.nightVision)) {
WorldClient worldclient = Minecraft.getMinecraft().theWorld;
if (worldclient.provider instanceof IGalacticraftWorldProvider && ((IGalacticraftWorldProvider) worldclient.provider).hasNoAtmosphere() && event.block.getMaterial() == Material.air && !((IGalacticraftWorldProvider) worldclient.provider).hasBreathableAtmosphere()) {
Vec3 vec = worldclient.getFogColor(1.0F);
event.red = (float) vec.xCoord;
event.green = (float) vec.yCoord;
event.blue = (float) vec.zCoord;
return;
}
if (worldclient.provider.getSkyRenderer() instanceof SkyProviderOverworld && event.entity.posY > Constants.OVERWORLD_SKYPROVIDER_STARTHEIGHT) {
Vec3 vec = TransformerHooks.getFogColorHook(event.entity.worldObj);
event.red = (float) vec.xCoord;
event.green = (float) vec.yCoord;
event.blue = (float) vec.zCoord;
return;
}
}
}
Aggregations